Jump to content

[SOLVED] Parse Error


unidox

Recommended Posts

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
Share on other sites

<?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
Share on other sites

// 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
Share on other sites

<?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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.