Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. 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
  2. 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?
  3. 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) }
  4. 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.
  5. 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.
  6. 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......
  7. I've heard that before.....
  8. 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.
  9. 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.
  10. 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.
  11. 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.)
  12. 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.
  13. Can we see it where you added the error checking?
  14. Do you handle potential query errors by checking the results of the query before trying to use it?
  15. If the page goes blank, check for php errors. Turn on error checking and see what they are.
  16. 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.
  17. So - where is the code that is doing this work for you?
  18. This seems to imply multiple dropdown boxes. Is that what you were asking about in your subject line? So - since it is to be more than one dropdown, let's start out simple. First - create the first dropdown and send it out. Then when the user clicks on a choice and submits the form, take the selected item and create the next dropdown and sent it all back to the user. Repeat for each successive dropdown that you need. PS - you can do this with ajax to make it slicker, but for now you might want to just go back and forth.
  19. Not on the philosophy, but on the syntax. You name one function then followed by a comma and then a (correct) function call. You might want to re-think your typing there.
  20. As I said in my response in one of the TWO OTHER forums you posted this question in - What the H... is this "array" you mention? There is no array indicated in your html.
  21. I think the real problem is you echoed stuff prior to sending the pdf, so the output is scrambled like it is. You must not send anything to the client other than the completed pdf file
  22. I am not familiar with the graphics functions of php. I don't see any output in the above script. Where do you actually send something out to the client?
×
×
  • 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.