Re: [PHP] another easy cookie question

2001-09-14 Thread Kelly Barrett
Hi George, You must output all headers (including cookies) before you output any content. So, you just need to move your header and setcookie calls so they are above the and tags. e.g. Cheers, Kelly. > Hi all, > > This is what I have at the top of my php page (php-4.0.6-winNT). > > >

RE: [PHP] easy cookie question

2001-09-13 Thread Kelly Barrett
You need to set the expire time. Set it to 10 years in the future or something. $expire_time = time() + (86400 * 365 * 10); setcookie("cookie", "value", $expire_time); Cheers, Kelly. > -Original Message- > From: Jay Paulson [mailto:[EMAIL PROTECTED]] > Sent: Friday, 14 September 2001 6

RE: [PHP] Getting ip address of client and displaying a number in decimal format.

2001-09-13 Thread Kelly Barrett
Troy, $REMOTE_ADDR gives you the client IP. To convert a number to show 2 decimals use "sprintf": $money = 5; $money_string = sprintf("%.2f", $money); // $money_string will be 5.00 Cheers, Kelly. > -Original Message- > From: Troy Lynch [mailto:[EMAIL PROTECTED]] > Sent: Friday, 14 Sep

Re: [PHP] PHP Security

2001-09-13 Thread Kelly Barrett
Hi Allen, What you should do is check the session variable from within PHP. If it doesn't exist, you redirect to a PHP authentication form. So at the head of each page you need something like: And in your PHP authentication form, you register the logged_in variable after the user details have b

Re: [PHP] php4 and apache on SuSE Linux

2001-09-13 Thread Kelly Barrett
It sounds like the PHP isn't getting parsed. Check the webserver is configured correctly for the extension of your file, or that your system requires you to use the CGI version of the PHP interpreter. > Rudolf, > > I have tried adding the double quotes, and when I do, nothing at all is > display

Re: [PHP] php4 and apache on SuSE Linux

2001-09-13 Thread Kelly Barrett
Hi Sean, What webserver are you using? Is it using the Apache module of PHP or the CGI version? Perhaps the extension of your file doesn't have the PHP processor associated with it (if it is installed as an Apache process)? Maybe you are using the CGI version incorrectly? With the command line

Re: Re[4]: [PHP] Searching for text in a file

2001-09-10 Thread Kelly Barrett
ECTED] owner-majordomo_site15 > [EMAIL PROTECTED] sys > > > Monday, September 10, 2001, 1:26:44 AM, you wrote: > > Kelly Barrett> Richard, > Kelly Barrett> I just put together a script using that code exactly, and it worked. > > Kelly Barrett> All I can say is make sur

RE: Re[2]: [PHP] Searching for text in a file

2001-09-10 Thread Kelly Barrett
echo "Match at line number $count"; > break; > } > ++$count; > } > > > Monday, September 10, 2001, 12:39:15 AM, you wrote: > > Kelly Barrett> Hi Richard, > Kelly Barrett> First, I think it should be: > Kelly Barrett> $variab

RE: [PHP] Searching for text in a file

2001-09-10 Thread Kelly Barrett
Hi Richard, First, I think it should be: $variable = "[EMAIL PROTECTED]"; instead of: > $line_text= "[EMAIL PROTECTED]"; as you overwrite $line_text with your fgets. Also: > if ($variable = trim($line_text)) { Should be: if ($variable == trim($line_text)) { Otherwise you are do