Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. 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.
  2. 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
  3. 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?
  4. 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.
  5. 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.
  6. So? What happens? How do you know you have a problem? Turn on error checking to see if you any errors.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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?
  12. 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!
  13. 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.
  14. 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.
  15. 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.
  16. 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.
  17. Show us the NEW code that you are using.
  18. 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?
  19. Is your C++ program sending the http request using the post method or the get method?
  20. 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)
  21. 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.
  22. Read up on the substr function in the php manual.
  23. 1 - turn on php error checking and let us see the lines in this code. 2 - whenever you do a function call that MUST be run correctly, you should CHECK the result of it to ensure that it ran. Modify ALL of your present code to check results and echo error messages where appropriate. Do those two things and you and we will learn what your problem is.
  24. What you want to do is certainly a common enough thing. Simply create your html wrapper with the div and css stylings and then place your php var in the html. Then let the html be output along with that var and you'll have what you want. I usually do this kind of thing by having all of my html in one function (DisplayPage) and then let all my php code happen before calling that function to send all my output - html and php vars that I have created. You can pass the vars into the function with args i.e.: DisplayPage($var1,$var2,$var3), or use global vars (which many are totally against, but they work just fine for me).
  25. Perhaps if you did some research on the proper syntax you would see what's wrong with that line. 1 - indices of an array should have quotes around them. 2 - php variables begin with a dollar sign. Constants do not. If you are in fact using a var here, then you need to fix it. 3 - while php does offer a goto statement but you should know that the use of a 'go' or 'goto' in any language for the last 20+ years has been frowned upon. My suggestion is that you avoid using one like the plague. Structure your code properly and you will find you have no need for this anachronism and in turn you will write better, more understandable code.
×
×
  • 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.