RE: [PHP] SESSIONS
| From: | John Holmes | Date: | Fri, 03 May 2002 01:03:53 +0000 |
| Subject: | RE: [PHP] SESSIONS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95774@lists.php.net to get a copy of this message | ||
You can't mix PHP and JavaScript. They are two entirely different
languages that execute in completely different ways. PHP executes to
create the HTML _AND_ JavaScript. One PHP is finished; it sends you the
code and is finished. It has no interaction with the HTML or JavaScript
except to create it.
On the receiving end, PHP can take GET, POST, or COOKIE data from the
user. If you want to send something to PHP, send it through one of those
methods.
---John Holmes...
> -----Original Message-----
> From: Morten Nielsen [mailto:mosgaard2000@hotmail.com]
> Sent: Thursday, May 02, 2002 1:22 PM
> To: php-general@lists.php.net
> Subject: [PHP] SESSIONS
>
> Hi,
> I got a php and a javascript page. In the PHP page I register a
SESSION
> call
> 'info'. I would then like to put a value into 'info' in my javascript
> page.
> Is that possible?
> I have tried the following:
>
> <?php
> $INFO["value"]=2;
> ?>
>
> And that works fine. But when I have an IF statement like:
>
> if(x==1)
> {
> $INFO["value"]=1;
> }
> else
> {
> $INFO["value"]=2;
> }
>
> My INFO always gets the value 2 even though x is 1.
> Can anyone help?
>
> Thanks,
> Morten
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php