Jump to content

HuggieBear

Members
  • Posts

    1,899
  • Joined

  • Last visited

Everything posted by HuggieBear

  1. It does make sense and it's what I thought you were trying to do. It isn't possible unless they're using a scripting language to pass a referring URL to your script. For a real technical overview, view the http specification Regards Huggie
  2. You're on the right track. Take a look at the user comments on the readfile() manual page for more details. Regards Huggie
  3. That version is too old, you'd need version 7.16.2 (I got this info from the cURL website) Regards Huggie
  4. Did you read the link I sent? Try it around your $article text. It will remove newlines from the beginning of your string. Regards Huggie
  5. Is this something you can show me so I have a better understanding of what you're trying to achive? Regards Huggie
  6. There's a perfect example on the session_start() manual page... <?php // Function to see if the sessions started function session_started(){ if (isset($_SESSION)) { return true; } else { return false; } } // Start the output buffer so we dont create any errors with headers ob_start(); // Run the function to check to see if the session has been started if (session_started()) { echo 'The session has been started.<br />'; } else { // Without buffering, this would cause an error later when trying to start a session echo 'The session has not been started.<br />'; } //Start the session echo 'Starting Session...<br />'; // This would also cause an error session_start(); //Check again if (session_started()) { echo 'The session has been started.<br />'; } else { echo 'The session has not been started.<br />'; } //Flush the buffer to screen ob_end_flush(); ?> Regards Huggie
  7. Are you saying that although you can't alter the PHP of img_test.php that you can alter the JavaScript, or are you referring to the JavaScript of the referring page. Huggie
  8. Horrible way to do things... It's a workaround for crap coding in the first place Regards Huggie
  9. The functions I provided you with are designed for stuff like that and you shouldn't need any client side header setting. Regards Huggie
  10. I can't see anything wrong with the code you posted. Maybe it's somewhere in the code you haven't posted. Regards Huggie
  11. Nope, the only way to do it would be to edit the img_test.php page, as that's the referring page, regardless of the technology used whether it be client or server side. Regards Huggie
  12. It can't be set in milliseconds, only seconds. As for a code snippet, have you read the manual? There's a good example there. Regards Huggie
  13. You could add it to an array each time, then just take the last 5 elements? Regards Huggie
  14. I believe the short answer is no then. You'd need the referring page (img_test.php) to pass the value onto image.php ideally through a get variable. Regards Huggie
  15. Hmmm, possibly use curl_setopt() with the CURLOPT_TIMEOUT option. Regards Huggie
  16. Also take a look at the output buffering functions. Regards Huggie
  17. Please try to indent your code. It's will make it easier to read, this is no help to anyone: if($thumb->getSize()){ if($thumb->setThumbnail()){ if($thumb->copyImage()){ if($thumb->resizeImage()){ $thumb->copyResize(); $thumb->display(); } } } } } else { echo("Invalid image/file has been uploaded. Please upload a supported file-type (JPEG/PNG)"); unlink(IMAGE_FULL . $fileName); die(); } Regards Huggie
  18. move_uploaded_file() takes 2 arguments, a source file and a destination file. So use something like this in your for loop: // Full path to image directory $path = '/usr/domain/public/images/'; // Move file to new location move_uploaded_file($_FILES['uploadFile'. $x]['tmp_name'], $path . $file_name) Incidently, there's an easier way to write this. You could use an array from your form, rather than individual field names. If you'd like further info then let me know. Regards Huggie
  19. I don't think that's what the OP's after. I'd imagine they want to check the referrer. Regards Huggie
  20. Use the $_POST variables as defaults to the input fields. Regards Huggie
  21. No it moves it to that location, hence the function name move_uploaded_file() It's not called copy_then_delete_uploaded_file() Yes, if you were going to use ftp_put() then you'd need to remove it from the original location afterwards using unlink(). As for the location of the temporary uploaded file, it's specified in $_FILES['file']['tmp_name'] Regards Huggie
  22. Take a look at move_uploaded_file() Regards Huggie
  23. You do indeed... Handling File Uploads Regards Huggie
×
×
  • 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.