hello,
i am trying php in html and getting following problem...
code:
<h3>hello!</h3>
<?php
echo "<p>in php</p>";
?>
<p>out of php</p>
Output:
hello!
in php
"; ?>
out of php
why i am getting "; ?>...code is in htdocs with .php extention....i am currently using windows notepad...plz also guide me which editor should i use DreamWeaver or PDT or any other?...rest php and apache are working well
problem using php in html
Moderator: General Moderators
Re: problem using php in html
For some reason PHP isn't executing that file.
The file should be somewhere in Apache's web files: probably the htdocs folder. Apache also needs to be set up to run PHP files.
The file should be somewhere in Apache's web files: probably the htdocs folder. Apache also needs to be set up to run PHP files.
Re: problem using php in html
hello
i edit my code to
<h3>hello!</h3>
<?php while(1); ?>
<?php echo "<p>in php</p>";
?>
<p>out of php</p>
but i am getting same output with "; ?>......my code is in apache htdocs folder....i think there is some configuration problem....
i edit my code to
<h3>hello!</h3>
<?php while(1); ?>
<?php echo "<p>in php</p>";
?>
<p>out of php</p>
but i am getting same output with "; ?>......my code is in apache htdocs folder....i think there is some configuration problem....
Re: problem using php in html
Me too. Read tasairis comment one more time.
Hint:
Hint:
Apache also needs to be set up to run PHP files.
Re: problem using php in html
hello
i am still not able to find the problem....when i am including PHPIniDir "c:/php" in apache conf file it is not starting....if i am using following code , without making above entry, i am not getting any output...the codes that i posted previously are also without this entry in apache conf file
code:
<?php
$like = "I like php but";
print $like;
$num = 12345;
print $num;
?>
please tell me the problem....what is the problem in configuration file if any...plz help
i am still not able to find the problem....when i am including PHPIniDir "c:/php" in apache conf file it is not starting....if i am using following code , without making above entry, i am not getting any output...the codes that i posted previously are also without this entry in apache conf file
code:
<?php
$like = "I like php but";
print $like;
$num = 12345;
print $num;
?>
please tell me the problem....what is the problem in configuration file if any...plz help
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: problem using php in html
index.php
If you dont see anything, you are doing good.
Code: Select all
<?php
exit;
echo 'PHP is not executing...';
?>Re: problem using php in html
Try this:
This should produce a very long list of settings for PHP. If it doesn't work, PHP isn't running and you need to carefully go through your Apache configuration (httpd.conf) as well as PHP configuration (php.ini) to determine what's wrong. There are lots of references online as to what needs to be in each of those files.
Code: Select all
<?php echo phpinfo(); ?>Re: problem using php in html
hello
my problem has been solved .....actually i did a small mistake ...thanks u all for helping
my problem has been solved .....actually i did a small mistake ...thanks u all for helping