php-windows Digest 18 Feb 2002 15:21:55 -0000 Issue 1006

Topics (messages 12120 through 12128):

MinGW, building from source -- win32
        12120 by: John Moeller

Re: mail() on windows - problem
        12121 by: Tom

dynamic checkboxes submit..help!
        12122 by: Sandeep Murphy
        12123 by: Mike Flynn
        12124 by: Sandeep Murphy
        12125 by: Mike Flynn
        12127 by: Mike Flynn
        12128 by: Nicole Amashta

Call Page
        12126 by: Mad Nas

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hello,

Has anyone here tried building PHP from source for win32 with MinGW?  If so, have you 
run into any trouble?  Do you have any hints?

Thanks,

John
--- End Message ---
--- Begin Message ---
hi,

try this.

put it in your *.php file, where your mail() function is located.

<?php

ini_set("SMTP", "your mailserver");

ini_set("sendmail_from", "your email-adress");

?>

i got the same probs.

W2K and IIS5 don't work with the smtp

[mail function] in php.ini.



tom



"George Pitcher" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
008201c1b470$41373b00$630db092@HLATITUDE">news:008201c1b470$41373b00$630db092@HLATITUDE...
> Hi all,
>
> Doing a little testing in advance of doing the scripting next week, I
> thought I'd try the mail() function.
>
> In php.ini, I have filled in the details of my SMTP server (University
> service) and the return address and I can't see anything else to
configure.
>
> A simple script, called as a web page, contains the following script:
>
> <?php
> mail("[EMAIL PROTECTED]","Mailtest from php","message");
> ?>
>
> and when I run this, I get an 'unknown' error and i [fairly obviously]
don't
> get the email it should be sending.
>
> Is there something else to configure?
>
> I know that the smtp part is correct as I am mailing that way using both
> Lasso (NT) and Frontier (Mac) with no problems.
>
> HYCH,
>
> George in Edinburgh
>


--- End Message ---
--- Begin Message ---
Hi,

I have a dynamically generated tree of checkboxes which I need to submit to
a PHP page for performing a search..

Can anyone pl suggest as to how I can submit the values of all the
checkboxes which are checked??

TIA,

sands
--- End Message ---
--- Begin Message ---
You have to be a little more clear.  What do you mean by "dynamically 
generated" and "tree"?  If the checkboxes are created dynamically, what 
naming convention are using to give the checkboxes names?  Set their 
value=".." to whatever you want, and use some convention for their 
names.  Then after submitting, use that same naming convention to look at 
all the names and see which ones have been set, and those are the ones that 
are checked.  The "values of all the checkboxes which are checked" are 
always submitted.  That's how forms work..

-Mike

At 01:23 PM 2/18/2002 +0000, you wrote:
>Hi,
>
>I have a dynamically generated tree of checkboxes which I need to submit to
>a PHP page for performing a search..
>
>Can anyone pl suggest as to how I can submit the values of all the
>checkboxes which are checked??
>
>TIA,
>
>sands

--- End Message ---
--- Begin Message ---
ok...

I am creating a tree of checkboxes from the information in the database..
like for everyname 
in the database I create a series of (3)checkboxes (update, view and priv)..

so when I do a submit i need to send all the values for every checkbox
clicked for any number of users...

My problem is that I am not sure how I can submit the values of all
checkboxes as they keep varying in number...


Hope my problem is more clearer now..

gratefull for suggestions...

sands

-----Original Message-----
From: Mike Flynn [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 18 de Fevereiro de 2002 13:43
To: Sandeep Murphy
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] dynamic checkboxes submit..help!


You have to be a little more clear.  What do you mean by "dynamically 
generated" and "tree"?  If the checkboxes are created dynamically, what 
naming convention are using to give the checkboxes names?  Set their 
value=".." to whatever you want, and use some convention for their 
names.  Then after submitting, use that same naming convention to look at 
all the names and see which ones have been set, and those are the ones that 
are checked.  The "values of all the checkboxes which are checked" are 
always submitted.  That's how forms work..

