...

View Full Version : Working with Submit Buttons and PHP



TrainReq
11-10-2007, 10:10 AM
Ok... I am doing this project just for test purposes. I have two submit buttons , one with the value of "Test 1" and one with the value of "Test Two" , both with the name of "test" , what I would like to do is echo the value of the submit button pressed. For instance, if you press the button with value of Test One , it will echo on the PHP page "Test One".

Here is the HTML I have:


<form action="process.php method="post">
<input type="submit" name="test" value="Test 2"><br><input type="submit" name="test" value="Test 1"></form>


Here is the PHP I have:


<? echo $_POST['test']; ?>


It is not echoing the value. Why am I having this issue?

phpBuddy
11-10-2007, 03:14 PM
<?php echo $_POST['test']; ?>
<form action="process.php" method="post">
<input type="submit" name="test" value="Test 2"><br>
<input type="submit" name="test" value="Test 1">
</form>you had a missing endquote around "process.php"
maybe this is the simple issue



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum