i am trying to use a php script in my html website. The php script is working as intended when I run it. My php script:
<?php
mysql_connect("localhost","demo","123abc");
mysql_select_db("demo");
$sql=mysql_query("SELECT vorname FROM users");
if(mysql_num_rows($sql)){
$select= '<select name="select">';
while($rs=mysql_fetch_array($sql)){
$select.='<option value='.$rs['vorname'].'>'.$rs['vorname'].'</option>';
}
}
$select.='</select>';
echo $select;
?>
Now what I want is, to have the dropdown on my website on different locations. My idea was to just insert the php script whenever I need it. My html part:
<td>
<?php include 'http://localhost/Testsamples/test.php'; ?>
</td>
But it is not working and I don't know why. Can someone help me out?
Thanks
.htmlextension. Change that to.phpas well.htmltophpprobably. Modifying the OP's server settings is indeed a bit out of the scope of this question :-)