Profile pic feature for my login script - NO CODES NEEDED

begamer26

New Member
Messages
24
Reaction score
0
Points
0
Okay I have succesfully created a login/register/accountpage php script but now I want to add onto that and create a feature that allows you to create a profile picture and keep it as YOUR profile picture. I dont need any codes as I will create the myself for the sake of learning but if you need to, to explain then thats fine :biggrin:

Im using WAMP for now so every feature on here is on there and im using HTML, PHP, MYSQL out of them:redface:
 

supajason

Member
Messages
288
Reaction score
2
Points
18
What do you mean by create a profile picture?

Do you mean; the user makes(draws lines, circles etc) the picture on your site or the user can upload the picture from there computer or a URL?
 

begamer26

New Member
Messages
24
Reaction score
0
Points
0
What do you mean by create a profile picture?

Do you mean; the user makes(draws lines, circles etc) the picture on your site or the user can upload the picture from there computer or a URL?
From there computer! :)
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
well here is the basic of it:

1| upload script
11| check for valid file type / file size
12| where to store the files
13| how to make the relation
2| database to store the relation of user to their picture
 

begamer26

New Member
Messages
24
Reaction score
0
Points
0
Okay I can upload the file, write the directory into the database but I cant get it to display it? heres a selection of my code, tell me whats wrong please -
Code:
        <table width="130" border="1">
          <tr>
            <td height="130"><img src="
   <?php
			  $COOKIE=$_COOKIE['username'];
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("begamer", $con);
$result = mysql_query("SELECT profilepic FROM users
WHERE username='$COOKIE';");
while($row = mysql_fetch_array($result))
  {
  $row['profilepic'];
  }
?> " width="100%" height="100%"></td>
          </tr>
        </table>
 
Last edited:

begamer26

New Member
Messages
24
Reaction score
0
Points
0
No Worry's I fugured it out! 8P I was using an un-needed loop
Code:
<?php
     $COOKIE=$_COOKIE['username'];
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("begamer", $con);
$result = mysql_query("SELECT profilepic FROM users
WHERE username='$COOKIE';");
$row = mysql_fetch_array($result);
echo($row['profilepic']);
?>
 
Top