Can anyone teach me how to code php? And to use header('location')? Thanks in advance. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone teach me how to code php? And to use header('location')? Thanks in advance.

php codes.

19th Mar 2017, 2:21 PM
Sedrick Panganiban
Sedrick Panganiban - avatar
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"); } ?>
19th Mar 2017, 2:44 PM
เคฆเฅ‡เคตเฅ‡เค‚เคฆเฅเคฐ เคฎเคนเคพเคœเคจ (Devender)
เคฆเฅ‡เคตเฅ‡เค‚เคฆเฅเคฐ เคฎเคนเคพเคœเคจ (Devender) - avatar
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.
19th Mar 2017, 2:50 PM
Sedrick Panganiban
Sedrick Panganiban - avatar
0
That true, the example cited above was just about the usage.
19th Mar 2017, 3:10 PM
เคฆเฅ‡เคตเฅ‡เค‚เคฆเฅเคฐ เคฎเคนเคพเคœเคจ (Devender)
เคฆเฅ‡เคตเฅ‡เค‚เคฆเฅเคฐ เคฎเคนเคพเคœเคจ (Devender) - avatar
0
Thanks sir :)
19th Mar 2017, 11:20 PM
Sedrick Panganiban
Sedrick Panganiban - avatar