Jump to content

NEED HELP error ...


lopdog

Recommended Posts

I've got a problem with a php code it doesn't work ...It gives me an error :

 

Parse error: syntax error, unexpected T_STRING in /home/rasi4325/public_html/sending.php on line 8

 

the html code is this :

 

<form action="sending.php" method="post" name="Contact Form" id="form1" onsubmit="MM_validateForm('E-mail','','R')return document.MM_returnValue" encytype="text/plain">
                <label>Va rugam introduceti adresa de e-mail pentru a primii ultimile noutati.</label>
                <input type="text" name="Email" size="29" id="Email" title="Email" />
                <input name="Submit" type="submit" id="Submit" value="Submit" />
                </form>

 

the php code is this ":

<?php 
$Name = $_REQUEST['Name']; 
$Email = $_REQUEST['Email']; 
$Phone = $_REQUEST['Phone']; 
$Message = $_REQUEST['Message']; 

/*Sending Email*/ 

$to = "[email protected]"; 
$subject = "Cerere Stiri"; 
$message = " 
Contact Client

Email = $Email 
$from = "$Email"; 


if(mail($to, $subject, $message, "From: $from")) 
echo "Mail sent"; 
else 
echo "Mail send failure - message not sent"; 

 

Link to comment
https://forums.phpfreaks.com/topic/210657-need-help-error/
Share on other sites

Thanks wildteen88 that did it... but now I have another problem  :P

 

I want to redirect the page so that it apears a message and redirects you to index.html. the code in php is this.

 

I TRYED "header("url") echo "<meta http-equiv=\"refresh\" content=\"2;url=index.html\" />"; and url long way and both of them gives me this error:

 

Parse error: syntax error, unexpected T_ELSE in /home/rasi4325/public_html/sending.php on line 17

 

 

 

 <?php 
$Email = $_REQUEST['Email']; 
$Message = $_REQUEST['Message']; 

/*Sending Email*/ 

$to = "[email protected]"; 
$subject = "Cerere Stiri"; 
$message = "Contact Client 
            Email = ".$Email." "; 
$from = "$Email"; 


if(mail($to, $subject, $message, "From: $from")) 
echo "Message sent"; 
else 
echo "Mail not sent please try again"; 
?>

 

 

PS: I am working on an html with css and this code is the only php code I'm using

Link to comment
https://forums.phpfreaks.com/topic/210657-need-help-error/#findComment-1099217
Share on other sites

Try this:

 

<?php 
$Email = $_REQUEST['Email']; 
$Message = $_REQUEST['Message']; 

/*Sending Email*/ 

$to = "[email protected]"; 
$subject = "Cerere Stiri"; 
$message = "Contact Client 
            Email = ".$Email." "; 
$from = "$Email"; 


if(mail($to, $subject, $message, "From: $from")) {
echo "Message sent"; 
headder( "location: index.html");
} else{ 
echo "Mail not sent please try again"; 
}
?>

Link to comment
https://forums.phpfreaks.com/topic/210657-need-help-error/#findComment-1099224
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.