|
Posted by bulldog8 on 09/07/07 22:37
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!)
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:
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;\"
Thanks
Jon
page1.php / page2.php results:
SESSION CONTAINS:
Array
(
[base_uri] => /dev/
[onetimepad] => T4q+GOY7
[delimiter] => /
[username] => tttttt@ttttt.com
[user_is_logged_in] => 1
[just_logged_in] => 1
[attachment_common_types] => Array
(
[image/gif] => 1
[image/x-xbitmap] => 1
[image/jpeg] => 1
[image/pjpeg] => 1
[application/x-shockwave-flash] => 1
[application/vnd.ms-excel] => 1
[application/vnd.ms-powerpoint] => 1
[application/msword] => 1
[*/*] => 1
)
[prefs_cache] => Array
(
[User_Name] => Ttttt Ttttttt
[User_Id] => 999
[CC_Reply_to] => ttttt@ttttt.com
[javascript_on] => 1
[date_format] => 4
[hour_format] => 1
[Cur_P1] => -20
[Cur_P2] => 16
[Cur_P3] => 99
[Next_P1] => 14
[Next_P2] => 15
[Next_P3] => 99
)
[prefs_are_cached] => 1
[theme_css] =>
[test] => Testing
)
--------------------------------------------------------------------------------
POST CONTAINS:
Array
(
)
--------------------------------------------------------------------------------
GET CONTAINS:
Array
(
)
--------------------------------------------------------------------------------
COOKIE CONTAINS:
Array
(
[PHPSESSID] => 1c882adeebfc6de61e496381d283ac53
[key] => QoTQdp6O
)
I have to admit, my PHP skills are quite light.
Navigation:
[Reply to this message]
|