Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-10-2007, 09:10 AM   PM User | #1
TrainReq
Guest

 
Posts: n/a
Working with Submit Buttons and PHP

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:

Code:
 <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:
PHP Code:
<? echo $_POST['test']; ?>
It is not echoing the value. Why am I having this issue?
  Reply With Quote
Old 11-10-2007, 02:14 PM   PM User | #2
phpBuddy
New Coder

 
Join Date: Nov 2007
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
phpBuddy is an unknown quantity at this point
PHP Code:
<?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
__________________
echo "PHP 5.2.5";
exit ( "Script End" );

Last edited by phpBuddy; 11-10-2007 at 02:23 PM..
phpBuddy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:20 PM.


Advertisement
Log in to turn off these ads.