I expected to see "<?php" as the output. However, the output seems to be interpreted as php code and executed again by the server and at the end I get nothing for output.Code:<?php $str = "<?php"; echo $str; ?>
I expected to see "<?php" as the output. However, the output seems to be interpreted as php code and executed again by the server and at the end I get nothing for output.Code:<?php $str = "<?php"; echo $str; ?>
When you run the page, look at the source (ie 'View Source" )
The output is there. Just not visible due to the fact the browser thinks < is starting an html tag and does not display it.
Nothing is always absolutely so.
You should be correct, and what you said is exactly what I thought.
However, by viewing the source of the page, I found nothing there.
Nonetheless, your way did work. Use < to replace the < did solve this problem.
Interesting, which browser do you use?
FireFox shows a blank page, but the source reveals the output.
IE8 shows the output as text
Chrome seems to show nothing in display or source.
Nothing is always absolutely so.
Chrome appears to strip XML processing instructions, even when displaying an unrendered view of the response body.
If you set the content type to "text/plain", you'll see everything.Code:<?foo ?>bar<?qux quux?>
Also, Chrome will display output in the source view after a "?>".PHP Code:<?php header('Content-type: text/plain'); $fmt='<?php header(\'Content-type: text/plain\'); $fmt=\'%s\'; printf($fmt, addcslashes($fmt, \'\\\'\\\\\')); ?>'; printf($fmt, addcslashes($fmt, '\'\\')); ?>
PHP Code:<?php $fmt='<?php $fmt=\'%s\'; printf($fmt, addcslashes($fmt, \'\\\'\\\\\')); ?>'; printf($fmt, addcslashes($fmt, '\'\\')); ?>
Last edited by misson; 04-06-2010 at 08:54 PM.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
That's it. I was using chrome.
Now I know that "viewing source" won't necessarily give me the real source. Chrome the cheater!