[PHP] Problem with PHP_SELF

2002-12-10 Thread info
Hello Leif, hello all,

i compiled successfully php-4.3-dev deom tarball as CGI  on RedHat7.3

register_globals is on

And here is how my php behave:

When I run the following script: info70.php

1) from commandline
then  [PHP_SELF] => info70.php
is set correctly

2)  from browser
then PHP_SELF = htdocs3/bildvote/admin/info70.php

zend and php-logo isnĀ“t depicted.

3) via http script is in the htdocs (/usr/local/apache/htdocs) directory
  PHP_SELF = 

What can I do? How can I use the superglobal array?

Oliver Etzel
.eu-Domains are coming
www.t-host.com




Re: [PHP] Problem with $PHP_SELF on PWS

2002-08-11 Thread Matt

>From: "John Brooks" <[EMAIL PROTECTED]>
>Sent: Sunday, August 11, 2002 10:21 AM
>Subject: [PHP] Problem with $PHP_SELF on PWS


> I have PHP installed on PWS running on a Windows 98SE m/c.
> When I invoke  everything is fine
and the form data is > extracted correctly.

> When I try to embed the same script in the body of the form using
>  I get "HTTP Error 405
Method not allowed.

If you view source from the browser you'll see the action is empty.

Use:





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




Re: [PHP] Problem with $PHP_SELF on PWS

2002-08-11 Thread Bas Jobsen

> http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem with $PHP_SELF on PWS

2002-08-11 Thread John Brooks

Hello All,
I have PHP installed on PWS running on a Windows 98SE m/c.
When I invoke  everything is fine and the form 
data is extracted correctly.

When I try to embed the same script in the body of the form using
 I get "HTTP Error 405 Method not 
allowed. The method specified in the request line is not allowed for the resource 
identified by the request. Please ensure that you have the proper MIME type set up for 
the resource you are requesting."

I'm sorry if this is a "newbie" problem, but I can't for the life of me see what the 
difference is between having the method embedded or separate.
Thanks in advance,
John Brooks.



Re: [PHP] problem with PHP_SELF

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 22:42, DoL wrote:
> Hi All
>
> I would like to submit a form to call itself, and according to some
> references I could use the $PHP_SELF variable in action attribute of the
> form element in a HTML document
> But it is not working for me, please help.
>
> I have this line of code
> 
>
> in the html source page, I get
> 
>
> Can anyone advice what did I missed here?
> Would this have anything to do with php or/and apache configuration?

You're probably using a newer version of php (4.1.x+). If so, then you need to 
refer to $PHP_SELF as $_SERVER['PHP_SELF']. Read the release notes for your 
version of PHP or read the php.ini or RTFM for more details.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
There but for the grace of God, goes God.
-- Winston Churchill, speaking of Sir Stafford Cripps.
*/


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




Re: [PHP] problem with PHP_SELF

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 10:42  AM, DoL wrote:

> Can anyone advice what did I missed here?
> Would this have anything to do with php or/and apache configuration?

Is it possible that your php.ini file is configured for 
register_globals = off ?

If so, you should use:

$_SERVER['PHP_SELF'] instead of $PHP_SELF.






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] problem with PHP_SELF

2002-06-24 Thread DoL

Hi All

I would like to submit a form to call itself, and according to some
references I could use the $PHP_SELF variable in action attribute of the
form element in a HTML document
But it is not working for me, please help.

I have this line of code


in the html source page, I get


Can anyone advice what did I missed here?
Would this have anything to do with php or/and apache configuration?

Thanks

/dl





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




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread Mark Charette

From: "David Otton" <[EMAIL PROTECTED]>
> My other point still stands though (I think) - that marking a variable
> as "global" to "pull it in to scope" is a clunky, ass-backwards way of
> doing things.

Which is why, of course, that parameters were invented "way back when".


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread David Otton

On Mon, 3 Sep 2001 09:16:00 -0700, you wrote:

>I couldn't help but frown at this message...  This is typical of this and
>hundreds of other lists... instead of learning the language, people just
>jump in, try to write code, and then when something doesn't work, it's the
>language's fault...  It absolutely amazes me that such a huge number of
>people don't bother reading the manual or even attempt learning the
>basics...

