Session Variables and Arrays?
| From: | Inpho | Date: | Thu, 08 May 2003 06:05:23 +0000 |
| Subject: | Session Variables and Arrays? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146785@lists.php.net to get a copy of this message | ||
Hey All,
Just a quick question that has had me bogged down for the last hour or so.
Probably something really simple i am over looking.
I have a form that accepts MAC addresses, it will generate as many mac
address inputs as u want using a simple while statement.
the inputs are numbered ie macad1, macad2 etc...
what I am trying to do is register each mac address as a session variable
using:
$count = 1;
while ($count <= $j ){
print "<input type='hidden' name=macad$count
value='$macad[$count]'>";
print "Mac Address $count: $macad[$count]<br>";
session_register("macad$count");
$count=$count+1;
}
Now trying to set the variable:
$macad$count presents problems due to the double varibale there.
and registering it as $macad[$count] returns macad[1] etc...
what I want in my session is macad1 = 00-22-33-44-55-66
etc...
that way on a later page all i have to do to print them out is do another
while loop to print them all out... anytips?
cheers
- paul -