$_SERVER[‘PHP_SELF’] will be used for getting current page name in php.
It will be necessary for us to use this $_SERVER[‘PHP_SELF’] for action attribute of form element if you want to post the form into the same page. If you use the filename instead of this variable then we may face difficulty when we change the file name.
If the page is located in sub-folder, then this variable will return the page name along with sub-folder name also (e.g qualtypoint/index.php)
If you want to get only the filename (e.g index.php) then you should use basename() as below.
basename($_SERVER[‘PHP_SELF’])
More Articles...
Search This Blog
AI Course | Bundle Offer | Unlocking AI | Dream Big | Listen to Dream Big
Today's Deals | Timesheet | Products | SQL ebook | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
Today's Deals | Timesheet | Products | SQL ebook | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
No comments:
Post a Comment