Jump to content

EasyPHP help.


reportingsjr

Recommended Posts

I have written some basic PHP code so I can learn things... BUt, when I write it it doesnt work. I was just messing around making a tire application but it wont show up. Here is the code:First page:

<body><center><h3>Joes Tire Shop</h3></center>Welcome to Joes Tire Shop! We sell the best of tires just for you!<br>Just fill out the following for to buy some tires from us!.<br><form action="second tire form page.php" method="POST">Name:<input type="text" maxlength="20" name="name"><br><fieldset><legend>Adress Information:</legend>City:<input type="text" name="City"> State:<input type="text" maxlength="2" name="State"><br>Zip Code:<input type="text" maxlength="5" name="Zipcode"> Adress:<input type="text" name="Adress"></fieldset>Amount of tires:<input type="text" maxlength="3" name="tireamt"><br><input type="submit" value="submit"></form></body>

Second Page

<body><?phpecho "Thank you for ordering tires $_POST["name"]!;echo "You ordered: $_POST["tireamt"];echo "Your adress is: $_POST["city"], $_POST["state"], $_POST["adress"],  $_POST["zipcode"];?>

If the coding isnt the problem, Do I need to save it in a certain folder for it to work?

Link to comment
Share on other sites

That's probably because echo doesnt display text and variables at the same time, you should try it like:

echo "Thank you for ordering tires" . $_POST['name'] . '! <br />';echo "You ordered:" . $_POST['tireamt'] . "<br />";echo "Your adress is:" . $_POST['city'] . "<br />" .  $_POST['state'] . "<br />" .  $_POST['adress'] . "<br />"  . $_POST['zipcode'];

The <br /> tags are there to sanitize it a bit

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...