Joan Garnet wrote:Nice fix

I saw your post, but I didn't know how to fix it..
This function is new for me, but now not anymore.
Where did you find it?? I can't find any reference..
I guess it gives the relative path from the root directory.
ThanX for sharing!
;)
I looked around the net and on the PHP manual (got the welp file on my desktop) and looked around in environement variables. There is alot you can do with variables and system variables other than Document root.
Here is a link to a document you should read if your interested in environment variables;
http://www.phpbuilder.com/manual/language.variables.predefined.php
phpbuilder.com/manual has very good stuff in it.
Also, place the following in a file named variables.inc in the current directory.
- Code: Select all
<?php
// Print Environment Variables
echo "<b>Environment Variables from \$HTTP_ENV_VARS</b><br><br>";
reset($HTTP_ENV_VARS);
while (list ($key, $val) = each ($HTTP_ENV_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print GET Variables
echo "<br>";
echo "<b>GET Variables from \$HTTP_GET_VARS</b><br><br>";
reset($HTTP_GET_VARS);
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print POST Variables
echo "<br>";
echo "<b>POST Variables from \$HTTP_POST_VARS</b><br><br>";
reset($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print COOKIE Variables
echo "<br>";
echo "<b>COOKIE Variables from \$HTTP_COOKIE_VARS</b><br><br>";
reset($HTTP_COOKIE_VARS);
while (list ($key, $val) = each ($HTTP_COOKIE_VARS)) {
print $key . " = " . $val . "<br>";
}
// Print SESSION Variables
echo "<br>";
echo "<b>SESSION Variables from \$HTTP_SESSION_VARS</b><br><br>";
reset($HTTP_SESSION_VARS);
while (list ($key, $val) = each ($HTTP_SESSION_VARS)) {
print $key . " = " . $val . "<br>";
}
?>
Call the file with the following at any point in your page where you would like the variables output.
- Code: Select all
<?php
require("variables.inc");
?>
Later!
NPereira