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
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
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
Edited by Ch0cu3r
Link to comment
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.

Edited by davidannis
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.