justinjkiss Posted July 15, 2008 Share Posted July 15, 2008 i just cant figure out my problem. Even had a friend that is fairly good at php programing look at it and he didnt know either. I have a feeling that it is in the table creation area that is causing my problem. ... <? /** * The user is already logged in and not allowed to register unless admin. */ if($session->isAdmin()){ echo "[<a href=\"../dealercenter.php\">Dealer Center Home</a>] "; echo "[<a href=\"process.php\">Logout</a>]"; ?> <br /><br /><p>Add Warranty Table</p> <form action="<?=$_SERVER['PHP_SELF']?>" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr> <td>Username:</td><td><input type="text" name="user" maxlength="30"></td> </tr> <tr> <td><input type="submit" value="Add Warranty table!"></td> </tr> </table> </form> <? $user=$_POST['user']; $sql = "CREATE TABLE `custkis6_login`.`$user` ( `model` varchar( 10 ) NOT NULL , `serial` int( 10 ) NOT NULL , `servdate` varchar( 10 ) NOT NULL , `faildate` varchar( 10 ) NOT NULL , `repairdate` varchar( 10 ) NOT NULL , `comment` longtext NOT NULL , `traveltime` mediumint( 3 ) NOT NULL , `repairtime` mediumint( 3 ) NOT NULL , `claimhours` mediumint( 3 ) NOT NULL , `hourrate` varchar( 3 ) NOT NULL , `claimname` varchar( 50 ) NOT NULL , PRIMARY KEY ( `serial` ) ) ENGINE = MyISAM DEFAULT CHARSET = latin1;[...]"; } else ($session->logged_in){ echo "<p>Access Denied</p>"; echo "<p>We're sorry <b>$session->username</b>, but you've not allowed to view this page. " ."<a href=\"../dealercenter.php\">Main</a>.</p>"; } ... Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/ Share on other sites More sharing options...
revraz Posted July 15, 2008 Share Posted July 15, 2008 And line 204 is... Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590533 Share on other sites More sharing options...
justinjkiss Posted July 15, 2008 Author Share Posted July 15, 2008 Line 204 is the "else" line. Seems the if isnt taking the close bracket. Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590538 Share on other sites More sharing options...
MadTechie Posted July 15, 2008 Share Posted July 15, 2008 shouldn't else ($session->logged_in){ be elseif($session->logged_in){ Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590539 Share on other sites More sharing options...
revraz Posted July 15, 2008 Share Posted July 15, 2008 elseif wouldn't be required if he is just using IF and ELSE But the error maybe he higher up, post all the code. Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590541 Share on other sites More sharing options...
justinjkiss Posted July 15, 2008 Author Share Posted July 15, 2008 the only php above that is <? require("include/session.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590545 Share on other sites More sharing options...
MadTechie Posted July 15, 2008 Share Posted July 15, 2008 else ($session->logged_in){ ($session->logged_in) is a condition thus requires the if! Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590555 Share on other sites More sharing options...
justinjkiss Posted July 15, 2008 Author Share Posted July 15, 2008 Thanks!!! That was the problem. I swear i copied the code from something that used that if else statement but i guess i must have modified it by mistake because i went and looked at what i copied it from and sure enough i was missing the else "if". Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590563 Share on other sites More sharing options...
MadTechie Posted July 15, 2008 Share Posted July 15, 2008 it was easy to miss.. missed it myself on the first eye sweep, if this is resolved can you please click topic solved Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590566 Share on other sites More sharing options...
justinjkiss Posted July 15, 2008 Author Share Posted July 15, 2008 where do i click that? Also i dont think my database submission is working properly. It wont add and i feel the user variable isnt registering the way it is wrote. Is this the area for that? Should i make a new topic? Im new here if you cant tell. Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590567 Share on other sites More sharing options...
MadTechie Posted July 15, 2008 Share Posted July 15, 2008 it should be bottom left, if its not there just post SOLVED.. new problem outside of the code you have posted .. then probably best to start a new thread.. the better the description the better the help Quote Link to comment https://forums.phpfreaks.com/topic/114839-solved-parse-error-syntax-error-unexpected-on-line-204/#findComment-590571 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.