Friday, 20 November 2015

19_PHP_SERVER_VARIABLE

$_SERVER VARIABLE


$_SERVER Variable is predefined set of environment to provide information. And it also allowed you to access information about the page, user request etc…


< ? php
$script_name1=$_SERVER['SCRIPT_NAME'];
echo $script_name1;
? >


This SCRIPT_NAME will gives us the current url run by the user…


create new page name “header.inc.php” file … Check out the code below..


Now call this header.inc.php file into index.php page … AS YOU CAN SEE THAT in HEADER.INC.PHP Page form action=”” is blank… Now Create anotherpage.php page


In anotherpage.php page also include the header.inc.php file


Now we want to do is … depending upon the page run by the user I want to update the form action…


We need to do some change in header.inc.php file



No comments:

Post a Comment