Jump to content

noclist

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

About noclist

  • Birthday 03/20/1986

Contact Methods

  • AIM
    carp131
  • Website URL
    http://www.whitebencantjump.com

Profile Information

  • Gender
    Male
  • Location
    Ohio

noclist's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Update: Finally figured it out. Had to remove the 'movieThumbs/" when assigning the default image. Thanks to everyone who helped, mark it solved.
  2. Here is what echoes for thumbNail: When I choose a thumbnail image to upload: [thumbNail] => Array ( [name] => x.gif [type] => image/gif [tmp_name] => /var/tmp/phpXylX84 [error] => 0 => 6577 ) When I leave the thumbnail field blank: [thumbNail] => Array ( [name] => [type] => [tmp_name] => [error] => 4 => 0 ) error 4 being no file uploaded, which is what I should see. I feel like I'm doing everything right except perhaps else { $thumbNail="movieThumbs/noimage.gif"; } Is that the correct way to assign the default image to that variable given my error 4?
  3. Using this method... if($_FILES['userfile']['error']==0) { // process } else { // handle the error } if($_FILES['thumbNail']['error']==0) { $thumbNail = $_FILES['thumbNail']['name']; } else { $thumbNail="movieThumbs/noimage.gif"; } Still having the same issue. I must be doing something fundamentally wrong.
  4. How do I go about testing for that error? I tried this with no luck: if ($_FILES['thumbNail']['error'] == 0) { $thumbNail = $_FILES['thumbNail']['name']; } else { $thumbNail="movieThumbs/noimage.gif";
  5. Okay, looks like it is verifying correctly, but I'm still having trouble assigning the default image. It turns out the folder I was uploading to is called movieThumbs, not thumbNail... if (isset($_FILES['thumbNail']['name'])) { $thumbNail = $_FILES['thumbNail']['name']; } else { $thumbNail="movieThumbs/noimage.gif"; } Leaving the thumbnail field blank still results in a broken image linking to just the movieThumbs/ directory.
  6. if (!isset($_FILES['thumbNail']['name'])) { $thumbNail="thumbNail/noimage.gif"; } Is something like that how I would check if there is a value already? Then obviously I'm trying to assign noimage.gif if there is no value.
  7. How do I determine if $_FILES['thumbNail']['name'] is blank? I am uploading images into a folder on my server called thumbNail and I would like to specify a default image (noimage.gif) if no prior image has been uploaded, but I'm having trouble getting an if statement to register true if the image upload was skipped. Thank you.
  8. I have a value in one table referenced in another table by foreign key and I'm having trouble wrapping my brain around how to write my insert statement. My table is called Years and each year is represented by a yID, which I then reference in my main table named Titles. I have a user interface inserting records in the database where I would like a year submitted which can assign the correct yiD to it's respective record in table Titles. Could someone explain how I would set this up in an insert statement without having to manually code in each year value and assigning them to php variables?
  9. That did the trick, thanks so much.
  10. I'm trying to upload images to my server using the $_FILES array but having issues. Here is the upload section from my form: Cover Art:<input name="coverArt" type="file" /> and my upload script I'm working with: $targetFile="coverart/" . $_FILES['coverArt']['name']; if (file_exists($targetFile)) { echo $targetFile . "<br />"; } if (move_uploaded_file($_FILES['coverArt']['tmp_name'], $targetFile)) { echo "Cover art success"; } else { echo "COVER ART ERROR"; } I'm trying to upload these images to a folder on my server called coverart, however file_exists always seems to be true no matter what and echoing $targetFile only shows my folder name "coverart/" without the filename. So of course move_uploaded_file isn't working either. Any suggestions?
  11. Thanks for the advice, I got it worked out.
  12. Would someone be able to tell me why I can't run a successful mysql_query($sql) with $sql="INSERT INTO myDB.Titles (Title, Year, cID) values('". $title . "', '" . $year . "', '" . $cID . "')"; $sql echoes out to "INSERT INTO myDB.Titles (Title, Year, cID) values('Test', '2000', '2')" It looks right but I'm probably off on the quotes somewhere. Thanks in advance.
  13. Cool that worked, not sure why I couldn't get the function to pop up though. Thanks for the help.
  14. I actually tried that earlier and it does the same thing and the statusbar shows "javascript:checkDelete(100, " without the title or closing parenthesis.
×
×
  • 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.