Hai, i'm currently trying to create a small database using php-4.3.0 and mysql3-23 run under linux red hat.
And i encounter the following problems :
<?php print $PHP_SELF; ?>
the command i used above didn't print anything. instead using $PHP_SELF, i tried to use <?php print "$_SERVER[PHP_SELF]; ?> and it works. and i was wondering why ? because the first command was actually from sample i read from a php book. Do i need to configure anything on my php to make the $PHP_SELF works ?
why couldn't i pass a variable after submitting a form with the same variable name ?
for example : i have
<form action="<?php print $SERVER[PHP_SELF]; ?>" method="POST">
<input type="text" name="username">
....
when i type onto the form and submit, the value which i typed is not pass on to variable "$username". Instead, if i use variable $POST["username"]; the value is passed..
the first method (without $POST["variable"]) is an example i saw in php book, which then i assume that it will pass the value onto $username..
again, do i need to configure anything on my php to make $username work instead of $POST["username"] ?
i create a class (php_class.php) in a different file from my main php file (php_main.php). so i use => include ("php_class.php"); inside php_main.php.
when i go to the browser, all my codes inside a php_class.php are pasted on the web.
anybody have any idea why this thing happened and how to fix it ?
i'm new in php, and books are the only references i have. i did exactly the same in the example, but it didn't work. so i find it very wierd. _______________..
thanks