New Users: Quick PHP CGI: Difference between revisions

m
no edit summary
mNo edit summary
 
Line 44: Line 44:




'''''Note 1:''''' PHP on Uniform Server has been set for '''short_open_tag on''' hence you can use '''<? ?>''' instead of '''<?php ?>'''<br>
'''''Note 1:''''' PHP on Uniform Server has been set for '''short_open_tag on''' hence you can use '''<? ?>''' instead of '''<?php ?>'''
 
However it is recommended you do not use short tags. All Uniform Server versions that include PHP 5.3.* has short tags disabled. 
 
'''''Note 2:''''' You can set Apache to use other file extension other than php see [[New Users: Quick PHP Info#PHP file extensions| PHP file extensions]] for details.
'''''Note 2:''''' You can set Apache to use other file extension other than php see [[New Users: Quick PHP Info#PHP file extensions| PHP file extensions]] for details.


Line 56: Line 59:
<title>Test 2</title>
<title>Test 2</title>
<body>
<body>
   <? phpinfo(); ?>
   <?php phpinfo(); ?>
</body>
</body>
</html>
</html>
Line 74: Line 77:
<pre>
<pre>
<html>
<html>
<? print "<title>PHP Info page test 3</title>\n"; ?>
<?php print "<title>PHP Info page test 3</title>\n"; ?>
<body>
<body>
<?php
<?php
Line 80: Line 83:
?>
?>
</body>
</body>
<? print "</html>" ?>
<?php print "</html>" ?>
</pre>
</pre>
Display the page by typing '''<nowiki>http://localhost/test3.php</nowiki>''' into your browser address bar.
Display the page by typing '''<nowiki>http://localhost/test3.php</nowiki>''' into your browser address bar.
Line 150: Line 153:
<nowiki><title>Test 6</title></nowiki><br>
<nowiki><title>Test 6</title></nowiki><br>
<body><br>
<body><br>
'''<nowiki><? include 'banner.php'; ?></nowiki>'''<br>
'''<nowiki><?php include 'banner.php'; ?></nowiki>'''<br>
<nowiki><p>This is my main page content</p></nowiki><br>
<nowiki><p>This is my main page content</p></nowiki><br>
<nowiki></body></nowiki><br>
<nowiki></body></nowiki><br>
'''<nowiki><? include 'footer.php'; ?></nowiki>'''<br>
'''<nowiki><?php include 'footer.php'; ?></nowiki>'''<br>
<nowiki></html></nowiki><br>
<nowiki></html></nowiki><br>
|}
|}