Re: usr VAR value as a VAR Name

From: Date: Thu, 26 Jan 2006 02:07:24 +0000
Subject: Re: usr VAR value as a VAR Name
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-229284@lists.php.net to get a copy of this message
if(isset($_POST['NAME_OF_FORM_VALUE'])) { // radio button was selected } 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 ?*
} ====================================== Thanks in Advance
-- --------------------------------------------------------- http://www.ciwcertified.com - Master CIW Designer http://www.zend.com - Zend Certified Engineer http://www.jamesbenson.co.uk ---------------------------------------------------------

« previous php.general (#229284) next »