justAnoob Posted February 7, 2009 Share Posted February 7, 2009 Could someone please give me a hand with this. I have been trying for a while now and can't seem to get this to work. A script like this couldn't be that long, could it? Quote Link to comment Share on other sites More sharing options...
Lodius2000 Posted February 7, 2009 Share Posted February 7, 2009 do you have any code, a database structure, anything? Quote Link to comment Share on other sites More sharing options...
webmaster1 Posted February 7, 2009 Share Posted February 7, 2009 Are you using blob or are you just storing the url of the image in your database? Quote Link to comment Share on other sites More sharing options...
justAnoob Posted February 7, 2009 Author Share Posted February 7, 2009 I have the database set up up already. The content(the image) is stored as a blob in the db. I have an upload script that does its job so far. I am still working on making it more secure.(by the way, i thank everyone here for helping out with the upload script). Anyways, the upload script stores the picture, name, description of picture, the username of the user who uploaded it, and so on. I am trying to do two things here. Have one page to display all the images. And have another page where it only shows the pictures that were uploaded by the user that is currently signed in. Here is the upload script. I just need a kick in the butt for the display script. <?php session_start(); include ("upload_db_info.php"); if (!empty($_POST['upload'])) { extract($_POST); if (isset($_POST['upload']) || $_FILES['upload_file']['size'] < 500000) { $user = $_SESSION['id']; $fileName = $_FILES['upload_file']['name']; $tmpName = $_FILES['upload_file']['tmp_name']; $fileSize = $_FILES['upload_file']['size']; $fileType = $_FILES['upload_file']['type']; if ( file_exists($tmpName) ) { $content = file_get_contents($tmpName); } } $user = mysql_real_escape_string($user); $trade = mysql_real_escape_string($trade); $picname = mysql_real_escape_string($picname); $fileName = mysql_real_escape_string($fileName); $fileSize = (int)$fileSize; $fileType = mysql_real_escape_string($fileType); $content = mysql_real_escape_string($content); $descrip = mysql_real_escape_string($_POST["descrip"]); $trade = mysql_real_escape_string($_POST["trade"]); $picname = mysql_real_escape_string($_POST["picname"]); $query = "INSERT INTO UploadedFiles (name, size, type, content, user, descrip, trade, picname)VALUES('$fileName', '$fileSize', '$fileType', '$content', '$user', '$descrip', '$trade', '$picname')"; $result = mysql_query($query)or die (mysql_error()); unset($_SESSION['uploaderror']); $_SESSION['uploadcomplete'] = "Your picture was uploaded to our system."; header("location: http://www.***********.com"); exit(); } ?> Quote Link to comment Share on other sites More sharing options...
justAnoob Posted February 7, 2009 Author Share Posted February 7, 2009 bump,, lodius and webmaster,, still there? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.