Hi,
Thanks ahead of time. I think I found the right place to get my head straightened out by finding this forum.
I am not new to programming in general but i am new to php.
Problem.
When I type the following in the URL - the screen remains blank.
localhost/phpWithAlex/index.php
Background:
I am on a Mac. OS X 10.8. MountainLion.
I am using NETBEANS for my editor…
I enabled apache.
Within my httpd.conf file I uncommented one line - a load module as described in severals AMP setups.
From terminal i started apachectl and verified it is running.
Before doing any install, I cross-referenced to make certain that I was doing it right.
I downloaded phpMyAdmin.
from localhost/phpMyAdmin I logged on.
My approach:
I am doing a tutorial sequence that are videos by a guy named Alex.
They are very good. I went thru the entire sequence just listening and now I am coding or trying to do it with him.
But
Alex is using xampp on Windows.
Alex has a path such as this…
xampp > htdocs > series
WhereAs my path is…
Library > WebServer >Documents > phpWithAlex
‘Series’ is the folder where Alex is putting all the tutorial .php files.
'phpWithAlex is the folder I am putting all the files I am creating.
We created our first file called index.php.
Used the ‘hello world’ code.
[php]<?php
Echo ‘hello world’;
?>
[/php]
I refresh my screen localhost/phpWithAlex/
Yes there is Output Hello World on the screen.
Then we added this code.
[php]<?php
$name = ‘Alex’;
$age = 21;
if (strtolower($name)===‘alex’){
if($age>=21) {
echo ‘You\re over 21’;
if (1===1){
echo ‘Yes, 1 is equal to 1’;
}
}
}else {
echo ‘you’re not alex’;
}
?>[/php]
NO OUTPUT
I checked from the finder. The index.php is in the phpWithAlex folder; path Library/WebServer/Documents/phpWithAlex/index.php
Why would it work for the ‘hello world’ script but not now.
I am doing what he is doing and I check by code carefully.
thanks.