July 22nd, 2013, 02:06 AM
PHP Basic Query
I am new person to PHP. Just using XAMPP V3.2.1. I have created two small scripts.
print "<h2>php program to add two numbers...</h2><br />";
$val1 = 20;
$val2 = 20;
$sum = $val2 + $val2; /* Assignment operator */
echo "Result(SUM): $sum";
echo "Hello World!";
The second script is showing a blank page in browser while 1st script is showing correct result. Any idea what could be the reason? Both look almost same.
July 22nd, 2013, 02:24 AM
dear you can check your spelling of html tags !
the spelling of title is wrong check and correct it first and then try again it will work . thanks
July 22nd, 2013, 06:40 AM
use PHP tags and you may see some errors highlighted. use a proper editor to edit, it will help you.
what are the names of the script? remember files need to end with .php!
July 22nd, 2013, 06:47 AM
kavin_brown already solved the problem: There was a typo in the closing title, which caused all content to appear in the title rather than on the page.
But using an editor or even an IDE is certainly a good idea, especially if you have trouble with splelnig.