Jump to content

I can't find where the error is occuring.


Far Cry

Recommended Posts

I've been trying to fix this for a while. I've turned to you guys to help  :o

 

 

Parse error: syntax error, unexpected '{' in /home/farcry/public_html/~sandbox/settings.php on line 142

 

[/code<?php require("styles/top.php");?>
<?php 
$salt1 = "*********";
$salt2 = "*********";
if(empty($username)){
echo"<script type='text/javascript'>
window.location = 'index.php'
</script>";
}
$page = $_GET['page'];
$ans = $_GET['a'];
$resp = $_GET['resp'];
?>
<div id="head_news">
<div id="head_cen_news">
  <div id="head_sup_news" class="head_height_news">
    <?php require("scripts/newsfeed.php"); ?>
   <?php require("scripts/links.php"); ?>
    </div>
    </div>
    </div>
<div id="content">
<br />
<?php
if($page == "confirm"){
$pass = $_GET['pass'];
?>
<center>
Are you sure you want to change your password?
<br />
<a href="settings.php?a=1&pass=<?php echo $pass ?>">Yes</a>  <a href="settings.php">No</a>
</center>
<?php
}
if($ans == 1){
$pass = $_GET['pass'];
mysql_query("UPDATE farcry_cev2.users SET farcry_cev2.users.password='$pass' WHERE farcry_cev2.users.username='$username'");
echo"<script type='text/javascript'>
      window.location = 'settings.php?resp=success'
      </script>";
}
if($resp == "success"){
echo"<script type='text/javascript'>
alert('Password successfully changed!');
</script>";
}
if(empty($page)){
?>


<center><p style="font-size:22px; color:#31A1FF; font-weight:bolder;">User Settings</p></center>
<hr />
<center><p style="font-size:18px; color:#000; font-weight:bolder;">Change Link Textbox Hover Colors</p></center>
<hr />
<center>
<table>
   <tr>
     <td>Current Color </td>
     <td><?php
 $query = mysql_query("SELECT * FROM farcry_cev2.users WHERE userid='$userid'")or trigger_error('Error: ' . mysql_error());
     $numrows = mysql_num_rows($query);
     $row = mysql_fetch_assoc($query);
  if($numrows == 1){
  $color = ucfirst($row['hover_color']);
  ?>
  <font color="<?php echo $color; ?>"><b><?php  echo"$color";?></b></font>
  <?php 
  } else {
  echo"An error has occured! Please try again later!";
  }
  ?>
    </td>
   </tr>
   <tr>
     <td>Change Color </td>
     <td>
 <select name="ch_color" class="textbox">
 <option value="white">White</option>
 <option value="black">Black</option>
                 <option value="green">Green</option>
                 <option value="yellow">Yellow</option>
 <option value="blue">Blue</option>
 <option value="red">Red</option>


 </select>
 </td>
   </tr>
   <tr>
     <td><p class="login">
    <input name="colorbtn" type="submit" class="btn" value="CHANGE" />
   </p></td>
   </tr>
</table>
</center>
</form>
<?php 
if(isset($_POST['colorbtn'])){
$newcolor = $_POST['ch_color'];

  if(!empty($newcolor)){
  mysql_query("UPDATE farcry_cev2.users SET hover_color='$newcolor'");
  echo"<script type='text/javascript'>
     alert('Settings updated!');
      </script>";
 }
}
?>
<hr />
<center><p style="font-size:18px; color:#000; font-weight:bolder;">Change Password</p></center>
<hr />

<form action="settings.php" method="post" enctype="multipart/form-data">
<center>
<table>
   <tr>
     <td>New Password </td>
     <td><input type="password" name="newpass" class="textbox" /></td>
   </tr>
   <tr>
     <td>Confirm Password </td>
     <td><input type="password" name="newpasscon" class="textbox" /></td>
   </tr>
   <tr>
     <td><p class="login">
    <input name="passbtn" type="submit" class="btn" value="CHANGE" />
   </p></td>
   </tr>
</table>
</center>
</form>
<hr />
<?php
if(isset($_POST['passbtn'])){
$newpass = $_POST['newpass'];
$newpasscon = $_POST['newpasscon'];

  if(!empty($newpass) && !empty($newpasscon)){
  
    if($newpass == $newpasscon){
      $pass = $newpasscon;
      if(validPassword($pass){
      $pass = $salt2.md5($pass).$salt1;
      echo"<script type='text/javascript'>
      window.location = 'settings.php?page=confirm&pass=$pass'
      </script>";
      }
    
}
    else{
  echo"<center><font color=\"#FF0000\">Your passwords do not match!</font></center>";
  }
}
  else{
  echo"<center><font color=\"#FF0000\">One of the password fields are empty!</font></center>";
  }
}
}
?>

<?php
}
?>
<div id="content_cen">
  <div id="content_sup">
  </div>
</div>
</div>
<div id="foot_news">
<div id="foot_cen_news">
<ul>
    
   </ul>
    <p></p>
</div>
</div>
</body>
</html>
]

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.