Jump to content

Unexpected Syntax Error


rmindigo

Recommended Posts

Getting the following error message: Parse error: syntax error, unexpected $end in /Applications/XAMPP/xamppfiles/htdocs/Testsite/emailto.php on line 3

 

Here is the code:

 

<form method="post" action="">

<table border="1" width="25%">

<tr>

<td width="10">To:</td><td><input type="text" name="to" size="20" value="<?php echo $_REQUEST['emails'];?>"></td></tr>

<td width="10">Subject:</td><td><input type="text" name="subject" size="20"></td></tr>

<tr>

<td width="10">Message:</td><td><textarea name="message" cols="30" rows="3"></textarea>

</tr>

</table>

<p><input type="submit" name="submit" value="send email"><p>

</form>

<?php

 

if(isset($_REQUEST['submit'])){

 

$to = $_REQUEST['to'];

$subject = $_REQUEST['subject'];

$body = $_REQUEST['message'];

$from = "admin@ryantutorials.com";

$headers = "From: $from";

 

if($to && $subject && $body){

 

mail($to,$subject,$body,$headers);

echo "your email has been sent";

header("Refresh:5; url=update.php");

}else{

echo "Please fill out all fields";

 

}

?>

 

Link to comment
https://forums.phpfreaks.com/topic/272156-unexpected-syntax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.