Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 23
Joined: Wed Nov 30, 2011 6:51 am


Postby Sunny » Sun Oct 27, 2013 11:35 pm


What does action="<?php $_PHP_SELF ?> mean in the below line

<form method="post" action="<?php $_PHP_SELF ?>">


New php-forum User
New php-forum User
Posts: 16
Joined: Thu Jun 23, 2011 9:28 pm


Postby tiger » Mon Oct 28, 2013 12:03 am

For my understanding, it means that the webpage will submit to itself no matter what the file name is. so with the $_PHP_SELF you can put the php code inside the webpage (like what you did in your other post) not in another file, but the extension has to be .php NOT .html

php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Postby johnj » Mon Oct 28, 2013 12:29 am

I don't understand what you meant by $_PHP_SELF. I think it has to be
action="<?php echo $_SERVER['PHP_SELF']; ?>"

Please read about Server and execution environment information from the php manual.

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests