Re: $_POST v4.3 to v5.0

From: Date: Wed, 14 Jul 2004 14:52:52 +0000
Subject: Re: $_POST v4.3 to v5.0
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-190482@lists.php.net to get a copy of this message
Michael Purdy wrote:
<script language="php"> echo '<form method="POST" action="2.php">'; echo '<p>Input a Test Variable <input type="text" name="testvar" size="20"></p>'; echo '<p><input type="submit" value="Submit" name="Button><input type="reset" value="Reset" name="B2"></p>'; echo '</form>'; </script>
Is there a particular reason you're doing it like this? None of the above contains any PHP code at all - so you don't need to wrap it in the PHP script block. Just use standard HTML. Also - you need to close the quotes around the submit button "name" value.
#### RECEIVING SCRIPT ### 2.php <script language="php"> $searchtype = $_POST['testvar']; echo $searchtype; </script> I still receive a error
Although it should work, is there a special reason you are using the <script> block tags for PHP? Try dumping out the values of $_POST to see if you were passed anything at all: print_r($_POST); Possibly do the same for $_GET too. Cheers, Rich -- http://www.launchcode.co.uk - PHP Development Services "I am not young enough to know everything." - Oscar Wilde

« previous php.general (#190482) next »