Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. How about the documentation where all the php functions are defined - http://www.php.net/download-docs.php
  2. You can always add a line to your php.ini to set date.timezone = 'your value' You can also set date.timezone in a .htaccess if php is running as an Apache Module or in a local php.ini when php is running as a CGI application.
  3. That makes no sense. If you have a form with a input type='file' field, the intent of that is to upload the file to the web server that the form submits to. If you are just browsing files on your computer for use on your computer, you would not be using a form in a browser.
  4. That's the way it is designed to work. And as far as the server is concerned, it does not matter what the actual path is on the client was, why do you care if you only get the filename?
  5. If JS means JavaScript, then the file must be web accessible since the JavaScript runs in the browser and it must be able to access the file over the Internet.
  6. You cannot just remove the 'i' and change the mysqli_ function calls into mysql_ function calls. The parameters and order of the parameters are not the same.
  7. The error message you are posting is for a mysql_query() statement. The code you are posting is using mysqli statements, unless you have a library of user written functions to use mysqli statements on a system that does not have mysqli installed. You would need to post the actual code that is producing that error.
  8. It means that your mysql_connect() failed (or was never executed) and the link you put into the mysql_query() statement was not a valid MySQL-Link resource. You would need to determine why your connection code failed and why your error checking logic in your code did not prevent the rest of your code from blindly attempted to execute a query when there was no connection.
  9. You have far too many function calls strung together and the dot . format is not one that strtotime() understands - http://www.gnu.org/software/tar/manual/html_node/Calendar-date-items.html#SEC121 Also, strtotime() can do date math. To get today's date + 1 week in the "m.d.Y" format - $ttldate = date('m.d.Y', strtotime(' + 1 week'));
  10. The reason for wanting to see the code responsible for the symptoms is to know what it is or is not doing. BTW: The case 1: and case 2: reasons are backward. #1 is The uploaded file exceeds the upload_max_filesize directive in php.ini, and #2 is The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form. You should probably add the Value: 7 error; Failed to write file to disk, in case the disk if full, a disk error is occurring, or the allocated disk space is being exceeded. Since you are checking for the error element > 0 and processing it as an error, that does not necessarily mean that the error element even exists in those cases where you are getting a failure in the is_uploaded_file(). There is a condition where if you exceed the post_max_size setting that the $_FILES array is empty and the error element won't be greater than zero because it is not set at all. There are also times when php seems to ignore settings (they display with the expected value but they are being overridden somehow.) So, my recommendations - A) Put in a test and an error message if the $_FILES array is empty. This should be before the existing code testing $_FILES['file']['error'], B) Only process the uploaded file if the error element is set and is exactly equal to zero, C) Develop and debug this on a system with error_reporting set to E_ALL and display_errors set to ON so that all the php detected errors will be reported and displayed. If the problem is due to an empty $_FILES array you would have been getting php errors when you attempt to access the non-existent elements.
  11. Web servers are stateless. They don't know or care anything about any http request that came before the current one or any that will come after the current one. Unless you store the status for each event somewhere on the server (in a database or a flat-file), it won't exist. You would then need to read the status and display it whenever anyone visits the page. The form you are submitted is only affecting the page it submits to. Any other visitor to that page won't see the results of the form YOU submitted when you do this.
  12. Is your problem solved? If you still cannot upload larger files, how about posting your upload form and your upload processing code.
  13. What does a phpinfo(); statement show for the two settings you have been trying to change?
  14. $HTTP_POST_FILES was depreciated really long ago in php4.1, turned off by default in php5.0, finally throws a depreciated error if turned on in php5.3, and has been completely eliminated in upcoming php6. Is there some reason why you have not updated your code to use $_FILES? In addition to that, it would appear that your code likely does not have any error checking logic in it to prevent accessing a non-existent uploaded file or to tell you when an upload fails.
  15. If you will never have any other sub-domains, using the redirect method (either in a .htaccess file or in your script) would be the best route because all your URL's will end up consistently with a www. on them. If you will end up needing this to work using sub-domains, you would need to set up the session.cookie_domain setting.
  16. If you are writing the whole xml document based on data you have, it is simplest just to write the tags and data yourself. However, if you are modifying or iterating over an existing xml document, you would likely want to use a more sophisticated method.
  17. I've got to ask, which part of doing this do you need help with? It is a trivial coding task (replace document_tag and data_tag with your choice of tag name) - <?php // execute your query here ... echo '<?xml version="1.0" encoding="UTF-8" ?>'; // just in case the evil short open tags are on echo "<document_tag>"; while($row = mysql_fetch_assoc($result)){ echo "<data_tag>{$row['column_name']}</data_tag>"; } echo "</document_tag>"; ?>
  18. Yes, definitely - A) trim() returns the value it trims, so it would be necessary to assign the value to something in order to use it, B) Don't pass values into a function using the global keyword and definitely don't pass that many. You should be using an array to hold a set of related data. C) Just putting a function definition around a block of code does not make that code into a function. You must design a function to perform a specific task, accept specific parameters, and return a specific result. Yes, clearly.
  19. You will find that if you use double-quotes as the initial and final quotes when writing a query string that you will be better off because you can then put single-quotes and php variables directly into the query string. Also, table and column names are not enclosed in single-quotes as that would make them strings instead of table and column names.
  20. WOW. Total lack of AND (with code even, just copy/paste) -
  21. Some mail servers don't like and won't parse the name <email> format. Just try - 'From: WebForm@RealEstateBram.com' as the From: address.
  22. Correct, arrays should be used when you have sets of related data. Edit: Also see the post at the following link and the last post in the same thread - http://www.phpfreaks.com/forums/index.php/topic,303934.msg1437742.html#msg1437742
  23. So, even after two different people suggested reading the documentation for that function, you apparently didn't
  24. Then it is likely that only your web host will be able to tell you why the mail() function call is returning a false value.
  25. Are both the From: and To: email address you are using, valid mail boxes (they exist) and are hosted at the mail server?
×
×
  • 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.