$_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...
Shop at Rajamanickam.com | Birthday Gift Idea? | Hire me for $6 per Hour
Get 3 useful ebooks for Rs 99 in India and $5.99 globally
Get a 75% commission | ChatGPT and and Google Gemini for Beginners (Use Discount code QPT)
Search This Blog
Art of Talking to AI | Tech eBook | Dream Big | Listen to Dream Big
Today's Deals | Timesheet | Products | 3 ebooks for $5.99 / Rs 99 | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
Today's Deals | Timesheet | Products | 3 ebooks for $5.99 / Rs 99 | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
No comments:
Post a Comment