Jump to content

Html Output to view file on server linked to a database


sperophp

Recommended Posts

@move_uploaded_file( $upload_Temp , $uploadFile); 
chmod($uploadFile, 0644);
$upload_URL = "uploads/".$upload_Name ;
$uploadFile = "uploads/".$upload_Name ;
$id=$_POST['id'];
 $name=$_POST['name']; 
 $upload_Name=($_FILES['FILE']['name']);
 //Writes the information to the database
 mysql_connect("localhost", "freak_admin", "what") or die(mysql_error()); 
 mysql_select_db("freak_doc") or die(mysql_error()); 
 mysql_query("INSERT INTO `users_cv` VALUES ('$id', '$name', '$upload_Name')");

Hello Good Php Gurus!

 

i have tried to find my way around this but no show.from the php admin everything works fine including the name of the file visible.

 

the above code works when i view the info on my view.php(the field for name shows)

however the field for upload_name is blank because the idea I had isnt working below

<td> echo "<a href=" ./ $upload_URL . basename($row_users['file']) . ">

         {$row_users['upload_Name']}</a>";</td>

 

Can someone help me with what i am doing wrong?

 

thanks

newbie

 

Link to comment
Share on other sites

i dont really understand your question but at first glance, you are assigning $upload_Name in line 7, but you refer to it in line 3

$upload_URL = "uploads/".$upload_Name ;
...
...
$upload_Name=($_FILES['FILE']['name']);

fyi, youd prolly get better help in a different forum.  this is not an HTML question

Link to comment
Share on other sites

Do not really understand where you coming from.

But this line seems weird to me.

mysql_query("INSERT INTO `users_cv` VALUES ('$id', '$name', '$upload_Name')");

 
isn't it be like mysql_query("INSERT INTO `users_cv` (id,name,upload_Name) VALUES ('$id', '$name', '$upload_Name')"); ??
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.