Server Php Self

[Solved] Server Php Self | Php - Code Explorer | yomemimo.com
Question : php server self

Answered by : ramsey-ediku

<form action="<?php echo $_SERVER['PHP_SELF']; ?>">
//there is no reason to use this to submit form data to the same page
<form action="">
//will do the same thing

Source : https://stackoverflow.com/questions/14093316/why-use-serverphp-self-instead-of | Last Update : Tue, 18 Feb 20

Question : php server function

Answered by : eager-elephant-1rm0w76uduiv

<?php // PHP $_SERVER['...']; method // PHP file name echo 'PHP file name: '.$_SERVER['PHP_SELF'].'<br>'; // Server name echo 'Server name: '.$_SERVER['SERVER_NAME'].'<br>'; // HTTP host echo 'HTTP host: '.$_SERVER['HTTP_HOST'].'<br>'; // Refering link echo 'Refering link: '.$_SERVER['HTTP_REFERER'].'<br>'; // User agent echo 'User agent: '.$_SERVER['HTTP_USER_AGENT'].'<br>'; // Script name echo 'Script name: '.$_SERVER['SCRIPT_NAME']; // The rest is optional if($_SERVER['PHP_SELF']=='/filename.php'){ //If there is no folder echo 'No folder'.$_SERVER['PHP_SELF']; } else{ // Echo the name of the folder containing the PHP file echo 'PHP file name: '.$_SERVER['PHP_SELF']; } // The same if statements can be used for the script name if($_SERVER['SCRIPT_NAME']=='/filename.php'){ // If there is no folder echo 'No folder'.$_SERVER['SCRIPT_NAME']; } else{ // Echo the name of the folder containing the PHP file echo 'PHP file name: '.$_SERVER['SCRIPT_NAME']; } echo '<a href="repl.it/@CoolWebDev">More from me...</a>'; // I hope you found this helpful!
?>

Source : | Last Update : Mon, 13 Jul 20

Answers related to server php self

Code Explorer Popular Question For Php