PHP help

brillbrill BeginnerLink Clerk
does anyone know how 2 obtain IP address without having it display in normal page just in code such as:

<!--

hey there, 24.125.62.92,

please note that this site and its contents are protected by
copyright. you can refer to our legal statement here:

<http://indexcore.com/legal/>;

-->


I dont want the client 2 see the address on the php main page where graphics is just when he / she looks at the site via the script ( source ) this should be seen. can anyone help??

Comments

  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    To be honest, I don't understand what you are asking for.. maybe you could explain in more detail...
  • ForgeForge Senior Member The Royal RAM
    you could just have this:
    
    <!--
    
    <? $id = $_SERVER['REMOTE_ADDR']; echo "$ip";?>
    
    -->
    
    
    Can fat people Go skinny Dipping?
  • brillbrill Beginner Link Clerk
    The last code was kinda correct but it didnt display the IP address.


    What I want is a PHP script that displays an IP in the source code without displaying it in the website. ( so only in the source code and NOT on the page )

    Thanks guys,
    Brill
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    I'm still a little blurrrrrr...... what do you mean display in the source code and not on the page?

    But anyway, try this out:
    <?
    
    $ip=getenv("REMOTE_ADDR");
    echo "$ip";
    
    ?>
    
  • PythonPython Forum Leader The Royal RAM
    I think I understand....so you want to display the users ip if the visitors views teh source but it shouldnt actually display on the page. try this:
    <?php
    
    $ip=getenv("REMOTE_ADDR");
    echo "<!-- ";
    echo "$ip";
    echo " -->";
    
    ?>
    

    In theory that will enclose the ip tag within those tags so that it wont actually be displayed on the page...only in the source

    The Royal Ram

  • brillbrill Beginner Link Clerk
    Does anyone know how to make all this in php and not have them as HTML and PHP without display in main site just in source:?

    Current code in php:

    <!--


    Hello their, <?php include('servlet/ip.php'); ?>,

    please note that this site and its contents are protected by
    copyright. you can refer to our legal statement here:

    http://www.indexcore.com/legal


    -->

    Would be great to see:
    I dont know how to make breaks in php and url's if I did then it would be easy,

    does anyone know how to make a <br> in php and a <a href= in php?

    <!--


    Hello their, 24.155.62.62,

    please note that this site and its contents are protected by
    copyright. you can refer to our legal statement here:

    http://www.indexcore.com/legal


    -->
  • PythonPython Forum Leader The Royal RAM
    <?php
    echo "<!--
    
    
    Hello there, ";
    include('servlet/ip.php');
    echo "
    
    please note that this site and its contents are protected by
    copyright. you can refer to our legal statement here:
    
    [url]http://www.indexcore.com/legal[/url]
    
    
    -->";
    ?>
    

    See if that works...Because your not actually using a break (<br>) I dont think it needs to be included. See if the above works.....
    Im still learning PHP so Im not amazing with it....yet, hehe

    The Royal Ram

  • brillbrill Beginner Link Clerk
    I got the script sorted out thanks! guys!! Saved my butt again!

    Does anyone know of any good CMS systems?
  • PythonPython Forum Leader The Royal RAM
    there are of course the obvious ones such as phpnuke but i wouldnt go with them

    The Royal Ram

Sign In or Register to comment.