The tone of your message is well-deserved... I switched to "help me"
mode long before I should have because I was under pressure of time.

>global variables have to be declared in functions.  It's a basic fact, and
>should've been learned before even attempting a line of code...

In fact, the function in question /already/ had a bunch of my own
variables declared global in it... I thoughtlessly jumped to the
conclusion that the install was at fault because i have reason not to
trust it.

My other point still stands though (I think) - that marking a variable
as "global" to "pull it in to scope" is a clunky, ass-backwards way of
doing things.

djo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with PHP_SELF

2001-09-03 Thread Joe Sheble \(Wizaerd\)

I couldn't help but frown at this message...  This is typical of this and
hundreds of other lists... instead of learning the language, people just
jump in, try to write code, and then when something doesn't work, it's the
language's fault...  It absolutely amazes me that such a huge number of
people don't bother reading the manual or even attempt learning the
basics...

global variables have to be declared in functions.  It's a basic fact, and
should've been learned before even attempting a line of code...


> -Original Message-
> From: David Otton [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 03, 2001 3:21 PM
> To: David Otton
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Problem with PHP_SELF
>
>
> On Mon, 03 Sep 2001 15:11:04 -0700, you wrote:
>
> Following up my own post (in case someone finds this in the archives):
>
> >Is there any situation where such variables would be available to
> >phpinfo(), but not the rest of the script?
>
> You can't see $PHP_SELF within a function until you declare it global.
>
> This language really frustrates me sometimes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread


From: David Otton <[EMAIL PROTECTED]>
Date: Mon, Sep 03, 2001 at 03:21:00PM -0700
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [PHP] Problem with PHP_SELF

> On Mon, 03 Sep 2001 15:11:04 -0700, you wrote:
> 
> Following up my own post (in case someone finds this in the archives):
> 
> >Is there any situation where such variables would be available to
> >phpinfo(), but not the rest of the script?
> 
> You can't see $PHP_SELF within a function until you declare it global.
> 
> This language really frustrates me sometimes...





It's not so frustrating if you configure it correct. If you set
register_globals, you can just use 'm everywhere. It's not something
you should do, though. You can better use $HTTP_SERVER_VARS[]. It's
(some) safer. For those you don't need to turn on the
register_globals. Just turning on track_vars will do then. And from
PHP 4.0.3 you don't even need to do that.


PHP variables

These variables are created by PHP itself. The $HTTP_*_VARS
variables are available only if the track_vars configuration is
turned on.  When enabled, the variables are always set, even if they
are empty arrays. This prevents a malicious user from spoofing these
variables.

Note: As of PHP 4.0.3, track_vars is always turned on, regardless of
the configuration file setting.

If the register_globals directive is set, then these variables will
also be made available in the global scope of the script; i.e.,
separate from the $HTTP_*_VARS arrays. This feature should be used
with care, and turned off if possible; while the $HTTP_*_VARS
variables are safe, the bare global equivalents can be overwritten
by user input, with possibly malicious intent. If you cannot turn
off register_globals, you must take whatever steps are necessary to
ensure that the data you are using is safe.


See: http://www.php.net/manual/en/language.variables.predefined.php



-- 

* R&zE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread David Otton

On Mon, 03 Sep 2001 15:11:04 -0700, you wrote:

Following up my own post (in case someone finds this in the archives):

>Is there any situation where such variables would be available to
>phpinfo(), but not the rest of the script?

You can't see $PHP_SELF within a function until you declare it global.

This language really frustrates me sometimes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem with PHP_SELF

2001-09-03 Thread David Otton

Hi, small problem :

phpinfo() shows all kinds of useful variables like PHP_SELF,
PATH_INFO, etc etc but I can't see them from my script.

I get a error - "Warning: Undefined variable: PATH_INFO in
[scriptname] on line 13"

Is there any situation where such variables would be available to
phpinfo(), but not the rest of the script?

Setup is Win2K, Apache, PHP 4.06

Any thoughts?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with PHP_SELF

2001-05-18 Thread James Holloway

Gah!  Forgot an element for that form:  Page element.

">

:)


