php-general Digest 25 Dec 2003 15:16:12 -0000 Issue 2493

Topics (messages 173314 through 173319):

Re: basic set and read a cookie probs
        173314 by: Jack E. Wasserstein, DDS, Inc.
        173318 by: Evan Nemerson

Re: JavaScript question
        173315 by: -{ Rene Brehmer }-

Problem with session variables on Mac
        173316 by: Jim & Sara Feldman

Re: programming the onclick() event in an anchor
        173317 by: Evan Nemerson

problem sending variables with forms
        173319 by: Abdullah Teke

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Sorry,

No such thing as $_POST_VARS




"Jack E. Wasserstein" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am using the following code on the php form handler
>
> if ($_POST[referdrremember] == "true") {
> setcookie("remailcookie",
> "$_POST_VARS[refdremail]",time()+3600,"/","wasserstein.com","0");
>
> Try to see the cookie in the same script, not sure which one to use with
or
> without $
>
> print " the cookie's value is  $HTTP_COOKIE_VARS[remailcookie] ";
> print " the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ";
>
> In addition when I get back to the calling form and refresh it I try to
see
> the cookie with this:
>
> if ($HTTP_COOKIE_VARS[remailcookie]) {
>   print ("remail cookie exists"); }
>   else {
>   print ("no cookie");
>   }
>
> This yeilds "no cookie"
>
> I have also tried $_COOKIE[] as well
>
>
> What am I doing wrong.
>
> Thanks in advance,
>
> Jack

--- End Message ---
--- Begin Message ---
On Wednesday 24 December 2003 10:15 pm, Jack E. Wasserstein, DDS, Inc. wrote:
> Sorry,
>
> No such thing as $_POST_VARS

next time you're having problems, try doing an error_reporting(E_ALL); It 
really helps a lot, though I'll admit it can be a bit finicky :)

Oh and don't forget to turn it off when you're done w/ development

>
>
>
>
> "Jack E. Wasserstein" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > I am using the following code on the php form handler
> >
> > if ($_POST[referdrremember] == "true") {
> > setcookie("remailcookie",
> > "$_POST_VARS[refdremail]",time()+3600,"/","wasserstein.com","0");
> >
> > Try to see the cookie in the same script, not sure which one to use with
>
> or
>
> > without $
> >
> > print " the cookie's value is  $HTTP_COOKIE_VARS[remailcookie] ";
> > print " the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ";
> >
> > In addition when I get back to the calling form and refresh it I try to
>
> see
>
> > the cookie with this:
> >
> > if ($HTTP_COOKIE_VARS[remailcookie]) {
> >   print ("remail cookie exists"); }
> >   else {
> >   print ("no cookie");
> >   }
> >
> > This yeilds "no cookie"
> >
> > I have also tried $_COOKIE[] as well
> >
> >
> > What am I doing wrong.
> >
> > Thanks in advance,
> >
> > Jack

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"It is an unfortunate fact that every man who seeks to disseminate knowledge 
must contend not only against ignorance itself, but against false instruction 
as well. No sooner do we deem ourselves free from a particularly gross 
superstition, than we are confronted by some enemy to learning who would set 
aside all the intellectual progress of years, and plunge us back into the 
darkness of mediaeval disbelief."

-HP Lovecraft

--- End Message ---
--- Begin Message --- you can simply call:

Window.location.href = 'http://yourdomain.com/phpscripttocall.php?variable1=value1&variable2=value2'

^works in all browsers supporting JavaScript ... there's a few variants of this that will only work in IE or Netscape, but this one is vague enough to work in both... (not sure about Opera, it doesn't run well on my setup, so testing with it is a basically impossible for me)...

if you use frames, it's a bit more tricky, but I trust you don't, otherwise just ask ... :) ... I've got the complete JavaScript code to change the content of frames criss-cross of each other in any way and pattern you can dream off... (my site used to be a JS driven monster before I got my webhotel and the option to do it all with PHP) ...

