Jump to content

PHP Image problem


kpetsche20

Recommended Posts

I'm having trouble getting an image to display. it is setup to select the location from mysql.

 

 

 

<td width="625" valign="top" class="mainbody">
     
    <div class="welcometo">My Account </div>
    <p>Keeping your account information up-to-date is very important. Remember to make changes when they are needed.</p>
    <p>  </p>
<?		$sql = "SELECT * FROM users WHERE login='".$_SESSION['login']."'";
    $result = mysql_query($sql);
$data = mysql_fetch_array($result);
echo "<img src='profile/resize_image.php?file=".$data['picture']."&w=120&h=100&id=".$_SESSION['login']."' name='profpic' />";
	if (isset($_POST['updatememberbt']))
{
	if ($_POST['firstname'] != '' AND $_POST['lastname'] != '' AND $_POST['email'] != '')
	{
		if (mysql_query("UPDATE users SET `firstname` = '".$_POST['firstname']."', `lastname` = '".$_POST['lastname']."', `email`= '".$_POST['email']."', `country`= '".$_POST['country']."', `squestion` = '".$_POST['squestion']."' , `answer` = '". $_POST['answer'] ."', `picture` = '".$_FILES['file']['name']."',`gender`= '".$_POST['gender']."', `phonenum`='".$_POST['phonenum']."' WHERE `login`= '".$_SESSION['login']."'"))
			{echo "your account was successfully updated <br /><br />";
if ($_FILES['file'] != ''){
$target = "/home/isearch/public_html/scriptlance/images/userimages/";
$target .= $data['login']."/";
$target2 = $target.$_FILES['file']['name'];
$ok=1;
$new=move_uploaded_file($_FILES['file']['tmp_name'], $target2);
if($new)
{
echo "The file ". basename( $_FILES['file']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file."; echo $_FILES['file']['error'];}
}
}
		else
			echo "your account was not successfully updated <br /><br />";
	}
	if ($_POST['oldpassword'] != '')
	{
		if (md5($_POST['oldpassword']) == $_POST['oldpasswordmd5'])
		{
			if ($_POST['newpassword'] != '' AND $_POST['newpassword2'] != '')
			{
				if ($_POST['newpassword'] == $_POST['newpassword2'])
				{
					if (mysql_query("UPDATE users SET `password` = '".md5($_POST['newpassword'])."' WHERE `login`= '".$_SESSION['login']."'"))
						echo "your password was updated <br /><br />";
					else 
						echo "your password was not updated <br /><br />";
				}
				else
					echo "password do not match! your password was not updated <br /><br />";
			}
		}
		else
			echo "please make sure to enter your exact current password in the Old password field <br /> ";
	}
}
?>

Link to comment
Share on other sites

1.) Can you define 'having trouble'? What happens? What is displayed?

 

2.) Whenever your having troubles with something that is possibly related to mysql, add an or die statement:

$result = mysql_query($sql) or die(mysql_error().'<br />With query:'.$sql);

 

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.