Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

What Is A T_string?


19 replies to this topic

#1 Hamtaro

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 372 posts
  • Interests:Watching Hamtaro, working on computers, programming, website designing (this one should be obvious).
  • myCENT:ZERO

Posted 18 January 2005 - 03:34 AM

I'm new at PHP, and I looked for a while on here, and found some stuff I was looking for about form processing, and sending E-Mail through PHP. However, the script I just created won't work. I get the following error: Parse error: parse error, unexpected T_STRING in /home/hamtaro/public_html/send_feedback.php on line 9
Exactly what is a T_STRING? If I need to post my code, I will.

#2 OpaQue

    Administrator

  • Admin - The Official Guru
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1,895 posts
  • Gender:Male
  • Location:Somewhere in Time & Space.
  • Interests:Discovering Myself.
  • myCENT:-129.97

Posted 18 January 2005 - 06:21 AM

Can you paste that part of the code.

BTW. What I feel is, you have missed a semi-colon ( ; ) somewhere... check the lines.
Also, it can happen if you have closed } the curly braces incorrectly. Check the nesting of the brackets.

#3 LuciferStar

    Advanced Member

  • Kontributors
  • PipPipPipPipPipPipPip
  • 114 posts
  • Location:Suzhou Jiangsu China

Posted 18 January 2005 - 10:14 AM

Hamtaro, on Jan 18 2005, 03:34 AM, said:

I'm new at PHP, and I looked for a while on here, and found some stuff I was looking for about form processing, and sending E-Mail through PHP.  However, the script I just created won't work.  I get the following error: Parse error: parse error, unexpected T_STRING in /home/hamtaro/public_html/send_feedback.php on line 9
Exactly what is a T_STRING? If I need to post my code, I will.

View Post


T_STRING is a string
if the string in your code has an error,then this error message may appear.
check your code on line 9,whether you missed a " or a ',or any others.

#4 Hamtaro

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 372 posts
  • Interests:Watching Hamtaro, working on computers, programming, website designing (this one should be obvious).
  • myCENT:ZERO

Posted 18 January 2005 - 11:09 PM

Ok, here's just the PHP code for the file. The rest is the page that displays the Thank-You page:

<?php
$message = "
User Name: ". $_POST['UserName'] . "\n
E-Mail Address: " .$_POST['EMail'] . "\n
IP Address: ". $REMOTE_ADDR . "\n
Comments: \n
" . $_POST['Comments'] . ";

mail("myemail@email.com", "Feedback",$message);
?>

The mail function is the part where I'm getting the error. If there's supposed to e a semicolon in there, where does it go?

#5 alapidus

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 74 posts
  • Location:Connecticut
  • Interests:sports, video games, computers, tv...

Posted 18 January 2005 - 11:26 PM

Hamtaro, on Jan 18 2005, 06:09 PM, said:

Ok, here's just the PHP code for the file.  The rest is the page that displays the Thank-You page:

<?php
$message = "
User Name: ". $_POST['UserName'] . "\n
E-Mail Address: " .$_POST['EMail'] . "\n
IP Address: ". $REMOTE_ADDR . "\n
Comments: \n
" . $_POST['Comments'] . ";

mail("myemail@email.com", "Feedback",$message);
?>

The mail function is the part where I'm getting the error.  If there's supposed to e a semicolon in there, where does it go?

View Post

take out the . " from the end of the string.

example:

<?php
$message = "
User Name: ". $_POST['UserName'] . "\n
E-Mail Address: " .$_POST['EMail'] . "\n
IP Address: ". $REMOTE_ADDR . "\n
Comments: \n
" . $_POST['Comments'];

mail("myemail@email.com", "Feedback",$message);
?>


#6 Hamtaro

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 372 posts
  • Interests:Watching Hamtaro, working on computers, programming, website designing (this one should be obvious).
  • myCENT:ZERO

Posted 19 January 2005 - 12:28 AM

Oh...That was the problem! Thanks! I sure feel stupid now....Anyway, thanks a lot for your help! Maybe I should also try to find some PHP Tutorials online to help with this...

#7 alapidus

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 74 posts
  • Location:Connecticut
  • Interests:sports, video games, computers, tv...

Posted 19 January 2005 - 12:40 AM

Hamtaro, on Jan 18 2005, 07:28 PM, said:

Oh...That was the problem!  Thanks! I sure feel stupid now....Anyway, thanks a lot for your help!  Maybe I should also try to find some PHP Tutorials online to help with this...

View Post

no problem, that took me some time to learn, too...

#8 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 31 December 2007 - 03:10 AM

Im also stuck with T_Strings :(
What Is A T_string?

<?

//set local variables
$dbhost = "localhost"; //www.100ws.Com
$dbuser = "db_user"; //margee1
$dbpass = "db_pass"; //
$dbname = "db_name"; //margee1_fabhab

//connect
$db = mysqlpconnect;(100ws.Com,margee1,cheese123);
Mysql_select_db("markgee1fabhab",$db)

?>

Thats the code I'm using for my radio and I click test connection on the installation package I'm using and when I click it it says this:

Parse error: syntax error, unexpected T_STRING in /usr/data2/hosted/SkyandLuc/connect.Php on line 10

I would really appreciate it if you could help.
Thanks :)

-Mark

#9 galexcd

    Trap Grand Marshal Member

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPip
  • 1,331 posts
  • Gender:Not Telling
  • myCENT:39.82

Posted 10 January 2008 - 03:51 AM

View PostFeedBacker, on Dec 30 2007, 07:10 PM, said:

Im also stuck with T_Strings :)

What Is A T_string?
<?

//set local variables
$dbhost = "localhost"; //www.100ws.Com
$dbuser = "db_user"; //margee1
$dbpass = "db_pass"; //
$dbname = "db_name"; //margee1_fabhab

//connect
$db = mysqlpconnect;(100ws.Com,margee1,cheese123);
Mysql_select_db("markgee1fabhab",$db)

?>

Thats the code I'm using for my radio and I click test connection on the installation package I'm using and when I click it it says this:

Parse error: syntax error, unexpected T_STRING in /usr/data2/hosted/SkyandLuc/connect.Php on line 10

I would really appreciate it if you could help.
Thanks :)

-Mark

the error would be the semicolon between the function name and the parenthesis. Try this:
mysqlpconnect(100ws.Com,margee1,cheese123);
Also, it appears that you are missing a semicolon on the very last line. You might want to fix that unless you want more errors.

#10 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 21 March 2008 - 05:58 PM

Parse error: syntax error, unexpected T_STRING in /home/fouwellb/ ... on line 20
What Is A T_string?

This is the contents of the referenced file. Line 20 is the one that begins with $noquery=" (the first one). Where do I err? (the variables, except "localhost", are substituted and exist)

<?
$hostname = "localhost";
$username = "username";
$passwordsc = "password";
$dbName = "database";

MYSQL_CONNECT($hostname, $username, $passwordsc) OR DIE("Unable to connect to database");

/* Select the database name to be used or else print error message if unsuccessful*/

@mysql_select_db( "$dbName") or die( "Unable to select database");

$noquery=" or die("SQL Error Occurred : ".Mysql_error().':'.$query)";
$noquery1=" or die("SQL Error Occurred : ".Mysql_error().':'.$query1)";
$noquery2=" or die("SQL Error Occurred : ".Mysql_error().':'.$query2)";

$ipaddress=getenv("remote_addr");
?>

-question by starcity




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users