+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Some PHP Help fora dynamic sig

  1. #1
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Some PHP Help fora dynamic sig

    Ok so im trying to create a dynamic sig ihn PHP to check the server Ports and stuff but when I run it I get nothing...its on my local pc right now.

    I have the following code to check for the port to be up or down:

    PHP Code:
    ini_set('display_errors','0'); 

             
    $fp fsockopen(64.92.165.7480,$errno,$errstr4);
             if (!
    $fp){
                 
    $data $background,10,0,91,63,$red,"arial.ttf","Down";
             } else {
                 
    $data $background,10,0,91,63,$green,"arial.ttf","UP";
             }
             return 
    $data;
    fclose($fp);

    imagettftext($data); 
    Do you see anything wrong with this...as if I delete this it works fine with the normal stuff.
    Last edited by Brandon; 09-10-2006 at 08:32 PM.
    Thanks,
    Brandon Long

  2. #2
    Chris S's Avatar
    Chris S is offline Retired Chris S is an unknown quantity at this point
    Join Date
    Mar 2005
    Posts
    1,036

    Re: Some PHP Help fora dynamic sig

    so no errors are being given?

    I would love to change the world, but they won't give me the source code

  3. #3
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Some PHP Help fora dynamic sig

    Either post or PM me the rest of the script and I'll check it out for you. I'd need to see the rest to fix the lines that put the "status text" on the image.
    Last edited by Bryon; 09-10-2006 at 09:03 PM.

  4. #4
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: Some PHP Help fora dynamic sig

    Here is all of it

    PHP Code:
    <?php
    header
    ("Content-type: image/png");
    $background imagecreatefrompng("back.png");
    $green imagecolorallocate($background6513457);
    $red imagecolorallocate($background1712020);

    // Server IP
    imagettftext($background,10,0,92,63,$green,"arial.ttf","64.92.165.74");
    //Server IP


    ini_set('display_errors','0'); 

             
    $fp fsockopen(64.92.165.7480,$errno,$errstr4);
             if (!
    $fp){
                 
    $data $background,10,0,91,63,$red,"arial.ttf","Down";
             } else {
                 
    $data $background,10,0,91,63,$green,"arial.ttf","UP";
                
             }
             return 
    $data;
     
    fclose($fp);

    imagettftext($data);


    imagepng($background);
    imagedestroy($background);

    ?>
    The like DNS: and everything like that is there on the image built in....i just have to copy that status code and change the positon and port i think if I can get that to work.
    Last edited by Brandon; 09-10-2006 at 09:14 PM.
    Thanks,
    Brandon Long

  5. #5
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Some PHP Help fora dynamic sig

    Where is the "back.png" image?

  6. #6
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: Some PHP Help fora dynamic sig

    Quote Originally Posted by Bryon
    Where is the "back.png" image?
    Ill PM it to you....hold on i dnt want that going out.
    Thanks,
    Brandon Long

  7. #7
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Some PHP Help fora dynamic sig

    PHP Code:
    <?php
       ini_set
    ('display_errors','0'); 

       
    header("Content-type: image/png");
       
    $background imagecreatefrompng('back.png');
       
    $green imagecolorallocate($background6513457);
       
    $red imagecolorallocate($background1712020);

       
    imagettftext($background1209565$green'arial.ttf''64.92.165.74');

       
    // HTTP Only
       
    $fp = @fsockopen('64.92.165.74'80$errno$errstr4);
       if (!
    $fp){
          
    $data 'Down';
          
    $color $red;
       } else {
          
    $data 'Online';
          
    $color $green;
       }
       @
    fclose($fp);
       
    imagettftext($background12011983$color'arial.ttf'$data);


       
    imagepng($background);
       
    imagedestroy($background);

    ?>
    Should give you a rough idea of how it should beeee. You may have to adjust the locations of the text.
    Last edited by Bryon; 09-11-2006 at 07:56 PM.

  8. #8
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: Some PHP Help fora dynamic sig

    Quote Originally Posted by Bryon
    PHP Code:
    <?php
       ini_set
    ('display_errors','0'); 

       
    header("Content-type: image/png");
       
    $background imagecreatefrompng('back.png');
       
    $green imagecolorallocate($background6513457);
       
    $red imagecolorallocate($background1712020);

       
    imagettftext($background1209565$green'arial.ttf''64.92.165.74');

       
    // HTTP Only
       
    $fp = @fsockopen('64.92.165.74'80$errno$errstr4);
       if (!
    $fp){
          
    $data 'Down';
          
    $color $red;
       } else {
          
    $data 'Online';
          
    $color $green;
       }
       @
    fclose($fp);
       
    imagettftext($background12011983$color'arial.ttf'$data);


       
    imagepng($background);
       
    imagedestroy($background);

    ?>
    Should give you a rough idea of how it should beeee. You may have to adjust the locations of the text.
    Thanks bro REP +..let me try it...
    Thanks,
    Brandon Long

  9. #9
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: Some PHP Help for dynamic sig

    Ok so here is a 15 min production of my first dynamic sig...the best is yet to come:



    As I beleve ppl should beable to view it...here is the source code:
    http://sigs.computer-forums.zealoush...stats.myimages

    and that image can be located here: http://i57.photobucket.com/albums/g2...4life/back.png
    Last edited by Brandon; 09-11-2006 at 08:47 PM.
    Thanks,
    Brandon Long

  10. #10
    TarinC is offline x10 Lieutenant TarinC is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Toronto, Canada
    Posts
    349

    Re: Some PHP Help fora dynamic sig

    Here are some ports:
    21 FTP server
    25 Exim - SMTP
    53 Bind nameserver
    80 Apache webserver
    110 POP mail server
    143 IMAP mail server
    443 Secure Apache webserver
    465 Secure SMTP
    993 Secure IMAP
    2082 cPanel
    2083 Secure cPanel (https)
    2086 WHM
    2087 Secure WHM (https)
    2095 Webmail
    2096 Secure webmail (https)
    3306 MySQL
    8888 Secure shell - SSHD

    You should use php to write the name(http status and stuff).
    Last edited by TarinC; 09-11-2006 at 11:04 PM.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  2. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  3. [PHP] PHP For Starters
    By Complex in forum Tutorials
    Replies: 24
    Last Post: 06-14-2008, 11:40 PM
  4. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  5. Dynamic Drive and PHP
    By jensen in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 04-17-2006, 03:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers