1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Can you call a php script in an image?

Discussion in 'PHP' started by NewTier, Nov 25, 2007.

  1. #1
    [​IMG]
    <?php
    $img_number = imagecreate(275,25);
    $backcolor = imagecolorallocate($img_number,102,102,153);
    $textcolor = imagecolorallocate($img_number,255,255,255);

    imagefill($img_number,0,0,$backcolor);
    $number = " Your IP is $_SERVER[REMOTE_ADDR]";

    Imagestring($img_number,10,5,5,$number,$textcolor);

    header("Content-type: image/jpeg");
    imagejpeg($img_number);
    ?>

    Here is the script.
     
    NewTier, Nov 25, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Are you asking something or what is the point of this?
     
    nico_swd, Nov 26, 2007 IP
  3. -NB-

    -NB- Peon

    Messages:
    153
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Was ready to post an answer... but it seems like you already know :)
     
    -NB-, Nov 26, 2007 IP
  4. Panjabi

    Panjabi Peon

    Messages:
    362
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    How can I do this by calling queries from MySQL?
     
    Panjabi, Nov 26, 2007 IP
  5. NewTier

    NewTier Notable Member

    Messages:
    2,201
    Likes Received:
    196
    Best Answers:
    0
    Trophy Points:
    250
    #5
    Sorry! :) I meant, can you like, capture referrers using an image? I tried, but it doesn't work...
     
    NewTier, Dec 1, 2007 IP
  6. hogan_h

    hogan_h Peon

    Messages:
    199
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Actually, your script is working fine for me (It shows IP Address when calling it.)
    Or did you mean something else?
     
    hogan_h, Dec 1, 2007 IP
  7. NewTier

    NewTier Notable Member

    Messages:
    2,201
    Likes Received:
    196
    Best Answers:
    0
    Trophy Points:
    250
    #7
    Can you make a script that shows your referral address?

    thanks hogan_h. :)
     
    NewTier, Dec 1, 2007 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    Replace:
    
    " Your IP is $_SERVER[REMOTE_ADDR]";
    
    PHP:
    With
    
    "You come from: {$_SERVER['HTTP_REFERER']}";
    
    PHP:
     
    nico_swd, Dec 1, 2007 IP