Jump to content
xisto Community
Sign in to follow this  
Hamtaro

What Is A T_string? Please help Im new at PHP Programming

Recommended Posts

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 9Exactly what is a T_STRING? If I need to post my code, I will.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

41801[/snapback]


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.

Share this post


Link to post
Share on other sites

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'] . "\nE-Mail Address: " .$_POST['EMail'] . "\nIP Address: ". $REMOTE_ADDR . "\nComments: \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?

Share this post


Link to post
Share on other sites

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'] . "\nE-Mail Address: " .$_POST['EMail'] . "\nIP Address: ". $REMOTE_ADDR . "\nComments: \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?

41903[/snapback]

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

 

example:

 

<?php$message = "User Name: ". $_POST['UserName'] . "\nE-Mail Address: " .$_POST['EMail'] . "\nIP Address: ". $REMOTE_ADDR . "\nComments: \n" . $_POST['Comments'];mail("myemail@email.com", "Feedback",$message);?>

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

41912[/snapback]

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

Share this post


Link to post
Share on other sites

Im also stuck with T_Strings :(

What Is A T_string?

 

<?

 

//set local variables

$dbhost = "localhost"; //https://www.100webspace.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

Share this post


Link to post
Share on other sites

Im also stuck with T_Strings :)

 

What Is A T_string?

<?

 

//set local variables

$dbhost = "localhost"; //https://www.100webspace.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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I cant get this to work...(PHP problem)

What Is A T_string?

 

I have similar problems..

 

Parse error: syntax error, unexpected $end in /home/a8308175/public_html/LocalSettings.Php on line 125

 

 

$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) ) ;

 

Any ideas?

 

-question by Chris

Share this post


Link to post
Share on other sites

I am also Having problems with this T_string thing

$query = " SELECT val FROM tutorials " .		 " LIMIT $offset, $rowsPerPage";$result = mysql_query($query) or die('Error, query failed on line 24 Error'mysql_error());

Share this post


Link to post
Share on other sites

Same Experience

What Is A T_string?

 

Got an error:

 

Parse error: syntax error, unexpected T_STRING in /home/archeron/public_html/evewarrior.Com/wp-content/themes/EVE Theme/index.Php on line 41

 

It's in this line:

 

<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?><br />

 

I don't know what I shouldn't or should have added.

 

-question by Tonglil

Share this post


Link to post
Share on other sites

T_STRING

What Is A T_string?

 

I also have the same error on the T_STRING:

 

Parse error: parse error, unexpected T_STRING in C:Program Filesxampphtdocsnew_website2upload_resume_application.Php on line 9

 

I am a newbie. Please help. Here's the code:

<?php

Session_start();

Include_once("database.Php");

$uploadDir = 'C:/upload/';

 

If(isset($_POST['upload']) and ($_FILES['resume']['size'] > 0)){

$fileName = $_FILES['resume']['name'];

$tmpName = $_FILES['resume']['tmp_name'];

$fileSize = $_FILES['resume']['size'];

$fileType = $_FILES['resume']['type'];

$filePath = $uploadDir . $fileName;

 

$fp = fopen($tmpName, 'are');

$content = fread($fp, filesize($tmpName));

$content = addslashes($content);

fclose($fp);

}

 

 

 

-question by abel

Share this post


Link to post
Share on other sites

I also have a problem with t-strings

 I have looked at the lines lots of times, but can get a clue what could be wrong...

here is the text:

 ?phpIf(isset($_POST['enviar'])) {$to = 'reservas@hotelatlantico-ita.Com.Br'; // reservas@hotelatlantico-ita.Com.Br$charset = $_POST['charset'];$nome = $_POST['nome'];$cidade = $_POST['cidade'];$estado = $_POST['estado'];$email = $_POST['email'];$telefone residencial = $_POST['Telefone residencial'];$telefone comercial = $_POST['Telefone comercial'];$celular = $_POST['celular'];$data de entrada = $_POST['data de entrada'];$data de saida = $_POST['data de saida'];$assunto = '=?' . $charset . '?B?' . Base64_encode($_POST['assunto']) . '?=';$mensagem = $_POST['mensagem'];$corpo = "Nome: $nomeCidade: $cidadeEstado: $estadoE-mail: $emailTelefone residencial: $telefone residencialTelefone comercial: $telefone comercialCelular: $celularData de entrada: $data de entradaData de Saida: $data de sa?theMensagem: $mensagem ";$headers = 'Return-Path: ' . $email . "

 

I got the message:

 

PHP Parse error:  syntax error, unexpected T_STRING in E:homehotelatlantiWebenviar.Php on line 16

 

but I am not able to see the mistake. Thanks for any help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.