|
|
|
|
![]() ![]() |
Apr 14 2006, 07:45 PM
Post
#1
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 144 Joined: 27-September 05 Member No.: 12,294 |
Hey guys, I have this code that send you to a page that say's: Mail Sent after you fill out this form on my site. Well I would like to put a Link that says Click Here. And it will take you back to the home page. this is the code. How do I do this?
CODE <?php //Edit the configurations below --- $to = 'jonathanirocc@gmail.com'; $subject = 'the subject'; $from = $_POST['email']; //Do not edit below --- $message = "Name: \n".$_POST['name']."\n\n"; $message = $message."Question/Comment/Ordering: \n".$_POST['question']."\n\n"; $message = $message."How did you here about us?: \n".$_POST['hear']."\n\n"; $message = $message."What is Computer for: \n".$_POST['comp']."\n\n"; $message = $message."What package? \n".$_POST['package']."\n\n"; $message = $message."For Custom Specs, Use box below: \n".$_POST['customspecs']."\n\n"; $message = $message."Questions/Comments: \n".$_POST['comments']."\n\n"; $message = $message."\n\n\nMailing script created by Inspiron."; if(mail($to, $subject, $message, "From: $from")) echo "Mail sent."; else echo "Mail send failure - message not sent"; ?> |
|
|
|
Apr 14 2006, 10:24 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 302 Joined: 17-June 05 From: Frankfurt, Germany Member No.: 8,358 |
hi. just copy and paste this version of the code to your site and dont forget to change the index.php in the link to the site you want the link to go back to. :
CODE <?php //Edit the configurations below --- $to = 'jonathanirocc@gmail.com'; $subject = 'the subject'; $from = $_POST['email']; //Do not edit below --- $message = "Name: \n".$_POST['name']."\n\n"; $message = $message."Question/Comment/Ordering: \n".$_POST['question']."\n\n"; $message = $message."How did you here about us?: \n".$_POST['hear']."\n\n"; $message = $message."What is Computer for: \n".$_POST['comp']."\n\n"; $message = $message."What package? \n".$_POST['package']."\n\n"; $message = $message."For Custom Specs, Use box below: \n".$_POST['customspecs']."\n\n"; $message = $message."Questions/Comments: \n".$_POST['comments']."\n\n"; $message = $message."\n\n\nMailing script created by Inspiron."; if(mail($to, $subject, $message, "From: $from")){ echo '<a href="index.php" >Back</a>'; } else{ echo "Mail send failure - message not sent"; } ?> Hope this helps you. if not come and ask again. If you are serious abotu learning php i suggest that you look at some tutorials. That was some pretty basic stuff right there. good luck with your site |
|
|
|
Apr 16 2006, 06:11 AM
Post
#3
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 144 Joined: 27-September 05 Member No.: 12,294 |
It looks to me as if you took out the mail sent part. I still want it to say that, But I also want a link. And trust me, As soon as I get this part done, My form will be done, And if I NEVER see PHP again, it will be to soon!
|
|
|
|
Apr 16 2006, 06:29 AM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 205 Joined: 14-March 06 From: Vermont or Boston (USA) Member No.: 20,077 |
The quick fix you were looking for would look like this: (assuming index.html was the name of your homepage file, and it was in the same directory as this feeback form).
CODE <?php $to = 'jonathanirocc@gmail.com'; $subject = 'the subject'; $from = $_POST['email']; //Do not edit below --- $message = "Name: \n".$_POST['name']."\n\n"; $message = $message."Question/Comment/Ordering: \n".$_POST['question']."\n\n"; $message = $message."How did you here about us?: \n".$_POST['hear']."\n\n"; $message = $message."What is Computer for: \n".$_POST['comp']."\n\n"; $message = $message."What package? \n".$_POST['package']."\n\n"; $message = $message."For Custom Specs, Use box below: \n".$_POST['customspecs']."\n\n"; $message = $message."Questions/Comments: \n".$_POST['comments']."\n\n"; if(mail($to, $subject, $message, "From: $from")) echo "Mail sent.\n"; echo '<a href="index.php" >Back To the Homepage</a>'; else echo "Mail send failure - message not sent"; ?> Please be aware that this script, that you are using, has several major fundamental flaws. First of all, people can send you complete garbage (or blank) responces. There is no error checking. Secondly, Spammers/"hackers" could easily use this form to send out millions of spam mails from your server. This poses a lot of hassles, and possible reprocussions from your isp/host. If you want to use a more secure script (though more complex) try looking here: http://www.trap17.com/forums/index.php?s=&...ndpost&p=240314 If you feel like implimenting it, and want any help doing so or customizing it, just lemme know. --Gaea |
|
|
|
Apr 16 2006, 05:50 PM
Post
#5
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 144 Joined: 27-September 05 Member No.: 12,294 |
Well, lol. Thing is, I have a form already that Inspiron just made for me, And it works perfectly! And I'm afraid if I do anything else that it won't work. It would be great if I could could keep the form but just put in the stuff you mentioned. But I'm no PHP expert. So if someone want to just try doing it for me for free, than I would appreciate the effort, Especially if it worked. If not, I'll hope for the best.
|
|
|
|
Apr 16 2006, 09:29 PM
Post
#6
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 205 Joined: 14-March 06 From: Vermont or Boston (USA) Member No.: 20,077 |
Well, lol. Thing is, I have a form already that Inspiron just made for me, And it works perfectly! And I'm afraid if I do anything else that it won't work. It would be great if I could could keep the form but just put in the stuff you mentioned. But I'm no PHP expert. So if someone want to just try doing it for me for free, than I would appreciate the effort, Especially if it worked. If not, I'll hope for the best. Sure, i'd be glad to help. But you need to lemme know exactly what you want. For instance, do you want a field (input box) for the user's email adderess, so you can reply to them? Give me a list of the fields you want to have included. Then give me: the email adderess you want this sent to (you can PM it to me, if you'd prefer), the subject you want these emails to have when they arrive in your inbox, and the url (i.e. www.yournamehere.com) that this is going to be hosted on. |
|
|
|
Apr 19 2006, 04:52 AM
Post
#7
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 144 Joined: 27-September 05 Member No.: 12,294 |
Alrighty! I have found all the help I need. And i'm thinking of looking into php. Thanks all you Guys/girls that have helped me. Topic un-officialy closed.
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 6th September 2008 - 02:29 AM |