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:[EMAIL PROTECTED]]
> Sent: Thursday, May 02, 2002 1:22 PM
> To: [EMAIL PROTECTED]
> 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



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

Reply via email to