-Mike

At 01:23 PM 2/18/2002 +0000, you wrote:
>Hi,
>
>I have a dynamically generated tree of checkboxes which I need to submit to
>a PHP page for performing a search..
>
>Can anyone pl suggest as to how I can submit the values of all the
>checkboxes which are checked??
>
>TIA,
>
>sands
--- End Message ---
--- Begin Message ---
Ok, well what I would do is have each of the series of checkboxes be in an 
array for each user, using variable variables.

There's probably an easier way to do it, but I'm not sure.. so here's 
basically what I'd do (in pseudocode):

for (each user, their id being $userid) {
   <input type="hidden" name="userids[]" value="$userid">
   <input type="checkbox" name="userdata_$userid[0]" value="1"> Update
   <input type="checkbox" name="userdata_$userid[1]" value="1"> View
   <input type="checkbox" name="userdata_$userid[2]" value="1"> Priv
}

then to process after the form is submitted:

foreach($userids AS $value) {
   do stuff for each user, the user ID being $value here
   you can check the three values as such:
   $theuserdata = "userdata_$value";
   $update = ${$theuserdata}[0]; // null or 1
   $view = ${$theuserdata}[1];   // null or 1
   $priv = ${$theuserdata}[2];   // null or 1
}

That would do what you want to do.  Whether there's a simpler way, I dunno. :)

-Mike

At 02:33 PM 2/18/2002 +0000, Sandeep Murphy wrote:
>ok...
>
>I am creating a tree of checkboxes from the information in the database..
>like for everyname
>in the database I create a series of (3)checkboxes (update, view and priv)..
>
>so when I do a submit i need to send all the values for every checkbox
>clicked for any number of users...
>
>My problem is that I am not sure how I can submit the values of all
>checkboxes as they keep varying in number...
>
>
>Hope my problem is more clearer now..
>
>gratefull for suggestions...
>
>sands

--- End Message ---
--- Begin Message ---
I should have been more specific in some of my pseudocode:
<?php
for (each user, their id being $userid) {
?>
   <input type="hidden" name="userids[]" value="<?php echo $userid; ?>">
   <input type="checkbox" name="userdata_<?php echo $userid; ?>[0]" 
value="1"> Update
   <input type="checkbox" name="userdata_<?php echo $userid; ?>[1]" 
value="1"> View
   <input type="checkbox" name="userdata_<?php echo $userid; ?>[2]" 
value="1"> Priv
<?php
}
?>

That is, the '$userid's and the array indexes '[x]' they are followed by 
are separate in the code.

-Mike

--- End Message ---
--- Begin Message ---
OK, name all the related check boxes with the same name and put [] at the
end of the name so it looks like an array.

Then, in your phpscript, you can access all the values in the area.

example:

In your HTML page:

<input type="checkbox" name="ids[]" value=1>
<input type="checkbox" name="ids[]" value=2>
<input type="checkbox" name="ids[]" value=3>
<input type="checkbox" name="ids[]" value=4>
<input type="checkbox" name="ids[]" value=5>

in your php script, access the ids like so:

$ids

you can loop through the $ids array to verify WHAT values were actually
checked on the form.

for($i=0; $i<$ids; $i++)
{
  if ( isset($ids[$i]) )
  // do something
}


Hop this helps ya!
Nicole Amashta
www.aeontrek.com
====================

"Sandeep Murphy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have a dynamically generated tree of checkboxes which I need to submit
to
> a PHP page for performing a search..
>
> Can anyone pl suggest as to how I can submit the values of all the
> checkboxes which are checked??
>
> TIA,
>
> sands


--- End Message ---
--- Begin Message ---
Hi all
In a page i have to action for change language. ( Arabic and English )
When use click in any of picture, the document must call with old parameters
but change a session variable in server ( for example $sActLang ).
How can i it?

Thanks for help
Mad Nas


--- End Message ---

Reply via email to