Page 1 of 1
Configuring PHP
Posted: Wed Jan 08, 2014 11:05 pm
by sundaresh
In my default php installation the echo with double quotes ", does'nt work, and the variable names are not substituted
with their values within the string, but single quotes with catenation operator works.How do I fix this problem ?
Re: Configuring PHP
Posted: Thu Jan 09, 2014 12:39 am
by requinix
By fixing your code. Because I guarantee you it's not quite what you've said it is.
Exactly what code isn't working?
Re: Configuring PHP
Posted: Fri Jan 10, 2014 9:53 pm
by sundaresh
Here is my code, which I executed
$limit=5;
echo "<p> $limit </p>"; // This does'nt work
echo '<p>'.$limit.'</p>'; // This works
I had a whole web-page coded in double-quotes and it displayed blank;
but when I changed them all to single quotes the page is displaying properly.
Re: Configuring PHP
Posted: Fri Jan 10, 2014 10:16 pm
by Christopher
I have never heard of that happening. Does it happen on every page on this server? Or only on this page?
Re: Configuring PHP
Posted: Fri Jan 10, 2014 10:19 pm
by Celauran
Also, you're saying the output is blank. Is error reporting enabled? Anything in the logs?
Re: Configuring PHP
Posted: Sat Jan 11, 2014 12:12 am
by requinix
sundaresh wrote:Here is my code, which I executed
$limit=5;
echo "<p> $limit </p>"; // This does'nt work
echo '<p>'.$limit.'</p>'; // This works
I had a whole web-page coded in double-quotes and it displayed blank;
but when I changed them all to single quotes the page is displaying properly.
So if you execute
that exact code, you get
as output?
Re: Configuring PHP
Posted: Sat Jan 11, 2014 10:26 pm
by sundaresh
When I execute the first echo seperately I get a blank-page.
When I execute the second echo I get 5 displayed on my browser.
I have'nt tried executing php on the console so I do'nt know, the php output.But the final html file is a blank when
I seperately use the first echo and the html is alright when I use the second format of echo.
Re: Configuring PHP
Posted: Mon Jan 13, 2014 5:50 pm
by requinix
So how about copy/pasting the entire, unaltered, exact contents of the file you are executing that contains both the working and not-working examples? Then browse to the script, do a View Source, and copy/paste the entire, unaltered, exact HTML you see.