Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. This "problem" is not just for you, everyone has that same overhead. So let's think of why they designed mysql to open a new connection each time a script call is made, k? The reasoning for that if it was left open the whole time the memory would get eaten up. This would literally kill your computer's resources which would make it 5 times slower. Think of this way, if you had 1,000 people connecting at the same time and you never closed the mysql connection, each one of those would need the connection data in it's memory. This would cause a huge memory overflow and would probably crash the server. That is why a new connection is made each page, to avoid such a catastrophe. I think you just need to understand that the new connection on each page is necessary, because it will save your server from losing resources and memory.
  2. Restarting a while loop does not really make any sense. If you are using an auto increment value, you just have to reset that if a condition is met. A while loop will go on forever while the statement in the while loop is true.
  3. <?php $ip = $_SERVER['REMOTE_ADDR']; I hope register_globals is off. At any rate try the above for the ip address, it could be register_globals is off but either way you should access the ip using the above. As for why it is saying "Waiting on response" no clue. If you are trying to hit your own server, that may be the issue. You might also try a meta redirect or javascript redirect instead. See if that changes anything.
  4. Are you sure she is running PHP 5? mysqli is only available in PHP 5.
  5. Hotmail tends to mark mail coming from servers as spam/junk. Check that also look into mail headers www.php.net/mail in the mail function.
  6. Your logic is wrong, you are contradicting yourself and $color will always be yellow since h2 does equal 5. You would need separate names for the colors or else the last true statement will always be the color, that or do an elseif, then the first true statement will always be the color. What exactly are you trying to accomplish? EDIT:: Flawed code. For one variables cannot be interpreted inside single quotes, for two that is a syntax error not adding the . for concatination and for three his original code was just fine, may not of been well formed html but it should have worked.
  7. Alright, this is my last try at helping you, then I am at a stand still. It seems as though there is something with your MySQL, Apache (if you are using apache) or PHP software. One of the 3 is throwing stuff off (if you are using IIS I would suggest trying apache instead as that is probably the problem). You have probably clean slated many times, but I would suggest getting WAMP or XAMP and trying to install those and run the script. If either of those works better it usually means there is an issue with how one (or all) of those three were installed. My suggestion, try one of those and see if it works better, if you are running those I would suggest installing mysql, apache and php on your own. Make sure with MySQL you get the ODBC driver too. Oh and btw, the Intel Core 2 Duo is the weakest link. Go AMD!
  8. Chances are you are right. Is there a clean function or something, it seems as though it is keeping the same sql statement and trying to use it for the exec, which of course probably does not except select statements. The problem is obviously with the PDO class and the exec code. If the creator has a forum or email check there. Chances are not many people worked with that class and will be of no help to you here.
  9. $edit = "UPDATE posts SET title='".$_POST['title']."',content='".$_POST['content']."',author_id=1,page='".$_POST['pages']."' WHERE id=".$_GET['id']; echo $edit; What is the difference in the query and exec, I think you need to use query for the edit statement too. Unsure as I do not know the $db_handle class and how it works. Generally you should not put ; in the sql statements, as php cannot do 2 seperate queries in one line it can throw it off. Try removing those and try the above. See what happens.
  10. It works, but if you are using php 5, you shouldn't use the var keyword, and if you are not you need a $ before childs var $childs = array(); or static $childs = array(); I am not sure if the second one is right, as I do not code in PHP 5, but if you are using PHP 4 I know the first one is right and you will probably have to remove the public keyword.
  11. <?php // Thanks to "imoldgreg at o2 dot co dot uk" for the base 'CHMOD via FTP' script. function chmod_open() { // Use your own FTP info $ftp_user_name = 'chmod@XXXXXXXXX.com'; $ftp_user_pass = 'XXXXXXXXXX'; $ftp_root = '/'; $ftp_server = 'localhost'; $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); return $conn_id; } function chmod_file($conn_id, $permissions, $path) { if (ftp_site($conn_id, 'CHMOD ' . $permissions . ' ' . $ftp_root . $path) !== false) { return TRUE; } else { return FALSE; } } function chmod_close($conn_id) { ftp_close($conn_id); } // CHMOD the required setup files // Connect to the FTP $conn_id = chmod_open(); // CHMOD each file and echo the results echo chmod_file($conn_id, 777, 'master/cache/') ? 'CHMODed successfully!' : 'Error'; echo chmod_file($conn_id, 777, 'master/files/') ? 'CHMODed successfully!' : 'Error'; echo chmod_file($conn_id, 777, 'master/store/') ? 'CHMODed successfully!' : 'Error'; echo chmod_file($conn_id, 766, 'master/config.php') ? 'CHMODed successfully!' : 'Error'; echo chmod_file($conn_id, 777, 'master/images/avatars/upload/') ? 'CHMODed successfully!' : 'Error'; // Close the connection chmod_close($conn_id); ?> Taken from www.php.net/chmod Maybe that will work out for you using the ftp setup.
  12. Why not try this: chmod( $upload_dir . $new_file_name . ".jpg", 0777); See if that works.
  13. Then chances are nothing will work. Just one of the glorious wonders of shared hosting!
  14. Are you on Windows? If so I do not think you can change the permission via php. (Nor do I think it is needed).
  15. It may not just be the .asp page. Make sure you have fopen_url_wrappers on in your php.ini file. If you are using shared hosting, chances are this is disabled. You may try using www.php.net/file_get_contents or www.php.net/file if those fail and you have cURL installed, I would suggest using curl. www.php.net/curl
  16. if($session->userinfo['gething'] == base64_decode($_GET['thing']) ) { You were missing the closing ) on the if statement.
  17. Seriously, if you want help post most of the code, not one line. There is not necessarily an error at line 18, it could be before it (most likely) in the 17 lines above it or after it (unlikely but possible). Post code, don't be shy we won't steal it.
  18. Why not post the code instead of having us trying to solve it blindly?
  19. You do realize that in the sql statement you only call $user_familiar, not $user_familiar_name right?
  20. Yahoo tends to filter mail from servers as junk, especially if no mail headers are passed. Check the junk email folder and look at www.php.net/mail the mail function to figure out a set of headers that will work for you.
  21. $target_path = "images/"; $target_path = $target_path . basename( $_POST['txtname']); move_uploaded_file($_FILES['file']['tmp_name'], $target_path); I highly suggest looking at this site closer, as it seems you just skimmed over it and ignored most of it. http://us3.php.net/features.file-upload
  22. No he can do that, it would be a problem if single quotes were in use, than you would need the { } curly braces around it.
  23. http://www.sitepoint.com/article/hierarchical-data-database Good article on categories.
  24. <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> You need the enctype to transfer files via a form.
×
×
  • 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.