You are here: Re: Session variables and IE7 « PHP Programming Language « IT news, forums, messages
Re: Session variables and IE7

Posted by Jerry Stuckle on 09/08/07 01:41

bulldog8@lycos.com wrote:
> On Sep 6, 5:34 am, Erwin Moller
> <Since_humans_read_this_I_am_spammed_too_m...@spamyourself.com> wrote:
>> bulld...@lycos.com wrote:
>>
>> Hi Bulldog,
>>
>>> I have a web page set up for doctors to request vacation. All was
>>> working well until they upgrade their home PCs to IE7, at which time
>>> the variables lose their values when they click submit.
>> 'the variables' refers to the ones in $_SESSION ?
>>
>> We've allowed
>>
>>
>>
>>
>>
>>> cookies from this site and allowed JS to run in an attempt to fix the
>>> issue, but no luck.
>>> I use a javascript calendar and additional javascript to make sure the
>>> end date > start date.
>>> The user can still use the calendar tool to select dates and the js
>>> still correctly ensures the end date and num of days requested fields
>>> are populated correctly, so I am looking at my PHP code first.
>>> Is there some error in my handling of session variables?
>>> PHP code:
>>> <?php
>>> /**
>>> * request.php
>>> *
>>> * Sends an email containing a vacation request and posts to database.
>>> *
>>> */
>>> session_start();
>>> //Let's see if they want to go to another page first
>>> if (strlen($btn) > 0) {
>> ????
>> Are you relying on register globals ancient wrong settings in php.ini?
>> This code needs to be fixed IMHO.
>>
>> <snipped a few pages of code>
>>
>> Bulldog, you better start with a very simple page that uses a sessions,
>> and a followup page that tries to read the session.
>> That will learn you what is wrong without the complications of the old
>> (bad) script.
>>
> <snipped>
>> Try something simple as this first, and see what happens.
>>
>> Regards,
>> Erwin Moller
>>
>> PS: Please fix the register globals thingy....http://nl3.php.net/register_globals- Hide quoted text -
>>
>> - Show quoted text -
>
> Erwin -
>
> Thanks for the tips.
>
> The site has PHP 4.3.9. The site also contains squirrelmail, so
> register_globals needs to remain 'on' (I tried it turned 'off' and
> the whole thing fell apart!)
>

Then you need to upgrade your version of SquirrelMail. It must be a
very old version - SquirrelMail hasn't required register_globals to be
on for at least two years that I know of.

> I tried your samples and the results are further down.
>
> The variables I am concerned with are in the following statement:
> $Result = saveVac($txtStartDate, $txtEndDate, $Priority, $vdays,
> $body);
>
> and
>
> function showInputForm () {
> global $send_to, $send_to_cc, $body, $subject, $org_logo, $btn,
> $txtStartDate, $txtEndDate, $Priority, $txtNumReq,
> $chkmsg, .....etc...
>
>
>
> Only thing I may be missing - within the HTML code, how do you assign
> values to session variables? The following is PHP code that I use to
> display the $txtStartDate value and allow the user to change, either
> manually or via the calendar button:
>

You don't. HTML cannot set session variables. You get them from the
$_POST array and place them in the $_SESSION array.

> Start Date <input type=\"text\" name=txtStartDate id=txtStartDate size=
> \"20\" tabindex=\"1\" value=\"" . $txtStartDate ."\"> <A HREF=\"#\"
> onClick=
> \"cal5.select(document.forms['request'].txtStartDate,'anchor5','MM/dd/
> yyyy'); return false;\"
>
>
> can I use:
>
> Start Date <input type=\"text\" name=txtStartDate id=txtStartDate size=
> \"20\" tabindex=\"1\" value=\"" . $_SESSION['txtStartDate'] ."\"> <A
> HREF=\"#\" onClick=
> \"cal5.select(document.forms['request'].txtStartDate,'anchor5','MM/dd/
> yyyy'); return false;\"
>
>

No.

> Thanks
> Jon
>
< lots of other stuff snipped >

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация