Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › New to HTML/PHP Quick question?
New Posts  All Forums:Forum Nav:

New to HTML/PHP Quick question? - Page 2

post #11 of 14
Thread Starter 
Okay another question.... in my product.html, I have "form id="Order Form" action="products.php" method="post""

Is that correct? So whatever info they put in on my Products.html, the info will be posted at products.php?
post #12 of 14
Quote:
Originally Posted by sheerjeenyus View Post

Okay another question.... in my product.html, I have "form id="Order Form" action="products.php" method="post""

Is that correct? So whatever info they put in on my Products.html, the info will be posted at products.php?

Is there any reason you're not testing this yourself? If you need to setup PHP & Apache try XAMMP or WAMPServer.
post #13 of 14
Thread Starter 
I have been. But nothing is working. And I have done that as well. Apparently theres still something Im missing.
post #14 of 14
Quote:
Originally Posted by sheerjeenyus View Post

Okay another question.... in my product.html, I have "form id="Order Form" action="products.php" method="post""

Is that correct? So whatever info they put in on my Products.html, the info will be posted at products.php?

You'll get a lot further with all of this if you read the post/information given to you already and use that to continue learning yourself - doing this yourself would make up for the classes you missed wink.gif

For php it is bad design to configure apache to forward all html pages to the php processor as not ever html file will have php code into it to process and it's just extra overhead.

This is what you want to do to make this dead simple, all in one file:

index.php
Code:

<html>

   <head>
      <title>Example Form</title>
   </head>
   <body>
<?php

// check to see if the $_POST var is set that we're looking for
if (isset($_POST["txtName"]))
{
  echo "Thanks for your submission!<br />";
  echo "Your name as entered: '" . $_POST["txtName"] . "'<br /><br />";
  echo "Click <a href='index.php'>here</a> to re-enter data into the form.";
}
else // else if it's not set show the form
{

?>
<form method="POST">

Enter your name: <input type="text" id="txtName" value="" /><br />
<input type="submit" id="btnSubmit" value="Submit" />

</form>

<?php

}

?>
   </body>
</html>


Now please excuse the code above, I haven't written PHP in over 2 years and I'm sure it shows.... I'm hoping it's still correct biggrin.gif

The html form is extremely barebones, I'm leaving it up to you to enhance what I've given you since it's your assignment and all tongue.gif

Edit:

Also for any tag in html do not use spaces e.g.:
Code:
<form id="This is an ID">

Very bad design form, use camel casing or a derivative instead e.g.:
Code:
<form id="thisIsAnID">

Edited by xyexz - 3/18/13 at 6:56pm
AMD Rig
(12 items)
 
  
CPUMotherboardGraphicsGraphics
8320 FX Gigabyte 990FX-UD3 XFX R9 270X XFX R9 270X 
RAMHard DriveOptical DriveCooling
Crucial Ballistix Sport Kingston V300 Bluray Cooler Master Seidon 240M 
OSKeyboardPowerCase
Windows 7 x64 Ultimate CM QuickFire Corsair CX750M Corsair 540 Air 
  hide details  
Reply
AMD Rig
(12 items)
 
  
CPUMotherboardGraphicsGraphics
8320 FX Gigabyte 990FX-UD3 XFX R9 270X XFX R9 270X 
RAMHard DriveOptical DriveCooling
Crucial Ballistix Sport Kingston V300 Bluray Cooler Master Seidon 240M 
OSKeyboardPowerCase
Windows 7 x64 Ultimate CM QuickFire Corsair CX750M Corsair 540 Air 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › New to HTML/PHP Quick question?