0

Hello!

I am working on a website, and this is a gaming clan webiste, and I want to have userprofile.

Taht means that the admin can add players to the database, and set them on a team etc.

But how can i do this? I will alsow have the ability to upload a thumbnail to the profile?

Best Regards,
Joakim

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Puster
0

hi,
No, I made a upload script taht uploads a image, and then should wirte the name of the file to the database and then get the image out o f the database with som codes, but the code will not print the file name to the database, what have I to do?
I am gettina a mysql_query error :S

0

Now the promblem is fixed!:)
But when i upload images over 100kb just half of the picture is been showed, why?
code:

<form action="profile.php" method="post" enctype="multipart/form-data" >
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
	File:
	<input type="file" name="image" /> <br /><br /><input type="submit"
 value="upload image" />
 </form>
 
 <?php
 
 // connect to database
include 'connect_profile.php';
 
 // file infomartion
 $file = $_FILES['image']['tmp_name'];
 
 if(!isset($file))
 	echo "Please select an image!";
 else
 {
	 $image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
	 $image_name =  addslashes($_FILES['image']['name']);
	 $image_size = getimagesize($_FILES['image']['tmp_name']);
	 
	 if ($image_size==FALSE)
	 	echo "That's not an image.";
	else 
	{
	  if (!$insert = mysql_query("INSERT INTO cms_profile VALUES ('','$image_name','$image')"))
	  echo "Soory, we've got a problem uploading your image, pleas try again:)";
	  else
	  {
		$lastid = mysql_insert_id();
		echo "image uploaded. <p /> Your Image:<p /><img src=get.php?id=$lastid width='200' height='200' />";

		  }
	  
		}
 
	 }
 ?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.