#1

  1. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Red face how to add php tag in online app site?


    I am working on my client site. I need to add user IP Address code to footer. It is not working. How to make it work?
    PHP Code:
    <div class="footer">
    <?php $ip=$_SERVER['REMOTE_ADDR'];
    echo 
    "<b>IP Address = $ip</b>";  ?>
    </div>
    I am trying to add this to my client online builder site : Free Insurance NC
    Getting Trouble
  2. #2
  3. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,214
    Rep Power
    1469
    The first step is to start a new thread.

    After that, you're not saying what you mean by not working. There are several ways to get an IP address depending on the address type. Here's what I use:
    PHP Code:
    function getipaddress(){

        if (!empty(
    $_SERVER['HTTP_CLIENT_IP'])) {

            
    $ip $_SERVER['HTTP_CLIENT_IP'];

        } elseif (!empty(
    $_SERVER['HTTP_X_FORWARDED_FOR'])) {

            
    $ip $_SERVER['HTTP_X_FORWARDED_FOR'];

        } else {

            
    $ip $_SERVER['REMOTE_ADDR'];
        }
        return 
    $ip;

    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  4. #3
  5. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,214
    Rep Power
    1469
    Split to new thread.
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  6. #4

  7. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1
    wow dear it is great function thanks for it. i use it.
  8. #5
  9. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,214
    Rep Power
    1469
    No problem. I'm glad that worked for you.
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  10. #6
  11. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    7
    Rep Power
    0
    By $_SERVER['REMOTE_ADDR'] function,you can find the ip address.
  12. #7
  13. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,214
    Rep Power
    1469
    Originally Posted by iamsuraj1991
    By $_SERVER['REMOTE_ADDR'] function,you can find the ip address.
    Did you even read the thread? That's what the OP used in his first post that DIDN'T work!
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  14. #8
  15. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Originally Posted by Nilpo
    Did you even read the thread? That's what the OP used in his first post that DIDN'T work!
    Our new pal suraj has been posting useless things in old threads for the last day or so. He's been warned once, and now twice.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  16. #9
  17. Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2004
    Location
    New Springfield, OH
    Posts
    1,214
    Rep Power
    1469
    Originally Posted by ManiacDan
    Our new pal suraj has been posting useless things in old threads for the last day or so. He's been warned once, and now twice.
    Ya, I went and read his warnings after I posted back. I was going to do the same thing.
    Don't like me? Click it.

    Scripting problems? Windows questions? Ask the Windows Guru!

    Stay up to date with all of my latest content. Follow me on Twitter!

    Help us help you! Post your exact error message with these easy tips!
  18. #10

  19. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1
    thanks for your great help friends. I learned many things from you.
    Respect is earned, honesty is appreciated, love is gained and loyalty is returned. Message by QWC
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2014
    Posts
    1
    Rep Power
    0
    $types = array();
    $rs = $db->select("select tags from fonts");
    if($db->numRows()>0)
    {
    while($ftypes = mysql_fetch_array($rs))
    {
    $types = array_merge($types, explode(" ", $ftypes[0]));
    }

    $types = array_unique_compact($types);

    for($i=0;$i<count($types);$i++)
    {
    echo '<a href="/fonts?t='.$types[$i].'">'. $types[$i].'</a>';
    if($i<count($types)-1) echo ",\n";
    }
    }

    Cqlsys offers six week industrial coaching to B.tech and MCA Students in the PHP Technology six week industrial training in chandigarh. The most objective of our PHP Industrial coaching is to supply the IT graduates with practical exposure to PHP.We have designed the PHP coaching course while keeping in mind the current trade requirement.


    For more information please visit six week industrial training in chandigarh

IMN logo majestic logo threadwatch logo seochat tools logo