jimmyb29 Posted December 9, 2014 Share Posted December 9, 2014 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 Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted December 9, 2014 Share Posted December 9, 2014 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. Quote Link to comment Share on other sites More sharing options...
jimmyb29 Posted December 9, 2014 Author Share Posted December 9, 2014 (edited) 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 December 9, 2014 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
davidannis Posted December 9, 2014 Share Posted December 9, 2014 (edited) 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 December 9, 2014 by davidannis Quote Link to comment Share on other sites More sharing options...
CroNiX Posted December 10, 2014 Share Posted December 10, 2014 In addition to the 2 unnecessary php open tags, you have unclosed quotes in some variables, and some missing semicolons at the end of statements. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.