Jump to content

RichE

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

RichE's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I would appreciate it if my account could be deleted as well. Thank you, Rich
  2. Here is the form. [code] <form action=reviewupload.php method=post enctype="multipart/form-data"> <table border="0" cellspacing="0" align=center cellpadding="3" bordercolor="#cccccc"> <tr> <td>Title:</td> <td><input type="text" name="Title" size=30 maxlength="200"></td> </tr> <tr> <td>Release Date:</td> <td><input type="text" name="Release_Date" size=30 maxlength="35"></td> </tr> <tr> <td>Rating:</td> <td><input type="text" name="Rating" size=30 maxlength="10"></td> </tr> <tr> <td>Runtime:</td> <td><input type="text" name="Runtime" size=30 maxlength="3"></td> </tr> <tr> <td>Director:</td> <td><input type="text" name="Director" size=30></td> </tr> <tr> <td>Writer:</td> <td><input type="text" name="Writer" size=30></td> </tr> <tr> <td>Studio:</td> <td><input type="text" name="Studio" size=30 maxlength="100"></td> </tr> <tr> <td>Staring:</td> <td><input type="text" name="Staring" size=30></td> </tr> <tr> <td>Reviewer:</td> <td><input type="text" name="Reviewer" size=30 maxlength="10"></td> </tr> <tr> <td>Picture:</td> <td><input type="file" name="filep" size=30></td> </tr> <tr> <td>Description:</td> <td><textarea cols="30" rows="7" name="Description"></textarea> </td> </tr> <tr> <td>Final Comments:</td> <td><textarea cols="30" rows="7" name="Final_Comments"></textarea> </td> </tr> <tr> <td>Rating:</td> <td><input type="text" name="Rating" size=30 maxlength="3"></td> </tr> <tr> <td colspan=2><p align=center> <input type=submit name=action value="Load"> </td> </tr> </table> </form> [/code] Thanks!
  3. Even if someone can confirm that the code is OK that would be great. I just need some feedback, ANY feedback. Thanks
  4. Hello, I have a weird problem. I have a script that uploads and image to a specified directory as well as a few other things, but a month ago it stopped working! No changes have been made to the file, but it doesn't work anymore! It may work once and a while, but most of the time it will not upload. The upload script is in a /upload directory and is uploading to /images/reviews Here is my code (filep is my upload form box name): [code] $folder = "../images/reviews/"; move_uploaded_file($_FILES["filep"]["tmp_name"] , "$folder".$_FILES["filep"]["name"]); chmod("$folder".$_FILES["filep"]["name"],0644); echo "<p align=center>File ".$_FILES["filep"]["name"]." uploaded.<br />"; [/code] I did try copy instead of move_uploaded_file, but it still did not work. This time I added error outputs, but nothing happened.: [code] $folder = "../images/reviews/"; copy ($_FILES['filep']['tmp_name'] , "$folder".$_FILES['filep']['name']) or die ("Could not copy"); chmod("$folder".$_FILES["filep"]["name"],0644); echo "<p align=center>File ".$_FILES["filep"]["name"]." uploaded.<br />"; [/code] Can anyone see something wrong? It should work because it worked for MONTHS before it stopped working! Thank you for your time.
  5. Alright, I found a page here: http://www.webmasterstop.com/63.html that seems to talk about the same problem I have. It goes on, and on about something called magic quotes, and a function called addslashes() but I think this page is the best thing I found so far. I am going to try some things in this page and let you guys know whats going on. EDIT: Alright, I just had to add addslashes() to each variable I assigned to the text fields, and it works ok. If I were to echo a variable before I addslashes() I would get, "It's fun". After addslashes() it would say, "It\'s fun". But it does not copy the slash to the database. It copies the normal text, so no other editing has to be made! Problem solved.
  6. Well, I tested out the script today, and I got an error message this time. Basically it said there was a syntax error in:, and starting outputting some of my text in the movie description. I noticed it starting the output on 's, so I tried taking out the ' on the 's, and resubmitted it and it worked. Now that's weird! How am I supposed to type we're, shouldn't, couldn't, don't, or any other word, or name that uses a single quotation mark ( ' ) Any Ideas why this gives an error. It sounds kinda fishy that that would be a problem. There has to be something wrong with my code. Can anyone see anything, or have any ideas? (Just to note, I went into phpmyadmin, and readded the '  But I don't want to do that everytime)
  7. Alright, I added a bunch of error outputs to my code. Now all I have to do is wait to test it. Here is what it looks like now. (I shortened the  mssql_query a bit so it didn't take up so much room) [code] if ($_POST["action"] == "Load") { $folder = "../images/reviews/"; move_uploaded_file($_FILES["filep"]["tmp_name"] , "$folder".$_FILES["filep"]["name"]); chmod("$folder".$_FILES["filep"]["name"],0644); echo "<p align=center>File ".$_FILES["filep"]["name"]." uploaded.<br />"; $link = mysql_connect("$host", "$user", "$pass") or die ("Could not connect to Database. Error: " . mysql_error()); $db_select = mysql_select_db("$db") or die("Could not select database" . mysql_error()); $result = mysql_query("INSERT into reviews (Title, Release_Date) VALUES('$Title', '$Release_Date')") or die ("Could not copy" . mysql_error()); if($link) { echo "Connected to Database...<br />"; } if($db_select) { echo "Database Selected...<br />"; } if($result) { echo "Review uploaded successfully...<br />"; } } [/code]
  8. Sorry, I was referring to the database datatype, but kinda mixed in my html code as well to make it confusing. :-) Most are text, but some are varchar, but those that are varchar are <50 characters, and those don't seem to be the problem. I can type the limit in those fields and it works, the problem seems to be with the textarea fields that have a text datatype. Even though the database can handle it, it seems not to get saved if over a certain amount of characters. Just a note: I am going camping for the weekend, so I probably wont respond until sunday. But thanks for the help so far guys!
  9. Thanks for the reply. Most of the fields are text, only some of the smaller ones are varchar with small limits. For the ones with limits, I set a maxlength on the text as well, so it will never go over that amount. Example: <tr> <td>Release Date:</td> <td><input type="text" name="Release_Date" size=30 maxlength="35"></td> </tr> I should also note, that when it doesn't work, I go into phpmyadmin and paste it in there, and it works fine every time.
  10. Hello, I have a script that I use to upload a series of text boxes, and textareas into a database (It's for posting movie reviews), as well as upload an image to /images/reviews. It seems to work fine if I do not type a lot, but if I start typing a fair amount, it wont write to the db. Here is a link to my actual code. It works fine most of the time, but if I get over a certain amount of characters, it wont post it, wont create a row, but will upload the image. I'm assuming I'm doing something wrong, but can't figure out what! Link to code: http://www.severedhorror.com/reviewupload.txt Any help would be appreciated! Thanks!!
  11. I got it! Now my php coding is all done. Thanks to everyone that helped me out. Especially Barand who basically wrote my code. :-) All the examples here really helped me out, and I can't believe everyone is willing to help people as much as they do. Thanks a lot!
  12. I think I get why your date output line did not work with my database. It is probably because I do not have full dates for every review. (Older reviews only gave the year, not day, month, year. --that would explain why some worked, and others did not) I'm still having trouble trying to get my primary_id field called from my database to use in outputting the reviews (so I can link to the actual reviews) Everything I try seems to cause the header letters (A, B, C, etc.) to output mostly numbers, but the occational letter at random). [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /]
  13. [!--quoteo(post=384407:date=Jun 15 2006, 07:45 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Jun 15 2006, 07:45 PM) [snapback]384407[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try this. The forum wouldn't let me post it [a href=\"http://members.aol.com/barryaandrew/response.txt\" target=\"_blank\"]My sample code[/a] [/quote] I'm not too sure what this line is supposed to do: [code]echo date('jS F Y', strtotime($date)), '<br>', $title, '<br><br>';[/code] But it was outputing the wrong dates. Mostly June 16, 2006. But occationally had the right date. Weird. I changed it to this: [code]echo $date, '<br>', $title, '<br><br>';[/code] And it outputs the right date now. Is that OK, or did I just mess up something I didn't notice yet? But wow that looks complicated. But I think I have an idea of what it is doing. It basically does exactly what I wanted! I do need a field called primary_id in my reviews table that I am going to be using to link to my reviews. Like this: [code]echo '<a href=review.php?id=', $pri_id, '>',$title, ' (', $date, ')', '</a><br>';[/code] I've tried calling it initially with the title, and release date, but when I do instead of getting the header letters. (A, B, C) I get random letters and numbers... Is there another way to get the primary_id FYI I have an auto incrementing primary_id for every review to make it easyer to call them in review.php?id=1 - like that. Thanks a lot for your help!
  14. [!--quoteo(post=384172:date=Jun 15 2006, 09:46 AM:name=RichE)--][div class=\'quotetop\']QUOTE(RichE @ Jun 15 2006, 09:46 AM) [snapback]384172[/snapback][/div][div class=\'quotemain\'][!--quotec--] I did that, and I get output now :-) But a couple problems. 1) The date is not shown on the output. (Which is $info[2] in your code. ) All that is shown is Title (). (I would assume that is because we selected title, not *, I'll change that and test it.) 2) The, and A are not displayed anymore in the final output. It removed it entirely, while the code before in phpmyadmin outputed The, and A (What I would like). Thanks for everyones help so far though! I do appreciate it! [/quote] Alright, I changed title, to * and it fixed both problems I was having!!!! Everything works fine NOW!! Thanks a lot! At the risk of overstaying my welcome, is there a way to sort by more then 1 letter. I found out through my searching that [A-I]% should work, but it doesn't for me...
×
×
  • 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.