Please help me for this for loop, explode code...

Discussion in 'PHP' started by drshail23, Jun 12, 2009.

  1. #1
    I want a result of this script is
    $link=http://yahoo.com

    but in this if i use
    $file=$_GET['file'];
    then it is not working
    but if i use directly
    $file="yahoo1";

    then i working ok
    so what will be problem...



     
    $type=2;
     $tlink=1;
     $aurl="http://yahoo.com|clickhere|yahoo1";
    
    /*and get word is yahoo1*/
    
    
    if(isset($_GET['file']))
    {
    
                $file=$_GET['file'];
    
    
    
                if ($type==2) {
                 $file_url = explode("@", $aurl, $tlink);
    
                 for($i = 0; $i < count($file_url);  $i ++)
                      {
    
                     $fileurl[$i]= $file_url[$i];
                     $url = explode("|", $fileurl[$i]);
    
    
                     if($url[2]==$file){
                       $link=$url[0];}
                     }
                     }
    
    
    
    }
    echo" $link";
    PHP:
     
    drshail23, Jun 12, 2009 IP
  2. CreativeClans

    CreativeClans Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I have no idea what you're trying to do with this code, but if it doesn't work with $file=$_GET['file'] and it does work with $file="yahoo1" then I'd say that $_GET['file'] doesn't contain "yahoo1"
     
    CreativeClans, Jun 12, 2009 IP
  3. drshail23

    drshail23 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No $_GET['file'] contain yahoo1 i checked by $f=$_GET['file'] and then i make echo"$f"; and then it display yahoo1 .

    actually i m doing it for hide a my download link.
     
    drshail23, Jun 12, 2009 IP