Help with a form output
Posted: Thu Nov 10, 2005 11:01 pm
feyd | Please use
and here is the php program that recieves it
im probably missing something that is real basic, but im just not seeing it
Any help would be appreciated.
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hey, i have an html form that is supposed to send information to the php script, and it seems like it does send the information, however, the php script always returns the same thing no matter what is sent.
here's the form that sends the information:Code: Select all
<form action = tradetestArray.php>
<table border = 1>
<tr>
<th>Goods</th>
<th>Recipient</th>
<tr>
<td>
<select name = Goods>
<option value = "A">coal</option>
<option value = "B">iron</option>
</select>
</td>
<td>
<select name = Recipient>
<option value = "A">United States</option>
<option value = "B">France</option>
</select>
</td>
<tr>
<tr>
<td colspan = 2>
<input type = "submit"
input value = "submit">
</td>
</tr>and here is the php program that recieves it
Code: Select all
<?php
$item = $_POST['Goods'];
$country = $_POST['Recipient'];
if ($item = "A"){
if ($country = "A"){
print "coal sent to the United States";
} else if ($country = "B"){
print "coal sent to France";
} else {
print "Error";
}// end if
} else if ($item = "B"){
if ($country = "A"){
print "iron sent to the United States";
} else if ($country = "B"){
print "iron sent to France";
} else {
print "Error";
}// end if
} else {
print "ItemError";
}// end if
?>Any help would be appreciated.
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]