> Hi Richard.
>
> Two methods, POST and GET:  Post for forms and best works with hidden
> elements.
>
> Get can be put across URL's:
>
> echo "Next";
>
> Or
>
> " METHOD="POST">
> " VALUE=" ?>">
> 
> 
>
> Of course form buttons look dreadful, so if you use that method, create a
> graphic to use, or do a javscript work around for text links. Hope that
> helps :)
>
> James.
>
> "Richard Kurth" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >   I am having a problem with this script. It works perfect if I just do
> >   a Query like ("SELECT * FROM customers") but if I call it from
> >   another script with a form to set the search criteria for this Query
> >("SELECT * FROM customers WHERE $metode LIKE '%$search%'") It will
> >show the first page but it gives me a error for any other page the
> >problem is it does not pass the $metode $search on to the next page
> with
> >PHP_SELF (look at bottom of script) How can I make it retain the
> >variables to the next page?
> >
> > // Number of entries per page
> > $per_page = 3;
> > $sql_text = ("SELECT * FROM customers WHERE $metode LIKE '%$search%'");
> >
> >
> > // Set page #, if no page is specified, assume page 1
> > if (!$page) {
> >$page = 1;
> > }
> > $prev_page = $page - 1;
> > $next_page = $page + 1;
> >
> > $query = mysql_query($sql_text);
> >
> > // Set up specified page
> > $page_start = ($per_page * $page) - $per_page;
> > $num_rows = mysql_num_rows($query);
> >
> >
> > if ($num_rows <= $per_page) {
> >$num_pages = 1;
> > } else if (($num_rows % $per_page) == 0) {
> >$num_pages = ($num_rows / $per_page);
> > } else {
> >$num_pages = ($num_rows / $per_page) + 1;
> > }
> > $num_pages = (int) $num_pages;
> >
> > if (($page > $num_pages) || ($page < 0)) {
> >
> > }
> > //
> > // Now the pages are set right, we can
> > // perform the actual displaying...
> > $sql_text = $sql_text . " LIMIT $page_start, $per_page";
> > $query = mysql_query($sql_text);
> > ?>
> > 
> > 
> > Plan
> > Domain
> > First Name
> > Last Name
> > Company
> > Email
> > User Name
> > Password
> > 
> >  > //$query = mysql_query("SELECT * FROM customersWHERE $metode LIKE
> '%$search%' LIMIT 0, 30 ");
> > while ($row  =  mysql_fetch_array($query))
> >{$plan=$row["plan"];
> > $domaname=$row["domaname"];
> > $fname=$row["fname"];
> > $lname=$row["lname"];
> > $company=$row["company"];
> > $email=$row["email"];
> > $cusername=$row["cusername"];
> > $cpassword=$row["cpassword"];
> > echo "";
> > print
>
("$plan$domaname ong>$fname
>
$lname$company
g>$email$cusername$cpass
> word");
> > echo "";
> >}
> > echo "";
> > // Previous
> > if ($prev_page)  {
> >echo "Prev";
> > }
> >
> > // Page # direct links
> > for ($i = 1; $i <= $num_pages; $i++) {
> >if ($i != $page) {
> >echo "$i";
> >} else {
> >   echo " $i ";
> >}
> > }
> >
> > // Next
> > if ($page != $num_pages) {
> >echo "Next";
> > }
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Best regards,
> >  Richard
> > mailto:[EMAIL PROTECTED]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with PHP_SELF

2001-05-18 Thread James Holloway

Hi Richard.

Two methods, POST and GET:  Post for forms and best works with hidden
elements.

Get can be put across URL's:

echo "Next";

Or

" METHOD="POST">
" VALUE="">



Of course form buttons look dreadful, so if you use that method, create a
graphic to use, or do a javscript work around for text links. Hope that
helps :)

James.

