Find Host IP address

  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi All

I have an IP address, say 12.345.67.89

This IP address is for a computer that is hosted on a shared server.

Is it possible to find out the hosting server IP address and name which we know is different from the computer IP address.

I was hoping to be able to use a php script that called up the IP above and then somehow finds the hosting server IP address

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Depends if they have reverse DNS setup for their IP address. If they do not then you may get close by doing a trace route to that IP address, but that usually only gives you clues about what datacenter the IP address belongs to. There are websites out there that simply visit thousands and thousands of other websites a day and then record the IPs associated with them for reverse lookups later when people need them. That would probably be the most reliable way.
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi

Thanks for your response

Are you saying then that there is no php script.

Could you point me to the websites that record the IPs

Thanks
  • demonmaestro
  • Gold Member
  • Gold Member
  • User avatar
  • Posts: 674
  • Loc: Conroe, Texas

Post 3+ Months Ago

just out of wondering why are you wanting to know the host ip address.?
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

On shared hosting your Client IP and the web server IP are different.

By being able to find the web server IP, if not dedicated, you can then get all the information about the hosting company.

I have many client ip's and I was hoping to be able to determine their web servers
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I think this is where I am not following you exactly. On a dedicated server there can be numerous shared hosting accounts that actually do use the main server's IP address. It is true a server can have multiple IP addresses setup on it, but that does not mean that the IP address of a website is using anything other than the main server's IP.

Above I was under the impression you were wanting to do a reverse lookup to see what domains were using that IP address, but now my impression is you are wanting to take an IP address under the assumption there is another main IP address for the server. I believe this thinking is flawed, because in many cases that will already be the main IP address. When many datacenters issue out servers they only provide the hosting company a few IPv4 addresses due to the fact that they are in short supply these days. Typically many hosts will share the main IP, and possibly use dedicated IPs for websites that need SSL (that requires a separate dedicated IP).

So I think the real question for you might be that for any given IP address that a website is hosting on, do other IP addresses exist on the server, and if so, what are they? In some cases its possible that only one IP is even binded to the server.

My first guess is that there is no way to determine the "main" ip address for the server, but there may be a way to determine all of the ip addresses that a server responses to. Regardless, with any given IP address you can usually always determine the datacenter that the IP belongs to, but you may not necessarily be able to determine the hosting company that is leasing servers from that datacenter.

However, like I mentioned before there are bots that go around the internet recording every single IP address associated with a website, and using that could be a way to do a reverse IP lookup to get an idea about what sort of domains are on a server. For example this one does it:

http://www.domaintools.com/research/reverse-ip/
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi

Thanks for your response

I have a client ip and a client hostname.
If I do a reverse IP for my client IP, I get either my client hostname or nothing, depending on who I use.

If I do a reverse IP for my domain name, then I get the Web server IP and all the other websites hosted for this server IP all the time.

It looks like the only way to get the web server IP is to do a reverse ip of the domain name.
Since I only get client IPs, it looks like it can't be done
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Just to confirm, when you say clients, you are talking about the visitors to your website correct? Typically you have servers which serve your content, and clients from remote machines who connect to the server. On this server numerous websites could be sharing one or more IP addresses. Client is referring to the user-end side, that is why you have what is known as server side scripting (PHP, PERL, etc), and clientside scripting (Javascript).

So when you say:

Quote:
I have a client ip and a client hostname.


That makes me think from the computer you are actually on typing these messages to the forum (not a server). In your very first post here you say:

Quote:
This IP address is for a computer that is hosted on a shared server.


See to me that makes no sense, how can a computer be hosted on a server? A server is a computer. That is like saying a computer is hosted on a computer :?

I just want to make sure we are not confusing terminology here because if we are that may be why I am not answering your question correctly. Please clarify you are meaning what I am saying. Thanks! :D
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi

Thanks for your reply.

I know each computer or server has a unique Internet Protocol (IP) address.

My computer has what I call a Client IP.
My web hosting company server has what I call a Server IP, where my domain is located.

