Jump to content

Need your help - very important


tomala90

Recommended Posts

Hi guys, anyone knows why do I keep getting a phrase errors? 

" Parse error: syntax error, unexpected '{' in /home/a7576050/public_html/email.php on line 30 "

 

Here is the code to my script

 

<?php
$to = "myemail@gmail.com";
$subject = "Invitation";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your email was sent"; }

f( isset($_REQUEST['email']) && isset($_REQUEST['message']) )
    {
        $email = $_REQUEST['email'];

        $message = $_REQUEST['message'];

        if($email == "" || $message == "")
        {

                echo "<br /><br />You did not fill out the form";

        }
?>

Link to comment
Share on other sites

<?php
$to = "myemail@gmail.com";
$subject = "Invitation";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your email was sent"; }

if( isset($_REQUEST['email']) && isset($_REQUEST['message']) )
    {
        $email = $_REQUEST['email'];

        $message = $_REQUEST['message'];

        if($email == "" || $message == "")
        {

                echo "<br /><br />You did not fill out the form";

        }
}
?>

 

You forgotten to close your curly braces and one of your if statement you left out the "i".

Link to comment
Share on other sites

That fixed the error phrase problem, but now I am getting something like this.  No matter if I put the information or no, I press "submit" it shows me that I did not fill out the form , and after this there are some weird symbols 

 

" ਍ℼⴭ眠睷〮〰敷桢獯⹴潣湁污瑹捩⁳潃敤ⴠ㸭਍猼牣灩⁴祴数∽整瑸樯癡獡牣灩≴猠捲∽瑨灴⼺愯慮祬楴獣栮獯楴杮㐲挮浯振畯瑮瀮灨㸢⼼捳楲瑰ാ㰊潮捳楲瑰㰾⁡牨晥∽瑨灴⼺眯睷栮獯楴杮㐲挮浯∯㰾浩⁧牳㵣栢瑴㩰⼯湡污瑹捩⹳潨瑳湩㉧⸴潣⽭潣湵⹴桰≰愠瑬∽敷⁢潨瑳湩≧⼠㰾愯㰾港獯牣灩㹴਍ℼⴭ䔠摮传⁦湁污瑹捩⁳潃敤ⴠ㸭਍ "

 

 

Link to comment
Share on other sites

There should not be any problem with language.  I have a script that works but it is a simple one, and for example when some one do not fill out the form and hit submit I get an email from nobody, no email no message. So I am trying to avoid this by developing my scrip but I cant get it right

 

This is my simple script that works

 

<?php
$to = "mymail@gmail.com";
$subject = "Invitation";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "your email was sent"; }
else
{print "En error has occurred, try again , "; }
?>

Link to comment
Share on other sites

There should not be any problem with language.  I have a script that works but it is a simple one, and for example when some one do not fill out the form and hit submit I get an email from nobody, no email no message. So I am trying to avoid this by developing my scrip but I cant get it right

 

This is my simple script that works

 

<?php
$to = "mymail@gmail.com";
$subject = "Invitation";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "your email was sent"; }
else
{print "En error has occurred, try again , "; }
?>

 

Easy.

 

Were are u getting $_REQUEST from ? lol

Link to comment
Share on other sites

Try adding a Content-type header with a charset to the email.

 

E.g. like this:

<?php
$to = "mymail@gmail.com";
$subject = "Invitation";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email\r\nContent-type: text/plain; charset=utf-8";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "your email was sent"; }
else
{print "En error has occurred, 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.