RE: Re:Re: [PHP] help for me about session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks like you are mixing JavaScript syntax with PHP, and that doesn't
work since JavaScript runs on the browser machine, and PHP on the server
(document.form.NextCourse.value is a syntax you will find in JavaScript,
not PHP).

Try something like this;

<?php
Startsession();
If($_SESSION["NextCourse"] == 1) {
   do something here on 2nd pass
} else {
   do something here on 1st pass
   $_SESSION["NextCourse"] = 1;
}
?>

Make sure sessions are enabled on your server, you can confirm this by
executing php_info();

HTH,

Warren Vail


> -----Original Message-----
> From: Josephson Tracy [mailto:smallblackbug@xxxxxxxxx] 
> Sent: Sunday, April 24, 2005 8:27 AM
> To: Steve Buehler
> Cc: php-mailing-lists
> Subject: Re:  Re:Re: [PHP] help for me about session
> 
> 
> I want to get the value of document.form1.NextCourse.value
> But I got the  value of $NextCourse in last page.
> 
> Steve Buehler <steve@xxxxxxxxx> wrote:
> 
> At 10:29 PM 4/23/2005, Josephson Tracy wrote:
> > > At 09:35 PM 4/23/2005, Josephson Tracy wrote:
> > > >hi everyone,
> > > >when i study php, i have a problem as following:
> > > >---------------------
> > > >file1.php
> > > >> > >if($NextCourse == 1){ do something;}
> > > >else($NextCourse ==""){do something other }
> > > >?>
> > > >-------------------------
> > > >but when the 2ed access the file1.php
> > > >the value of $NextCourse is the $NextCourse in the , Not 
> the value 
> > > >of document.form1.NextCourse.value.
> > > >
> > > >could someone tell me why?thanks
> > >
> > > I believe it should be:
> > > > > if($NextCourse == 1){ do something; }
> > > elseif(!$NextCourse){ do something other; }
> > > > >
> > > By the way you have your statement, I think you are only 
> looking for 
> > > the "1". You might try the following instead.
> > > > > if($NextCourse == 1){
> > > do something;
> > > }else{
> > > do something else;
> > > }
> > > ?>
> > >
> >ok. the key problem is when I click the button to submit.
> >the value of $NextCourse is not the value of value
> > of document.form1.NextCourse.value.
> >just is the pre page's $NextCourse,that's say "null";
> >how can i get document.form1.NextCourse.value?
> 
> How are you passing the variable $NextCourse to this script?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux