Jul 26, 2008

More Help With Php

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

More Help With Php

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

?>

 

 

 


Reply

sxyloverboy
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. smile.gif 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 biggrin.gif

 

 

 


Reply

JC05
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!

Reply

gaea
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

Reply

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

Reply

gaea
QUOTE(JC05 @ Apr 16 2006, 05:50 PM) *

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.

Reply

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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics
Looking for php

Searching Video's for php
advertisement



More Help With Php



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE