Web Analytics Made Easy -
StatCounter Emergency! - Visiter IP Script Gone - CodingForum

Announcement

Collapse
No announcement yet.

Emergency! - Visiter IP Script Gone

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolved Emergency! - Visiter IP Script Gone

    Hi guys, this is urgent, my whole site depends on it really!

    I have been using a script that was here
    PHP Code:
    http://scripts.hashemian.com/js/visitorIPHOST.js.php 



    BUT NOW ITS GONE!!!





    Some of you may be aware of it.

    What it was, was a script to read ip address and i used it alot do decide what info was shown to who on my site. I know it was stupid to depend on an outside script but i have learned from my mistake.

    The problem is, WHAT DO I DO NOW????

    An example of my code is :

    Code:
    <script language="JavaScript">
    VIH_ForeColor = "navy";
    VIH_FontPix = "16";
    VIH_DisplayFormat = "%%IP%%";
    VIH_DisplayOnPage = "no";
      </script>
            <script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
            
            <script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
          <script>
    if (VIH_HostIP == "111.111.111" || VIH_HostIP ==

    well you get the point


    Please help me as my site is gone to sh1t now and wont even load for most....


    Thanks in advance
    Last edited by embeebutterly; Aug 28, 2011, 08:37 PM.

  • #2
    Originally posted by embeebutterly View Post

    BUT NOW ITS GONE!!!


    The problem is, WHAT DO I DO NOW????
    Restore it from your backups?

    Comment


    • #3
      It was an external script..... i was using it from an external site

      Comment


      • #4
        His site is *NOT* hashemian.com. It's a foreign-to-him site, that was, essentially, giving him a web service that told him the IP address of a visitor.

        ***********

        embee: It's really a pretty simple-minded task to create a PHP or ASP or JSP server-side script/code that will do this for you.

        I don't know what all those variables in your code controlled in that external script:
        Code:
        VIH_ForeColor = "navy";
        VIH_FontPix = "16";
        VIH_DisplayFormat = "%%IP%%";
        VIH_DisplayOnPage = "no";
        But I'm *guessing* that the DisplayOnPage = "no" means that all you really wanted the script to do was plunk the IP address into the JavaScript variable VIM_HostIP

        If you have ASP capabilities on your site, then you could do that thus:

        Create a file named getIPAddress.asp that has just this code in it:
        Code:
        var VIM_HostIP = "<%=Request.ServerVariables("REMOTE_ADDR")%>";
        and then in your HTML page you just do
        Code:
        <script type="text/javascript" src="getIPAddress.asp"></script>
        I'm not a PHP person, but I *THINK* the PHP equivalent would to create a file named getIPAddress.php that has just this code:
        Code:
        <?php
        echo 'var VIM_HostIP = "' . $_SERVER["REMOTE_ADDR"] . '";';
        ?>
        and then use
        Code:
        <script type="text/javascript" src="getIPAddress.php"></script>
        in your HTML.

        But, of course, you would need to have a host that offers you either ASP or PHP to make one of those work.
        Be yourself. No one else is as qualified.

        Comment


        • #5
          thank you a million times over Sir Old Pedant! dthis is perfect, simple and is about to restore my site to normal working order, plus, i no longer have to rely on an outside script. Thank you very much!

          Comment


          • #6
            Don't thank me until it works!
            Be yourself. No one else is as qualified.

            Comment


            • #7
              Originally posted by embeebutterly View Post
              It was an external script..... i was using it from an external site
              oh ok, I thought you were saying you got the actual code from an eternal site, not actually linking to it which is a dangerous thing to do as you have found out.

              Comment


              • #8
                Originally posted by Old Pedant View Post
                Don't thank me until it works!

                I tested it mate it works! Your a lightsaber!

                _______________________________________________

                For anyone reading this (and for search engine)

                What i use to get the users IP address is a php file with the following:

                PHP Code:
                <?php
                echo 'var VIM_HostIP = "' $_SERVER["REMOTE_ADDR"] . '";';
                ?>
                Thank you once again Old Pedant

                Comment


                • #9
                  Good. Was doing minor guessing on the PHP code, but the docs seemed clear enough. And the analogy to ASP is pretty easy to see.
                  Be yourself. No one else is as qualified.

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