"Richard Kurth" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>   I am having a problem with this script. It works perfect if I just do
>   a Query like ("SELECT * FROM customers") but if I call it from
>   another script with a form to set the search criteria for this Query
>("SELECT * FROM customers WHERE $metode LIKE '%$search%'") It will
>show the first page but it gives me a error for any other page the
>problem is it does not pass the $metode $search on to the next page
with
>PHP_SELF (look at bottom of script) How can I make it retain the
>variables to the next page?
>
> // Number of entries per page
> $per_page = 3;
> $sql_text = ("SELECT * FROM customers WHERE $metode LIKE '%$search%'");
>
>
> // Set page #, if no page is specified, assume page 1
> if (!$page) {
>$page = 1;
> }
> $prev_page = $page - 1;
> $next_page = $page + 1;
>
> $query = mysql_query($sql_text);
>
> // Set up specified page
> $page_start = ($per_page * $page) - $per_page;
> $num_rows = mysql_num_rows($query);
>
>
> if ($num_rows <= $per_page) {
>$num_pages = 1;
> } else if (($num_rows % $per_page) == 0) {
>$num_pages = ($num_rows / $per_page);
> } else {
>$num_pages = ($num_rows / $per_page) + 1;
> }
> $num_pages = (int) $num_pages;
>
> if (($page > $num_pages) || ($page < 0)) {
>
> }
> //
> // Now the pages are set right, we can
> // perform the actual displaying...
> $sql_text = $sql_text . " LIMIT $page_start, $per_page";
> $query = mysql_query($sql_text);
> ?>
> 
> 
> Plan
> Domain
> First Name
> Last Name
> Company
> Email
> User Name
> Password
> 
>  //$query = mysql_query("SELECT * FROM customersWHERE $metode LIKE
'%$search%' LIMIT 0, 30 ");
> while ($row  =  mysql_fetch_array($query))
>{$plan=$row["plan"];
> $domaname=$row["domaname"];
> $fname=$row["fname"];
> $lname=$row["lname"];
> $company=$row["company"];
> $email=$row["email"];
> $cusername=$row["cusername"];
> $cpassword=$row["cpassword"];
> echo "";
> print
("$plan$domaname$fname
$lname$company$email$cusername$cpass
word");
> echo "";
>}
> echo "";
> // Previous
> if ($prev_page)  {
>echo "Prev";
> }
>
> // Page # direct links
> for ($i = 1; $i <= $num_pages; $i++) {
>if ($i != $page) {
>echo "$i";
>} else {
>   echo " $i ";
>}
> }
>
> // Next
> if ($page != $num_pages) {
>echo "Next";
> }
>
>
>
>
>
>
>
>
>
>
>
>
>
> Best regards,
>  Richard
> mailto:[EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem with PHP_SELF

2001-05-18 Thread Richard Kurth

  I am having a problem with this script. It works perfect if I just do
  a Query like ("SELECT * FROM customers") but if I call it from
  another script with a form to set the search criteria for this Query
   ("SELECT * FROM customers WHERE $metode LIKE '%$search%'") It will
   show the first page but it gives me a error for any other page the
   problem is it does not pass the $metode $search on to the next page with
   PHP_SELF (look at bottom of script) How can I make it retain the
   variables to the next page?

// Number of entries per page
$per_page = 3; 
$sql_text = ("SELECT * FROM customers WHERE $metode LIKE '%$search%'");


// Set page #, if no page is specified, assume page 1
if (!$page) { 
   $page = 1; 
} 
$prev_page = $page - 1; 
$next_page = $page + 1; 

$query = mysql_query($sql_text);

// Set up specified page 
$page_start = ($per_page * $page) - $per_page; 
$num_rows = mysql_num_rows($query);


if ($num_rows <= $per_page) { 
   $num_pages = 1; 
} else if (($num_rows % $per_page) == 0) { 
   $num_pages = ($num_rows / $per_page); 
} else { 
   $num_pages = ($num_rows / $per_page) + 1; 
} 
$num_pages = (int) $num_pages; 

if (($page > $num_pages) || ($page < 0)) { 

} 
// 
// Now the pages are set right, we can 
// perform the actual displaying... 
$sql_text = $sql_text . " LIMIT $page_start, $per_page"; 
$query = mysql_query($sql_text); 
?>


Plan
Domain
First Name
Last Name
Company
Email
User Name
Password

";
print 
("$plan$domaname$fname
 
$lname$company$email$cusername$cpassword");
  
echo "";
   } 
echo "";
// Previous
if ($prev_page)  {
   echo "Prev"; 
}

// Page # direct links 
for ($i = 1; $i <= $num_pages; $i++) {
   if ($i != $page) {   
   echo "$i"; 
   } else { 
  echo " $i "; 
   } 
} 

// Next 
if ($page != $num_pages) { 
   echo "Next"; 
}













Best regards,
 Richard  
mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]