Jump to content

valoukh

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

valoukh's Achievements

Member

Member (2/5)

0

Reputation

  1. the error number is 1, if you mean this bit: FILES:Array ( [uploaded] => Array ( [name] => bday_special_100%.jpg [type] => [tmp_name] => [error] => 1 [size] => 0 ) ) And "upload_max_filesize" seems to say "2M" regardless of the .htaccess file.. :S thanks
  2. still struggling with this, if anyone has any ideas!
  3. Yes - I cleared the html from the form to make it clearer but must have removed this accidentally: <input type="hidden" name="MAX_FILE_SIZE" value="300000"> However I played with this a lot before I even posted here: changing the value does nothing at all, and removing it did nothing either - but what I didn't realise is removing it gives a different error, 1 instead of 2. So it's failing at php.ini upload_max_filesize (the file I just tried was 7mb, in .htaccess I wrote "php_value upload_max_filesize 10M" but it doesn't seem to be working) thanks
  4. PFMaBiSmAd: Here's what I get: Image of 700k: FILES:Array ( [uploaded] => Array ( [name] => test1.bmp [type] => [tmp_name] => [error] => 2 [size] => 0 ) ) Image of 100k: FILES:Array ( [uploaded] => Array ( [name] => test2.jpg [type] => image/jpeg [tmp_name] => /tmp/phpXr9rGB [error] => 0 [size] => 109109 ) ) pkedpker: I got the error "call to undefined function: iniset()", I changed it to "ini_set" and now get the error above. It's not the format as I've also tested with large JPGs. Thanks for your help so far guys.
  5. Hey, thanks for your reply. Here goes: FORM: <form enctype="multipart/form-data" action="upload_up.php" method="POST"> Choose file: <input name="uploaded" type="file"> <input type="submit" value="Upload"> </form> PROCESS: <?php $uploadedfile = $_FILES['uploaded']['tmp_name']; $src = imagecreatefromjpeg($uploadedfile); list($width,$height)=getimagesize($uploadedfile); $newwidth=250; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); if ($width > 250) { imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); } $filename = "uploads/". $_FILES['uploaded']['name']; imagejpeg($tmp,$filename,100); imagedestroy($src); imagedestroy($tmp); if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $filename)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded<br>"; } else{ echo "There was an error uploading the file, please try again!<br>"; } ?>
  6. Hi all, I can't seem to upload files larger that 300kb on my site. I've checked the phpinfo() page: upload_max_filesize = 2M post_max_size = 8M I don't have access to change php.ini so I edited ".htaccess" and added this line: php_value upload_max_filesize 10M Still not working. It let's me upload anything less than 300kb, but I could do with more like 3mb! If anyone has any ideas it'd be much appreciated. Thanks, valoukh
  7. By the way this is for some photo album code I'm trying to write - the idea is for the user to upload a zip file full of images so I can process it into an album...
  8. Not sure if this is relevant: if it's PHP5 I noticed you have to write "<?php" every time you begin some code, as opposed to just "<?".
  9. Hi everyone. I have a dilemma... I'm trying to unzip a file server-side (as part of a small application). I'm using the following code: $zip = new ZipArchive; $zip->open('TEST.zip'); $zip->extractTo('./'); $zip->close(); echo "Ok!"; It's not working and through intensive research I've found that this is because the server doesn't have the zip 'extension' installed...or something. It's just a web hosting company (QiQ.co.uk) so I have no control over what's installed. I've noticed they DO have something called "BZip", so my question is does anyone know of a way to convert zip files to bzip, or does anyone have an other ideas? E.g. is there any other way to unzip files without having this server-side support? I'm pretty stuck here! Thanks in advance, valoukh.
  10. Hi all, I've installed "Recaptcha" on my php guestbook to stop spam and up until today I thought it was working fine. However, I've realised that it only seems to work in IE, not Mozilla (the main two browsers I test with). Here's the page: http://www.denbygrace.com/HTML/guestbook.php I understand that code can be interpreted differently in the different browsers but I wasn't aware that this was the case with basic php (IF and INSERTS etc). Can anyone help? Here's the code: <? $sql="INSERT INTO guestbook (subject, date, comment, name) VALUES ('$_POST[subject]','$_POST[date]','$_POST[comment]','$_POST[name]')"; require_once('recaptchalib.php'); $privatekey = "(removed)"; $error = null; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($resp->is_valid) { echo "<p class='title'>Comment added, thank you! Click <a href='../HTML/guestbook.php'>here</a> to return to the <b>Guestbook</b> page.</p>"; $result = mysql_query($sql); } else { die ("<p class='title'>The reCAPTCHA wasn't entered correctly. Please return to the <a href='guestbook.php'>Guestbook</a> page and try again.</p>"); } ?> Thanks!
  11. Yea! I've already got mail working on one page - it was a simple INSERT to database, followed by an automatic email to the user (try the mailing list form http://www.denbygrace.com/HTML/index.php). The only difference with this one is im trying to send to multiple recipients, pulled from the database mailing list. And I'm not using mail(), but "PEAR Mail package", I followed the instructions here: http://email.about.com/od/emailprogrammingtips/qt/et073006.htm Forgive my lack of understanding, I just expected it to work the same on both pages, regardless of the record loop!
  12. im currently getting this error: Failed to set sender: @localhost [sMTP: Invalid response code received from server (code: 501, response: <@localhost>: no local part)] I removed all instances of "\r"
  13. i just realised that on top of what you said, I was trying to loop the POST instead of the record, always takes someone else to notice that lol. Just putting together the code as per your reccommendation, will be back with more questions im sure, haha. thanks.
  14. Hmm, that document doesn't seem to tell me anything I don't already know (when it comes to databases/loops). It's the syntax I'm having trouble with! Anyone?
  15. I'll have a look, thank you. Just FYI I've used loops many times so I know I can do them, I'm just having a bit of trouble getting this small loop to run within the mail script!
×
×
  • 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.