Jump to content
xisto Community
Sign in to follow this  
JC05

More Help With Php

Recommended Posts

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?

<?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";?>

Share this post


Link to post
Share on other sites

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. :

<?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. :lol: ill be happy to look over it 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 :lol:

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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).

 

<?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://forums.xisto.com/topic/34823-using-a-php-contact-form-please-help/

 

If you feel like implimenting it, and want any help doing so or customizing it, just lemme know.

 

--Gaea

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. http://www.yournamehere.com/) that this is going to be hosted on.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.