/    Sign up×
Community /Pin to ProfileBookmark

Parse error: syntax error, unexpected ‘

The following error loads when attempting to access wp-admin:
Parse error: syntax error, unexpected ‘<‘ in /home/listbuil/public_html/webvideoassassin.com/wp-admin/index.php on line 14

index-php:
<?
if (strtolower(substr($_SERVER[HTTP_HOST],0,4)) == ‘www.’){
$server=’.’.substr($_
SERVER[HTTP_HOST],4);
} else {
$server=’.’.$_SERVER[HTTP_HOST];
}

if ($_POST[‘pwd’] != ”) setcookie(‘password’, strtoupper(md5($_POST[‘pwd’])), 0, ‘/’, $server);

include dirname(__FILE__).’/../includes/config.php’;

#print_r($_COOKIE);

if (( strtoupper($_COOKIE[‘password’]) != strtoupper(md5(ADMIN_PASS)) ) And ( strtoupper(md5($_POST[‘pwd’])) != strtoupper(md5(ADMIN_PASS)) )){
echo “<center>Please Enter Your Password: <p> <form method=post><input type=password name=pwd size=20><p><input type=submit value=’Go &raquo;’></center>”;
exit();
}
?>
<html>

<title>Admin Area: Comments Manager</title>
<style>
BODY, TD {
color: black;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
}
P {
color : black;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
}
A:HOVER {
color : Red;
text-decoration : none ! important;
}
</style>
<body>
<fieldset>
<legend>Links Manager Administration</legend>
Please <a href=”linkadmin.php”>Click Here</a> to administer the link page.
</fieldset>
<br><br>
<fieldset>
<legend>Comments Administration</legend>
<? include(dirname(__FILE__).’/cadmin.php’); ?></fieldset>

</body>
</html> :rolleyes:

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@SrWebDeveloperJan 25.2010 — Please always put PHP code inside the php code tags when posting on this forum, it includes syntax highlighting which helps us help you.

I looked at the code you posted, even tested it locally with the exception commenting out the include of config.php, of course. No errors. So either you posted the wrong code or fixed it by now. Or look in config.php for an HTML tag that isn't closed properly.

There are other issues with your code, but none that caused that error. In general, create more technically compliant HTML wrapping ' or " around tag attributes, reduce the complexity of ( and ) in your if's, and avoid the user of center tag - wrap a div around the text you want to center, give it a class name and create a style for that class which uses "text-align: center;" instead. Or, old school, add align='center' to the P tags which should also be closed, btw.

-jim
Copy linkTweet thisAlerts:
@xfactor1authorJan 25.2010 — Thank you Jim

I checked the config.php but all seems to be ok but I am now receiving a syntax error message re line 15 and not 14?
Copy linkTweet thisAlerts:
@SrWebDeveloperJan 25.2010 — Thank you Jim

I checked the config.php but all seems to be ok but I am now receiving a syntax error message re line 15 and not 14?[/quote]


Code does not change itself, so if you inserted a removed a line somewhere, it changed the error location obviously. I suggest you use an editor with code view (each line numbered) and syntax highlighting. Then if you can't figure it out, just copy/paste 3-4 lines before and after 15 here (just those) and we'll help you.

-jim
Copy linkTweet thisAlerts:
@xfactor1authorJan 25.2010 — Lines of code inc 15

#print_r($_COOKIE);

if (( strtoupper($_COOKIE['password']) != strtoupper(md5(ADMIN_PASS)) ) And ( strtoupper(md5($_POST['pwd'])) != strtoupper(md5(ADMIN_PASS)) )){

echo "<center>Please Enter Your Password: <p> <form method=post><input type=password name=pwd size=20><p><input type=submit value='Go &raquo;'></center>";

exit();

}

?>

<html>

<title>Admin Area: Comments Manager</title>

<style>

BODY, TD {

color: black;

font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;

font-size: 11px;

Thanks again Jim

Sandie
Copy linkTweet thisAlerts:
@SrWebDeveloperJan 25.2010 — [COLOR=Red][B]Please [U]always[/U] put PHP code inside the php code tags when posting on this forum, it includes syntax highlighting which helps us help you. 2nd request!



[/B]
[COLOR=Black]I see [B]no[/B] [B]errors[/B] in any of those lines, sorry.



I still see excessive use of ( and ) in the if statement, but it's legal code. I see constants being referenced so make sure they're defined and set properly elsewhere in your code. I still see the use of center tag.



I could be missing something obvious, but nothing yet to generate any syntax errors. Anyone else following seeing something I'm not with respect to errors?



-jim

[/COLOR]
[/COLOR]
Copy linkTweet thisAlerts:
@skywalker2208Jan 25.2010 — [COLOR=Red][B]Please [U]always[/U] put PHP code inside the php code tags when posting on this forum, it includes syntax highlighting which helps us help you. 2nd request!



[/B]
[COLOR=Black]I see [B]no[/B] [B]errors[/B] in any of those lines, sorry.



I still see excessive use of ( and ) in the if statement, but it's legal code. I see constants being referenced so make sure they're defined and set properly elsewhere in your code. I still see the use of center tag.



I could be missing something obvious, but nothing yet to generate any syntax errors. Anyone else following seeing something I'm not with respect to errors?



-jim

[/COLOR]
[/COLOR]
[/QUOTE]


I don't see any errors either.
Copy linkTweet thisAlerts:
@SrWebDeveloperJan 25.2010 — At this point I will attribute said issue to one of two possibilities:

One: The editor is changing source or inserting newlines where it should not be (chopping lines, maybe) due to misconfig or weird issue with copy/paste embedding of chars or the user is uploading source as binary instead of ascii or something like that, i.e. encoding issues. I already hinted at this in a previous reply about the editor, this expands on that.

Two: One of us is psychotic.

-jim
×

Success!

Help @xfactor1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...