hi guys,

I got it to loop up to the wget, and then it stoped... can you please help:

Thanks for all your help guys!

This is what I have per your request:

PHP Code:
if (!([email protected]("feed.xml", "r"))) die ("Couldn't open XML.");
$usercount=0;
$userdata=array();
$state='';
$flag=0;

function startElementHandler ($parser,$name,$attrib){
global $usercount;
global $userdata;
global $state;
global $flag;

switch ($name) {
case $name=="ITEM" : {
$flag=1;
break;
}
case $name=="ENCLOSURE" : {
if($flag==1)
   $userdata[$usercount]["encl_url"] = $attrib["URL"];
break;
}

default : {$state=$name;break;}
}
}

function endElementHandler ($parser,$name){
global $usercount;
global $userdata;
global $state;
global $flag;
$state='';
if($name=="ITEM") {$usercount++;$flag=0;}
}

function characterDataHandler ($parser, $data) {
global $usercount;
global $userdata;
global $state;
global $flag;

if (!$state) {return;}
if($flag==1)
{
 if ($state=="TITLE") { $userdata[$usercount]["item_tit"] = $data;}
 if ($state=="DESCRIPTION") { $userdata[$usercount]["item_desc"] = $data;}
 if ($state=="PUBDATE") { $userdata[$usercount]["item_pubdate"] = $data;}
}
}

if (!($xml_parser = xml_parser_create())) die("Couldn't create parser.");
xml_set_element_handler( $xml_parser, "startElementHandler", "endElementHandler");
xml_set_character_data_handler( $xml_parser, "characterDataHandler");

while( $data = fread($fp, 4096))
{
 // $trans = array("&" => "&amp;", "<" => "&lt;", ">" => "&gt;");

 // $data = strtr($data, $trans);

 $data = str_replace("&","&amp;",$data);
 //$data = str_replace("<","&lt;",$data);
 //$data = str_replace(">","&gt;",$data);
 //$data = str_replace("\'","&apos;",$data);
 //$data = str_replace("\"","&quot;",$data);

 if(!xml_parse($xml_parser, $data, feof($fp)))
 {
  break;
 }
}

xml_parser_free($xml_parser);

?>
<html>
<head><title>PHP - XML parser</title>
</head>
<body>
<?php
for ($i=0;$i<$usercount$i++)
{
 print 
"<br>";
 print 
$userdata[$i]["item_tit"]."<br>";
// $vidtitle = $userdata[$i]["item_tit"];
 
print $userdata[$i]["item_desc"]."<br>";
// $viddesc = $userdata[$i]["item_desc"];
// print $userdata[$i]["item_pubdate"]."<br>";
 
$viddate $userdata[$i]["item_pubdate"];

 
$temp1 $userdata[$i]["encl_url"];

 
  
// echo "The file $filename exists";

  
$temp2 str_replace(".mp4",".flv",$temp1);



  print 
$temp2."<br>";
  
$file_name = (basename ($temp2,".flv"));
  print 
$file_name;
 
 if(isset(
$temp2))
                    {
  
exec("wget -P/home/site/public_html/testxml $temp2");
  
   
$sql="insert into video set
                        UID=1,
                        title='
{$userdata["$i"]["item_tit"]}',
                        description='
{$userdata["$i"]["item_desc"]}',
                        keyword='
{$userdata["$i"]["item_tit"]}',
                        channel='0|1|0',
                        addtime='"
.time()."',
                        adddate='"
.date("Y-m-d")."',
                        vkey='"
.mt_rand()."',
                        type='public'"
;
                        
                
$conn->execute($sql);
                
$vid=mysql_insert_id();
                
$vdoname=$file_name.".".flv;

                        
$ff "/home/site/public_html/testxml/".$vdoname;
                        
$mov = new ffmpeg_movie($ff);
                            
video_to_frame($ff,$vid,&$mov,$listch[0]);
                            
$duration=$mov->getDuration();
                            
exec("/usr/bin/ffmpeg -i $ff -s 468x350 -b 600k -acodec mp3 -ab 32 -ar 22050 -f flv $config[flvdodir]/".$vid.".flv > /dev/null 2>&1 &");


                
$key=substr(md5($vid),11,20);
                
$sql="update video set
                        vdoname='
$vdoname',
                        flvdoname='"
.$vid.".flv',
                        duration='
$duration',
                        vkey='
$key' WHERE VID=$vid";
                
$conn->execute($sql);
        
 }
 else
 {
  echo 
"The file $temp1 does not exist<br>";
 }

}

?>
What I'm trying to do is full the url from a xml, rename the extension, and encode it to a path...

for some reason, it only does it once, and not twice or 3 times as I do have more than one links...

Please help...