Submit Button - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36) +---- Forum: Website Development (https://www.supportforums.net/forumdisplay.php?fid=43) +---- Thread: Submit Button (/showthread.php?tid=13236) |
Submit Button - ElephantShoe - 10-27-2010 Alright, so I made (copy and pasted) a Submit / Suggestion box for my website but I have no idea how .asp works. How would I receive the information that a user types in the box? Here's the code: Code: <form name="input" action="html_form_action.asp" method="get"> If not, does anyone have a simple form mail script? RE: Submit Button - Brandon - 10-27-2010 Yeah, Code: <html> That's the contact form you want to use, for example "Contactus.php" or whatever. This is sendmail.php, the script itself. Code: <html> It's rather basic and self explanatory. You can also obviously tell where to edit and customize it as you see. It's good to learn how it works too EDIT: Oh, i'll also give you a small explanation. It basically just sends the information the user types in via POST and then the sendmail.php uses the actual code. Contact.php is basically the input values only. In contact.php we have: <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> Your Name: <br /> <input type="text" name="visitor" size="35" /> <br /> This will be just an example. Then, that creates the form to be named "visitor" as a variable like situation. When it goes into sendmail.php, it'll use that to generate the email using the "visitor" variable defined in sendmail as "$visitor = $_POST['visitor']; ". Simple, right? The extra code: '<?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?>' Is to get the users IP information, etc. It's not always necessary but useful. Also, I just made it for a friend so you'll want to customize a lot of it to your own uses obviously. It's in PHP too, not ASP. I wouldn't know how this works in ASP exactly anymore. Enjoy Brandon RE: Submit Button - ElephantShoe - 10-28-2010 Thanks a lot for this! Works perfectly. :] RE: Submit Button - Malmoc - 11-10-2010 Lawl .. i use that script Thanks! |