Jump to content

Recommended Posts

This error keeps coming

Parse error: syntax error, unexpected ';' in /home/a3504700/public_html/changeavatar.php on line 11

 

<?php

include("leftnavigation.php");

$user = $info['username'];

$userid = $info['id'];

 

$password2 = $info['password'];

?>

<center><?php

if(isset($_POST['update']))

{

$enteredpass = md5($_POST['password'];

if($password2==$enteredpass)

{

$avatar = $_POST['avatar'];

$update = mysql_query("UPDATE users SET avatar = '$avatar' WHERE id = $userid");

echo "Your avatar was updated succesfully";

}

else

{

echo "Enter correct password";

}

}

else

{

echo "Here you can change the avatar. Enter.current password for verification.";

}

?>

 

<form method=post>

Choose your avatar <br><?php echo '<img id=avatarchange src=images/trainers/000.png />'; ?>

<?php

echo '<select name=avatar id= Avatar onchange=changeAvi()>';

$sql6=mysql_query("SELECT * FROM avatars");

while ($row6=mysql_fetch_array($sql6)){

echo "<option value='".$row6['Image']."'>".$row6['Name']."</option>";

}

echo '</select>';

?>

<script type="text/javascript">

function changeAvi(){

var image = document.getElementById('avatarchange');

var dropd = document.getElementById('Avatar');

image.src = dropd.value;

};

</script>

Enter Current Password :<br /><input type="password" name="password" maxlength="40">

 

 

<input type=submit name=update > </form>

 

<script type="text/javascript">

function changeAvi(){

var image = document.getElementById('avatarchange');

var dropd = document.getElementById('Avatar');

image.src = dropd.value;

};

</script>

 

 

<?php

include("rightnavigation.php");

?>

 

Link to comment
https://forums.phpfreaks.com/topic/270157-help/
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.