|
|
10.3: Enable the built-in PHP module
Great hint! The test file needs brackets after the 'phpinfo' line though. Here is the correct version
10.3: Enable the built-in PHP module
No, PHP doesn't need the ?> at the end of a script for it to parse correctly. May be nice for appearances (and necessary for brain-dead editors like Dreamweaver), but on the other hand, any empty lines you may have in your PHP after the closing tag, will be sent out to the client, which is unnecessary.
works fine.
10.3: Enable the built-in PHP module
Just because it can be done doesn't mean it's correct. The whole point of "smart" markup languages like PHP, SSI, ASP, or JSP is to contain the advanced logic inside of HTML/XML/SGML tags so that the document remains otherwise syntactically valid. If Dreamweaver complains about a dangling marker like PHP's "?>", it's doing the right thing. Come on, its only another two characters (three if you count a line break) -- it's not hard to include, and doing so is one way to avoid a mentality of sloppiness that can come back to haunt you when debugging other code later. ---
10.3: Enable the built-in PHP module
Actually, I was talking about the () brackets. The original post had only :
10.3: Enable the built-in PHP module
What? That doesn't work -- the 'greater than' character at the end of the first line breaks everything. Didn't you test this before commenting? The version that actually works looks like this: <?php phpinfo(); ?> The version given earlier, which starts <?php>, just returns a blank web page for me. Drop the '>' from that line and it works. (The hint text is now using the broken version -- it probably should be amended.) Also, I've tried two variations that give much different results: <!-- variation ONE: gives a roughly plain text page back --> <?php phpinfo; ?> <!-- variation TWO: gives a colorful, formatted page with tables, etc --> <?php phpinfo() ?> I don't know enough PHP to speculate about what the difference is here, or why the result is so different. Is it because there are no line breaks in the second version? Is it because there is no 'end of line' character in that one? I can't figure out what the important difference is between the two tags, but they give very dissimilar output after being served. --- |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.07 seconds |
|