Jump to content

Pikachu2000

Staff Alumni
  • Posts

    11,377
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Pikachu2000

  1. Contrary to what you were told in the other thread, I would not use this approach for something this simple*, that remains essentially static. There's no reason you can't do this with php. *unless your goal is to do it without a page refresh.
  2. Just put the information on the site that the application is windows-only and that you do not issue refunds and be done with it. If you really feel the need to make absolutely certain the person knows the terms, put a "I understand the app is Windows-only, and agree to the terms" checkbox and make it mandatory. You can't always stop stupid people from doing stupid things.
  3. Magic quotes adds slashes, not quotes. The code above removes the slashes inserted by magic quotes.
  4. I hope you changed your database password in addition to editing it out of your post. Google indexes these pages usually within a couple minutes. If you haven't changed it yet, go do it right now.
  5. To limit the number of results returned, you would add a LIMIT clause to your query.
  6. It relies on a setting in php that should be turned off, and remain off. You need to explicitly assign the value from the form to $email in your if( empty($email) ) { conditional, or use the form value directly in it.
  7. The code on phpeasystep.com is ten years out of date. Avoid that site and it's lousy tutorials.
  8. Look at where your SELECT queries are. Look at where your UPDATE query is. Do you think maybe the order of operations has something to do with the problem?
  9. Make it clear that the program will only run on Windows, and that you don't issue refunds. That just opens the door for people to download it, install it on their Windows machine, and say "o, I didnt no it wuz fer windos! Munny bak, PLZ?" Then they have the program, and you don't have their money.
  10. Swap the quotes so the entire query string is enclosed in double-quotes, but the variables within it are in single-quotes. More information here: http://us1.php.net/manual/en/language.types.string.php
  11. Variables are not interpolated in a single-quoted string in PHP. Echo the query string and you'll see what I mean.
  12. True, but all of that is pretty much irrelevant when the query string is in single quotes . . .
  13. I'm sure it is just because you're new. echo $sql; and look at the query string you get. If you don't understand why you see what you see, just say so . . .
  14. It's actually a not a bad idea to use the hyphens, it removes any ambiguity when you have a problem and start echoing data to debug things like this. Have you echoed the query string to make sure it contains the values you'd expect it to contain? If that's the actual code, I can tell already that it doesn't . . .
  15. Is this what you mean? <script type="text/javascript"> document.write("Total Hits :" + sessionStorage.<?php echo $counter; ?>); </script>
  16. Is the database field a DATE data type?
  17. That error indicates your query failed to execute. echo mysql_error to see why.
  18. Add this line to your script and see if you get an error: $notvalid = $_SESSION['notvalid']; It should produce an 'undefined index' error. If it doesn't, we need to figure out why.
  19. In your php.ini file, find the error handling section and make sure the following lines are in it, and appear only once without a leading semicolon: error_reporting = -1 display_errors = On Then restart Apache and see if you get any errors when you run the script. If you find more than one php.ini file, put phpinfo(); die(); in a script and run it. You can also verify your settings that way.
  20. And do you have error_reporting at E_ALL, or preferably -1, and display_errors set to On?
  21. You aren't actually comparing the length of the value entered in $_POST[$field}. You'd need strlen for that.
  22. Instead of the alias, try the longhand version of it in the WHERE. SELECT *, STR_TO_DATE(invDetails.invoiceDate,'%m/%d/%y') as newDate FROM stores AS store INNER JOIN invoice_details AS invDetails ON store.sCustNum = invDetails.sCustNum WHERE store.sSalesman = 508 AND store.BillToId = 7161 AND STR_TO_DATE(invDetails.invoiceDate,'%m/%d/%y') BETWEEN '2012-01-01' AND '2012-12-31' GROUP BY store.sCustNum
  23. I'm pretty sure you can't use the field alias in the WHERE clause.
  24. Clearly, help was given. If you chose to ignore it and do something else, then that's your prerogative.
  25. That code should be giving you an 'undefined index' notice when you first call it. If it isn't, you don't have error reporting set up at a high enough level for developing.
×
×
  • 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.