-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpBasics.php
More file actions
79 lines (54 loc) · 1.83 KB
/
phpBasics.php
File metadata and controls
79 lines (54 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
//MODEL - data
//assign ariables at top of page
//access a database at top of page or near top of page
// get information available to bring in
//CONTROLLER - business logic/general code
//VIEW -user interface
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
/*
behind wordpress
server side language similar to javascript, etc
which language depends on company and what type of work being done
c# and Java need to get to advanced before get to server side
still need an html component
can start with a .html for autocomplete in html language then change
extention to .php
can put php anywhere on a page
php real goal is display information out to the customer
echo = document.write or print
*/
<h1>WDV341 Intro PHP</h1>
<h2>PHP Basics and Examples</h2>
<h3>Hello from PHP</h3>
<h3 class='greetingLine'>Welcome Mary</h3>
<?php
echo "<h3>Hello from PHP</h3>";
//will display the view of the user so is placed in the 'VIEW'
//source code modified by the server environement
?>
<h3 class=<?php echo "'greetingLine'" ?>>Welcome: <?php echo "Mary"; ?> </h3>
<label for="colorRed">Red:</label>
<input type="radio" name="colorGroup" value="red">
<?php
for ($x=0; $x < count($colors); $x++){
$radioColor = $colors[$x];
//echo $colors [$x];
echo "<div>";
echo "<label for='color$colors[$x]'>$radioColor:</label>";
echo "input type='radio' name='colorGroup' id='colorBlue' value=' "
. strtolower($radioColor) . "'>";
echo "</div>";
}
//Parse error -- syntax error, unexpected token "echo", expecting "," or";' . . .
//php requires semicolons in order to run correctly
?>
</body>
</html>