Jump to content

treeleaf20

Members
  • Posts

    76
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

treeleaf20's Achievements

Member

Member (2/5)

0

Reputation

  1. Even if I remove that from the code it still doesn't work. I just added that as more of a debugging tool to see if the file even had contents in it. Either way, it still doesn't work.
  2. All, I've got the following code to force a file download for a zipfile that I just created: $zip_name = 'download.zip'; $result = create_zip($other_files_to_zip,$zip_name,true); if($result){ echo "The filesize is: ".filesize($zip_name); header('Content-Type: application/zip'); header('Content-disposition: attachment; filename=filename.zip'); header('Content-Length: ' . filesize($zip_name)); readfile($zip_name); } When I echo out the filesize it shows a correct size and it prompts me to download the filename.zip which is ok since it's just a filename but then when I save the document and try and open Windows says that Windows cannot open the folder because the folder is invalid. Any ideas on how to resolve an issue like this? Thanks in advance!
  3. That did the trick, I'm using domain.com. How can I tell what version of PHP they are using? Thanks!
  4. If I make it: $oldKey = null; I get the following error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /usr/local/pem/vhosts/243668/webspace/httpdocs/offers/form_key.php on line 5 If I make it: var $oldKey; I get the following error: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /usr/local/pem/vhosts/243668/webspace/httpdocs/offers/form_key.php on line 7 Thanks.
  5. All, I'm getting the following error when I work with a class: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /webspace/httpdocs/offers/form_key.php on line 5 The complete code for this is class is: <?php class Form_Key { protected $oldKey; public function __construct() { // Ensure we have an available session if ( NULL == session_id() ) { session_start(); } // Grab our former key for validation if ( isset( $_SESSION['form_key'] ) ) { $this->oldKey = $_SESSION['form_key']; } // Assign the new key $_SESSION['form_key'] = md5( uniqid( mt_rand(), TRUE ) ); } public function isValid() { return 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['form_key'] ) && '' != trim( $_POST['form_key'] ) && '' != trim( $this->oldKey ) && $_POST['form_key'] === $this->oldKey; } public function getKey() { return $_SESSION['form_key']; } public function getOldKey() { return $this->oldKey; } public function render() { return '<input type="hidden" name="form_key" value="' . $_SESSION['form_key'] . '" />'; } public function __toString() { return $this->render(); } } ?> The line that is giving the issue is this line: protected $oldKey; Is it ok just to remove this line?? If I comment it out it gives me the same message but for line 7, which is this one: public function __construct() Anyone have any ideas? Thanks in advance.
×
×
  • 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.