PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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:
<?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
?>
im probably missing something that is real basic, but im just not seeing it
Any help would be appreciated.
on a side note, it's good practice to put at least some kind of quote around your html tag attributes
for example <select name="country"> instead of <select name = country>
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
One another note, is there any limit to the number of If/else statements that you can have imbeded inside eachother?
it's getting the information, but it's not returning any values, and i was wondering if this was because of some limit on nested if/else statements.
Last edited by InnerShadow on Fri Nov 11, 2005 9:55 am, edited 3 times in total.