Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

120 users online



robouk e-mail forms.

robouk e-mail forms.

Currently viewing this thread: 1 (0 members and 1 guests)


FatBoy

FatBoy

Status: Offline!

robouk e-mail forms.

Hi Im new at PHP an Im trying to set up robouk's e-mail form. If you can see what I do wrong.

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /customers/rau77.dk/rau77.dk/httpd.www/mailform/thanks.php on line 1

Parse error: parse error, unexpected T_IF in /customers/rau77.dk/rau77.dk/httpd.www/mailform/thanks.php on line 2

Here is my source codes:

PHP part:

Code:

<?php \par
if($sentemail == "2")\{ \par
include("sorry.php"); \par
\par
\}else\{ \par
\par
$num = $sentmessage + 1; \par
setcookie("sentemail","$num",time()+600); //set the cookie \par
\par
$email = "Sender Name:\\t$name\\nSender E- Mail:\\t$thereemail\\nMessage:\\t$message\\nIP:\\t$RE\par
MOTE_ADDR\\n\\n"; \par
$to = "admin@rau77.dk"; \par
$subject = ""; \par
$mailheaders = "From: $thereemail <> \\n"; \par
$mailheaders .= "Reply-To: $thereemail\\n\\n"; \par
mail($to, $subject, $email, $mailheaders); \par
include("thanksecho.php"); \par
\} \par
?>

Here is HTML part:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form method=post action="thanks.php"><table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="108">Your Name:</td>
<td width="192">
<input type="text" name="name">
</td>
</tr>
<tr>
<td width="108">Your E-mail:</td>
<td width="192">
<input type="text" name="thereemail">
</td>
</tr>
<tr>
<td width="108" valign="top">Your Message:</td>
<td width="192">
<textarea name="message"></textarea>
</td>
</tr>
<tr>
<td width="108">&nbsp;</td>
<td width="192">
<input type="submit" name="Submit" value="Send">
</td>
</tr>
</table>
</form>
</body>
</html>

THX in advance.. :confused:

TrumpBunny

TrumpBunny

Status: Offline!

I don't really know what to say besides that code looks messed up. Those /s and /pars look out of place. Try this:

PHP:


<?php  

$email 
"Sender Name:\t$name\nSender E-Mail:\t$thereemail\nSender Message:\t$message\nSender IP:\t$REMOTE_ADDR\n\n"
$to "YOUREMAIL"
$subject "EMAILSUBJECT"
$mailheaders "From: $thereemail <> \n"
$mailheaders .= "Reply-To: $thereemail\n\n"
mail($to$subject$email$mailheaders); 
include(
"thanks.php"); 

?> 

Save that as "send.php" Then create a form like this:

<FORM METHOD="post" ACTION="send.php">
Name<INPUT TYPE="text" name="name" SIZE="10"><BR>
Email<INPUT TYPE="text" name="thereemail" SIZE="10"><BR>
Message<INPUT TYPE="text" name="message" SIZE="10"><BR>
<INPUT TYPE="submit" value="Send Form">

Now create a page called "thanks.php" It is the page the user will be redirected to after submitting. Put all those files in the same directory.

Try that and see if it works, Very simple email script.

FatBoy

FatBoy

Status: Offline!

Thx Im gonna try it out now Wink

FatBoy

FatBoy

Status: Offline!

I have made the script u set up. But I get this error Warning: Failed opening 'thanks.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php/PEAR') in /customers/rau77.dk/rau77.dk/httpd.www/formmail/send.php on line 9 :confused:

Only things I have changed from your scripts are:EMAILSUBJECT and YOUREMAIL

Here is my script for Thanks:

PHP:

<?php 
 
 
echo "<p>Thanks for your e-mail</p>"
 
 
?> 

The rest works fine, I recive all the data by maile Smile

TrumpBunny

TrumpBunny

Status: Offline!

Thanks for your e-mail

Try that for "thanks.php"

Let me know if it works.

-TrumpBunny

TrumpBunny

TrumpBunny

Status: Offline!

Better yet, Let's make it even simpler...

Replace:

PHP:

<?php
include("thanks.php");
?>

With

PHP:

<?php
echo "<p>Thanks for your e-mail</p>";
?>

FatBoy

FatBoy

Status: Offline!

Thanks 4 ur help... I finally got it to work Wink So now I'll be see if a can figure it out getting the thanks.php working on a seperate site.. thx again Smile

TrumpBunny

TrumpBunny

Status: Offline!

Glad I could help. I don't know why it won't let you include, worked fine for me. You might want to check with your admin to see if you are able to.

-TrumpBunny

FatBoy

FatBoy

Status: Offline!

Well in another tutorial I followed it worked fine. But it dident have all the info I wanted only e-mail and message. Sad

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0086 seconds.