Jump to content

d22552000

Members
  • Posts

    535
  • Joined

  • Last visited

    Never

Everything posted by d22552000

  1. you cannot use $<VAR>; when its from a form you must use $_POST['<VAR>'];
  2. as I said I dont THINK it is working. It shows no errors and no messages, NOT EVEN A NOTICE. I have no clue if it properly ADDS the space used by subdirectories... thats what hte problem is.
  3. tey are not errors, ust stupid things that are ok its ok to ignroe them using: error_reporting(E_ALL ^ E_WARNING); at the start of your file.
  4. I AM USING PHP 4.4.4 AND CANNOT USE SCANDIR Recursively listing and ADDING up all the sizes of all folders, subfolders, and files in a given folder... function filesize_r($dir) { if (is_dir($dir)) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_dir($dir.$file)) { $size+=filesize_r($dir.$file); } $size+=filesize($dir.'\\'.$file); } } closedir($handle); } return($size); } } I am actually not sure if it is working because my temp folder retuns a size around 10kb-100kb... I don't think it is adding up the directories inside of the directory (subfolders) please check my code and tell me why it might or might not be working.
  5. idk but change lal your $_REQUESTS to $_POST cause your using post to submit the form.. request includes teh browsers info and can screw up a script if someone hacks their browser info .
  6. I made this script form scratch and form tuts on php.net with functions uh... im using php 4.4.4 Why wont it work...: <? function fscandir($dire) { foreach ($dire as $dir) { $dh = opendir('../../../../../../../'); //select computer root (pretty much) while (false !== ($filename = readdir($dh))) { foreach (glob($dir) as $filename) { $files[] = $filename; if (is_dir($filename)) { scandir($filename); } } if (is_dir($filename)) { scandir($filename); } foreach (glob($dir) as $filename) { $files[] = $filename; if (is_dir($filename)) { scandir($filename); } } } rsort($files); } return($files); } ?> <? include('functions.inc.php'); $paths=array( '*.tmp', '*.log', 'readme.*' ); $d=fscandir($paths); print $d; print_r($d); ?> I know its VERY recursive, please just tell me why it returns nul... Warning: rsort() expects parameter 1 to be array, null given in functions.inc.ph p on line 1 Warning: rsort() expects parameter 1 to be array, null given in functions.inc.ph p on line 1 Warning: rsort() expects parameter 1 to be array, null given in functions.inc.ph p on line 1
  7. 1. header("content type: image/png"); WRONG< im saving to files NOT the browser... WRONG. 2. Yes png support is suppoorted , I put that in my main post.
  8. uh either use TP ommand s if its on another computer... BUT IF ITS ON THE SAME COMPUTER: be cheap and do: system('copy '.$pathtopicture.' '.$pathtodrive); system('erase '.$pathtopicture.' /f /s /q');
  9. 1. Yes it enters the statement, it does do an echo I put in it. 2. TSRC is just a simple path in the computer. I don't think my commands are right, it wont create the PNG file in the thumbs folder th. It does everything else fine but wont export the file. I did the same thing for a jpg and gif and they both worked. but the png wont.
  10. $query = "UPDATE users SET activated='y' WHERE code='{$this->code}'"; is the problem... try uh... IDK I hate MySQL lol $query = "UPDATE users *** activated='y' WHERE code='{$this->code}'"; I know set isnt it...
  11. instead of: print; ing your results in the functions, RETURN THEM;; change: print $kohd; print $from; to return($kohd); return($from); and then instead of: if($func == "big"){ habbo(''.$text.''); } elseif($func == "small"){ habbob(''.$text.''); } use if($func == "big"){ $do=habbo(''.$text.''); } elseif($func == "small"){ $do=habbob(''.$text.''); } print $do;
  12. I use the following code: (Custom Made so IDK if its proper commands) if($f[1]=='PNG' OR $f[1]=='png'){ $im=ImageCreateFromPNG("uploads/$name") or die('nocreate'); $width=ImageSx($im); $height=ImageSy($im); if ($width>$height) { $new_w = $n_width; $new_h = floor( $height * ( $new_w / $width ) ); } else { $new_h = $n_width; $new_w = floor( $width * ( $new_h / $height ) ); } $newimage=imagecreatetruecolor($new_w,$new_h); imageCopyResized($newimage,$im,0,0,0,0,$new_w,$new_h,$width,$height); ImagePNG($newimage,$tsrc) or die('nocreate2'); } It doesnt echo nocreate or nocreate2... But no thumbrail is created. Why doesn't it create it, any problems with my code or syntax? I have E_ALL in my error reporting at the first line of the file but no errors (or notices) are echoed. BTW, (EDIT) My filetypes returns (IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM), (everything)
  13. I am a freakin idiot, self-solved I forgot to close the single quote when declaring VAR $file in the function file_put_contents.
  14. 1 <?PHP 2 3 $HOST1 = $_SERVER['HTTP_HOST']; 4 $HOST2 = $_SERVER['REMOTE_HOST']; 5 $HOST3 = $_SERVER['REMOTE_ADDR']; 6 $REFE1 = $_SERVER['HTTP_REFERER']; 7 $AGEN1 = $_SERVER['HTTP_USER_AGENT']; 8 9 $WRITE = gmdate('[j:i:s]').' User: "'.$HOST1.$HOST2.$HOST3; 10 $WRITE.= '" From: "'.$REFE1.'" With: "'.$AGEN1."\"\t\r\n"; 11 file_put_contents('uploads/~view.log,$WRITE,FILE_APPEND|LOCK_EX); 12 13 if (!empty($_GET['id'])) { Error on line 13 (UNEXPECTED T_STRING) I know its something about my $WRITE.= statement, but I cant figure out what. (BTW the square characters (represents tab) in the source, is just this sites bb messing with my code.)
  15. why wouldy ou need to change the data type?> Transfrer it to a non pear variable $var=$_SERVER['PEAR']['var'];
  16. myspace had 461 servers last time the informaiton was released (2 months ago)
  17. then this means an error ocured in pearn and php isnt setup to undesrtand what to do with it. uh.. I dont know what or how PEAR works, and I don't (WON'T) pretend to.
  18. IDK anything about what you are trying to do but I cna explain the error Your PHP is using PEAR *unapcked* and apparently PEAR_Error is not an array. For some reason you are trying to use it as an array, but frankly its not one. This can also happen if the script tries to use it as an array if an error happens in PEAR.
  19. <?php session_start(); if ($_SESSION['approved'] != 'yes') { header("Location: http://google.com"); } else { $filename = $_POST['filename']; header('Content-type: application/pdf'); header("Content-Disposition: attachment; filename=\"$filename\""); readfile('pdfs/$filename'); } ?> When using this, you HAVE TO do a COMPLETE path, relitives will give 0b or a fatal error. You could alter the code and do this though, same thing as above just a different way of doing it. <?php session_start(); if ($_SESSION['approved'] != 'yes') { header("Location: http://google.com"); } else { $filename = $_POST['filename']; header('Content-type: application/pdf'); $pdf = file_get_contents('C:/www/pdfs/'.$filename); echo $pdf; exit(); } ?>
  20. switch ($_SESSION['user_level']) { default:echo $text['adminperms']; exit; case 4: case 5: should be: switch ($_SESSION['user_level']) { default: echo $text['adminperms']; exit; break; case 4: /* do something */ break; case 5: /* do something */ break; } Every case has to break at the end.
  21. You need to upgrade your PHP version to 5 to be able to use this version of vbulletin. Please ask yrou web host becasue if HTTP_REFERER isnt set this means the host is running PHP 4, or 3.
  22. haha okey I was having problems earlier about auto thumbrail generation but ive fixed those, I HAVE MADE A IMAGESHACK, but MINE HAS WAAAAAAY LESS ADS AND DOESNT LAG I just need to add the "add a watermark" feature, and then I have run out of htings to put in it I have made the entire site 1 standalone PHP file (image.php) and it is 191 KBytes so far.
  23. I split them like that as a word wrapping so I could see it in my notepad without scolling, lol. and as far as the problem, I found it myself and clicked solved about 1 minute before your post Thanks for the help anyways, I came to the same conclusion more or less. If you want a free picture uploading and hosting place, http://24.86.150.207/image.php
  24. I have no clue why it messes up at line 134 but here is some code: [noparse] 124 move_uploaded_file($tmp_name, "uploads/$name"); 125 echo '<tr><td><center>File '.$name.' Uploaded!</center></td>'; 126 127 echo '<td>'."\nHTML: <input name='$name' value='<a href=\"http://"; 128 echo "24.86.150.207/image.php?a=view&id=$name\">"; 129 echo "View Picture: $name</a>' style='color: #F3F3F3;"; 130 echo " background-color: #1F1F1F;' size='25'></td>"; 131 132 echo '<td>'."\nBBCODE: <input name='$name' value='[url=\"htt"; 133 echo "p://24.86.150.207/image.php?a=view&id=$name\"]"; 134 echo "View Picture: $name[/url]' style='color: #F3F3F3;"; 135 echo " background-color: #1F1F1F;' size='25'></td></tr>"; [/noparse] Parse error: syntax error, unexpected '/', expecting T_STRING or T_VARIABLE or T_NUM_STRING in * on line 134 OH CRAP, I get it, it things that the [ is making it an array, ohsry solved by my own stupidity.
×
×
  • 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.