Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Your script is riddled with syntax errors. I'd start by fixing those.
  2. I would use the $key when making your form, that way you know things are going to be held together as they should be: echo '<div id="content_title"><label for="title[' . $row['id'] . ']">Title:</label></div>'; echo '<div id="content_box"><input name="title[' . $row['id'] . ']" type="text" id="title[' . $row['id'] . ']" value="' . $row['title'] . '" /></div>'; echo '<div id="content_title"><label for="price[' . $row['id'] . ']">Price:</label></div>'; echo '<div id="content_box"><input name="price[' . $row['id'] . ']" type="text" id="price[' . $row['id'] . ']" value="' . $row['price'] . '" /></div>';
  3. The mysql_* functions are not deprecated, there use has been discouraged. I very much doubt they are going anywhere soon however.
  4. Are you sure that $key matches up with your ids? Your not using your ids in your initial form creation code.
  5. Can you post some relevant code? It's pretty hard to even know what your talking about.
  6. You need to use the $key to get the index of the price. foreach ($_POST['title'] as $key => $value) { $title = $value; $price = $_POST['price'][$key]; // execute your query }
  7. This topic has been moved to Ajax Help. http://forums.phpfreaks.com/index.php?topic=364393.0
  8. Have you got your domain setup with Google apps? It's not going to happen otherwise.
  9. The entire point of Ajax is that you can use it to make server requests in the background, and then insert the data returned into the current page without having to reload the entire page.
  10. That is not written in PHP so no, it will not be easier. I suggest you read requinix's reply again, he describes exactly the process you need to follow.
  11. Approaching what? You haven't told us what your trying to do, you've simply told us how your planning on doing it, and your how sounds very convoluted and unnecessary.
  12. <title><?php echo $title . ' ' . $pagenumber; ?></title>
  13. Not only are they enabled by default in 5.4, but <?= is always available, regardless of the short tags setting.
  14. It's a string. No, it's not valid. You know you can always try these simple script to see if they work?
  15. As I said. Placing user input into a query like that is a major security concern. Don't do it. You need to validate and sanitise *all* input used within database queries.
  16. Sorry, but that code needs to be scraped all together and a fresh start made. Running queries within loops is never a good idea. There is a construct in sql called a JOIN, you should do some research into them.
  17. SMF's code is terrible. It really is holding the site back.
  18. You can find a users ip address within the $_SERVER array. As for inserting it into a database. Have you tried searching for a tutorial? There has to be at least a couple of hundred thousand results on the subject.
  19. The code you have posted makes no sense. You pass your values to ucfirst as an argument. eg; ucfirst($_POST['fname']); Having said that, why are you modifying user submitted data? And secondly, your not using user submitted data directory in your queries are you?
  20. Depends on what was in it doesn't it. It's just a php script though, so....
×
×
  • 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.