Jump to content

[SOLVED] Capturing the incoming url


jpfred

Recommended Posts

I have been reading several PHP books and have yet to find out how to capture the users url.  I would imagine that there exitst a session variable/value that can be captured into a variable.

 

Anybody have a idea to set me in the right direction?

Link to comment
Share on other sites

To clarify what I am trying to do,

 

When an individual executes to myfile.php by clicking on SUBMIT on myfile.html I would like to be able to capture their current ip address or complete url and write it to a database.  A conceptual example of what I would like can be seen below:

 

<?php

$myip=??????;

mysql_connect("myserver.myserver.com", "myuserid", "mypassword") or die(mysql_error());

mysql_select_db("mydatabase") or die(mysql_error());

$data = mysql_query("INSERT INTO mytable VALUES($myip)");

?>

 

Expected result would be:

 

$myip = 11.11.11.11

 

The part I am confused about is what would I need to fill in "??????"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.