I can find them both for my computer and my domain.

When a visitor connects to my site, I can determine their (Client) IP for their computer.

What I would like to find is the IP address of their web hosting server.

I would like the process to be automatic somehow.
I read about pinging, but I am not a programmer so would not know how to set this up automatically.

Hopefully I have made things a little clearer.
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

I think your thinking is flawed. Just because someone uses the internet doesn't mean they automatically have a web hosting account. Even if they do, it doesn't mean they use the same internet provider for hosting as they do for client use.

If you're just trying to determine the client's ISP, you're going to need a database that maps ISPs to leased IP pools (which changes daily). If you had the time and resources to do so, you might be able to grep out the ISP from the client FQDN, but you'd still need a database that maps FQDNs to ISPs, and even this wouldn't give it all to you because someone may have att and show as rr.com, for example.

I think you should step back and rethink what you're trying to do. Chances are it's been done before utilizing resources that don't go into all this.
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

Yea he has no idea what he is doing but it looks to me he is fishing for information. But the funny thing is that i don't think he has a lot of experience in Networking or OS.

wpas wrote:
I would like the process to be automatic somehow.
I read about pinging, but I am not a programmer so would not know how to set this up automatically.



i usually just keep my comments to myself but this one i did not know either should i laugh or cry, then again this entire post i can not find a point.

Kernel Panic LOL
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

You are right Zealous, I do not have much experience, which is why I raise the questions.

When you are unfamiliar with an area, the idea is to ask questions so you can get some constructive criticism, not to be laughed at.

When you first started out,how much experience did you have. Did you not learn by asking questions, whether they had a point or not. That is how we learn.

As far as I am concerned, and as I tell everyone else, no question is stupid, no matter how pointless it might sound as the next question will no doubt then be to the point.

Hopefully I made you laugh and not cry
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I don't think any of your questions are dumb, if I did I would not be spending my time trying to answer. I am just trying to make sure am understanding exactly what you are saying, so that I can answer your question for how you are intending it to be.

With that said I do think I understand more now.

Quote:
When a visitor connects to my site, I can determine their (Client) IP for their computer.

What I would like to find is the IP address of their web hosting server.


The first part of that I can understand, and that is easy to do, I think you already know how to do that from my understanding. The second part is that you want to find the IP address of their web hosting server. Do you actually mean their ISP? or are you under the assumption that your visitors all have servers somewhere hosting websites? The way this sounds to me is that if I were to visit one of your websites, you would know my IP, and based off of that you would hope to find all of my servers and websites I run. If that is the case that would be impossible, as there is absolutely zero relations to my computer's IP address and my server's IP addresses and the websites I run.

If you are just trying to find the ISP, then doing a basic whois on the client's IP address should usually be enough to give you a good idea what ISP they are using, such as ATT, Comcast, Cox, Roadrunner, etc, etc.

While this may not be relevant, I am curious to your reasons for wanting to use this information for your script.
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

wpas wrote:
You are right Zealous, I do not have much experience, which is why I raise the questions.

When you are unfamiliar with an area, the idea is to ask questions so you can get some constructive criticism, not to be laughed at.

When you first started out,how much experience did you have. Did you not learn by asking questions, whether they had a point or not. That is how we learn.

As far as I am concerned, and as I tell everyone else, no question is stupid, no matter how pointless it might sound as the next question will no doubt then be to the point.

Hopefully I made you laugh and not cry


yes i know i am being a ass but i do suggest you ask as many questions as possible and i do try and help as many people as possible but once in a while i post something stupid.

And Yes i was once a noob but i read 24/7 book after book and site after site till i could do it.

But yea this is what i get for posting at 6am in the morning hahahaha

But serious mate if you need help with someone send me a pm if you want. More then happy to help anytime with networking and OS help Linux and Windows
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi Bigwebmaster and Zealous

After I read your responses, it did get me thinking.

I want to know how the visitor got to my website.

I figure it would be one of the following:
1) direct connection
2) referral from a search engine.
3) referral from another website.

