Skip to content
Browse files

added php

  • Loading branch information...
0 parents commit d43799389f8b48acb85b19d06910ed633d3f19de @unknownforce committed Jan 16, 2012
Showing with 60 additions and 0 deletions.
  1. +18 −0 forms.php
  2. +24 −0 index.php
  3. +18 −0 name.php
18 forms.php
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Forms</title>
+</head>
+
+<body>
+
+<form>
+ <label for="planet">Fav. Planet</label>
+ <input id="planet">
+ <button type="submit">Submit</button>
+</form>
+
+
+</body>
+</html>
24 index.php
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Query Strings</title>
+</head>
+
+<body>
+<?php if (isset($_GET['name'])) : ?>
+<?php
+ echo $_GET['name'];
+ echo ' ';
+ echo $_GET['lastname'];
+?>
+<?php endif; ?>
+<br />
+<a href="name.php?name=Petrus">Petrus</a>
+<a href="name.php?name=Loser">Loser</a>
+<a href="name.php?name=Thomas">Thomas</a>
+<a href="name.php?name=Guyy">Guyy</a>
+
+
+</body>
+</html>
18 name.php
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Say Hello</title>
+</head>
+
+<body>
+
+<!--
+ 'isset()' allows us to check if an index in an array exists, before trying to use it
+-->
+<?php if (isset($_GET['name'])) : ?>
+<h1>Hello, <?php echo $_GET['name']; ?></h1>
+<?php endif; ?>
+
+</body>
+</html>

0 comments on commit d437993

Please sign in to comment.
Something went wrong with that request. Please try again.