Jump to content

hi im new to php

- - - - -

  • Please log in to reply
3 replies to this topic

#1
tofikey

tofikey

    Newbie

  • Members
  • Pip
  • 2 posts
hi i created a simple html with php script in it but my brovser does not show the output of php it shows just html output.
here is the code
<html>

<head>

<title>Hello in PHP</title>

</head>

<body>

<h1>Hello in PHP</h1>


<?

print "Hello, world!";

phpInfo();

?>


</body>

</html>

i used easyphp to install apache php and mysql

Edited by Orjan, 31 December 2010 - 12:44 PM.


#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
Hi, your code probably threw an error and prevented output, try this following code:
<?php 
ini_set('display_errors', 1);
error_reporting(E_ALL);
print "Hello, world!";  
phpInfo();  
?>
That will turn on error reporting, and it should tell you "Call to undefined function phpInfo();"

Try this:
<?php
print "Hello, world!";  
phpinfo();  
?>

Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
tofikey

tofikey

    Newbie

  • Members
  • Pip
  • 2 posts
i recognised that the problem is that my localhost does not show php files i make folder with php file in it under www folder. when i click in localhost certain folder it does not show php files.

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
Hi, are you sure wamp is running without error, and you typed the name of the PHP file manually?
i.e. C:\wamp\www\hello.php and browsing http://localhost/hello.php
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users