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 Quote Link to comment Share on other sites More sharing options...
nethnet Posted February 26, 2008 Share Posted February 26, 2008 Semicolon at the end of the line? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
juelpatwary Posted February 26, 2008 Author Share Posted February 26, 2008 Bump Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment 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. Quote Link to comment 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 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.