juelpatwary Posted February 26, 2008 Share Posted February 26, 2008 Hi, Ive been making a website but i get this error in index.php, Ive tried for ages, But i just figure it out, I am guessing its realy simple but i cant do It So i turned to you! Google was my friend and found the best PHP help site out there,So please can you help me This is what it says on the website Parse error: syntax error, unexpected T_STRING in /home/a6331818/public_html/index.php on line 7 And in the file index.php it says this $chandle = mysql_connect("localhost", $dbuser, $dbpass) So?... Any help please and thankyou, Regards Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/ Share on other sites More sharing options...
nethnet Posted February 26, 2008 Share Posted February 26, 2008 Semicolon at the end of the line? Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477238 Share on other sites More sharing options...
pocobueno1388 Posted February 26, 2008 Share Posted February 26, 2008 Your missing the semi-colon at the end of the line. $chandle = mysql_connect("localhost", $dbuser, $dbpass); If thats not it, post more code. Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477239 Share on other sites More sharing options...
juelpatwary Posted February 26, 2008 Author Share Posted February 26, 2008 Okey thanks for the fast replys And ill try it now Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477241 Share on other sites More sharing options...
juelpatwary Posted February 26, 2008 Author Share Posted February 26, 2008 Okey thanks for the fast replys And ill try it now Argh! no it says this now Parse error: syntax error, unexpected T_VARIABLE in /home/a6331818/public_html/index.php on line 7 Heres some of the code (It wont let me post all the code) <?php $time = time(); $time15 = time() + (15 * 60); session_start(); $dbuser="a6331818_rs2"; $dbpass="randomalfie111" $dbname = "a6331818_rs2"; $chandle = mysql_connect("localhost", $dbuser, $dbpass); or die("Connection Failure to Database"); mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found." . $dbuser); $playerClan = 0; $playerId = -1; $mysql = mysql_query("SELECT * FROM uber3_players where name='".$username."' and pass='".$password."' LIMIT 1") or die(mysql_error()); while($row = mysql_fetch_assoc($mysql)){ $playerId = $row['id']; $playerClan = $row['ClanID']; } function loggedIn() { if(isset($_SESSION['username'])) { $username = $_SESSION['username']; $password = $_SESSION['password']; $mysql = mysql_query("SELECT * FROM uber3_players where name='".$username."' and pass='".$password."' LIMIT 1") or die(mysql_error()); $destroy = true; while($row = mysql_fetch_assoc($mysql)){ $_SESSION['dbid'] = $row['id']; $_SESSION['mgroup'] = $row['mgroup']; $destroy = false; } if($destroy) { echo 'Your password has changed. You must relogin.'; session_destroy(); return false; } echo $playerClan; return true; } else { echo 'Welcome guest, please <a href="index.php?action=login">Login</a> or <a href="index.php?action=newchar">Register</a>.'; } return false; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns:ie=""> <head> Edit: sorry i meant to of pressed edit, I pressed quote sorry Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477247 Share on other sites More sharing options...
juelpatwary Posted February 26, 2008 Author Share Posted February 26, 2008 Bump Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477255 Share on other sites More sharing options...
nethnet Posted February 26, 2008 Share Posted February 26, 2008 You still have forgotten a semi-colon on line 6. Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477263 Share on other sites More sharing options...
juelpatwary Posted February 26, 2008 Author Share Posted February 26, 2008 Ooooooooh ill try Yup that worked thanks, Now i get this Parse error: syntax error, unexpected T_LOGICAL_OR in /home/a6331818/public_html/index.php on line 9 Lol never ending! Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477265 Share on other sites More sharing options...
nethnet Posted February 26, 2008 Share Posted February 26, 2008 Get rid of the semi-colon after your $chandle variable. You can't seperate functions from "or die()" with a semi-colon. This is all pretty elementary. If you keep getting errors based on your syntax I'd recommend looking over some introductory tutorials. It's unnecessary to post every syntax error you get on these forums when they're all pretty much the same. Be careful with your semi-colons. Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477270 Share on other sites More sharing options...
juelpatwary Posted February 26, 2008 Author Share Posted February 26, 2008 Okey thanks mate, I agree and i will be careull cheerz Link to comment https://forums.phpfreaks.com/topic/93153-php-t_string-help/#findComment-477272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.