Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. So - where is the code that is doing this work for you?
  2. 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.
  3. 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.
  4. 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.
  5. 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
  6. 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?
  7. stripslashes does have a purpose, but it is not necessarily for handling user input, unless you have magic quotes on. One thing that can be used on input is addslashes or one of the *_real_escape_string functions, if you are not use pdo, or many of the functions to strip html tags, and validate input. You'll get an authoritative discourse shortly from one of the wizards on the forum soon I'll bet.
  8. Why are you stripping slashes on an input? The only reason to have them on input is if your server still has magic_quotes on - which it shouldn't.
  9. So? What happens? How do you know you have a problem? Turn on error checking to see if you any errors.
  10. Is that sarcasm? This is a forum for helping those who help themselves. You asked me to design your page - which is not the purpose of a PHP forum, but an HTML/CSS one wiseguy. This forum helps those who have made the effort to do something and have run into a roadblock. When you have some code to show us and ask for help on (not CSS either!), come back and you'll be amazed at how much help you'll receive.
  11. Ideas on how to what? Use the <div> tag? Sure - check out an html resource and learn what it does and then learn some css and set the div up the way you want.
  12. Yes - something like that. The form would be created for each row of the html table. And don't forget to include an onclick= attribute on the submit. BTW - it is not necessary to provide both a name= and id= attribute on elements. Name - yes - since you need it to reference in php. Id - no - unless you have some JS code that will use it. Seems that there are many posters who do this and I wonder if they realize that it is not always needed.
  13. Just to point out - changing something from "Jones & Sons" to "Jones Sons" really makes for a confusing expression. If I named my company as such I wouldn't like to see it changed to something with less meaning/identity.
  14. You said that you have placed your data in a table already. Is that not what you want? I don't know what you mean about making it look like an online shop. Perhaps you want to output each row of data in a separate html table? Or place each set of data in a separate div tag to help arrange them on the page?
  15. Great that you are learning php and that you are showing some real indications of doing the right things. One point - since you are just beginning you must backup a step and learn to use either the mySqli or PDO sql interface, since the mysql one is being eliminated shortly. I suggest PDO and learning about prepared statements. Your code looks pretty good except: - make it a practice to check the result of a query call before trying to use the results (such as checking # rows). It's good practice to utilize the returns that function calls give you when offered so that you don't continue on with invalid results. - for the sake of readability, use indents/tabs to write your code. It will make your life a lot easier when trying to debug your code. As for adding a delete button for each row, you will need to understand how forms work and either output one form wrapped around all of your rows with a separate button on each row. You will have to have a way of knowing which row the button is to be associated with too. Or you could just have a field where you provide the record number or key and a single button that looks at that key value and then deletes accordingly. Another good feature of a delete button is to use a simple JS confirm box to give the user a last chance to change his/her mind. Lots to learn yet!
  16. What are you trying to do with implode? Did you read up on substr in the manual? You wanted to remove the last pipe symbol which is the last character of your string, no? The substr function is made just for something like that.
  17. My solution? I'm only pointing out what I see as a potential pitfall. It's up to you to either clarify what I'm seeing perhaps incorrectly, or to produce your own corrections.
  18. Add a test of your query execution to be sure it's a valid query (it has to be bad and not performing and therefore none of your follow up code is even attempted). Tip - One should ALWAYS check query results and any other dramatic function call that affects the proper execution of your script.
  19. I don't get the use of the implode function on an input of 1 value. All this is going to do is put a comma(?) after that value and then you will pass that to the query. If you had used a test on the query results you would have probably been shown a mysqli error message saying your query is bad.
  20. Show us the NEW code that you are using.
  21. Sorry - I don't know anything about doing this. I didn't know you could emulate an http request but you will have to do some research on the proper formatting of that data stream and perhaps how to make php retrieve it. In fact, how ARE you telling php where the data is coming from?
  22. Is your C++ program sending the http request using the post method or the get method?
  23. So - this data is coming from a c program and not from a client's browser? (I'm a little sketchy on what you are trying to accomplish)
  24. All of your POST variables are the result of an html page being 'posted' to this script. Do you have such a thing calling this script or are you running it as a url in your browser? As gristol said - confirm that the elements exist in the POST array,even if you run it as the result of a posted form and they are supposed to exist.
×
×
  • 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.