For direct connection, it would be strictly the computer IP connecting directly to my website via their browser and there would be no referror.

For search engines, such as Google look up, they would click on the link on the google page.

For other websites, they again would click on a link to my website.

What I need then is the referror url

Once I get the referror URL, I would need to strip it done to get only the domain name and then try to find the Server IP and Server Name.

Not being a great php programmer I would need help for the following:

- I know how to get the referror so no help needed here.
- how to strip the referror URL so that I only get the domain name.
- once I have the domain name, how to convert it to the server IP

Once I have the server IP, I can then easily determine any thing else I want to find out above.

Hopefully my questions now are becoming more to the point which I suppose now is due to the previous questions asked and answered.

Would appreciate your help or guidance
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

in php, $_SERVER['HTTP_REFERER'] will often (not always) give that to you. Just be sure your code accounts for the value being empty.
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

If you have cpanel there is 3 types of logging software that will give you all these stats in a log file and pie chart. Where the traffic is coming from and what % is from where. So check your cpanel logs for the marketing info you need also adding google analytic code to your template will load every page and google keeps track with 10x more marketing data which btw once it is setup and working you find out soooo much about your visitors i increased my SEO 5x once i had some data.

take this 213 post into testing and see where it goes but the converting to IP should be pinged results or resolved domain to IP but either way if you send a request to the domain name or IP they are getting redirected to the same place. Domain names are better to read and write then ip addresses.

image if we used IP's instead of domains like ozzu would be http://70.87.154.200/ and google would be http://74.125.237.18/

I know this is just basic DNS stuff but i find it rather amusing if we did not have domains lol

But the thing i want to know is what are you building?
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Here is what I have done so far.

When a visitor visits my website I read the Referrer URL.
I realize that there could be no URL if it is a direct connection or if it is turned off in the browser and even that they can be faked.

I parse the URL to get only the domain host name and then I find the IP for this hostname which would be the server IP. I then use the server IP to get the host name of the server if it is different.

When a visitor visits my home page, I capture the Referrer URL.
I want to be able to store this URL or somehow pass it on to another webpage on my site.
The reason is once a visitor is on my home page and then clicks on another web page, the Referrer URL now becomes my home page which is of no use to me.

I want to be able, in php, to capture the originating Referrer URL so that I can use it on the web page in question.

I would apprecite some suggestions

Thanks
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

Hi Wpas,

Consider reading the following.

http://en.wikipedia.org/wiki/Hypertext_ ... r_Protocol
http://httpd.apache.org/docs/current/vhosts/
http://php.net/manual/en/reserved.variables.server.php
http://en.wikipedia.org/wiki/Transmissi ... l_Protocol

Depending on your goal, understanding of these things are vital.

On the what I have done so far, I must point out the following possibly erroneous assumptions in your approach.

1. IP wont do you any good in many cases, its just "House address" and people relocate allot on the internet, or use multiple houses to service the same request.
2. Also when its a webserver using Name Based virtual hosting, this one IP address might host thousands of websites. Again leaving useless information.
3. The IP address might also infact be a load balancer instead of an actual server, in which case the IP will tell you nothing worth storing (at least i cant think of an reason)

If you are figuring out the "Hosting party" for any website, do a reverse lookup.

i.e

QUESTIONS:
www.google.com, type = AAAA, class = IN
ANSWERS:
-> www.google.com
canonical name = www.l.google.com
ttl = 18997 (5 hours 16 mins 37 secs)
Name: www.l.google.com
Addresses: 74.125.79.104
74.125.79.147
74.125.79.99
Aliases: www.google.com

QUESTIONS:
104.79.125.74.in-addr.arpa, type = PTR, class = IN
ANSWERS:
-> 104.79.125.74.in-addr.arpa
name = ey-in-f104.1e100.net
ttl = 86400 (1 day)

------------
Name: ey-in-f104.1e100.net
Address: 74.125.79.104

Again, like here most of the time the information is useless.

So please explain in detail 'what question' you are trying to answer with your code..
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi may

Thanks for your response
I understand what you mean and its OK

