PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
richie256
Forum Commoner
Posts: 37 Joined: Mon Oct 13, 2003 8:00 pm
Location: Montréal/Canada
Post
by richie256 » Mon Apr 12, 2004 8:07 pm
I don't know why, but I am getting this error:
Code: Select all
Forbidden
You don't have permission to access /<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>C:/Program Files/Apache Group/Apache2/htdocs/clients.php</b> on line <b>203</b><br /> on this server.
here on line 203:
Code: Select all
<?php
<form method="post" action="<?php echo $PHP_SELF; ?>?mode=add">
?>
I really don't know why I can't use $PHP_SELF
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Mon Apr 12, 2004 8:11 pm
Code: Select all
$_SERVER['PHP_SELF']
// or EDIT:
action={$_SERVER['PHP_SELF']} method="GET" ect...
Steveo31
Forum Contributor
Posts: 416 Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA
Post
by Steveo31 » Mon Apr 12, 2004 8:51 pm
I had this problem.
Code: Select all
<form method="get" action="<?php $_SERVER['PHP_SELF'] ?>">
You cant have it be a POST form with GET variables appended to it.
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Mon Apr 12, 2004 8:58 pm
You cant have it be a POST form with GET variables appended to it.
Sure you can
Example:
Code: Select all
<?php
if(!empty($_GET)){
var_dump($_GET);
}
if(!empty($_POST)){
var_dump($_POST);
}
?>
<html>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>?id=45">
<input type="text" name="uname">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
Steveo31
Forum Contributor
Posts: 416 Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA
Post
by Steveo31 » Mon Apr 12, 2004 11:22 pm
Really... wow. My bad. Didn't know that