Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Everything posted by dreamwest

  1. If you know where the data is coming from, and the method used -then it's usually better to use $_POST or $_GET. Otherwise, dont use $_REQUEST another problem: if you pass things in url (including session id), http referer will be leaked out when user click on a out linking url. but if u hide it in <form action=post>, then this will not happend.
  2. it was strreplace interfering with the filename.....dammit
  3. Im trying to delete files with 0 size, im using unlink function but it doesnt work, do the files need to have a size greater than 0 to unlink? $fileName = "Video.mpg"; if (filesize($fileName) < 0){ unlink($fileName); echo $fileName." too small - deleted<br>"; } The echo part is printing out but the unlink doesnt do anything
  4. Yeah i wasnt sure if filesize() function was in bytes or kilobytes Thanks
  5. Options +FollowSymLinks RewriteEngine on RewriteRule ^$ index.php RewriteRule ^contact/ contact.php
  6. how can i check the filesize of a file, i need to make sure its above 0.5mb (500kb). Ive done this below but im not sure if its right $file = "file.mpg"; if (filesize($file) < 500kb){ unlink($file); }
  7. No I was checking my cpanel, apparently they do have it but my server has it switched off. Dammit...looks like ill be a script kiddie for some time
  8. Heres a list of directories i can access on my server through ftp public_html tmp public_ftp www bash_history bash_logout bash_profile bashrc contactemail ftp_quota lang last_login pearrc zshrc php mail bin ssh access_logs and a few other misc stuff Can i do something with this
  9. Do i need shell access, cause the server im using is shared. I have cpanel installed can i do it through this??
  10. Ok i have no idea how to run a command line on linux
  11. Ive searched for hours on how to actually run/execute a bash script on linux. Do i run it in my browser or do i need root access of the server and run it through something like putty
  12. If I get a freelancer to write a script for me and pay them, do I own the script exclusively
  13. How can i delete an entire directories contents but keep the directory itself
  14. Im trying to send a user back to a page he was viewing before he goes to login.php page page.php > login.php After login redirect back to page.php Ive done this code but i dont know if $_SERVER['HTTP_REFERER'] is the best way to track internal pages //after successful login redirect $come_from = $_SERVER['HTTP_REFERER']; if ($come_from == "site.com/login.php"){ $redirect_url = "http://site.com/index.php"; }else{ $redirect_url = "javascript:history.go(-2)"; } redirect($redirect_url)
  15. If you know where the data is coming from, and the method used -then it's usually better to use $_POST or $_GET. Otherwise, dont use $_REQUEST another problem: if you pass things in url (including session id), http referer will be leaked out when user click on a out linking url. but if u hide it in <form action=post>, then this will not happend.
  16. I worked it out. Thanks
  17. im trying to convert a flv file to mpg, but it doesnt seem to work, also this script has no errors, it wont echo out the final line. // Set our source file $srcFile = "/home/user/public_html/tmp_download/1233254702384805425.flv"; $destFile = "/home/user/public_html/tmp_download/test.mpg"; $ffmpegPath = "/usr/bin/ffmpeg"; $flvtool2Path = "/usr/bin/flvtool2"; // Create our FFMPEG-PHP class $ffmpegObj = new ffmpeg_movie($srcFile); // Save our needed variables $srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth()); $srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight()); $srcFPS = $ffmpegObj->getFrameRate(); $srcAB = intval($ffmpegObj->getAudioBitRate()/1000); $srcAR = $ffmpegObj->getAudioSampleRate(); // Call our convert using exec() exec($ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . " -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " | " . $flvtool2Path . " -U stdin " . $destFile); // Make multiples function function makeMultipleTwo ($value) { $sType = gettype($value/2); if($sType == "integer") { return $value; } else { return ($value-1); } } echo "Done..........";
  18. Can someone recommend a photo gallery thats free and thats lightweight. please not coppermine, its a 10MB stone Ohh and has a nice interface for users....not asking too much am i
  19. Hey it works! Thanks
  20. Nope doesnt work. I need to transfer it anyways to convert it to another format
  21. echos out HTTP/1.1 200 OK Date: Sat, 16 May 2009 11:52:43 GMT Server: Apache Last-Modified: Tue, 17 Feb 2009 11:00:33 GMT Accept-Ranges: bytes Content-Length: 1350504 Content-Type: text/plain The file is video
  22. I have no idea what im doing with this. No errors, file wont go into local folder. Im using version 5 of php Is there some error handler i can use to see if it transfered correctly
  23. Ive tried everything to get this to work.....i give up. Onwards to scriptlance.............
  24. dreamwest

    CURL

    I never done anything with curl before. Can someone give me an example of how i can get a file from remote server and store it in local server http://remote_site.com/files/video.mpg to http://local_site.com/temp/video.mpg $remote = "http://remote_site.com/files/video.mpg"; $local = "http://local_site.com/temp/video.mpg"; $ch = curl_init($remote); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); echo $output; Also can i use "http://" in the curl_int or do i have to remove slashes
×
×
  • 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.