I am trying to store the referring URL to my home page in a session.

To the index.php file I added the following:

PHP Code: [ Select ]
session_start();
if(!isset($_SESSION['referrer'])){
//get the referrer
if ($_SERVER['HTTP_REFERER']){
$ref = $_SERVER['HTTP_REFERER'];
}else{
$ref = "unknown";
}
//save it in a session
$_SESSION['referrer'] = $ref; // store session data
}
  1. session_start();
  2. if(!isset($_SESSION['referrer'])){
  3. //get the referrer
  4. if ($_SERVER['HTTP_REFERER']){
  5. $ref = $_SERVER['HTTP_REFERER'];
  6. }else{
  7. $ref = "unknown";
  8. }
  9. //save it in a session
  10. $_SESSION['referrer'] = $ref; // store session data
  11. }


On the web page that uses the referring URL I added the following to check it

PHP Code: [ Select ]
session_start();
echo "referrer = ".$ref." "; //retrieve data
  1. session_start();
  2. echo "referrer = ".$ref." "; //retrieve data


I then link to my website from another website.
I then click on the link to the web page that uses the session.

All I get is a blank. I do not get the referring URL
I know for sure the referring URL is sent as I did check it.

Am I doing something wrong.

I have a Joomla CMS site if that means anything

thanks
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

Hi wpas,

I still dont see what good the referrer is in this example.

Anyway you prob. get a blank line because you are not accessing the session var in which you are storing the information in the first place.

i.e. This example should explain the session vars a bit. Load the code into an php file and access and refresh the page..

PHP Code: [ Select ]
<?php
session_start();
if(isset($_SESSION{'count'})){
     $_SESSION{'count'} = $_SESSION{'count'} + 1;
}else{
     echo 'Setting session for first time use <br/>';
     $_SESSION{'count'} = 1;
}
 
echo $_SESSION{'count'};
?>
 
  1. <?php
  2. session_start();
  3. if(isset($_SESSION{'count'})){
  4.      $_SESSION{'count'} = $_SESSION{'count'} + 1;
  5. }else{
  6.      echo 'Setting session for first time use <br/>';
  7.      $_SESSION{'count'} = 1;
  8. }
  9.  
  10. echo $_SESSION{'count'};
  11. ?>
  12.  


on the second page you should access the declared session var
PHP Code: [ Select ]
<?php
session_start();
$ref = $_SESSION['referrer'];
echo "referrer = $ref";
?>
 
  1. <?php
  2. session_start();
  3. $ref = $_SESSION['referrer'];
  4. echo "referrer = $ref";
  5. ?>
  6.  


Also when you are using double quotes to declare a var, you dont need to escape it to access vars inside the declaration (see above example).

Greets May,
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi may

Just a quick question

In the First part you make no mention of $_SERVER['HTTP_REFERER'] so how is it stored

Thanks
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

it was an addition to you own code.

oke, this is what it 'could' look like using a redirect from page1.php to page2.php using the session vars.


PHP Code: [ Select ]
//page1.php
 
// Check if we have the reff information from the server
// collected headers
if(isset($_SERVER{'HTTP_REFERER'})){
   $sRef = $_SERVER{'HTTP_REFERER'};
}else{
   $sRef = 'unknown referer';
}
 
// Store the query string used to get here //
$sQuery = $_SERVER{'QUERY_STRING'};
 
// Store this vital information in a session
session_start();
$_SESSION{'sRef'} = $sRef;
$_SESSION{'sQuery'} = $sQuery;
 
// Redirect the user to a different page
// by sending alternative http headers
header('location:page2.php');
 
  1. //page1.php
  2.  
  3. // Check if we have the reff information from the server
  4. // collected headers
  5. if(isset($_SERVER{'HTTP_REFERER'})){
  6.    $sRef = $_SERVER{'HTTP_REFERER'};
  7. }else{
  8.    $sRef = 'unknown referer';
  9. }
  10.  
  11. // Store the query string used to get here //
  12. $sQuery = $_SERVER{'QUERY_STRING'};
  13.  
  14. // Store this vital information in a session
  15. session_start();
  16. $_SESSION{'sRef'} = $sRef;
  17. $_SESSION{'sQuery'} = $sQuery;
  18.  
  19. // Redirect the user to a different page
  20. // by sending alternative http headers
  21. header('location:page2.php');
  22.  


