For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > December 2004 > server has problems with php self









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author server has problems with php self
Wayne...

2004-12-24, 4:00 am

Is there any other way to reload a page apart from PHP_SELF ? as my server
seems to refuse to have anything to do with it at all!
I know this is a bit of a newbie question but so far I'm running up against
a massive brick wall with a file upload script I am working on.
thanks in advance.

Wayne...


Anthony Plunkett

2004-12-24, 4:00 am

Wayne... wrote:
> Is there any other way to reload a page apart from PHP_SELF ? as my server
> seems to refuse to have anything to do with it at all!
> I know this is a bit of a newbie question but so far I'm running up against
> a massive brick wall with a file upload script I am working on.
> thanks in advance.
>
> Wayne...
>
>



You didn't mention how you're currently going about it, so I'm assuming
you're having a form submitting to itself, and the simple answer would
be, just leave the form action empty; by default it submits to itself.

eg:

#test.php

<form method=post action="">
<input type="hidden" name="f_hidden" value="voila!">
<input type="submit">
</form>

<?php

echo $_POST["f_hidden"];

?>

Hope that helps,

Anthony.
Hilarion

2004-12-27, 3:55 pm

> You didn't mention how you're currently going about it, so I'm assuming you're having a form submitting to itself, and the simple
> answer would be, just leave the form action empty; by default it submits to itself.


This solution was allready discussed on this group, but I'll remind the facts:
"action" attribute in "form" tag is required and when it's missing, then
the browser decides how to inteprete it (some will not treat it as a valid
form, some will, but still they may respond differently).

Hilarion


Hilarion

2004-12-27, 3:55 pm

> Is there any other way to reload a page apart from PHP_SELF ? as my server
> seems to refuse to have anything to do with it at all!


How do you use PHP_SELF? How does the server "refuse to have anything to do
with it"?

You might want to take a look at:

related predefined constant:
__FILE__

related predefined variables:
$_SERVER['PHP_SELF'] - this differs from __FILE__ !! (try in included files)
$_SERVER['DOCUMENT_ROOT']
$_SERVER['SCRIPT_FILENAME']
$_SERVER['PATH_TRANSLATED']
$_SERVER['SCRIPT_NAME']


Hilarion


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com