Need help with a PHP script using the: .php?blahblahblah

Discussion in 'PHP' started by jasonwilks, Jan 15, 2007.

  1. #1
    Ok, I have this page on my site such as:

    http://www.site.com/dwnldguide.php

    I am selling a digital product on ebay, I then email them a link to download the product on my website. This is the link I give them:

    http://www.site.com/dwnldguide.php?ebayuser=accountname

    Where "accountname" is the ebay user's accountname that I manually put in there.

    The download page is pretty generic and simply just has a raw link to the downloadable product. All I want that PHP file (dwnldguide.php) to do is simply take that variable after the "?" and simply put it into the html page at a certain spot. Which the end result will look something like this:

    This product is registered to the "ebayuser=accountname" and any attempt at piracy will be monitored blah blah blah... Download the Product Here!.... thanks for the purchase... etc..

    This is ONLY a scare tactic, just to make them not distribute the link to anyone. I know this is not 100% secure, but Im just using this as an extra measure.

    So can anybody make me this simple php script? Thanks for any help!!
     
    jasonwilks, Jan 15, 2007 IP
  2. solidphp

    solidphp Peon

    Messages:
    46
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does this help?

    This product is registered to <?PHP echo $_GET['ebayuser']; ?>
    PHP:
     
    solidphp, Jan 15, 2007 IP
  3. angielski

    angielski Peon

    Messages:
    57
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    if register globals is off solidphp's solution is very good.

    If globals are on it simply enough to write <? echo $ebayuser; ?>

    But it's recommended to use the first solution
     
    angielski, Jan 15, 2007 IP
  4. vvoole

    vvoole Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    more secure:

    <?php 
    (isset($_GET['ebayuser']) && $_GET['ebayuser'] !== '') 
    ? echo trim(preg_replace("/[^\x20-\xFF]/",'', $_GET['ebayuser'])) 
    : echo 'undefined'; 
    ?>
    Code (markup):
     
    vvoole, Jan 15, 2007 IP