PHP Code: [ Select ]
// Page2.php
 
//start a session
session_start();
 
//collect and print the session information
if(isset($_SESSION)){
   foreach($_SESSION as $key => $value){
      print("session array index $key contains the information $value <br/>");
   }
}else{
   // redirect back to page1 to collect and set the header information
   // and prevent a loop using the session vars the way they where intended.
   if(!isset($_SESSION{'redirected'})){
      $_SESSION{'redirected'} = true;
      header('location:page1.php');
   }else{
      echo 'We failed to collect the required information, please check your php enviroment';
      exit;
   }
}
 
  1. // Page2.php
  2.  
  3. //start a session
  4. session_start();
  5.  
  6. //collect and print the session information
  7. if(isset($_SESSION)){
  8.    foreach($_SESSION as $key => $value){
  9.       print("session array index $key contains the information $value <br/>");
  10.    }
  11. }else{
  12.    // redirect back to page1 to collect and set the header information
  13.    // and prevent a loop using the session vars the way they where intended.
  14.    if(!isset($_SESSION{'redirected'})){
  15.       $_SESSION{'redirected'} = true;
  16.       header('location:page1.php');
  17.    }else{
  18.       echo 'We failed to collect the required information, please check your php enviroment';
  19.       exit;
  20.    }
  21. }
  22.  


This example should be self explaining.

I used the redirect to show why we would want to use the session, usually to store php management information or to limit lookups like a caching mechanism. To store referal information is strange in my humble opinion, but it can be done as shown in my example.

-Rgrds,
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi May

Since I do not want to redirect to the other web page, I commented out
I also changed $sRef to $ref

PHP Code: [ Select ]
// Check if we have the reff information from the server
// collected headers
if(isset($_SERVER{'HTTP_REFERER'})){
   $ref = $_SERVER{'HTTP_REFERER'};
}else{
   $ref = 'Unknown';
}
// Store the query string used to get here //
$sQuery = $_SERVER{'QUERY_STRING'};
// Store this vital information in a session
session_start();
$_SESSION{'Ref'} = $ref;
$_SESSION{'sQuery'} = $sQuery;
// Redirect the user to a different page
// by sending alternative http headers
//header('location:page2.php');
  1. // Check if we have the reff information from the server
  2. // collected headers
  3. if(isset($_SERVER{'HTTP_REFERER'})){
  4.    $ref = $_SERVER{'HTTP_REFERER'};
  5. }else{
  6.    $ref = 'Unknown';
  7. }
  8. // Store the query string used to get here //
  9. $sQuery = $_SERVER{'QUERY_STRING'};
  10. // Store this vital information in a session
  11. session_start();
  12. $_SESSION{'Ref'} = $ref;
  13. $_SESSION{'sQuery'} = $sQuery;
  14. // Redirect the user to a different page
  15. // by sending alternative http headers
  16. //header('location:page2.php');



For the second page I set the redirect to my Home Page

PHP Code: [ Select ]
//start a session
session_start();
 //collect and print the session information
if(isset($_SESSION)){
   foreach($_SESSION as $key => $value){
      print("session array index $key contains the information $value <br/>");
   }
}else{
   // redirect back to home page to collect and set the header information
   // and prevent a loop using the session vars the way they where intended.
   if(!isset($_SESSION{'redirected'})){
      $_SESSION{'redirected'} = true;
      header('location:index.php');
   }else{
      echo 'We failed to collect the required information, please check your php enviroment';
      exit;
   }
}
  1. //start a session
  2. session_start();
  3.  //collect and print the session information
  4. if(isset($_SESSION)){
  5.    foreach($_SESSION as $key => $value){
  6.       print("session array index $key contains the information $value <br/>");
  7.    }
  8. }else{
  9.    // redirect back to home page to collect and set the header information
  10.    // and prevent a loop using the session vars the way they where intended.
  11.    if(!isset($_SESSION{'redirected'})){
  12.       $_SESSION{'redirected'} = true;
  13.       header('location:index.php');
  14.    }else{
  15.       echo 'We failed to collect the required information, please check your php enviroment';
  16.       exit;
  17.    }
  18. }