Rene

At 19:58 02-11-2003, you wrote:
Good morning.

I know this may be off-topic but I don't know where to turn.

I'm building a dynamic web page system with PHP and need to figure out in
JavaScript how to do something. I have the timer figured out in JavaScript
but what I need is a way to automatically submit a request back to the web
server after the timer runs out. What I'm trying to do is display slides in
sequence. When the timer expires, it sends back to the web server the
parameters of slide group and the last slide displayed. The PHP on the
server end builds a new page and sends it to the browser with the next slide
in the sequence.

Any help would be greatly appreciated and my PHP skills are vastly above my
JavaScript skills (very basic beginner).

Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020

-- Rene Brehmer aka Metalbunny

http://metalbunny.net/
References, tools, and other useful stuff...

--- End Message ---
--- Begin Message --- I should first admit to being a php newbie, so the answer may be obvious, but this looks like a
bug to me. Global variables are OFF. I start a session at the very top of page "member.php":


session_start();

In a function called from the same page, I store some variables in the session array:

        $pilot = mysql_fetch_array($result);
        $usrname = $pilot['given']." ".$pilot['last'];
        $valid_ID = $pilot['ID'];
        $timestamp = date("U");
        session_register("usrname","timestamp","valid_ID");

then in another function called from the same page (or a different page, since this is where I find which
user is sending in a page), I attempt to use the "timestamp" data. Three "echo" lines are added to provide
some debugging help.


        if (session_is_registered("valid_ID")){
                        echo "inside check IF <br>";
                $current_time = date("U");
                        echo "Time = $current_time.<br>";
                $session_time = $current_time - $_SESSION('timestamp');
                        echo "session time = $session_time seconds.<br>";

The output to the browser (Safari) is as follows:

inside check IF
Time = 1072308706.

Fatal error: Call to undefined function: array() in
/Library/WebServer/Documents/testit/Logsafe_project/user_auth_fns.php on line 35


As you can see, the code bombs as soon as it hits the $_SESSION('timestamp'). Note that it did pass through
(session_is_registered("valid_ID") successfully and if I go look in the directory where the cookie would go,
it is there.


I am operating in system 10.3.2 (Panther) and, as far as I can tell, using php 4.3.2. Any help would be appreciated.

Jim

--
Jim Feldman
14 Linda Lane
Newton, MA 02461

617-527-0509
--- End Message ---
--- Begin Message ---
On Wednesday 24 December 2003 08:06 pm, Peter Walter wrote:
> I have written a session-enabled php page which displays a table of
> search results. The first column in the table contains anchor links to
> www.mydomain.com/mypage?seqno=xxxx where seqno is a variable I would
> like to pass when the anchor is clicked. However, I do not wish the
> ?seqno=xxxx to display in the url of the browser. After googling a lot,
> it appears that I can use JavaScript to set a session variable in the

I doubt it- otherwise it would be pretty easy to set, say 
$_SESSION['logged_in']

> onclick() event, but I have not been able to find an example of how to

But you /can/ use JS to set a cookie, which can be retrieved (and stored in a 
session variable if you want) by PHP.

http://www.webreference.com/js/column8/
http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.cookies

> do it. Does anyone have experience doing this? Sample code would be
> greatly appreciated.

http://www.webreference.com/js/column8/functions.html

>
> Peter

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"There is a certain right by which we may deprive a man of life, but none by 
which we may deprive him of death."

-Nietzsche

--- End Message ---
--- Begin Message ---
  I have a problem that  i cant send variable over a form. Because of that when i watn 
to echo the variable next page  an error occured...i use redhat 9.0, apache 2 and php 
4.3.4. Please help me....


  Abdullah Teke 
  _____________________________ 

  Telephone : +90 555 337 21 89 
  Messenger  : [EMAIL PROTECTED] 
  Web            : http://abdullahteke.cjb.net 
  Icq              : 164500674

--- End Message ---

Reply via email to