[PHP-DB] cookies

2003-12-04 Thread Maris Kalnins
Let's assume that we have an html page where we plant a call
to cookie registering php script. This is done by
the following html line which is placed on that page
we would like to have cookies stats for:


html
...
body
..
img nocache border=0 width=2 height=1
src=http://www.cookiedomain.com/cookies/cookies.php
..
/body

/html


Php cookie registering script has the following
cookie set operation:

setcookie(test, 1, time() + 3600, /, );


The problem is that when executing HTML above, everything
works fine as long as page and php script are on
the same domain

But as soon as page is for example www.pagedomain.com and
cookie script is still on www.cookiedomain.com
No cookies are set no more.

My  understanding is that with line
img nocache border=0 width=2 height=1
src=http://www.synchrodat.com/sdcookies/cookies.php
we simply execute php script the same way as it would be typed
in url line and executed, why there's a difference?

Could you share with your experience and point out where
is the problem here. I tried different variations for
domain parameter in setcookie command but it didnt help

Is this construction usable in this case with different
domains at all?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] cookies

2003-12-04 Thread Maris Kalnins
Right, but in my example HTML line

img nocache border=0 width=2 height=1
src=http://www.cookiedomain.com/cookies/cookies.php

isnt it refering and setting cookie for  www.cookiedomain.com
even if this HTML file is on another domain?

Maris


Richard Davey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello Maris,

 Thursday, December 4, 2003, 10:40:33 AM, you wrote:

 MK Could you share with your experience and point out where
 MK is the problem here. I tried different variations for
 MK domain parameter in setcookie command but it didnt help

 It's a security mechanism built into cookies. They cannot be
 cross-domain. They can cross sub-domains (i.e. *.launchcode.co.uk) but
 a cookie set for one domain cannot be read by another. Think of the
 anarchy that would happen if they could (being able to read and mess
 with say Hotmail cookies from your own site for example).

 -- 
 Best regards,
  Richardmailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP-DB] cookies

2003-12-04 Thread Maris Kalnins
thanks a lot Richard, now it's completely clear for me!

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] odbc_pconnect

2002-04-02 Thread Maris Kalnins

Hi All!

I have a situation where I need to keep connection still active after php
script is done and page displayed!
I tried to use

$cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);

But unfortunately connection closes automatically when script is done!
What must I do to keep connection alive and be able to use $cx again and
again without connectign?

Thanks!




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] odbc vs mysql

2002-04-02 Thread Maris Kalnins

When connecting to database (Sybase) through ODBC it takes some time to
establish odbc connection with:

$cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);

And only after that I am able to access data through SQL Selects

The problem is that every time the script is finished this connection is
automatically closed,
how to keep it open after displaying a page - no idea ...

How about using MySql in this situation?
There will be no need to waste time connecting to ODBC every time,
is it really so? could this be faster?

is there any idea how to keep ODBC connections open after script is
finished?

Any other solutions?

Thanks

P.S. I tried to use Sybase funcitons.. but it says - that they're not
defined or something like that..






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] odbc_pconnect doesnt reuse connection

2002-04-02 Thread Maris Kalnins

Hi!

Configuration: WinXP, the latest Apache, PHP4

The problem is that every time the script runs and the following command is
executed
$cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);
it happens very often that a new connection is created instead of reusing
the old one!

Is there any idea what's wrong... ?

And another question - when user hits reload or submit button at the moment
when
actually this odbc_pconnect is in progress - it generates another connection
leaving the old one
(half opened or whatever) still alive..

So if you will click on submit button more than 10 times with a little short
interval -
we will get ODBC error - Database server connection limit exceeded

I tried to set in PHP config file
odbc.max_persistent = 1

but it still overgoes more than 1 connection to the same database, user and
password..

What's  wrong?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php