unidox Posted October 12, 2007 Share Posted October 12, 2007 This is the error: Parse error: syntax error, unexpected T_VARIABLE in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\acp\incs\conf.inc.php on line 24 This is my code: <form action="../actions/admin_login.php" method="post"> Admin Login <div> <div style="text-align: center;"> <? include("conf.inc.php"); $q = mysql_query("SELECT * FROM `pcp_users` ORDER BY `user_id` DESC"); $r = mysql_fetch_array($q); if($_GET['e'] != 1) { echo "Please enter the admin password to continue."; } else { echo "The password/username you entered was incorrect. Please try again."; } echo "<br /><br />"; ?> Username: <input type="text" name="username" size="20" /> Password: <input type="password" name="password" size="20" /> <input type="submit" value="Log In" /> </div> </div> </form> Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/ Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 <?php include("conf.inc.php"); $q = mysql_query("SELECT * FROM 'pcp_users' ORDER BY 'user_id' DESC"); $r = mysql_fetch_array($q); if($_GET['e'] != 1) { print ("Please enter the admin password to continue."); } else { print ("The password/username you entered was incorrect. Please try again."); } print("<br /><br />"); ?> Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368143 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 didnt work, I am using it on my home server, is there something I need to enable in php to have it work? Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368145 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 shouldnt be as long as PHP is enabled and running Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368146 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 hmm, I dont know what could be wrong. Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368147 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 can you tell me where line 24 is and comment it out? like <?php ///this is a comment ?> Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368150 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 There is no line 24. btw, I tried on a real server, and same problem. So its not the server. Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368151 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 and thats the only code in the page? Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368152 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 Yes, would you like the config? Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368154 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 that would help Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368157 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 you arent missing any semicolons so i dont know why it would be doing that ??? Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368160 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 // Start the session @session_start(); // Mysql Info $db_user = "root" // Username $db_pass = "********" // Password $db_database = "pcp" // Database Name $db_host = "localhost" // Server Hostname // DO NOT EDIT ANYTHING AFTER THIS LINE! $db_connect = @mysql_connect ($db_host, $db_user, $db_pass); $db_select = @mysql_select_db ($db_database); // Requests information for clan name and the link to the forums. if ($db_connect && $db_select) { $q = @mysql_query("SELECT 'info' FROM 'pcp_information' WHERE type = 'name';"); $r = @mysql_fetch_array($q); $clanname = $r['info']; $q = @mysql_query("SELECT 'info' FROM 'pcp_information' WHERE type = 'forumlink';"); $r = mysql_fetch_array($q); $forumlink = ($r['info'] == "") ? "index.php?p=forum" : $r['info']; } else ( $db_error = 1; } // Switch Statements for title switch($_GET['p']) { default: $title = " Welcome!"; break; case "admin": $title = "Pure cP"; break; case "admin_settings": $title = "PcP - Settings"; break; case "admin_preview": $title = "PcP - Preview"; break; case "admin_news": $title = "PcP - News"; break; case "admin_sponsors": $title = "PcP - Sponsors"; break; case "admin_servers": $title = "PcP - Servers"; break; case "admin_roster": $title = "PcP - Roster"; break; case "admin_matches": $title = "PcP - Matches"; break; case "admin_contact": $title = "PcP - Contact"; break; case "admin_upcoming_matches": $title = "PcP - Upcoming Matches"; break; case "admin_media": $title = "PcP - Media"; break; case "admin_demos": $title = "PcP - Demos"; break; case "admin_cotw": $title = "PcP - Clip Of The Week"; break; case "admin_gallery": $title = "PcP - Gallery"; break; case "admin_events": $title = "PcP - Events"; break; case "admin_ads": $title = "PcP - Events"; break; case "admin_lead_sponsor": $title = "PcP - Lead Sponsor"; break; case "admin_premier_sponsor": $title = "PcP - Premier Sponsor"; break; case "admin_poll": $title = "PcP - Poll"; break; case "roster": $title = "Roster"; break; case "contact": $title = "Contact"; break; case "upcoming_matches": $title = "Upcoming Matches"; break; case "media": $title = "Media"; break; case "demos": $title = "Demos"; break; case "cotw": $title = "Clip Of The Week"; break; case "gallery": $title = "Gallery"; break; case "events": $title = "Events"; break; case "ads": $title = "Advertisements"; break; case "lead_sponsor": $title = "Lead Sponsor"; case "premier_sponsor": $title = "Premier Sponsor"; break; case "poll": $title = "Poll"; break; case "sponsors": $title = "Sponsors"; break; case "matches": $title = "Matches"; break; case "about": $title = "About Us"; break; case "profile": $title = "Profile"; break; case "contact": $title = "Contact Information"; break; } Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368162 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 first off you need to put semi's after your connection <?php $db_user = "root" ;// Username $db_pass = "********" ;// Password $db_database = "pcp"; // Database Name $db_host = "localhost"; // Server Hostname ?> Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368164 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 I did, same problem Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368166 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 <?php $db_error = "1";?> Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368167 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 Nope. still have the problem. I am using mysql, do I need mysqli? Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368168 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 the problem is in the config page hmm Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368170 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 I dont see anything wrong... Its really annoying Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368172 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 found it <?php } else ( ?> should be <?php }else{ ?> Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368174 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 I changed it, but I am still getting the error. Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368176 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 paste the new code? Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368177 Share on other sites More sharing options...
maxudaskin Posted October 12, 2007 Share Posted October 12, 2007 Works on my server... besides the missing files. http://www.virtualzoom.net/testing.php Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368178 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 Max, can you paste the code? Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368179 Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 <?php // Start the session @session_start(); // Mysql Info $db_user = "root"; // Username $db_pass = "********" ;// Password $db_database = "pcp" ;// Database Name $db_host = "localhost"; // Server Hostname // DO NOT EDIT ANYTHING AFTER THIS LINE! $db_connect = @mysql_connect ($db_host, $db_user, $db_pass); $db_select = @mysql_select_db ($db_database); // Requests information for clan name and the link to the forums. if ($db_connect && $db_select) { $q = @mysql_query("SELECT 'info' FROM 'pcp_information' WHERE type = 'name';"); $r = @mysql_fetch_array($q); $clanname = $r['info']; $q = @mysql_query("SELECT 'info' FROM 'pcp_information' WHERE type = 'forumlink';"); $r = mysql_fetch_array($q); $forumlink = ($r['info'] == "") ? "index.php?p=forum" : $r['info']; } else { $db_error = "1"; } // Switch Statements for title switch($_GET['p']) { default: $title = " Welcome!"; break; case "admin": $title = "Pure cP"; break; case "admin_settings": $title = "PcP - Settings"; break; case "admin_preview": $title = "PcP - Preview"; break; case "admin_news": $title = "PcP - News"; break; case "admin_sponsors": $title = "PcP - Sponsors"; break; case "admin_servers": $title = "PcP - Servers"; break; case "admin_roster": $title = "PcP - Roster"; break; case "admin_matches": $title = "PcP - Matches"; break; case "admin_contact": $title = "PcP - Contact"; break; case "admin_upcoming_matches": $title = "PcP - Upcoming Matches"; break; case "admin_media": $title = "PcP - Media"; break; case "admin_demos": $title = "PcP - Demos"; break; case "admin_cotw": $title = "PcP - Clip Of The Week"; break; case "admin_gallery": $title = "PcP - Gallery"; break; case "admin_events": $title = "PcP - Events"; break; case "admin_ads": $title = "PcP - Events"; break; case "admin_lead_sponsor": $title = "PcP - Lead Sponsor"; break; case "admin_premier_sponsor": $title = "PcP - Premier Sponsor"; break; case "admin_poll": $title = "PcP - Poll"; break; case "roster": $title = "Roster"; break; case "contact": $title = "Contact"; break; case "upcoming_matches": $title = "Upcoming Matches"; break; case "media": $title = "Media"; break; case "demos": $title = "Demos"; break; case "cotw": $title = "Clip Of The Week"; break; case "gallery": $title = "Gallery"; break; case "events": $title = "Events"; break; case "ads": $title = "Advertisements"; break; case "lead_sponsor": $title = "Lead Sponsor"; case "premier_sponsor": $title = "Premier Sponsor"; break; case "poll": $title = "Poll"; break; case "sponsors": $title = "Sponsors"; break; case "matches": $title = "Matches"; break; case "about": $title = "About Us"; break; case "profile": $title = "Profile"; break; case "contact": $title = "Contact Information"; break; } ?> Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368181 Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 Well, I fixed the t var part, by restarting apache. Thanks Link to comment https://forums.phpfreaks.com/topic/73011-solved-parse-error/#findComment-368206 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.