RE: [PHP] Help needed

From: Date: Fri, 29 Oct 2004 10:15:48 +0000
Subject: RE: [PHP] Help needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200613@lists.php.net to get a copy of this message
> > Hi > I developed a html form in which I have text box and combo > box. Now my > problem is I have to pass the values of this page to another > page. How can i > pass the values/variables to next page using href > Kindly help me > Thanks > Suma As you've posted to a PHP list I will assume your second page is a PHP page. Set your FORM action to the second page ie: <FORM name="myForm" method="POST" action="page2.php"> <INPUT type="TEXT" name="field1"> Then within page2.php all the form fields will be available in the $_POST array. $field1 = $_POST['field1']; You can also use GET in place of POST. As for using href, well this isn't a form option as far as I am aware. If you wish to subsequently pass variables using href: <a href="pagex.php?var1=val1&var2=val2">Link Text</a> --OR-- <?php echo "<a href=\"pagex.php?var1=$var1&var2=$var2\">Link Text</a>"; ?> HTH Graham

« previous php.general (#200613) next »