$_SERVER[PHP_SELF] - problem

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

Post Reply
r_amin
Forum Newbie
Posts: 3
Joined: Fri May 11, 2007 11:31 am

$_SERVER[PHP_SELF] - problem

Post by r_amin »

Code: Select all

<form name="myForm" action='$_SERVER[PHP_SELF]' onsubmit="return validate_form(this);" method="POST">
It returns the massage
The requested URL /web_PSoriasis/$_SERVER[PHP_SELF] was not found on this server.

what's the problem hare?


Please Help emmediately.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I suspect you aren't using echo()/print().
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: $_SERVER[PHP_SELF] - problem

Post by Christopher »

Yes, is should either be:

Code: Select all

<form name="myForm" action='<?php echo $_SERVER[PHP_SELF]; ?>' onsubmit="return validate_form(this);" method="POST">

Code: Select all

echo "<form name=\"myForm\" action=\"$_SERVER[PHP_SELF]\' onsubmit=\"return validate_form(this);\" method=\"POST\">";
(#10850)
Post Reply