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 = "support@test.ro"; 
$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
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 = "support@text.com"; 
$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
Share on other sites

Try this:

 

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

/*Sending Email*/ 

$to = "support@text.com"; 
$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.