[PHP] Re: Wrong IP address

2004-04-02 Thread K.Bogac Bokeer
I'm using this one: function FetchIP() { $client_ip = $_SERVER['HTTP_CLIENT_IP']; $x_forwarded_for = $_SERVER['HTTP_X_FORWARDED_FOR']; $remote_addr = $_SERVER['REMOTE_ADDR']; if ( !empty ($client_ip) ) { $ip_expl =

[PHP] Re: Relative Url

2004-04-02 Thread K.Bogac Bokeer
I'm using this on Apache. You need to include 'inc/globals.php' in your script. inc/globals.php ? require_once('functions.php'); define('RELPATH', GetRelativePath()); ? inc/functions.php function GetRelativePath() { $RELPATH = str_replace(UpDirectory(__FILE__), '',

[PHP] Re: combining variables...

2004-04-06 Thread K.Bogac Bokeer
$i = 2; $var = view_request_$i; $value = $$var; Tristan Pretty wrote: Simply put, can I connect 2 variables, to make one... I want to output: $view_request_$i making for example a string: view_all_2 But I'm getting errors..? Parse error: parse error in

[PHP] Re: Understanding sessions

2004-04-14 Thread K.Bogac Bokeer
You can use $sid = session_name().'='.session_id(); instead of SID or you can define o constant define('SID', session_name().'='.session_id()); at the start of script ( after session_start() ). Todd Cary wrote: I am trying to understand sessions are done with php. My learning script has the

Re: [PHP] Newbie question about good coding practice [isset]

2004-06-05 Thread K.Bogac Bokeer
When $var is 0? ? $var = 0; // Output: $var: $var not exists if ( $var ) echo '$var: $var existsbr'; else echo '$var: $var not existsbr'; // Output: isset(): var exists if ( isset($var) ) echo 'isset(): $var existsbr'; else echo 'isset(): $var not existsbr'; ? Larry E