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> Quote Link to comment 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 />"); ?> Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 ?> Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 Yes, would you like the config? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 that would help Quote Link to comment 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 ??? Quote Link to comment 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; } Quote Link to comment 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 ?> Quote Link to comment Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 I did, same problem Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 <?php $db_error = "1";?> Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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{ ?> Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted October 12, 2007 Share Posted October 12, 2007 paste the new code? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
unidox Posted October 12, 2007 Author Share Posted October 12, 2007 Max, can you paste the code? Quote Link to comment 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; } ?> Quote Link to comment 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 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.