Hi, this is a repost and nothing i've tried is working. Basically, I
allow people to upload pictures and they all go to the proper
directories but I can't see the picture. I can see the pictures great
on my windows server but no one else can see it. Obviously the path to
the images is screwed but I can't figure it out. The $picdir i've tried
are:
$picdir = "./userpics";
$picdir = "c:/phpweb/userpics/"
$picdir = "/userpics";
$picdir = "../userpics";
All of the above don't work. I'll post my code below:
<?PHP
session_start();
include("dblib.inc");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Uploading your potrait</title>
<Link href="arial.css" rel=stylesheet title=arial type=text/css>
<body>
<img src="pics/logo.gif">
<BR>
<H3>Portrait Picture</h3>
<?PHP
//defines location
$filedir = "c:/phpweb/userpics";
$picdir = "./userpics";
//check for jpeg image type
if($fupload_type =="image/pjpeg")
{
//copies picture to new directory and renames to username
if(copy($fupload,"$filedir/$CUserName.jpg"))
{
print ("<B>Hey Goodlooking! Your picture has been uploaded
correctly</b><BR><BR>");
print "<table border=1>
<TR>
<TD height=\"300\" width=\"300\" align=\"center\">";
print ("<img src=\"$picdir/$CUserName.jpg\">");
print"</td>
</tr></table>";
print "<BR><B><a href=\"memberprofile.php?$PHPSESSID\">Home</a></b>";
print " <B><a href=\"fupload.php\">Upload again</a></b><BR>";
//adds 'yes' to database so user can search only profiles with
pictures.
$query="UPDATE clients SET CPicture='yes' WHERE
CUserName='$CUserName'";
//FAILED PROCESS
if(!mysql_query($query))
{
print "A process has failed during the update. Please report this
incident to the Web Master <a
href=\"mailto:[EMAIL PROTECTED]\">[EMAIL PROTECTED]</a><BR><BR>";
print "<BR><B><a href=\"memberprofile.php?$PHPSESSID\">Home</a></b>";
return false;
}
return true;
}
die ("Error in uploading. Please try again");
}
else
{
//PRINTS IF PICTURE IS ANYTHING BUT JPEG FORMAT
print "In order to show off your qualities to the fullest extent.<BR>
LDSAlberta.com currently only acceptes pictures in JPEG format which
have the highest color quality and in turn show you off the best!";
print "<BR><B><a href=\"memberprofile.php?$PHPSESSID\">Home</a></b>";
print " <B><a href=\"fupload.php\">Upload again</a></b><BR>";
}
unlink($fupload);
mysql_close();
?>
</body>
</html>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]