php-windows Digest 10 Mar 2003 02:05:26 -0000 Issue 1626

Topics (messages 18921 through 18926):

Getting current page details
        18921 by: rotsky

Re: Not rhetorical: Why upgrade php when current versio n is working fine?
        18922 by: Svensson, B.A.T. (HKG)

Variable problems
        18923 by: Reggie P
        18924 by: Thomas Smart
        18926 by: Reggie P

Re: Setting sessions variables
        18925 by: Rich Gray

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 ---
I'm using a login routine and I'd like to return the user to the page where
they started before going to the login form. I figured I could do this by
grabbing the current page details, putting these into a session variable and
using that to link back to the page later.

So the question is, how do I get the current page's details? I suspect some
might say PHP_SELF contained in the $_SERVER array - is this the best way?



--- End Message ---
--- Begin Message ---
Yuo might find three reasons for a version upgrade:

1) Extended (and needed) functionality 
2) Security pathes
3) Support is not given for the version you use

       //Anders

-----Original Message-----
From: Beach, Jim
To: [EMAIL PROTECTED]
Sent: 7-3-03 17:01
Subject: [PHP-WIN] Not rhetorical: Why upgrade php when current version is
working fine?

So now I'm pondering why should I upgrade when what I had was working
just fine?

 

Jim


--- End Message ---
--- Begin Message ---
I am new to php and I am having problems passing variables from one page to
another. I wrote a simple script as such:

<html>
<head>
<body>
<Form Action="./cgi-bin/insert2.php" METHOD=post>
name <input type="text" name="test" size=20>
<input type=submit name="submit" value="submit!">
</form>
</body>
</html>

then pass to this page:

<html>
<head>
</head>
<body>

<?
print ("$test\n");

?>
</body>
</html>

I get this for the response:

Notice: Undefined variable: test in E:\websites\girls\cgi-bin\insert2.php on
line 8

Please help!!





--- End Message ---
--- Begin Message ---
in the page that recieves the variable add this:

$test = $_POST['test'];



"Reggie P" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am new to php and I am having problems passing variables from one page
to
> another. I wrote a simple script as such:
>
> <html>
> <head>
> <body>
> <Form Action="./cgi-bin/insert2.php" METHOD=post>
> name <input type="text" name="test" size=20>
> <input type=submit name="submit" value="submit!">
> </form>
> </body>
> </html>
>
> then pass to this page:
>
> <html>
> <head>
> </head>
> <body>
>
> <?
> print ("$test\n");
>
> ?>
> </body>
> </html>
>
> I get this for the response:
>
> Notice: Undefined variable: test in E:\websites\girls\cgi-bin\insert2.php
on
> line 8
>
> Please help!!
>
>
>
>



--- End Message ---
--- Begin Message ---
Now I get this error

Notice: Undefined index: test in E:\websites\girls\cgi-bin\insert2.php on
line 7
Could I have installed something wrong? It is running on win2000 server and
IIS 5

"Thomas Smart" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> in the page that recieves the variable add this:
>
> $test = $_POST['test'];
>
>
>
> "Reggie P" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I am new to php and I am having problems passing variables from one page
> to
> > another. I wrote a simple script as such:
> >
> > <html>
> > <head>
> > <body>
> > <Form Action="./cgi-bin/insert2.php" METHOD=post>
> > name <input type="text" name="test" size=20>
> > <input type=submit name="submit" value="submit!">
> > </form>
> > </body>
> > </html>
> >
> > then pass to this page:
> >
> > <html>
> > <head>
> > </head>
> > <body>
> >
> > <?
> > print ("$test\n");
> >
> > ?>
> > </body>
> > </html>
> >
> > I get this for the response:
> >
> > Notice: Undefined variable: test in
E:\websites\girls\cgi-bin\insert2.php
> on
> > line 8
> >
> > Please help!!
> >
> >
> >
> >
>
>



--- End Message ---
--- Begin Message ---
> Let me get this straight - if register_globals is set to off, the best way
> to assign a value to a session variable is to use:
> 
> $_SESSION['varname'] = 'value' ;

Yes - this will also work fine with register_globals set to On

> 
> This both creates the variable and sets it. And then I can access 
> this from
> any page (that has session_start() at the beginning) with:
> 
> $somevar = $_SESSION['varname'] ;    // or whatever
> 
> Is that right? Is it really that simple?

Yes

> 
> And is it true that it is best to keep register_globals off 
> because there is
> some security implication? (I've got a feeling my hosting service 
> insists on
> it).

Yes - http://www.php.net/manual/en/security.registerglobals.php

> 
> Info gratefully received...
> 
> +a
> Steve

Voila!
Rich

--- End Message ---

Reply via email to