This topic is locked

Saving IP address

5/11/2008 8:58:07 PM
PHPRunner General questions
M
michaelmac author

hey Support..
I am working on a new website, and the client wants to save the IP. I know how to get it from the session variables in PHP, but how do it tell to save the info with the rest of the information with that page. I was thinking I could do $value['IP_addr']=_SESSION['REMOTE_ADDR']; // I am not at my desk... is this correct? Also if I wanted to ADD a variable to the array $value that is passed to the BeforeAdd event, can I assign my values that are not on the page there if the corresponding names exist in the table. Also if I want to ADD something to a table that already INSERT, is there a way to retrieve the last autoincremented value I am using as the record counter.
Thanks again
Mike

J
Jane 5/12/2008

Mike,
sure you can assign value the array even if field is not on the page.
To pull in last inserted ID use mysql_insert_id() function in the After record added event:

$id = mysql_insert_id();

B
bochaka 5/20/2008

Mike

How do you get it from the session variable

M
michaelmac author 10/17/2008

Hey..
I am sorry, I have been swamped since I took this new position...
What I do in runner is add the following:
$ip=$_SERVER['REMOTE_ADDR'];
or
$values['ip'] = $_SERVER['REMOTE_ADDR'];
in either my beforeAdd or add insert code depending where I need the "info" saved...
Sorry for the LONG LONG delay
Thanks
Mike