When I ran it, it was still blank.

I would have expected to see the print() statement, but did not even see that.

Is $value the referring url
I even tried to echo that and nothing

Have I done something wrong
Moderator Remark: Remember to put [php] tags around your code in the post so it shows nicely. Did that for you.
  • may
  • Proficient
  • Proficient
  • User avatar
  • Posts: 328
  • Loc: Holland [NL]

Post 3+ Months Ago

Hi Wpas,

Your missing the point on why the $_SESSION superglobal even exists in PHP.

And then there is this other point, how am i supposed to help you when you are altering my scripts which where intended to teach you something?

In short, is the referrer information shown on page2.php after calling page1.php when you do not change my script and simply open it in a browser? If so (and it will because I have tested it) try to follow the scripts logic and then review your own code.

Your error is pretty obvious when you understand the the script i have given you.

Rgrds, May

ps. Please read these manuals before posting ;-)
http://www.php.net/manual/en/language.types.php
http://www.php.net/manual/en/language.v ... basics.php
http://www.php.net/manual/en/language.v ... .scope.php
http://www.php.net/manual/en/language.v ... riable.php
http://www.php.net/manual/en/language.v ... ternal.php
http://www.php.net/manual/en/reserved.variables.php
http://www.php.net/manual/en/session.examples.basic.php
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi May

I have a Joomla CMS website.
After much research I found the Joomla and external php sessions do not go together. Joomla has its own session manager.

What I had to do was to adapt my external web page to use the Joomla session manager. Once I done this, everything works fine now.

I did use some of your ideas.

Thanks again for your help
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

Hi All

As mentioned I managed to solve my session problem.
I just have one issue now.

When someone visits my homepage, and if there is a referring url, I save it in a sesssion.

When I link to another web page, I call this session to do some data manipulation.

When finished, the visitor goes back to my home page which creates my issue.

The referring url now changes to my website, as the visitor has gone back to my home page via another web page on my site. The original referring url is now replaced by my website url.

Is there any way I can make the original referring url not change no matter how many links the visitor clicks on in my website to prevent my website from becoming the referring url.

Thanks
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

The way the HTTP_REFERER works is that it simply tells you the last referring page, which includes your own website's pages. To do something like you are wanting there could be numerous ways by tracking the referrer's and associating them with the session, or setting a cookie in the user's browser to store whatever information you want that you could then read on other pages as they navigate through your website. You could easily use cookies to retrieve the original outside referring website on each page view then.
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

The way my joomla website works is that everything is handled by the index.php page and then information is passed on to other pages.

This basically means that I only need to take care of it on the index.php page.

When a visitor comes to my homepage I store the referring URL.
Although they are linking to other web pages, they are really only the index.php page so I just need to take care of it here.

What I was thinking was maybe some how using the if(isset())

When the visitor first comes to my site the session is set.
Now everytime the visitor links to other pages, the referring url is bascially my website and replaces the original referring url

By using the if(isset()) function I can check for the presence of the session and if it exists, it is not to be changed.

I am not sure quite how to do this and would appreciate some guidance.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Internally on your Joomla website everything gets started through your index.php. Joomla uses mod_rewrite to redirect all requests through index.php. From the browser standpoint there are many more URLs than just the index. For instance if you have a page on your site called about-us.html that that was rewritten via your index.php file, if they click on any links from that page to other pages on your site the HTTP_REFERER variable that is passed will be about-us.html and not index.php. Just keep that in mind, you probably understand this already though.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 36 posts
  • Users browsing this forum: No registered users and 59 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.