Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Echo the value in $uploaded_type when your validation test fails so that you can see what exactly it is. Different browsers send different mime types for the same file and your code must allow for multiple values.
  2. You would need to do what ldb358 just posted. However, since this violates one of the prime rules of programming, separation of code and data/content (i.e. your data should not contain code), you must be extremely careful where this code came from and what it is. A lot of web sites get taken over because they allow hackers to get their raw code to be executed on a server because it got ran tough an eval() or include() statement. If you accidentally run some content that came from a visitor through the eval() as part of the php code you have stored in a database and that content was not properly validate and happened to contain raw php code itself, a hacker just took over your web site. Also, any syntax error in this code (or any syntax error that a hacker can trigger through content in an effort to probe your server for ways to break in or to simply shut down your site) stored in the database will halt ALL php code execution on your page (the eval() invokes an instance of the php language engine, both making this a slower process than you expect and parse errors in the code stops all php code execution.) Are you sure what you are doing cannot be accomplished by separating the php code out so that you only store data or content in the database and keep the php code as part of the logic on your page?
  3. You have got 4 similar error messages on 4 different lines in your program. They each show an invalid path statement that contains //. You would need to look at the lines of code mentioned in the error messages and try to determine why that invalid path is being produced. Either the path syntax is exactly what is shown in the error and needs to be corrected by removing one of the /'s or there is a variable or a defined constant being used in between the two // and the variable or defined constant is empty or does not exist and you would need to determine why it is empty or does not exist and correct that problem so that it does supply the expected value in the code.
  4. So, the answer is YES and you would need to do what someone already suggested.
  5. You would need a WHERE clause in your query - WHERE date < DATE_SUB(NOW(),INTERVAL 10 MINUTE)
  6. If you read the documentation for the memory_limit setting, you will find out where you can change it. For example, if your web host has not prevented it, you can set memory_limit in a script using an ini_set() statement.
  7. If you want the actual file name to use an unique ID from a database table, use an auto_increment field in the table. INSERT the row in the table and use mysql_insert_id() to get the ID that was just assigned. If the whole filename consists of more than just the ID, insert empty data for the actual filename and go back and execute an UPDATE query to fill in the actual information once it has been assigned.
  8. That's because that query does not address what you stated. What type of values are in your date column?
  9. I suspect what you actually want is to only retrieve (match) rows WHERE their datetime is more than 10 minutes ago? Rows with a datetime 10 minutes ago or less would not be retrieved?
  10. Of course there are limits, such as the amount of available memory. You should be developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON so that php will help you by reporting and displaying all the errors it detects.
  11. I used gmdate('Y-m-d H:i:s', 1157087100 ); to come to that conclusion. Php.net has had a number of reoccurring bugs in its functions (the change log reads like a clown act at times.) It's hard to say for a fact that the gm___ functions would produce the correct value. All the more reason to not use a Unix Timestamp.
  12. The most apparent problem is that the From: address in the email header must be a valid email address hosted at the sending mail server to both get the sending mail server to send it and to get most receiving mail servers to accept it. You would want to put the arbitrary email address that was entered in a form into a Reply-to: address. For debugging purposes, if you set error_reporting to E_ALL and display_errors to ON, the mail() function might return some information that would help.
  13. The Unix Timestamp you have been using in this example is 2006-09-01 05:05:00AM GMT
  14. You have two mysql_query() statements in your code, so of course you will get double entries - $result = mysql_query($query); if (!mysql_query($query)) Computers only do exactly what their code tells them to do. Why does your code execute the query once, then a second time?
  15. The format you showed in the first post is NOT a DATETIME value in a msyql database. Converting that to an actual DATETIME (YYYY-MM-DD HH:MM:SS) is what you should be attempting. You could then sort the data by dates and times, do greater-than/less-then comparisons, use the two dozen mysql date/time functions on it, and more importantly, you could directly do queries that return results for a range of dates, grouped by human readable time periods, like days, months, and years... within that range of dates. What exact problem are you having that makes you think you want to convert these values into Unix Timestamps and that the sample value you have posted is and will always result in the Unix Timestamp that you posted?
  16. The code you did post is incomplete and cannot produce the results you would need in order to get this to work. For example, the UPDATE and SELECT queries don't contain a WHERE clause so if they actually execute without errors, the result would not be anything you could use. We can only help you with specific problems and with the specific code that you are using. The code you did post in this thread would need to have an existing record in the database in order for the UPDATE query to be the correct method to use. For all we know, the link to the file you got in the browser was something that was already in the database table from previous testing.
  17. The only thing browsers can make to web servers are HTTP/HTTPS requests. They cannot directly 'call' php code on a page or php functions within that code. They make requests for URL's. The HTTP/HTTPS request that results from clicking on each individual tab/link must contain enough information so that the php code on the requested page can determine what action to take. One way to do this would be to use a GET parameter on the end of the URL, something like http://your_domain.com/some_page.php?tab=some_value1, http://your_domain.com/some_page.php?tab=some_value2, http://your_domain.com/some_page.php?tab=some_value3, ... You would then access the value of the GET parameter 'tab' by referencing $_GET['tab'] in your code.
  18. Your current code produces this error - The parameter you are supplying in the function call is not set to any value, so you get nothing out. You should also be developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON so that php will help you. You will save a TON of time.
  19. The closing brace } for the function definition is at the end of the code. The current call to the function is inside of the function definition.
  20. Functions like strtotime() and date() are dependent on the current time zone setting and any DST settings or even if the DST database that php is using is up to date (a lot of locations have changed the DST start/stop dates) and you will see a lot of problems with the conversion into or out of a Unix Timestamp. If you want a date/time to always be the correct value that was entered, store it as a DATETIME (YYYY-MM-DD HH:MM:SS.) No conversion is necessary to use the value (changing a DATETIME formated value to something else involves simple lookups and simple math, no error prone and time zone dependent conversion is needed.)
  21. Wouldn't it be a better use of your time upgrading the code to the current standards so that it will work under future versions. None of the function have been removed in php5.3, but they do produce depreciated errors in a effort to get people ready for php6. The functions that are producing the depreciated errors will be removed in php6. You can alter the error_reporting level to hide the depreciated errors if your code will be fixed or replaced by the time php6 is released.
  22. Best guess is that your form is not setting $_POST['user'], so the code you did post is being skipped over.
  23. What exactly is your page displaying? Since you are not echoing anything until the code at the end runs, how do you know that the page is only half loaded? What have you checked in the code to pin down what it is doing? Is the value in $acount correct? Your INSERT query has no error checking or error reporting logic, so even if it fails, you will never know if or why. For what you are doing, you should echo mysql_error() if the mysql_query() statement ever returns a FALSE value.
  24. If you add the two missing elements that I stated the syntax error will be fixed.
  25. You are missing a closing double-quote and a semi-colon on the following line - End Lease Date: $eld \n
×
×
  • 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.