PDA

View Full Version : [WILL PAY] php form help



mike475
06-02-2008, 10:23 PM
I will pay you £1 via PayPal if you can get this form to work.

Link :: http://www.savereg.co.uk/petition.php

Please can you provider me the code I need to put in the file "mailer.php"

The form code is ::


<body>
<form action="mailer.php" method="post">
<div class="row"><label class="col1">Name:&nbsp;&nbsp;</label>
<span class="col2"><input name="Name" class="input" type="text" id="Name" size="50" tabindex="1" /></span>
</div>
<div class="row"><label class="col1">E-mail:&nbsp;&nbsp;</label>
<span class="col2"><input name="Email" class="input" type="text" id="Email" size="50" tabindex="2" /></span>
</div>
<div class="row"><label class="col1comment">Comment:&nbsp;&nbsp;</label>
<span class="col2comment"><textarea cols="20" class="textarea" rows="4" name="comment" id="comment" tabindex="4" ></textarea></span>
</div>
<div align="center" class="submit"><input type="image" src="images/b_send.gif" alt="send" width="52" height="19" border="0" />
</div>
</form>
</body>

Thank you

loserWILL
06-02-2008, 10:54 PM
You want it to email to you?

mike475
06-02-2008, 10:58 PM
You want it to email to you?

Yeah =]

So it comes out as ::


Name:
Email:

Comment:


in a email to me :D
ty

loserWILL
06-02-2008, 11:00 PM
This might work. Let me know if it does or doesn't.


<?php

// These defines your email, and how the PHP grabs the data from the other file
$name = ($_POST["Name"]);
$email = ($_POST["Email"]);
$comment = ($_POST["comment"]);
$to = "youremail";
$subject = "$name's Contact Submission";
$message = "Name: $name<br />
Email: $email<br />
Comment: $comment";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

// This sends the email with the data and displays a message to the user
echo "Thanks for your comment, an email has been sent to the administrator."; // Edit this to whatever you want
mail($to,$subject,$message,$headers);
exit;

?>

Moh
06-02-2008, 11:03 PM
cPanel > Fantastico > Other Scripts > phpFormGenerator

Does it all for you, all you have to do is fill in the infomation ;)

VistaBoy
06-02-2008, 11:04 PM
also you can look on pixel2life they have a lot of contact forms there as well.

mike475
06-02-2008, 11:10 PM
thank you loadsssssss!!!

could you please also tell me how to make it instantly redirect to /thankyou.html please?

ta

loserWILL
06-02-2008, 11:20 PM
Use this.


<?php

// These defines your email, and how the PHP grabs the data from the other file
$name = ($_POST["Name"]);
$email = ($_POST["Email"]);
$comment = ($_POST["comment"]);
$to = "youremail";
$subject = "$name's Contact Submission";
$message = "Name: $name<br />
Email: $email<br />
Comment: $comment";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

// This sends the email with the data and displays a message to the user
echo "Thanks for your comment, an email has been sent to the administrator.
<meta http-equiv="refresh" content="2;url=thankyou.html">"; // Edit this to whatever you want
mail($to,$subject,$message,$headers);
exit;

?>

mike475
06-02-2008, 11:20 PM
grrr whys there a white background now?

http://www.savereg.co.uk/petition.html

- chanes back -

loserWILL
06-02-2008, 11:21 PM
I didn't mean replace the WHOLE code with that, just the contact form code.

Is it changed back to the old one now?

Awfy
06-02-2008, 11:29 PM
cPanel > Fantastico > Other Scripts > phpFormGenerator

Does it all for you, all you have to do is fill in the infomation ;)
Do NOT use this, it's bloody awful...

mike475
07-02-2008, 03:59 PM
http://www.savereg.co.uk/petition.php

is the new one

however its got a white background which i dont like, i want it to like, have no white ness and blend in with the current background.

And how can I make it so it redirects to /thankyou.html once the user has sent it?

You can get a £1 from this :D

loserWILL
07-02-2008, 04:07 PM
Are you using the PHP code I posteD?

EDIT: Add me on msn - [email protected]

Want to hide these adverts? Register an account for free!