Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. If you want to capture and 'return' the tag or data values, you will need to use the xml parser inside of a class/OOP, because the three call back functions are called by the parser and they cannot directly accept or return values to your program. However, in a class, you can store values found in the call back function into class variables.
  2. Given that your function executes a query and returns more than one value and that you are then going to want to access those other values inside the conditional logic, you likely would not want it to work the way you tried as you would then be calling the function multiple times. That would not be very kind to your database server, i.e. executing the query each time you referenced any element of catexists($_GET['cat'])[x].
  3. You need to set error_reporting to E_ALL and display_errors to ON. You can do this in a .htaccess file (when php is running as an Apache Module), in a local php.ini (when php is running as a CGI application), or in your script (though this won't show fatal parse errors.) Is there some reason you are not developing and debugging your code on a local development system and only putting it onto a live server once it is 100% tested?
  4. http://us2.php.net/json
  5. My recommendation would be to find a different, up to date, supported, script. In the time you will waste getting to the point where the current script will even run without any errors, then you will still need to determine if it meets your needs, you could search for, find, and evaluate 10 other scripts to find one that does what you want it to.
  6. You can safely ignore that error. The code on that line should have been properly written as - if (isset($this->attr["NAME"]) && $this->attr["NAME"] != "") Frankly, you are going to see a few dozen similar problems. You should contact the author of the script for his help.
  7. There are two lines in that file that define the same variable. You could comment one out and see if it works. However, since that error would have always prevented the code from working, I seriously doubt that you will be successful in getting the overall script to work. Who would have posted a script that fails to run due to a simple error in the source code?
  8. That would be question for the Author of the code. Until you debug what is causing the blank page, you won't know. You could be missing a php extension the code relies on or the code could be using some depreciated feature that is tuned off in the php.ini on the systems that you have tried it on.
  9. A) I did not state to put the settings into your code (because doing so won't cause fatal parse errors, the most common reason for a blank page, to be displayed.) B) The site.php file sets error_reporting to 0 and will hide any runtime errors, unless you commented out the line to prevent it from doing so.
  10. A) Blank php pages are usually caused by fatal parse or fatal runtime errors. Are you developing and debugging this on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will both report and display all the errors it detects? You will also want to go through the code and remove/comment out any lines that are setting error_reporting/display_errors. B) This is the second major script I have seen lately that puts sensitive information into a .xml file (i.e. your database connection details.) However, anyone that recognizes the script will know that they can simply browse to the site.xml file and get your database connection information. You must take steps to insure that the site.xml file is not web accessible. You either need to prevent http access to the file or move it to a folder that is not web accessible.
  11. You have multiple opening <form > tags. That is invalid HTML.
  12. If you use your database's DATE data type and your database's date/time functions to perform operations on the values, what you are doing will work. You can also use php's DateTime class objects/methods.
  13. Did you do a 'view source' of the resulting HTML to see what you are getting?
  14. Do you actually have a memcached server running on your system? The php language extension is just the client interface that allows you to use the memcached server.
  15. You would need to post your actual code the exhibits the problem. The three lines you did post, work are expected.
  16. anks, you are directly echoing two lines of HTML instead of concatenating them with the $navigation variable. Also, based on the number of blank lines, you are apparently echoing other things or have something not enclosed within <?php ?> tags before the doctype tag.
  17. Your query failed to execute. Does your code have any error checking/error reporting/logging logic in it to get it to tell you when a query fails and to tell you why the query failed?
  18. One of the reasons for the YYYY-MM-DD format is because you can do greater-than/less-than comparisons and sorting on the values.
  19. ^^^ Why are you reading and discarding the first row from the result set with the above line of code ^^^
  20. According to the source that the validator used, your doctype tag is on line 7 in your file and you have another HTML tag before it in the file as well.
  21. Give this a try - <?php $input = $_GET['string']; $dates = explode('; ', $input); foreach ($dates as $values) { echo $values; $parts = preg_split("/[\s,]+/", $values); print_r($parts); echo "<br />"; } ?>
  22. As long as all the values have the correct (and same) format, the comparison will work. now() is a DATETIME value and you should not be comparing it with a DATE value. See CURDATE()
  23. You are probably exceeding the post_max_size value, which causes the $_FILES and $_POST arrays to be empty and your form processing code is probably just being skipped over. What is your code and do you have any error checking/error reporting logic in it to get it to tell you why it is failing?
  24. $_POST is a perfectly fine array variable. In a lot of cases, making other named variables out of every $_POST entry is a waste of processing time, program memory, and typing (both in making the variables and then later referencing all the variables.) If you want to simply store all the form data, you can use a foreach() loop to iterate over the $_POST array. Using the foreach($array as $key => $value) syntax, you can get both the key (index name) and the value.
×
×
  • 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.