Results 1 to 3 of 3

Thread: ]need help urgent][$GET, If, else]

  1. #1
    Join Date
    May 2007
    Posts
    23
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Post ]need help urgent][$GET, If, else]

    Code:
    <?php
    
    $v = $_GET["v"];
    
    
    
    $url = "http://www.megavideo.com/?$v="."$v";
    
    
    $soubor = file_get_contents("$url");
    
    
    preg_match("/<embed src=\"http:\/\/www.megavideo.com\/v\/$v(.*)\" type=\"application\/x-shockwave-flash/i", $soubor, $tag_contents);
    $obrazek = $tag_contents[1];
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> preview player </TITLE>
    </HEAD>
    
    <BODY bgcolor="white" style="margin:0;">
    <TABLE cellpadding="0" cellspacing="0" width="100%" height="100%">
    <TR>
    	<TD valign="middle" align="center">
    <object width="100%" height="100%" data="http://wwwstatic.megavideo.com/mv_player.swf?image=http://img1.megavideo.com/<?php echo $obrazek; ?>.jpg&userid=cookie&v=<?php echo $v; ?>+++" id="video" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true"><param name="wmode" value="transparent"><param name="allowscriptaccess" value="never"><param name="allowNetworking" value="internal"><param name="movie" value="http://wwwstatic.megavideo.com/mv_player.swf?image=http://img1.megavideo.com/<?php echo $obrazek; ?>.jpg&userid=cookie&v=<?php echo $v; ?>+++"></object>
    	</TD>
    
    </TR>
    </TABLE>
    
    </BODY>
    </HTML>
    above is this script of mv, what i am trying to do is as you know mv has both query string like both ?v= ?d=

    i need some help, as you can see right now i already have ?v=4KY6SVFL working fine but i want to add some thing like when ever i use ?v= or ?d=, as soon as i excute one of this , i want to do this in php
    Code:
    <object width="100%" height="100%" data="http://wwwstatic.megavideo.com/mv_player.swf?image=http://img1.megavideo.com/<?php echo $obrazek; ?>.jpg&userid=cookie&v=<?php echo $v; ?>+++" id="video" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true"><param name="wmode" value="transparent"><param name="allowscriptaccess" value="never"><param name="allowNetworking" value="internal"><param name="movie" value="http://wwwstatic.megavideo.com/mv_player.swf?image=http://img1.megavideo.com/<?php echo $obrazek; ?>.jpg&userid=cookie&v=<?php echo $v; ?>+++"></object>
    i want this to change in php look at the object
    userid=cookie&v=<?php echo $v; ?>
    so when i excute ?d= i want that v to change to d

    right now i am using v as default so can some help out their help how do i do this in php i did try yo add if end if but it doesn't help at all. some 1 please help me i want to for if $_GET[v] else $_GET[d] i did try this but doesnt work i need help.

  2. #2
    Join Date
    May 2007
    Posts
    23
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Post

    if any 1 knows how to do it in any way plz help me i dont care how u do it just need help!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It's really hard to understand what you wrote. Breaking apart your sentences will help.

    Based on what I think you're looking for, it isn't that difficult.

    PHP Code:
    <?php
    if (isset($_GET['d'])) { $v $_GET['d']; } //set $v to the SECONDARY value 
    if (isset($_GET['v'])) { $v $_GET['v']; } //set $v to primary value
    //now $v is not set if neither was sent, or
    //d if only d was sent, or
    //v if only v or both v and d were sent
    //.......
    //if you want to avoid errors if no value is sent, add this at the top, before the ifs above:
    $v ''//defaults it to an empty string
    //.......
    echo $v;
    ?>
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •