Jump to content

gw1500se

Members
  • Posts

    1,041
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by gw1500se

  1. Convert the date string to a time data type then compare: if(strtotime($test_date) < strtotime("now")) { $new_date=strtotime(&test_date. "+ 1 day"); } // format $new_date however you need
  2. If I understand correctly, you need to see if the hour has gone past and if so increment the date.
  3. Then it is not a max packet size issue. Post some code so we can see what you are talking about.
  4. Did you check for errors? If you exceed the max packet size you should see error 1153. If you need to change it, set 'max_allowed_packet' in the ini file.
  5. Reading the manual will help a lot.
  6. Sorry by my clairvoyance is not working today. Perhaps if you posted some code it might help. Be sure to use the code icon (<>) and select PHP.
  7. So what is your question or what is the error?
  8. What have you tried and what is not working?
  9. I think the OPs small matter goes a bit deeper. Probably needs to do a lot of learning of HTML and PHP.
  10. PHP keeps the original data type unless you specifically change it. Thus it will always be data type float and will output 0.0. If you want it to be blank then add a check to see if it is 0, if it is then do not output the variable. Because you didn't use the proper code icon (<>) I am not going to wade through that difficult to read code but wherever you are outputting that variable, add the 'if' block.
  11. I failed to mention that if you have admin privileges you can create rewrite rules that protect the directory containing member only pages. But that is not a pure PHP solution but rather an httpd configuration solution.
  12. Use sessions. Each page will need to check a session variable to determine if a user is logged in. If so deliver the page, if not deliver the login page or an error.
  13. Use var_dump() to see what $_POST contains: echo "<pre>"; var_dump($_POST); echo "</pre>"; You can find the variable you want from that.
  14. Personally I would abandon trying to fix the code and instead rewrite it using PDO. Since it uses deprecated code that is going away in any case, it makes no sense to waste time trying to fix it.
  15. Your curl code needs to be part of the loop. Not showing it makes it difficult to understand what you are trying to do.
  16. You can't just copy code and expect it to work without understanding what it does. That you are using 'wp_redirect' indicates you are writing a WordPress application. What error are you getting? Also your coding is vary hard to read and not good programming practice. You should modularlize your PHP code. A process section and presentation section. Don't embed PHP into HTML like that, build the output string in then echo it.
  17. Yes, when it comes from an HTML page. That is any time you are inserting user provided data.
  18. I always have trouble using them in that context which is why I use my suggestion trouble free.
  19. First please use the code icon (<>) to insert code and select PHP. It makes your code much easier to read. The main thing I notice is that you are using single quotes for your variaables when you build the query string. Single quotes tells PHP to treat the contents as literals. Had you used the code icon you probably would have seen that. mysqli_query($connection, "INSERT INTO comment_table (name, date_col) VALUES (".$name.", ".$date_col.")"); That being said never, ever use the above code. You leave it wide open to injection attack. Any time you want to insert HTML variables into a query you MUST use prepared statements.
  20. Not for DNS assigned IPs. Static IPs are only a maybe. There is no way to capture that reliably without user interaction.
  21. IP address locations are based on the ISP location not the assigned user location.
  22. It will be more than just a script. You will need to set up a database as well to store the user login information. Try reading this to start.
  23. I know it was a namespace statement but it had nothing to do with the original problem. It still looks like a path issue for the PHPMailer code.
×
×
  • 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.