austonb
-
Posts
1 -
Joined
-
Last visited
Never
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
PHP include being written to div using JS DOM?
in PHP Coding Help
Posted
I've got my php code that queries/results from my mysql db here
[code]<?php
$con = mysql_connect("localhost","userr","passw*rd);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("databasee", $con);
$result = mysql_query("SELECT * FROM fags");
while($row = mysql_fetch_array($result))
{
echo "<b>". $row['Question'] . "</b><br/> " . $row['Answer'];
echo "<br />";
}
mysql_close($con);
?>[/code]
and then I use this php include tag/command/function
[code]<?php include("thefileurl/filename.php"); ?>[/code]
and I use it in this javascript function, which is located in an external file on my server(lamp server)
[code]function faqclick()
{ document.getElementById('sfhead').innerHTML="<br><h2>F.A.Q.</h2><h3>Frequently Asked Questions.</h3>";
document.getElementById('sfcontent').align="left";
document.getElementById('sfcontent').innerHTML="<?php include('http://hiphop-tops.com/testsite/header.php'); ?>";
}[/code]
does anyone have any insight as to why it's not working and what I can do to make it work?