Jump to content

Why this error?


MySQL_Narb

Recommended Posts

Code:

 

<?php session_start(); ?>
<?php require "global_settings.php"; ?>
<title><?php echo $sitetitle; ?></title>
<font face='arial' size='2'></a>
<?php session_start(); ?>
<center>
<style>
a:link {
color:#24374C;
text-decoration:none;
}

a:visited {
color:#24374C;
text-decoration:none;
}

a:active {
outline: none;
color:#24374C;
text-decoration:none;
}

body {background-color:#b0c4de}

div.box {
width:250px;
padding:10px;
border:3px double #000000;
margin:10px;
background-color:#74AFF2;
}

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}

div.menu-blue {
BORDER-RIGHT: #333366 1px solid;
BORDER-LEFT: #6699cc 1px solid;
BORDER-TOP: #6699cc 1px solid;
BORDER-BOTTOM: #333366 1px solid;

FONT-WEIGHT: normal;

COLOR: #ffffff;

BACKGROUND-COLOR: #23559C;
TEXT-DECORATION: none;
font-stretch : condensed;
}

.menu-top  {
BORDER-RIGHT: 1px solid #333366; BORDER-TOP: 1px solid #6699CC; FONT-WEIGHT: normal; BORDER-LEFT: 1px solid #6699CC; COLOR: #FFFFFF; BORDER-BOTTOM: 1px solid #333366; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none;
font-stretch : condensed
}
</style>
<center>
<div class='menu-blue'>
<div align="center"> 
<table width="600" cellspacing="1" cellpadding="5" style="background-color:#23559C"> 
<tr> 
<td style="background-color:#FFFFFF"> 


    <div align="center"> 
    <table border="0"> 
    
    </form> 
    </table>
<?php

if ($_SESSION['username'])
   echo "
<form action='signature_changed.php' method='POST'>
<div class='box'><h3>Update signature</h3>
<input type='hidden' name='name' value='<?php echo $_SESSION['username']; ?>'>
<textarea name='newsig' cols='20' rows='5'>
</textarea><input type='submit' value='Change'></a>
</div>
</form>";
else
   die ("Narb.");

?>

 

Error:

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/a5488351/public_html/ucp.php on line 81

Link to comment
Share on other sites

for starters, you have started a session twice in almost as many lines .. eliminate the second session_start();

 

try taking away that initial whitespace before the first session_start():

 

<?php
session_start();
?>

 

and, check this line:

 

<input type='hidden' name='name' value='<?php echo $_SESSION['username']; ?>'>

 

to:

 

<input type='hidden' name='name' value='".$_SESSION['username']."'>

 

next time, at least indicate where line:81 is in the script.

Link to comment
Share on other sites

I have posted line 83. It's the same as line 81, in the other code I posted. The one above this post. The only reason it's 83 instead of 81, is because I removed the white space like you said.

you're posting the error code, i need to see the php code on line 81 in the file ucp.php.
Link to comment
Share on other sites

Code:

 

<?php 
session_start(); 
?>
<?php require "global_settings.php"; ?>
<title><?php echo $sitetitle; ?></title>
<font face='arial' size='2'></a>
<?php session_start(); ?>
<center>
<style>
a:link {
color:#24374C;
text-decoration:none;
}

a:visited {
color:#24374C;
text-decoration:none;
}

a:active {
outline: none;
color:#24374C;
text-decoration:none;
}

body {background-color:#b0c4de}

div.box {
width:250px;
padding:10px;
border:3px double #000000;
margin:10px;
background-color:#74AFF2;
}

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}

div.menu-blue {
BORDER-RIGHT: #333366 1px solid;
BORDER-LEFT: #6699cc 1px solid;
BORDER-TOP: #6699cc 1px solid;
BORDER-BOTTOM: #333366 1px solid;

FONT-WEIGHT: normal;

COLOR: #ffffff;

BACKGROUND-COLOR: #23559C;
TEXT-DECORATION: none;
font-stretch : condensed;
}

.menu-top  {
BORDER-RIGHT: 1px solid #333366; BORDER-TOP: 1px solid #6699CC; FONT-WEIGHT: normal; BORDER-LEFT: 1px solid #6699CC; COLOR: #FFFFFF; BORDER-BOTTOM: 1px solid #333366; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none;
font-stretch : condensed
}
</style>
<center>
<div class='menu-blue'>
<div align="center"> 
<table width="600" cellspacing="1" cellpadding="5" style="background-color:#23559C"> 
<tr> 
<td style="background-color:#FFFFFF"> 


    <div align="center"> 
    <table border="0"> 
    
    </form> 
    </table>
<?php

if ($_SESSION['username'])
   echo "
<form action='signature_changed.php' method='POST'>
<div class='box'><h3>Update signature</h3>
<input type='hidden' name='name' value='<?php echo $_SESSION['username']; ?>'>
<textarea name='newsig' cols='20' rows='5'>
</textarea><input type='submit' value='Change'></a>
</div>
</form>";
else
   die ("Narb.");

?>

Link to comment
Share on other sites

If you're still getting that error, you must not of updated the code. I just tried your code and it works fine with:

<?php
if ($_SESSION['username'])
{
	echo "<form action='signature_changed.php' method='POST'>
<div class='box'><h3>Update signature</h3>
<input type='hidden' name='name' value='<?php echo '".$_SESSION['username']."'; ?>'>
<textarea name='newsig' cols='20' rows='5'>
</textarea><input type='submit' value='Change'></a>
</div>
</form>";
}
else
{
   		die ("Narb.");
}
?>

 

 

Link to comment
Share on other sites

Ignore the above post... try:

<?php
if ($_SESSION['username'])
{
	echo "<form action='signature_changed.php' method='POST'>
<div class='box'><h3>Update signature</h3>
<input type='hidden' name='name' value='" . $_SESSION['username'] . "'>
<textarea name='newsig' cols='20' rows='5'>
</textarea><input type='submit' value='Change'></a>
</div>
</form>";
}
else
{
   		die ("Narb.");
}
?>

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.