Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php lines is not working in html file

Status
Not open for further replies.

ariefk

Technical User
Mar 17, 2002
18
ID
This is a simple dropdown list test .html file that is not working. Neither with a simple php echo test on 7th line. Both php script doesn't show at all on execution.
I suppose something went wrong on my apache or php configuration. I use Apache 2.x, PHP 4.x on Windows 98.

<html>
<head>
<title>New Page 1</title>
</head>
<body>
<p>Dropdown Test - Education</p>
<?php echo("Yahooo"); ?>
<form method="POST" action="test.php">
Pendidikan : <select size="1" name="Pendidikan">
<script language="php">
include "./common_db.inc";
$link_id = db_connect('pasi');
$query = "SELECT * FROM master_pendidikan";
$result = mysql_query($query) or die (mysql_error());
if(mysql_num_rows($result)) {
while($row = mysql_fetch_row($result))
{
print("<option value=\"$row[0]\">$row[1]</option>");
}
} else {
print("<option value=\"\">No data</option>");
}
</script>
</select></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
</body>
</html>

Any suggestion ?
 
This problem solved by adding these lines on my httpd.conf. Somehow it doesn't work just by creating .htaccess on my htdocs.

Thanks
 
i dont get it, a php file must be named as .php, why did u name it as .html???

Known is handfull, Unknown is worldfull
 
It's an html file with php script inserted within it.
 
You can parse any extension you like as long as you tell apache what to do.

Personally I have apache parsing .jpeg for php content.

If you have the Allo Override direcive set correctly, a .htaccess file should work, but this would be best discussed in the apache forum.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Obviously, <script language="php"> is not supported on your PHP installation (it's not recommended escaping method). Use common <?php ... ?> tags.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top