/    Sign up×
Community /Pin to ProfileBookmark

Help with warning/parse error ” (ASCII=92)

Warning: Unexpected character in input: ” (ASCII=92) state=1 in /home/revillu/public_html/boards/admin_formatuser.php on line 2

Parse error: parse error, unexpected T_STRING in /home/revillu/public_html/boards/admin_formatuser.php on line 2

HTe script works fine on my server but on another server it gives that error here it is

[code=php]
<?php
include(“common.php”);
if (checkAccess(“accessadmin”))
{
if ($action == “savenameformat”)
{
$navigationhead = “Update Name Formatting”;

$validcolourregex = “^#[0-9A-Fa-f]{6}$”;
$jregex = “^[0-9A-Fa-f]{6}$”;
$kregex = “^[A-Za-z]+$”;

// Make sure a valid colour code comes through for colour attributes.
// First, see if the same code we put into inputChoice() comes back
// from it.
$sethlcolour = inputChoice(“colours”, “hlcolour”, $hlcolour, “show”);
$settxtcolour = inputChoice(“colours”, “txtcolour”, $txtcolour, “show”);
$setbordercolour = inputChoice(“colours”, “txtcolour”, $bordercolour, “show”);

// Now check – if the same code DIDN’T come back, then validate it
// against $validcolourregex
if (($sethlcolour != $hlcolour) && (ereg($validcolourregex, $hlcolour) || ereg($jregex, $hlcolour) || ereg($kregex, $hlcolour)))
{ $sethlcolour = $hlcolour; }
if (($settxtcolour != $txtcolour) && (ereg($validcolourregex, $txtcolour) || ereg($jregex, $txtcolour) || ereg($kregex, $txtcolour)))
{ $settxtcolour = $txtcolour; }
if (($setbordercolour != $bordercolour) && (ereg($validcolourregex, $bordercolour) || ereg($jregex, $bordercolour) || ereg($kregex, $bordercolour)))
{ $setbordercolour = $bordercolour; }

$newsettings[hlcolour] = $sethlcolour;
$newsettings[txtcolour] = $settxtcolour;
$newsettings[stylebold] = $bold;
$newsettings[styleitalic] = $italic;

$newsettings[styleunderline] = $underline;
$newsettings[styleoverline] = $overline;
$newsettings[stylestrikethrough] = $strikethrough;

$newsettings[bottomborder] = $bottomborder;
$newsettings[topborder] = $topborder;
$newsettings[leftborder] = $leftborder;
$newsettings[rightborder] = $rightborder;
$newsettings[bordercolour] = $setbordercolour;

if ($sethlcolour || $settxtcolour || $bold || $italic || $underline || $overline || $strikethrough || $bottomborder || $topborder || $leftborder || $rightborder || $setbordercolour)
{
$vars[displayformat] = serialize($newsettings);
}
else
{
$vars[displayformat] = “”;
}

$update = updateUser($userid, $vars, “no”);
if ($update)
{
$sysmsg = “custom”;
$sysmsgcustomcontent = “The Users Name Display has been updated.”;
$action = “”;
}
else
{
$reason = “Err, something went wrong”;
$action = “”;
}
}

if ($action == “”)
{
$navigationhead = “Name Formatting”;

//print_r($formatsettings);
//echo “<BR>n”;
$hlcolour = $formatsettings[hlcolour];
$txtcolour = $formatsettings[txtcolour];
$bold = $formatsettings[stylebold];
$italic = $formatsettings[styleitalic];
// Legacy
$bottomborder = $formatsettings[styleunderline];
$topborder = $formatsettings[styleoverline];
$strikethrough = $formatsettings[stylestrikethrough];
// Border switches
$bottomborder = $formatsettings[bottomborder];
$topborder = $formatsettings[topborder];
$leftborder = $formatsettings[leftborder];
$rightborder = $formatsettings[rightborder];
$bordercolour = $formatsettings[bordercolour];

include(“elements/nameformat.php”);
$output = “<SPAN CLASS=’InputSection’>Change Name Colour</SPAN><BR>n”
.”<FORM ACTION=’$PHP_SELF’ METHOD=POST>n”
.”<b>Enter User ID to change format of</b><BR>”
.”<input type’text’ name=’userid’ value=’1′><BR>”
.inputHidden(“action”, “savenameformat”)
.$nameformatform
.”<P>n”
.inputSubmit(“Change Formatting”)
.”</FORM>n”;
}
}
else
{
$output=”You do not have access to this page”;
}
$pagecontents=$output;
include(“layout.php”);
?>[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@JonaJul 25.2004 — [font=trebuchet ms]Typically this means that you have an apostrophe somewhere it shouldn't be. It's a good practice to refer to array elements with quotes:[/font]

[code=php]
$array['name'] = "value";
[/code]


[font=trebuchet ms]Rather than[/font]

[code=php]
$array[name] = "value";
[/code]
×

Success!

Help @Conor 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 6.15,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...