Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Sorry, part of the message was cut off. The rest is below. Side note: mysql_real_escape_string() requires a database connection to be established before it's used. More information can be found here: http://php.net/manual/en/function.mysql-real-escape-string.php
  2. This may seem like a silly question, but did you post the same code as what you're actually using? Perhaps you could re-paste the code you are currently working with. Of course, you'll want to hide the database password like before. Also, do you have it so all errors and warnings are being shown? <?php //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); ?>
  3. It seems like a quote wasn't closed after Please check below for Error Details It seems fine in the code posted. Did you remove any code from insert.php before posting it here?
  4. HTML pages can be configured to run PHP.
  5. Did you run the code? That's an easy way to find out.
  6. Note that formatting names like this will cause names like "McKenzie" to display incorrectly.
  7. Yep, try out nogray's code.
  8. If all you want to do is display a message and prevent further code from being executed on Sundays, exit() is what you're looking for. If you're looking to accomplish something else, let us know.
  9. What are you looking to accomplish? Is the same image always being displayed...or are you looking to rotate through a series of different images?
  10. Perhaps exit() is what you're looking for: http://php.net/manual/en/function.exit.php
  11. As long as the date() function is part of the third argument for mail(), it should appear in the message. The best way to determine if it works is to give it a try. Note: you'll probably want to send any tests to yourself instead of the people who typically receive the message. That way you can send out multiple messages without bothering other people. For future reference, I would recommend using variables to store the arguments for mail(). The code becomes much easier to follow. Examples 2 and 4 on the following page will show you what I mean: http://php.net/manual/en/function.mail.php
  12. In addition to what PravinS said, the date() function needs to be outside of the quotes. <?php ..."Awards Re-Order", date('r') . "|{$_POST['yearaward']}|"... ?>
  13. Have you looked into fwrite()? http://us3.php.net/manual/en/function.fwrite.php You could also look at some of the other file functions found here: http://us3.php.net/manual/en/ref.filesystem.php If you need help saving things to a text file, there may be something for you here: https://www.google.com/search?q=save+php+output+to+file
  14. It looks like the user_data() function expects a user ID. You're currently passing a string: user_data('user_type')
  15. If you decide to go with a JavaScript solution, just be aware that the user could modify their system's clock to cheat the system.
  16. As you're looping through the MySQL data, you could build a multidimensional associative array. More information could be found here: https://www.google.com/search?q=multidimensional+associative+array+php You could then use a foreach loop to display the HTML table.
  17. Sorry, I'm not really sure what you're asking. Are you stuck somewhere? If you're looking to create/use cookies, perhaps the following will help: http://php.net/manual/en/features.cookies.php Note that you could also use PHP sessions: http://us1.php.net/manual/en/book.session.php
  18. Are the datalists for Gene 1 and Gene 2 supposed to be the same? If so, you could use a single query to grab the list, store it in a variable, and use the variable to populate the datalists. Also, you probably don't need to create the $Column_2 variable in the while loop. You could just use the $rows variable: <?php echo "<option value={$rows['COL 2']}>{$rows['COL 2']}</option> <br>"; ?>
  19. Have you looked closely at the values for the LIMIT clause? LIMIT $startpoint, $limit I suspect it might be an offset issue. The following quote was pulled from http://dev.mysql.com/doc/refman/5.0/en/select.html:
  20. It sounds like you're looking for length property: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length If you're unsure how to use length, there are many resources here: https://www.google.com/search?q=javascript+character+count+textarea For future reference, JavaScript questions should be posted in the JavaScript forum: http://forums.phpfreaks.com/forum/18-jvscript-help/
  21. From the manual (http://php.net/manual/en/language.oop5.properties.php):
  22. Have you checked that the variables contain expected values? For example, what do you get for the following: <?php $array=$_POST['tel']; //numbers fetched from contact of mobile print '<pre>' . print_r($array, true) . '</pre>'; $jstring = (array)json_decode($array,JSON_FORCE_OBJECT); print '<pre>' . print_r($jstring, true) . '</pre>'; ?>
  23. Are you using OpenCart? If so, perhaps this will help: http://forum.opencart.com/viewtopic.php?t=45398
  24. Have you tried passing a GET variable with the header redirection? The addproduct.php page could then display the success message if the GET variable is detected. <?php header("Location: addproduct.php?sucess=1"); ?>
  25. Sorry, the portion after the code was cut off. Here is the rest: Of course, you'll want to perform some extra tests to make sure the POST variable actually contains a URL. You could utilize the built-in validation filter: http://php.net/manual/en/filter.filters.validate.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.