[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <4319a858$1_4@mk-nntp-2.news.uk.tiscali.com> [ref] => [htmlstate] => on_nl2br [postusername] => WeeWillyTonka [ip] => WeeWillyTonka@h [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> : : : It seems to be when I format the link as is ok if formated like this . So now all I ave to do is work out how to link all the sub folders to it . WW [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <4319befd_2@mk-nntp-2.news.uk.tiscali.com> [ref] => <4319a858$1_4@mk-nntp-2.news.uk.tiscali.com> [htmlstate] => on_nl2br [postusername] => WeeWillyTonka [ip] => WeeWillyTonka@h [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> YOUR SERVER (example.php) /|\ | | (index.php) Doing: include "http://your_server.com/folder/index.php"; performs an HTTP request; the location just so happens to be the same server. Therefore, the PHP in index.php is parsed in an entirely separate session, i.e.: HTTP HTTP USER <---------> YOUR SERVER <---------> YOUR SERVER (example.php) (index.php) The IP address is obtained from $_SERVER['REMOTE_HOST'], which gets the details from the corresponding HTTP request. So when index.php uses $_SERVER['REMOTE_HOST'], ite gets it from the *second* HTTP session, which was requested by your server, not the original user. -- Oli [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => <4319a858$1_4@mk-nntp-2.news.uk.tiscali.com> <4319befd_2@mk-nntp-2.news.uk.tiscali.com> [htmlstate] => on_nl2br [postusername] => Oli [ip] => catch@olifilth. [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> YOUR SERVER : (example.php) : /|\ : | : | : (index.php) : : Doing: : : include "http://your_server.com/folder/index.php"; : : performs an HTTP request; the location just so happens to be the same : server. Therefore, the PHP in index.php is parsed in an entirely : separate session, i.e.: : : : HTTP HTTP : USER <---------> YOUR SERVER <---------> YOUR SERVER : (example.php) (index.php) : : : The IP address is obtained from $_SERVER['REMOTE_HOST'], which gets the : details from the corresponding HTTP request. So when index.php uses : $_SERVER['REMOTE_HOST'], ite gets it from the *second* HTTP session, : which was requested by your server, not the original user. : : : -- : Oli Im sure thats what I said :)) WW [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <4319e5ed$1_1@mk-nntp-2.news.uk.tiscali.com> [ref] => <4319a858$1_4@mk-nntp-2.news.uk.tiscali.com> <4319befd_2@mk-nntp-2.news.uk.tiscali.com> [htmlstate] => on_nl2br [postusername] => WeeWillyTonka [ip] => WeeWillyTonka@h [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> bit of a problem ip & include - PHP Development

bit of a problem ip & include - PHP Development

IP2MORE :: IP2COUNTRY V2 I'm trying to use the above it is working fine apart from if I use <? include(" ") ?> to ad it to any page's it shows the web servers IP address and not the visitor. I know this is because the web page is requesting the include file,but what I can't seem to do is mod the script to work round this if indeed it is possible. Can anyone help me with this or is it not possible? Thanks WW <?php require_once('i2m.class.php'); if(isset($_GET['ip']) && !empty($_GET['ip'])){ $i2m = new ip2more($_GET['ip']); } else { $i2m = new ...

  1. #1

    Default bit of a problem ip & include

    IP2MORE :: IP2COUNTRY V2

    I'm trying to use the above it is working fine apart from if I use <?
    include(" ") ?> to ad it to any page's it shows the web servers IP address
    and not the visitor.

    I know this is because the web page is requesting the include file,but what
    I can't seem to do is mod the script to work round this if indeed it is
    possible.

    Can anyone help me with this or is it not possible?

    Thanks

    WW

    <?php


    require_once('i2m.class.php');
    if(isset($_GET['ip']) && !empty($_GET['ip'])){
    $i2m = new ip2more($_GET['ip']);
    } else {
    $i2m = new ip2more;
    }

    #$i2m->flags_dir = './flags/';
    #$i2m->flags_dir = 'http://domain-name/flags/';
    ?>

    <?php if(isset($_GET['do']) && $_GET['do']=='src'){?>

    <?php } else { ?>
    <script language="javascript">
    <!--
    function is_valid_ip(ip_address)
    {
    var allowed = '.0123456789';
    var dots = 0;
    var is_valid = true;
    if(ip_address.length < 8 || ip_address.length > 15){
    is_valid = false;
    } else {
    for(i=0,l=ip_address.length;i<l;i++){
    t = ip_address.substr(i,1);
    if(t == '.') dots++;
    if(allowed.indexOf(t) == -1){
    is_valid = false;
    break;
    }
    }
    }
    if(dots != 3) is_valid = false;
    if(!is_valid) alert('Invalid IP Address');
    return is_valid;
    }
    -->
    </script>


    WeeWillyTonka Guest

  2. #2

    Default Re: bit of a problem ip & include


    "WeeWillyTonka" <com> wrote in message
    news:4319a858$news.uk.tiscali.com...
    : IP2MORE :: IP2COUNTRY V2
    :
    : I'm trying to use the above it is working fine apart from if I use <?
    : include(" ") ?> to ad it to any page's it shows the web servers IP
    address
    : and not the visitor.
    :
    : I know this is because the web page is requesting the include file,but
    what
    : I can't seem to do is mod the script to work round this if indeed it is
    : possible.
    :
    : Can anyone help me with this or is it not possible?
    :
    : Thanks
    :
    : WW
    :
    : <?php
    :
    :
    : require_once('i2m.class.php');
    : if(isset($_GET['ip']) && !empty($_GET['ip'])){
    : $i2m = new ip2more($_GET['ip']);
    : } else {
    : $i2m = new ip2more;
    : }
    :
    : #$i2m->flags_dir = './flags/';
    : #$i2m->flags_dir = 'http://domain-name/flags/';
    : ?>
    :
    : <?php if(isset($_GET['do']) && $_GET['do']=='src'){?>
    :
    : <?php } else { ?>
    : <script language="javascript">
    : <!--
    : function is_valid_ip(ip_address)
    : {
    : var allowed = '.0123456789';
    : var dots = 0;
    : var is_valid = true;
    : if(ip_address.length < 8 || ip_address.length > 15){
    : is_valid = false;
    : } else {
    : for(i=0,l=ip_address.length;i<l;i++){
    : t = ip_address.substr(i,1);
    : if(t == '.') dots++;
    : if(allowed.indexOf(t) == -1){
    : is_valid = false;
    : break;
    : }
    : }
    : }
    : if(dots != 3) is_valid = false;
    : if(!is_valid) alert('Invalid IP Address');
    : return is_valid;
    : }
    : -->
    : </script>
    :
    :
    It seems to be when I format the link as <?
    include("http://somesite.ru/ipaddress/index.php") ?>
    is ok if formated like this <? include("ipaddress/index.php") ?> .

    So now all I ave to do is work out how to link all the sub folders to it .

    WW


    WeeWillyTonka Guest

  3. #3

    Default Re: bit of a problem ip & include

    WeeWillyTonka said the following on 03/09/2005 16:19: 
    <SNIP>
     

    Well, that makes perfect sense!

    Doing:

    include "folder/index.php";

    reads the file from your server's filesystem, i.e. the PHP in file.php
    is pd locally, i.e.:


    HTTP
    USER <---------> YOUR SERVER
    (example.php)
    /|\
    |
    |
    (index.php)

    Doing:

    include "http://your_server.com/folder/index.php";

    performs an HTTP request; the location just so happens to be the same
    server. Therefore, the PHP in index.php is pd in an entirely
    separate session, i.e.:


    HTTP HTTP
    USER <---------> YOUR SERVER <---------> YOUR SERVER
    (example.php) (index.php)


    The IP address is obtained from $_SERVER['REMOTE_HOST'], which gets the
    details from the corresponding HTTP request. So when index.php uses
    $_SERVER['REMOTE_HOST'], ite gets it from the *second* HTTP session,
    which was requested by your server, not the original user.


    --
    Oli
    Oli Guest

  4. #4

    Default Re: bit of a problem ip & include


    "Oli Filth" <co.uk> wrote in message
    news:gskSe.2110$ntli.net...
    : WeeWillyTonka said the following on 03/09/2005 16:19:
    : > "WeeWillyTonka" <com> wrote in message
    : > news:4319a858$news.uk.tiscali.com...
    : > : IP2MORE :: IP2COUNTRY V2
    : > :
    : > : I'm trying to use the above it is working fine apart from if I use <?
    : > : include(" ") ?> to ad it to any page's it shows the web servers IP
    : > address
    : > : and not the visitor.
    : > :
    : > : I know this is because the web page is requesting the include file,but
    : > what
    : > : I can't seem to do is mod the script to work round this if indeed it
    is
    : > : possible.
    : > :
    : > : Can anyone help me with this or is it not possible?
    : > :
    : <SNIP>
    :
    : > It seems to be when I format the link as <?
    : > include("http://somesite.ru/ipaddress/index.php") ?>
    : > is ok if formated like this <? include("ipaddress/index.php") ?> .
    :
    : Well, that makes perfect sense!
    :
    : Doing:
    :
    : include "folder/index.php";
    :
    : reads the file from your server's filesystem, i.e. the PHP in file.php
    : is pd locally, i.e.:
    :
    :
    : HTTP
    : USER <---------> YOUR SERVER
    : (example.php)
    : /|\
    : |
    : |
    : (index.php)
    :
    : Doing:
    :
    : include "http://your_server.com/folder/index.php";
    :
    : performs an HTTP request; the location just so happens to be the same
    : server. Therefore, the PHP in index.php is pd in an entirely
    : separate session, i.e.:
    :
    :
    : HTTP HTTP
    : USER <---------> YOUR SERVER <---------> YOUR SERVER
    : (example.php) (index.php)
    :
    :
    : The IP address is obtained from $_SERVER['REMOTE_HOST'], which gets the
    : details from the corresponding HTTP request. So when index.php uses
    : $_SERVER['REMOTE_HOST'], ite gets it from the *second* HTTP session,
    : which was requested by your server, not the original user.
    :
    :
    : --
    : Oli

    Im sure thats what I said :))

    WW


    WeeWillyTonka Guest

Similar Threads

  1. include problem
    By chris in forum PHP Development
    Replies: 13
    Last Post: September 2nd, 08:02 AM
  2. CF Include Problem
    By Glenn_Stern in forum Dreamweaver AppDev
    Replies: 2
    Last Post: April 25th, 01:01 PM
  3. problem with INCLUDE
    By Sylvain Perreault in forum PHP Development
    Replies: 2
    Last Post: September 11th, 02:28 PM
  4. [PHP] Problem with include();
    By Raditha Dissanayake in forum PHP Development
    Replies: 0
    Last Post: September 7th, 06:14 AM
  5. Php Include Problem
    By Stephen in forum PHP Development
    Replies: 0
    Last Post: July 22nd, 07:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •