Member Avatar for Puster

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

I suggest going with a forum. Or you could try something like phpfox.

Member Avatar for Puster

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

Member Avatar for Puster

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' />";

		  }
	  
		}
 
	 }
 ?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.