Hi All,

First of all A very big thank you to all of you for solving my Password() 
encryption problem.

Now I'm stuck on new problem which is image not uploading.  I'm using the 
following code. 




include ("header.php");
include ("dbconnect.php");

 $submit=$_REQUEST["submit"] ;
 $url_provided = $_REQUEST["url_provided"];

if ($submit == "Sign!")

function getImageFile($file){
$takeFile = fopen($file, "r");
$file = fread($takeFile, filesize($file));
return $file;
function getfileType( $name ){
$name = explode(".", $name);
$name = array_reverse($name);
$name = $name[0];
return $name;
$allowedImageTypes = array("gif","jpg","png");
echo "File not uploaded";
else {
$fileType = $_FILES['file']['name'];
if(in_array(getfileType($fileType), $allowedImageTypes)){
$fileContent = getImageFile($_FILES['file']['tmp_name']);
$uploadedImage = chunk_split(base64_encode($fileContent));
$query = "INSERT INTO artist (name,about_u,imgdata, profile_url) 

$result = mysql_query($query);
if(mysql_affected_rows() > 0){
echo "Image has been inserted succesfully";
else {
echo "Image can not be inserted check your submission";
else {
echo "This is not a true image type";

<div align="center" class="style1">
  <h1>Artist Profile Form</h1>
  <form action="artist.php"  method="post" enctype="multipart/form-data">
    <table width="397" border="0">
        <th width="221" scope="col"><h4 align="right">Name:</h4></th>
        <th width="166" scope="col"><div align="left">
            <input name="aname" type="text" id="username3">
        <th scope="row"><div align="right">About Yourself </div></th>
        <td><div align="left">
            <textarea name="urself"></textarea>
        <th scope="row"><div align="right"> Profile export from myspace/face 
book </div></th>
        <td><div align="left">
            <input name="url_provided" type="text" id="repass">
        <th scope="row"><div align="right">Upload Photo </div></th>
        <td><div align="left">
          <input type="file" name="file">
        <th scope="row">&nbsp;</th>
  <input type="submit" name="submit" value="Sign!">
        <input type="reset" name="Reset" value="Reset"></td>

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  

Reply via email to