Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by ginerjm

  1. "can only be edited in php"? Whatever does that mean?
  2. Sorry - no can do. I have a real hard time reading and following such confusing code. Switching in and out of php mode is so tedious.
  3. as an example of what exactly? You weren't trying to show us your own work? How silly to post it then! We DO know what a GET query looks like.
  4. Are you just trying to hack us while we are responding to your fake query for help? I just tried that example url of yours. It's written in Chinese! Normally I refuse to click on these kinds of things. For some ungodly reason I went against my better sense and exposed myself to your game. What a jerk!
  5. I suggest that you add a line to your code at the end of the function that builds that query statement and echo it out. See what you are actually building and then correct it. As was already pointed out to you you have to add quotes around string values in a query and you have ignored that advice.
  6. Is this page under your control, ie, did you write it or are you hosting it on your own account? If so you can modify how it works. Perhaps to use a POST method instead of a GET method and add a form to it to get the search argument.
  7. But - as Barand noted - there were so many other things plain wrong with your code. Wrong!
  8. Does this mean your problem is resolved?
  9. "just making websites for fun or little money"??? You'll have to upgrade your skill set to continue doing this hobby. Of course there are difficult things but what you are currently trying to accomplish is not that hard to do. You just have to organize your thoughts and write the correct code. So far from what you are asking that part is the hard thing for you to do currently. Perhaps you need to do some reading since you don't have a handle on the basics of files if you think that you can simply re-name an image file because you like a specific name. Once you manage to write a satisfactory (to you) upload module, you could then read up on the functions available (see the official PHP manual) to do re-sizing. Again - you will have to LEARN things. BTW - if this is just a hobby, why don't you have the time to learn about these things? Isn't part of a hobby the fact that you actually learn from it? It can't be much fun if it's always work because you haven't managed to figure things out. PS - have we managed to solve your original problem with the case of your filename?
  10. PHP HAS changed. The switch away from the mysql interface began several/many years ago. You're just a bit late to the party. And as chhorn says your script will cease to work once your provider removes it from his PHP install. The only reason it works for you now is because your provider is not moving quite yet, but sooner or later he will and then you'll be stuck. Of course if you are running your own db server and managing your own php installation, go right ahead living in the past. Eventually you will have to move on and then you will have to modify all of your programs. Will you then have the time to not only learn PDO but to make all those coding changes? I think not. Since your knowledge seems limited at this point anyway, why not spend a little time to pick up using PDO? It's a small investment in your skill set that will last a long time. Look at the manual for many good examples of how to make a connection, how to use prepared queries and their arguments and how to execute the query and fetch the results. It's really not much different than the mysql extension - just a few different concepts. And as for "always using jpg". If the file, ie, the image, is NOT a jpg file you cannot simply call it one since you may not be able to open it later on. What you need to do with proper file upload logic is to check what the file type is when it is being uploaded and decide if it is one of your expected types before accepting it and storing it in your picture repository. You don't just decide to name it as a ".jpg" file.
  11. NO that doesn't always work? A coder writes the code that holds that name - how the h... does it "not work"? Please elaborate. You are the first person whom I have seen using this convoluted naming convention. I have been reading these forums and coding PHP/HTML for about 6 years now. What does that tell you about your statement that it doesn't always work? And - autcomplete is an html feature (not php) that helps to finish providing the input value of the tag and has absolutely nothing to do with the name attribute clause. The assigned name will always be the assigned name from the time that the php script generates it, sends it, and receives it back unless someone hacks the page (and perhaps other input tags as well) and sends it back to your script corrupted. Good security procedures advise you to check for valid input "names" and their expected values. An altered input name attribute as I have already said is a sign that you should not use the inputs at that point.
  12. How about this: $target_file = $target_dir . strtolower(basename($_FILES["fileToUpload"]["name"]));
  13. Some page was messed up because someone used artificial intelligence on it? Is that what you are trying to say? The assignment of an input's name attribute is solely controlled by the guy writing the script and therefore the form/html. And AS I SAID if the script doesn't find that name in the POST array input then it is quite apparent that someone DID do something and your script should not process the whole thing!
  14. Have no idea what your last post was trying to say. Does it even make sense to you? You are doing something that I doubt very many others even consider. When writing forms and inputs one chooses a name attribute value for each input field and then uses that value to retrieve it once the user submits the form and its data. To have a variable name value means a headache for your receiving script which has to figure out what to call that specific field when having simple static values is so much easier. As for a hack - if the name of an input is un-knowable then you won't get that piece of data from the submit and so your script should properly abort its process and send the user a message to that effect. I have made my case. Good bye.
  15. That was suggested to the OP days ago. Apparently no desire to test it out.
  16. Since you already seem to be aware of the strtolower function I don't understand the need for your question.
  17. If you are stuck with the current format, here is one way to handle it. $input_str = "action: Added; quantity: 1; item_code: RNA1; product_name: Mens organic T-Shirt; colour: white; size: XL"; $items = explode(';',$input_str); foreach($items as $item) { list($k,$v) = explode(':',$item); $k = trim($k); $v = trim($v); $final_arr[$k] = $v; } echo "final result: <pre>",print_r($final_arr,true),"</pre>"; exit(); Note: the comma at the end of your original input sample is possible incorrect. I replaced it with a semi.
  18. I'd like to see your entire form html so I can see how you named all of your other input elements and why you chose one of them for the mystery name.
  19. Are you able to send just a simple text email with a simple "hello world" message in it instead of all this other stuff? Testing the ability to send emails is priority one now I think.
  20. YOu really can't be using a variable value as the name attribute of an html tag. Simply call your comment input "comment" and reference that in the $_POST or $_GET array when you receive the submitted data. The use of SESSION for this is kinda screwy!
  21. PPS - if connupdate is an ajax-called-only script then the display_errors setting wont' work since you have no console/client to show messages on. Have you found the error_log file and checked it out lately?
  22. PS - is this line correct? data: {streamId : streamId} Seems like there s/b quotes in there; otherwise it simply looks like two varnames
  23. OK - that is not what you first posted. Do you know IN FACT that connupdate is NOT getting called? And the query statement you just posted is incorrect. Try simply doing an echo at the beginning of the called script and then exit. Don't do anything else. Then in your caller, show the message returned from that exercise and prove that the ajax call is actually happening. You have me confused as to what's not working with your changes in posted code samples here.
  24. Am I mis-reading the ajax call where it says to call index.php?
  • 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.