Page 1 of 1

Parse error: syntax error, unexpected T_STRING in ..........

Posted: Mon Mar 10, 2008 1:00 pm
by sabsin
Everah | Please use the appropriate bbCode tags when posting code in the forms. You can use [code], [{lang}] or [syntax="{lang}"] where {lang} is the language you want to highlight as.

Everah | Please post in the correct forums.

Hi ! i'm facing t- String error for my feebback form

Parse error: syntax error, unexpected T_STRING in /home/ezines/public_html/savefeedback.php on line 19

below is the code.. pls help me to figure out the problem
------------------------------------------------------------

Code: Select all

<?php
    ob_start();
    echo "<pre>";
    print_r($_POST);
    
    $con = mysql_connect("localhost","ezines_india","ezines123");
    if (!$con)
    {
        die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("ezines_inquiry",$con);
    
    mysql_query("INSERT INTO ezines_inquiry VALUES ('".$_POST['name']."', '".$_POST['address']."','".$_POST['phone']."','".$_POST['email']."','".$_POST['comments']."')");
    
    $msg = "Thank You for Your Inquiry.\n\nWe will get back to you shortly.\n\nWith Best Regards\nSaba";
    mail($_POST['email'],"Inquiry Mail",$msg);
    $msg = "Name : ".$_POST['name']."\nAddress : ".$_POST['address']."\nPhone : ".$_POST['phone']."\nEmail : ".$_POST['email']."\nComments : ".$_POST['comments'];
    mail("ansari_saba@yahoo.co.in","Inquiry Mail",$msg)
    mysql_close($con);
    header("Location: thanks.php");
?>
-------------------------------------------------------------------------------------
Problem can be seen at http://www.ezinesindia.com/inquiry.php


thanx

Sabs

Everah | Please use the appropriate bbCode tags when posting code in the forms. You can use [code], [{lang}] or [syntax="{lang}"] where {lang} is the language you want to highlight as.

Re: Parse error: syntax error, unexpected T_STRING in ..........

Posted: Mon Mar 10, 2008 1:55 pm
by alex.barylski

Code: Select all

mail("ansari_saba@yahoo.co.in","Inquiry Mail",$msg)
Your missing a closing semi-colon at the end of that statement -- that will cause an issue -- not sure if it's the one you are having though. :P

p.s-Format your code nicely and use PHP blocks it makes diagnosing much easier.

Re: Parse error: syntax error, unexpected T_STRING in ..........

Posted: Tue Mar 11, 2008 7:07 am
by Jenk
General Discussion

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Re: Parse error: syntax error, unexpected T_STRING in ..........

Posted: Wed Mar 12, 2008 3:39 am
by sabsin
thank you it's working

p.s-Format your code nicely and use PHP blocks it makes diagnosing much easier.

can I hv a hint of it...PHP blocks ? how 2 use it :(

Re: Parse error: syntax error, unexpected T_STRING in ..........

Posted: Wed Mar 12, 2008 4:55 am
by Chris Corbyn
sabsin wrote:thank you it's working

p.s-Format your code nicely and use PHP blocks it makes diagnosing much easier.

can I hv a hint of it...PHP blocks ? how 2 use it :(
Effectively, any time you go inside a curly brace, indent your code by 1 tab, or some fixed number of spaces.

Code: Select all

class Foo
{
  //Everything is indented because of the curly
  var $something;
  
  function bar()
  {
    //Everything is idented even more because of the curly
    $x = 0;
    while ($x < 10)
    {
      //everything is indented yet again because of the curly
      $x++;
    }
  }
 
}
It's not a syntax thing, just a way to make you code easier to read that's all ;)

Re: Parse error: syntax error, unexpected T_STRING in ..........

Posted: Wed Mar 12, 2008 5:32 am
by sabsin
thanx a tons :)

Re: Parse error: syntax error, unexpected T_STRING in ..........

Posted: Thu Mar 13, 2008 11:38 am
by RobertGonzalez
Moved to PHP - Code.