Jump to content

cyberRobot

Moderators
  • Posts

    3,145
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by cyberRobot

  1. Are you getting any errors? Is PHP set up to show all errors and warnings?
  2. In case you are interested, there is more information about hashing passwords here: http://php.net/manual/en/faq.passwords.php
  3. What are you looking to do? Are you creating an HTML image map...or just a simple image? For what it's worth, you can create a hyperlinked image with Photoshop slices:
  4. It may help if you provide more information on what you are hoping to do. For what it's worth, only the first call to the die() function will be executed. The second call never gets executed since die() terminates the PHP script. More information can be found here: http://php.net/manual/en/function.die.php
  5. Yeah, the withdrawals were just starting to kick in.
  6. If QuickOldCar's suggestion doesn't work...are you getting any errors? Are PHP errors and warning being displayed? Note that you can add the following to the top of your script to show them: <?php error_reporting(E_ALL); ini_set('display_errors', 1); ?> Of course, you'll want to remove the above code once you are done debugging. Also, if you're not doing so already, you'll want to look into preventing SQL injection attacks. One way is to use mysql_real_escape_string(): http://php.net/manual/en/function.mysql-real-escape-string.php
  7. Have you considered using PHP's built-in method for validating email addresses? More information can be found here: http://php.net/manual/en/filter.examples.validation.php
  8. It's a user-defined function defined near the top of the script. function died($error) { //... }
  9. Have you checked to see if any MySQL errors are being thrown? More information on how to do that can be found here: http://php.net/manual/en/pdo.errorinfo.php
  10. The overall query is in double quotes though. $query = "INSERT INTO `databasename` (`id`, `firstname`, `lastname`, `bustype`, `email`, `telephone`, `description`, `timestamp`,) VALUES (NULL, '$firstname', '$lastname', '$bustype', '$email', '$telephone', '$description', CURRENT_TIMESTAMP,)";
  11. Also note that the form variables are being added directly to the query. To use the named parameters defined in $q->execute(), you should change this: ... VALUES (NULL, '$firstname', ... To this: ... VALUES (NULL, ':$firstname', ... Note that I'm not very familiar with PDO, so hopefully someone will correct me if the syntax is incorrect. More information about preparing queries can be found here: http://php.net/manual/en/pdo.prepare.php
  12. It looks like you're missing a close curly quote at the end of your script. <?php //... $con = null; } ?>
  13. Try removing the "AND" before the YEAR() function. AND YEAR(datepicker) It also looks like you're missing the "WHERE" part in the where clause. WHERE YEAR(datepicker) = '2015'
  14. That depends. If your SESSION variable is named with a dollar sign, it should stay. I was just checking to see if the dollar sign was put there on purpose. Did you turn off the output buffer after the session_start() call? That way you can see if PHP is throwing errors. If no errors are showing up, do you know if errors are being hidden by the server? Note that you can add the following lines at the top of your script...probably after your session_start() call: //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1);
  15. Also, is your SESSION variable called "Sess_Name" or "$Sess_Name"? Note that your code adds a dollar sign to the name.
  16. When viewing the page in your browser, does the correct name appear in the source code? Are you getting any JavaScript errors? In case you're not aware, you can right-click the page in a browser like Chrome. Then click the Inspect Element option. The errors would be displayed in the Console tab.
  17. It looks like you're missing the close parenthesis for the YEAR() function here: YEAR(datepicker = '2015' If that doesn't fix the issue, what error(s) are you seeing?
  18. It looks like json_encode() adds the quotes for you. Try changing this: var tempoVar = "<?php echo json_encode($theName); ?>"; To this: var tempoVar = <?php echo json_encode($theName); ?>;
  19. No problem; glad to help!
  20. Were you able to adapt the code to work with the timepicker plugin? Perhaps something like the following will work: $(document).ready(function(){ $('.schedule-timepicker').each(function() { $(this).timepicker({ timeFormat: 'HH:mm:ss', minDate: new Date(1, 1, 1, $(this).data('minhour'), 00), maxDate: new Date(1, 1, 1, $(this).data('maxhour'), 00), }); }); }); Note that the timepicker code is untested.
  21. When I connect with MySQLi and try to use a mysql_*, I get errors like the following: Since you're using PDO, it should provide similar warnings. Perhaps your server / page is set to hide warnings. Did you add the followings lines to the top of your script? <?php //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); ?>
  22. Have you tried looping with .each()? $(document).ready(function(){ $('.schedule-timepicker').each(function() { alert($(this).attr('data-minhour')); }); });
  23. The overall function should work just fine...as long as you pass the necessary field value as defined in the function. <?php function create_text_field ($label, $name, $value){ echo '<label>' . $label . ': </label>'; echo '<input type = "text" name ="'.$name.'" value = "'.$value.'"'; echo '/><br><br>'; } ?> Out of curiosity, what is the goal behind the following lines of code? if(isset($_POST[$name])&&($_POST[$name]==$value)){ echo $_POST[$name]; } Are you trying to add an override for $value? If so, the test should probably be executed prior to the input field being displayed. Side note: the <label> tag isn't currently connected to the input field. The following documentation provides examples on how to make the connection: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
  24. Sorry, I'm not sure what you are asking? Please restate the question.
  25. Do you have errors enabled? Note that you can add the following to the top of your script to show all PHP errors: <?php //REPORT ALL PHP ERRORS error_reporting(E_ALL); ini_set('display_errors', 1); ?> It seems like the issue is caused by using mysql_* functions like the one here: $run_posts = mysql_query($get_posts); Based on the earlier query, you didn't connect with mysql_*. Side note: using the raw value from $_SERVER['PHP_SELF'] opens your script to XSS attacks. More information can be found here: http://seancoates.com/blogs/xss-woes The above article only talks about the <form> tag, but the PHP_SELF variables in your <a> tags are also affected.
×
×
  • 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.