- Dec 27, 2001
- 3,493
- 92
- 91
How would you put this php script into a flash swf file?
Basically, the script logs onto the server and pulls the schedule and outputs it into a table. The result can be seen here
I know Flash cant just display a php file. Have been searching on google but maybe I haven?t search with the right keyword. Any advice?
The php code is:
===========
<?
$connection = mysql_connect("localhost","x","x");
if (!$connection)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
$db = mysql_select_db("verge", $connection);
$today = date(D);
$sql = mysql_query("SELECT * FROM `daily` where day='".$today."' ORDER BY 'mil_time' ASC");
$num_results = mysql_num_rows($sql);
if ($num_results<>0)
{
echo "<table align=center width=223 cellpadding=0 cellspacing=5 border=0 class=todaycontent>";
while ($row = mysql_fetch_array($sql)) {
$field1 = $row["time"];
$field2 = $row["classes"];
$field3 = $row["teacher"];
echo "<tr><td width=55>$field1<td>$field2<td>$field3</td></tr>";
}
echo "</table>"; }
?>
Basically, the script logs onto the server and pulls the schedule and outputs it into a table. The result can be seen here
I know Flash cant just display a php file. Have been searching on google but maybe I haven?t search with the right keyword. Any advice?
The php code is:
===========
<?
$connection = mysql_connect("localhost","x","x");
if (!$connection)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
$db = mysql_select_db("verge", $connection);
$today = date(D);
$sql = mysql_query("SELECT * FROM `daily` where day='".$today."' ORDER BY 'mil_time' ASC");
$num_results = mysql_num_rows($sql);
if ($num_results<>0)
{
echo "<table align=center width=223 cellpadding=0 cellspacing=5 border=0 class=todaycontent>";
while ($row = mysql_fetch_array($sql)) {
$field1 = $row["time"];
$field2 = $row["classes"];
$field3 = $row["teacher"];
echo "<tr><td width=55>$field1<td>$field2<td>$field3</td></tr>";
}
echo "</table>"; }
?>