Jump to content

T_String Error


jimmyb29

Recommended Posts

Hi, again,

 

I'm still working on my Guestbook, and finally realized that the code is antiquated! I'm now trying it with PDO_Mysqli.

 

I get an error:

 

Unexpected T_String in/hermes/bosnaweb o4ay/62713/ipg.jimmybryant.net/Guestbook.php.

 

I don't recognize anything; anyone see the problem?

 

Thanks MUCH,

 

Jimmy

Link to comment
https://forums.phpfreaks.com/topic/292977-t_string-error/
Share on other sites

the error typically means that php found the end of a string where it wasn't expecting one. the error message also included a line number to give you a starting point to look at to find the problem. we cannot specifically help you without seeing the code leading up to the point where the error was discovered. if you post about 10 lines of code leading up to and including the line where the error is being reported at, someone can probably help you.

Link to comment
https://forums.phpfreaks.com/topic/292977-t_string-error/#findComment-1499068
Share on other sites

Hi, mac_gyver,

 

I finally found my way back with the info you requested about the T_STRING error.

 

Here

s the code from the affected area:

 

<?php
// CONNECT TO THE SERVER AND SELECT DATABASE
$server = ' <?php 
$link = mysqli_connect( <?php 
$link = mysqli_connect(*****', '****', '****'); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
echo 'Connected successfully'; 
 
It's on line 5.
 
Thanks,
 
Jimmyb
Link to comment
https://forums.phpfreaks.com/topic/292977-t_string-error/#findComment-1499122
Share on other sites

You have a couple extra opne php tags in there.

$server = ' <?php 
$link = mysqli_connect( <?php 

instead of actual code. Looks like you have that hardcoded on the line below, so you can get rid of those two lines. Also, NEVER post passwords for your databases. You will get hacked.

Link to comment
https://forums.phpfreaks.com/topic/292977-t_string-error/#findComment-1499124
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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