Re: [PHP] Use VAR string value AS VAR Name
On Wed, January 25, 2006 6:11 pm, Fernando Anchorena wrote: I'm stuck trying to get work this : This is an example page1.php === form action=/page2.php?form=yes method=post $sql_pro =SELECT Sid FROM table; $res_pro = @mysql_query( $sql_pro); while ($campo_pro = @mysql_fetch_array($res_pro)) { $sid_pro = $campo_pro[Sid]; // *sid_pro = 4* $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of $sid_pro as a VAR name *$sid_pro = p4* print td *input name='$sid_pro' type= 'radio' value='SOLVE_ME'/* /td; // *name=p4 * BLA BLA BLA } SUBMIT FORM === page2.php === $sqlname = SELECT Sid FROM Table; $res = mysql_query ($sqlname) ; while ($campo_pro = mysql_fetch_array($res)) { $name1 = $campo_pro[Sid]; // *$name1 = 4* $radio = '$'.'p'.$name1 ; // *$radio = $p4 -- Now the Problem **How can I get the Value SOLVE_ME from the submited form ?* } == While Variable Variables solve the original question, as asked, I suspect you'd be better off using: ... NAME=camp_pro[?php echo $sid_pro?] ... in your radio buttons. HTML and browsers will treat the radio buttons as the same if the camp_pro part matches, and you'll have $sid_pro I confess the formatting left me a bit confused as to which variable you want where, but I suspect resorting to Variable Variables is not needed at all. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Use VAR string value AS VAR Name
I'm stuck trying to get work this : This is an example page1.php === form action=/page2.php?form=yes method=post $sql_pro =SELECT Sid FROM table; $res_pro = @mysql_query( $sql_pro); while ($campo_pro = @mysql_fetch_array($res_pro)) { $sid_pro = $campo_pro[Sid]; // *sid_pro = 4* $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of $sid_pro as a VAR name *$sid_pro = p4* print td *input name='$sid_pro' type= 'radio' value='SOLVE_ME'/* /td; // *name=p4 * BLA BLA BLA } SUBMIT FORM === page2.php === $sqlname = SELECT Sid FROM Table; $res = mysql_query ($sqlname) ; while ($campo_pro = mysql_fetch_array($res)) { $name1 = $campo_pro[Sid]; // *$name1 = 4* $radio = '$'.'p'.$name1 ; // *$radio = $p4 -- Now the Problem **How can I get the Value SOLVE_ME from the submited form ?* } == Thanks in Advance.
RE: [PHP] Use VAR string value AS VAR Name
Either try: $sid_pro = p.$sid_pro; or try: input name='.$p{$sid_pro}.' type= 'radio' value='SOLVE_ME'/ -Original Message- From: Fernando Anchorena [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 25, 2006 4:12 PM To: php-general@lists.php.net Subject: [PHP] Use VAR string value AS VAR Name I'm stuck trying to get work this : This is an example page1.php === form action=/page2.php?form=yes method=post $sql_pro =SELECT Sid FROM table; $res_pro = @mysql_query( $sql_pro); while ($campo_pro = @mysql_fetch_array($res_pro)) { $sid_pro = $campo_pro[Sid]; // *sid_pro = 4* $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of $sid_pro as a VAR name *$sid_pro = p4* print td *input name='$sid_pro' type= 'radio' value='SOLVE_ME'/* /td; // *name=p4 * BLA BLA BLA } SUBMIT FORM === page2.php === $sqlname = SELECT Sid FROM Table; $res = mysql_query ($sqlname) ; while ($campo_pro = mysql_fetch_array($res)) { $name1 = $campo_pro[Sid]; // *$name1 = 4* $radio = '$'.'p'.$name1 ; // *$radio = $p4 -- Now the Problem **How can I get the Value SOLVE_ME from the submited form ?* } == Thanks in Advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Use VAR string value AS VAR Name
Sorry I totally didn't read the question fully -Original Message- From: Mark Steudel [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 25, 2006 4:28 PM To: php-general@lists.php.net Subject: RE: [PHP] Use VAR string value AS VAR Name Either try: $sid_pro = p.$sid_pro; or try: input name='.$p{$sid_pro}.' type= 'radio' value='SOLVE_ME'/ -Original Message- From: Fernando Anchorena [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 25, 2006 4:12 PM To: php-general@lists.php.net Subject: [PHP] Use VAR string value AS VAR Name I'm stuck trying to get work this : This is an example page1.php === form action=/page2.php?form=yes method=post $sql_pro =SELECT Sid FROM table; $res_pro = @mysql_query( $sql_pro); while ($campo_pro = @mysql_fetch_array($res_pro)) { $sid_pro = $campo_pro[Sid]; // *sid_pro = 4* $sid_pro = 'p'.$sid_pro; // I'm trying to use de value of $sid_pro as a VAR name *$sid_pro = p4* print td *input name='$sid_pro' type= 'radio' value='SOLVE_ME'/* /td; // *name=p4 * BLA BLA BLA } SUBMIT FORM === page2.php === $sqlname = SELECT Sid FROM Table; $res = mysql_query ($sqlname) ; while ($campo_pro = mysql_fetch_array($res)) { $name1 = $campo_pro[Sid]; // *$name1 = 4* $radio = '$'.'p'.$name1 ; // *$radio = $p4 -- Now the Problem **How can I get the Value SOLVE_ME from the submited form ?* } == Thanks in Advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php