The Conservative Cave
The Help Desk => Computer Related Discussions & Questions => Topic started by: SSG Snuggle Bunny on April 04, 2012, 10:50:42 AM
-
Trying to learn php.
I DL'ed and installed WAMP and it appears to be running correctly.
I open my notepad and type the following, per the instructions of my "How-To" book:
<?php
echo "<table border=\"1\" cellpadding=\"4\" cellspacing=\"4\">n";
for ($y=1; $y<=12; $y++) {
echo "<tr> \n";
for ($x=1; $x<=12; $x++) {
echo "<td>";
echo ($x * $y);
echo "</td> \n";
}
echo "</tr> \n";
}
echo "</table>";
?>
The book says to save it as a .php file and put it in the document directory and then open using a web browser.
However, when I open using FF or IE all I get is the above code.
I even tried throwing html-head-body tags around it.
So what did I miss?
-
Did you name it index.php?
-
Did you name it index.php?
Das Book says to name it: testnestfor.php because it's teaching the nesting of loops.
-
Das Book says to name it: testnestfor.php because it's teaching the nesting of loops.
Yeah I guess you can do that too.
And you have IIS or Apache installed on your test machine?
-
Yeah I guess you can do that too.
And you have IIS or Apache installed on your test machine?
Yep. Apache.
And it is running...near as I can tell.
I'm not really trying to be a server admin. I'm trying to learn mySQL, XML, JavaScript etc. but to do that I need an Apache-esque server to run the documents thru.
-
Yep. Apache.
And it is running...near as I can tell.
I'm not really trying to be a server admin. I'm trying to learn mySQL, XML, JavaScript etc. but to do that I need an Apache-esque server to run the documents thru.
Yes you do. I don't see anything wrong with your code.
-
When I was learning PHP I had to install a MySQL server , PHP (http://windows.php.net/download/) Server and Apache server. All were free downloads and all ran on the same machine.
-
Trying to learn php.
I DL'ed and installed WAMP and it appears to be running correctly.
I open my notepad and type the following, per the instructions of my "How-To" book:
<?php
echo "<table border=\"1\" cellpadding=\"4\" cellspacing=\"4\">n";
for ($y=1; $y<=12; $y++) {
echo "<tr> \n";
for ($x=1; $x<=12; $x++) {
echo "<td>";
echo ($x * $y);
echo "</td> \n";
}
echo "</tr> \n";
}
echo "</table>";
?>
The book says to save it as a .php file and put it in the document directory and then open using a web browser.
However, when I open using FF or IE all I get is the above code.
I even tried throwing html-head-body tags around it.
So what did I miss?
Not versed in php at all but do you have to chmod php scripts so that they're executable?