0
Can anyone teach me how to code php? And to use header('location')? Thanks in advance.
php codes.
4 Answers
+ 2
php is a server side scripting language that is widely used for developing dynamic websites.
1. PHP script file saved with extension '.php'
2. It can be easily blend with html language.
3. PHP block is enclosed in <?php ?> enclosure
4. Most of the basic programming consturcts are similar to C/C++/Java
5. Variables are declared in perl style i.e., variable name preceded by
$ symbol. Data type of variable is decided by the value stored in it
example: $age = 23;
6. PHP fully supports database connectivity.
7. WAMP/XAMPP for windows MAMP for MAC are the best suite that install and
configure all tools required for web development using php.
Now header("location: url") function redirects to the page specified by the url.
Example
<?php
if (!loggedin){
header("Location: login.php");
}
?>
0
Thanks sir :) But when i search on the internet when their using php its have a word isset example. if(isset($_SESSION['login'])) header("location:login.php")like that.
0
That true, the example cited above was just about the usage.
0
Thanks sir :)