I'm creating a form at http://www.spookybetty.com/order.html and have encountered some problems along the way. After a lot of fiddling about, I'm now using http://www.thesitewizard.com to help me out with the php element, as I know bugger all about php. Its during the html where I've become stuck though.
I think I've got an error in the code, but I can't figure out how to fix it. I've got boxes for people to enter information in (i.e "name", "address" etc) and then I've got a drop-down menu where people can select the right size. However, although the drop down menu is towards the end of the code, its showing up at the very top of the page. How do I stop it from doing this? Also, radio buttons come up at the very top of the page too!
2) It is important to associate explicitly form controls with their labels.
3) It is important to group form controls into fieldsets.
4) You ought not to mix up HTML and XHTML.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Wow, thats very impressive looking! Thanks very much for that.
The only problem is, I was using that table form because thats how I adapted it from the website I got the PHP form from. Basically, I know *nothing* about PHP, and need for people to be able to fill in that form, and for me to recieve the information in my email account. I was told I needed PHP for this, and managed to find a site that produced two codes, one was a form and the other is a PHP file. I don't think I can use the form you've provided me with, because I don't know how to alter the PHP file to work with it. I downloaded a php code, altered the appropriate areas (email address, the url you go onto after you've pressed "submit" - the thankyou.html url, and the error url.) and then uploaded it as feedback.php
// Build Message Body from Web Form Input
$MsgBody = @gethostbyaddr($REMOTE_ADDR) . "\n$Divider\n";
foreach ($_POST as $Field=>$Value)
$MsgBody .= "$Field: $Value\n";
$MsgBody .= $Divider . "\n" . $HTTP_USER_AGENT . "\n";
$MsgBody = htmlspecialchars($MsgBody); //make content safe
// Send E-Mail and Direct Browser to Confirmation Page
mail($SendTo, $SubjectLine, $MsgBody, "From: " . $SendFrom);
header("Location: $ThanksURL");
?>
Is it possible to alter this to work with your form? I assume I would have to change that php file and also the form you've provided me with, as the crappy html table form I did, had to involve areas relating to the php file.
Basically, I just need to be able to have the contents of the form emailed to me.
That's just a rough version to get you started. You are going to want to keep working on that. Remember, HTML is for content and CSS is for layout and presentation. And when you are done, make sure that you page passes the validators: http://validator.w3.org/ and http://jigsaw.w3.org/css-validator/.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Thank you. Frustratingly though, its not working with the php script. In my old script, I had <form action="feedback.php" method="post"> and towards the bottom, <input type="submit" value="Submit" /><br /> Don't I need these still, so the feedback.php works?
Not knowing PHP, I'm not sure exactly what's going on. But a couple of observations:
1) There is a PHP forum and the folks over there can help you with the PHP side.
2) <button type="submit">Submit</button> and <input type="submit" value="Submit"> are the same as far as the FORM submission is concerned. I use BUTTON because it makes the CSS a little bit easier.
3) Those trailing slashes, <br />, are a part of XHTML™ and have no place in HTML. Do not use them.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
// Build Message Body from Web Form Input
$MsgBody = @gethostbyaddr($REMOTE_ADDR) . "\n$Divider\n";
foreach ($_POST as $Field=>$Value)
$MsgBody .= "$Field: $Value\n";
Bookmarks