php inside html is not working!<

liunx

Guest
i am trying to run this script within basic html! and it is not working. I want to include the scrolling forums for a guy on his site and I am tyring to test it out from his root!

<!-- m --><a class="postlink" href="http://www.lextasy.com/test.html">http://www.lextasy.com/test.html</a><!-- m -->

<html>

<head>
<title>New Page 1</title>
</head>

<body>
<?php
//
// Basic Configuration
// How Many Topics you want to display?
$topicnumber = 10;
// Scrolling towards up or down?
$scroll = "up";
// Change this to your phpBB path
$urlPath = "http://www.lextasy.com/forum";

// Database Configuration (Where your phpBB config.php file is located
include("forum/config.php");

// Connecting & Selecting Databases
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
mysql_select_db("$dbname") or die("Could not select database");

// Perform Sql Query
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");

// Outcome of the HTML
// Be carefull when you edit these!
print "<marquee id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"150\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='150'>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<tr valign='top'><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#FFCC00\"><b><a href=http://www.htmlforums.com/archive/index.php/\"$urlPath/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#000000\"> by: <a href=http://www.htmlforums.com/archive/index.php/\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" .
$row["username"] .
"</td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#ff0000\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr></font>";
}
print "</table></marquee>";

// Free Result
mysql_free_result($result);

// Close the Connection
mysql_close($link);
?>
</body>

</html>


that is not working and the same script is in his root folder also!!

<!-- m --><a class="postlink" href="http://www.lextasy.com/scroll.php">http://www.lextasy.com/scroll.php</a><!-- m -->


how do I get this to go inside the html properly and function or what am i doing wrong!!you have to rename the file from .html to .php in order to have the server analysing it...

or change the server configuration to parse every html file....Parsing of all HTML pages will load the server, best to change the names of files that need to be parsed to PHP and leave those that do not need to be parsed as HTML files.thanks for the responce. For some reason when I check the button to receive a reply, it is not working, I do not get the emails and the email here is correct!!!Thats a funnny post, but thats what the forums are for trial and error, I made the same mistake last year with my new site. Hahah.

Glad you got it now.
Good Luck.
 
Top