Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Put an echo in front of the unlink and one after it to prove that it ran. Turn on php error checking too.
  2. This is the link to this forum. http://forums.phpfreaks.com/forum/13-php-coding-help/ The first post is labeled "README: PHP Resources & FAQs
  3. I don't see why - ttry adding an echo after it to see if it gets there. Also - just noticed that you are losing the first row of you csv file due to an extra read before your loop
  4. Don't know why you can't - it's right up there with other info about this site. You are at the top of THIS forum and not the freaks home page?
  5. How about (like I said) the post at the top of this VERY FORUM that says "Readme".
  6. You didnt' give us an error so we don't know what's happening, but let me provide a little improvement on your code that may help you to get a better understanding of what you are doing. To process the contents of the csv file do this: while ($slice = fgetcsv($getfile, 100000000, ",")) { $col0 = $slice[0]; $col1 = $slice[1]; $col2 = $slice[2]; $col3 = $slice[3]; $col4 = $slice[4]; $col5 = $slice[5]; $col6 = $slice[6]; $col7 = $slice[7]; ... ... } A much clearer and sensible of retrieving the data read in.
  7. You can't without using js. Or you can get the post values in your php, check them and then send the screen back with whatever they did provide and a message
  8. You get that when you don't have a query that ran. ALWAYS check the results of an operation to be sure it worked before moving on. Also as a newbie - you should read the posts at the top of the forum that say to please read them. This very problem is discussed there since everybody goes thru it once. Also I notice that your insert query is doing a second escape on your args. Not good. You already did it once, why are you doing it again?
  9. Not to confuse the issue, but when a submit button is passed to the script it is not the "ID" that you look for but the "name" that you look for and in order to distinguish between multiple buttons with the same name you look for the "value". ex. <form method="POST"> <input type='submit' name='btn' value="Submit"> <input type='submit' name='btn' value="Cancel"> </form> In you php you would then do: if ( !isset($_POST['submit'])) { (handle no submit yet) } // got a click from the form $btn = $_POST['submit']; if ($btn == "Submit") { ( do the submit logic) } if ($btn == "Cancel") { (do the cancel logic) }
  10. Hard to help you with your coding when you don't show any. Read up on how it's done, write something and see what happens. Then if it doesn't work, we can help you.
  11. To finish your (deprecated) code: if ($title) { $row = MySQL_fetch_assoc($title); $my_title = $row['title']; } else { echo "Error running title query - message is " . MySQL_error(); exit(); } Of course you should change your db interface to mysqlI or pdo to keep up with the times.
  12. Look - I debugged your problem and pointed out your failure to follow proper programming practices. At this point it's your job to solve your dilemma and Do Some Homework. (You could already be reading up on this.) Of course some other well-meaning reader here will probably capitulate and give you an answer that will allow you to continue. Oh, well......
  13. I've heard that before.....
  14. You really, really need to learn some things about data handling. Especially when you are going to put it into a query - you risk having your data corrupted, your tables deleted and worse. Take 30 mins and google something like "php input sanitizing". Yes - I could give you one simple fix right now, but you would then still be sorely lacking in the knowledge you need.
  15. mysqli-error should replace all that 'global' stuff you have in your die clause. As for the 'textarea' problem - since you are not scrubbing any of your input, is it possible I(probable?) that you have invalid chars in the text coming in that you need to escape? A single quote in that paragraph will break your query statement. Proper handling of your input prior to including it in a query would have protected you from this.
  16. Looking at this code, how did you make the determination that a "textarea" (?) was your problem? If you code returned an actual error message it would be nice if you show it to us. You could also turn on php error checking to be sure that there is no other error.
  17. What the heck are those echo statements doing? I've never encountered anyone using them that way before. Please explain. Other than that you should look up the format specs on the date function since yours are definitely wrong. (You get '6969' cause you have a spec that begins with 'yy' which means the last 2 digits of the full year will come out twice.)
  18. Notes: 1 - you defined a public var called val1 but it is not part of your class. Correct? 2 - you defined the class and included an executable line. I do not know how that fits since it is not part of a constructor. Of course, I'm not a big OO guy. Also - you have no methods for this class. 3 - you attempt to display a property of the class that is not defined for the class. Got to be an error.
  19. Can we see it where you added the error checking?
  20. Do you handle potential query errors by checking the results of the query before trying to use it?
  21. If the page goes blank, check for php errors. Turn on error checking and see what they are.
  22. Perhaps. IMHO - your code is too confusing to follow. You have JS, HTML and PHP all just running on in a single path, making it hard to understand. If you think you've got it, congratulations.
×
×
  • 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.