Howdy_McGee Posted July 1, 2010 Share Posted July 1, 2010 Ok so I've always used a free form generator to code my forms for me, but the website I've always used updated their policy so that you can only receive 200 email before you have to pay. I tried coding one myself and connecting it to their server but on Internet Explorer the user would have to enable cookies and I don't know how to fix it so that doesn't happen. So anyway I was wondering if anyone knew a good free form generator? Link to comment Share on other sites More sharing options...
dink Posted July 1, 2010 Share Posted July 1, 2010 Why do you need to enable cookies? What language are you using for your form?dink Link to comment Share on other sites More sharing options...
thescientist Posted July 2, 2010 Share Posted July 2, 2010 have you tried making a form? they're not that hard. Or can you show us an example of a form you need made in case its more complex then we are led to believe? Why are you using cookies; to save their personal information for repeated visits? Link to comment Share on other sites More sharing options...
Howdy_McGee Posted July 2, 2010 Author Share Posted July 2, 2010 This code below looks legit, but whenever I submit the form - for starters it doesn't email me - and it opens the sendmail.php on submit instead of the thank you page that's set up, am i missing something here or should this work?Form <form method="post" action="sendmail.php"> Email: <input name="email" type="text" /><br /> Message:<br /> <textarea name="message" rows="15" cols="40"> </textarea><br /> <input type="submit" /></form> PHP <?php $email = $_REQUEST['email']; $message = $_REQUEST['message']; mail( "example@HowdysEmail.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.trileafdesigns.com" );?> I need it to allow checkboxes also, but for now i'm just trying to get it to send a message to my email. Link to comment Share on other sites More sharing options...
thescientist Posted July 2, 2010 Share Posted July 2, 2010 shouldn't you be using $_POST for the incoming data (as opposed to $_REQUEST?) on what I am assuming is sendmail.php? (i.e. the PHP code sample you provided). Do you have error reporting turned on? Are you checking and tracing your variables to ensure that they are what you expect them to be? and yes, you are telling it to go to sendmail.php which will send the mail, as that is the only code on the page for it to act on. If you are trying to get some sort of other functionality, maybe you could describe in detail what exactly you expect of the flow. Link to comment Share on other sites More sharing options...
Howdy_McGee Posted July 2, 2010 Author Share Posted July 2, 2010 I have no idea what im doing really, I found the code tid bits on some website. What I need the form to do though is send information to my email of course, then upon submitting redirect them to a thank you page.- - - - Does the HTML Page need to be life for the email form to go through? I'm just working on this through my desktop, i don't know but maybe that's why it's not sending the information. Link to comment Share on other sites More sharing options...
thescientist Posted July 2, 2010 Share Posted July 2, 2010 i was just about to ask that. you have to be working on a live server or have your local machine setup to act like a server with mail functionality included. at the very least you have to have some sort of ability to run server side scripts in order to test them. Look up WAMP (windows) or MAMP (mac) to get started with testing locally. Link to comment Share on other sites More sharing options...
RobberBaron Posted July 2, 2010 Share Posted July 2, 2010 <?php $email = $_POST['email']; $message = $_POST['message']; mail( "example@HowdysEmail.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.trileafdesigns.com" );?> Link to comment Share on other sites More sharing options...
thescientist Posted July 2, 2010 Share Posted July 2, 2010 <?php $email = $_POST['email']; $message = $_POST['message']; mail( "example@HowdysEmail.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.trileafdesigns.com" );?> I suggested that, but he won't see anything until he has his code running on a server (live or emulated). Although emulated requires a bit more work as far as sending email goes. Link to comment Share on other sites More sharing options...
Howdy_McGee Posted July 2, 2010 Author Share Posted July 2, 2010 so once I uploaded it to the server it worked!:)Now, this probably isn't the place for it, but what if I need to add some text fields and checkboxes? <?php $email = $_REQUEST['email']; $message = $_REQUEST['message']; $phone = $_REQUEST['phone'']; $checkbox1 = $_REQUEST['checkbox']; $checkbox2 = $_REQUEST['checkbox']; $checkbox3 = $_REQUEST['checkbox']; mail( "example@HowdysEmail.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.trileafdesigns.com" );?> Link to comment Share on other sites More sharing options...
thescientist Posted July 2, 2010 Share Posted July 2, 2010 try reading up on forms and how to submit them. There's information here on w3schools and the net that will get you going. If you have any further questions based on the code you have come up with you would probably best be served by posting in the PHP forum. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.