Jump to content

cgimusic

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cgimusic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Works great. I don't see why my code with salathe's modification didn't work but thanks for fixing the problem. Final code: <?php foreach($episodes as $episode){ $temp289[]=$episode["airdate"]; }; array_multisort($temp289,SORT_ASC,$episodes); ?>
  2. I'm still not getting the right result. The first four results are: 2008-09-23 2008-09-30 2008-10-14 2008-09-16
  3. Hi guys. I have a list of TV show episodes and air dates in the form of $episodes[x]["airdate"]=yyyy-mm-dd but I don't know how to sort the episodes by their air dates. Here is the code I attempted to use to sort by year but it doesn't seem to work. The episode order appears to be basically random. <?php function recordcompare($record1,$record2){ return strnatcmp($record1,$record2); }; usort($episodes,"recordcompare"); ?>
  4. Thank you. I completely forgot that == is the comparison operator. I said it would be a stupid mistake.
  5. I have a really weird problem with some code I wrote: <?php echo file_exists("includes/".$_GET["page"].".inc.php"); if($_GET["page"]=""||!isset($_GET["page"])){ include "includes/main.inc.php"; } elseif(file_exists("includes/".$_GET["page"].".inc.php")){ include "includes/".$_GET["page"].".inc.php"; }; ?> The elseif part does not execute despite the fact that echo file_exists("includes/".$_GET["page"].".inc.php"); returns "1" w/o quotes and the file definitely does exist. I believe it is the $_GET part that is causing the problem because when I do elseif(!file_exists("includes/".$_GET["page"].".inc.php")){ I get the error "Warning: include(includes/.inc.php) [function.include]: failed to open stream: No such file or directory" It is probably just a really stupid mistake but I can't figure out is wrong. I would much appreciate any enlightenment you may have to offer.
  6. Try 000webhost. They claim to support the PHP mailing functions.
  7. There is no reason why you shouldn't. It is a useful feature.
  8. I am using PHP to generate a random and unique 5 character, numerical ID. The code I am using is not very efficient as the more ID's are generated the more chance there is of getting more repeat ID's before a unique one is generated so I was wondering if there is a better way. The "Id_exists" function checks a MySQL database if that helps. <?php $Id=rand(10000,99999); while(Id_exists($Id)){ $Id=rand(10000,99999); }; ?>
  9. It probably expired. Here is my script currently. <?php error_reporting(E_ALL); $file = file("http://www.youtube.com/watch?v=".$_GET["id"]); for ($count=0;$count<count($file);$count+=1) { if (preg_match('/.*?(var swfArgs)/',$file[$count])) { $linestring=$file[$count]; }; }; $url=explode("\"",$linestring); $count=1; while(isset($url[$count])&&!$url[$count]==""){ $vars[$url[$count]]=$url[$count+2]; $count=$count+4; }; echo "http://www.youtube.com/get_video?video_id=".$_GET["id"]."&t=".$vars["t"]; //$ch=curl_init("http://www.youtube.com/get_video?video_id=".$_GET["id"]."&t=".$vars["t"]); //curl_exec($ch); //curl_close($ch); ?>
  10. I don't know how long it is valid for but here you go: http://www.youtube.com/get_video?video_id=-xlAyxtEMFk&t=vjVQa1PpcFNIY3tmSkt3E8BtQq2ELdBONL-JtVLCY30%3D
  11. I want to stream a YouTube video through my server to a flash FLV player. What is wrong with this code? I just get a blank page. $ch=curl_init("http://www.youtube.com/get_video?video_id=".$_GET["id"]."&t=".$vars["t"]); curl_exec($ch); curl_close($ch);
  12. I have an on another server. http://www.example.com/video.flv. I want to parse it streight to the user. Should I use curl or readfile. Any help is greatly appreciated.
×
×
  • 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.