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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to