Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Perhaps if you told us why you moved the wamp folder to somewhere else and back? Did you install some other web server software and it is interfering/preventing the wamp based server from running?
  2. It might be interesting to see what getcwd shows?
  3. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=334373.0 Error has nothing to do with mysql
  4. ^^^ Not inside a string. Inside a string, $txn[txn_id] is parsed as though it was written as $txn['txn_id'] (I'm guessing if you were to look at the C code responsible for doing that, it probably looks like it was written by the clown act in a circus.) Outside of a string, php first evaluates the txn_id in $txn[txn_id] as a constant (which it should only do, then stop), then when it does not find a defined constant by that name and finishes with the error response code it assumes the programmer meant to enclose the index name in quotes and evaluates it as $txn['txn_id'] (more fun C code.)
  5. The quote I posted in your other thread on this subject, is directly out of the post_max_size documentation. It's not a bug, its the defined response that php takes -
  6. @TLG, when validating user supplied data, it is important to tell the user exactly what was wrong with the data they supplied (as long as you are not exposing security related information). Just telling them that some data they supplied didn't work is a useless waste of bandwidth.
  7. For an upload, you generally test if $_SERVER['REQUEST_METHOD'] == 'POST' to detect that a form was submitted, then you test if the $_FILES array is empty, which would indicate that the size exceeded the post_max_size setting. Then if the $_FILES array is not empty, you would test $_FILES['file_upload']['error'] for any of the other possible upload errors.
  8. You should be developing and debugging your code 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. The $POST variables would have produced undefined... error messages that would have helped you to find them.
  9. Have you checked in the 'view source' of your form page if the hidden sub field even has the value you expect?
  10. I just tested the code you posted (writing the content of the $_POST array to a file) and your posted code sends the comment, msg_id, and sub values.
  11. Without actually testing what you did post, the problem is fairly likely to be in your comment_ajax.php code. Posting that and posting all of the form page would help because it would allow someone to both see and test your actual code.
  12. The only thing that stands out in what you posted is that there is no </input> closing tag and the two you have should be removed.
  13. Upon further review of your code, you are using two == signs in your code that is trying to set the $_SESSION variables - $_SESSION['review_name']==$review_name; ^^^ That should only be one = sign (an assignment operator.) Two equal signs is a comparison operator. Are you developing and debugging your code 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. That is how I found the problem (the session index name is not defined, but the line of code was supposed to be setting the value, not referencing the value.)
  14. What does browsing to a .php script with a phpinfo(); statement in it show for the register_globals setting? - <?php phpinfo(); ?>
  15. Someone already suggested some of the common ways this is done - <?php // assuming you have the code that is to be displayed in a string ... $code = <<<HEREDOC <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Display code test</title> <script type="text/javascript" src="jquery.js"></script> </head> <body> <?php echo "some php code"; ?> </body> </html> HEREDOC; echo "------------------------ htmlentities method -----------------------<br />"; echo "<code>"; echo nl2br(htmlentities($code,ENT_QUOTES)); echo "</code>"; echo "<br />------------------------ highlight string method -----------------------<br />"; echo highlight_string($code,true); ?>
  16. Did you read this note in the crc32 documentation -
  17. You will find that <pre> </pre> doesn't stop the html from being rendered and <xmp> </xmp> is depreciated.
  18. You do realize that making a connection to a remote database server - A) Has more overhead to just establish the connection using an Internet protocol. B) Is subject to the reliability of the connection between where you are at and where the database server is at. C) Has a transfer rate that is several times slower than a local database server, which would immediately impact any web page that executes several queries and/or retrieves a lot of data.
  19. A persistent database connection is released (it goes back into the pool of available persistent connections) by the script when the execution on a page ends, assuming that your web server/php combination supports persistent connections in the first place. The ONLY difference between non-persistent and persistent connections is that if there is an available persistent connection, you save the overhead needed to make the actual connection to the database server. You must still call the code necessary to get an existing connection/form a new connection if there are no available connections. The only way a persistent connection would help with a time-out situation would be if making the initial connection took an abnormally long time. There are literally millions of php/mysql based web pages that don't use and don't even support persistent connections that work as expected.
  20. Either use - htmlentities with the second parameter set to ENT_QUOTES or use highlight_string or highlight_file There are also several open source code highlighters that you can find by searching the Internet.
  21. If you use method='get' (or specify no method) in your <form> tag, you cannot put any get parameters on the end of the URL in the action="" attribute. Any get parameters on the end of the URL will be completely replaced by the form data. You would need to use a hidden form field in this case.
  22. One = sign is an assignment operator. Two == signs is a comparison operator.
  23. It's not possible to do this in a single query because the query is executed on the database server that you have connected to. Any one query can only access the data that the database server can directly read. Perhaps if you tell us why you need to do this, someone can suggest the best solution, which could range from replicating one of the databases on the other server to querying each separate database and combining the data using php code.
  24. The part of the form you posted is incomplete and nonfunctional. There are countless upload scripts posted all over the Internet.
  25. $HTTP_POST_FILES was depreciated over 9 years ago, turned off by default in php5.0, and is scheduled to be completely eliminated in an upcoming php version. Use $_FILES instead.
×
×
  • 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.