Jump to content

Asnforum


baterdene

Recommended Posts

Hi,
I have tried to follow the instruction below, but could not get the web forum working. Could anybody tell me what should be done if one to follow this instruction? What is a "MySQL table based on "asnforum.sql" ASCII file" (where asnforum is the forum name)?

Create MySQL table based on "asnforum.sql" ASCII file. Use MySQL management software such as "PhpMyAdmin" to make this job easy.
Link to comment
Share on other sites

Thanks for replying! MySQL Server 5.0 is running on my computer. I can open this forum's index page. But if I try to access the admin page, I get the message below:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\Apache\htdocs\forum\admin.php on line 32
No records found!

If I try to post a new topic, I get the following message:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\Apache\htdocs\forum\newtopic.php on line 83

Try the last action for yourself using the link below:

[a href=\"http://www.emcd.info/forum/index.php\" target=\"_blank\"]webpage[/a]
Link to comment
Share on other sites

I think I have solved the problem myself. However, I have a new problem. When I submit a new topic, I get the message "No posting found" instead of the topic being posted. Try for yourself what I am talking about using the link below:

[a href=\"http://www.emcd.info/forum/index.php\" target=\"_blank\"]webpage[/a]


Do you think there is an error in the following script and that is why I am getting this result:

<?php

/*
___________________________________________________

project : asn forum version 2.0
file : newtopic.php
author : asn - webmaster@tourdebali.com
date : november 25th, 2004
note : copyright 2004 by asn
___________________________________________________

*/


include("config.php");
include("lib.php");
include("header.php");

?>

<script LANGUAGE="JavaScript">
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
</script>

<table width="200" border="0" cellspacing="0" cellpadding="1" bgcolor="#CCCCCC">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#f5f5f5">
<tr>
<td class="normal" align="center"><b>&nbsp;&nbsp;&nbsp;<a href="index.php" class="none">Forum Home</a>&nbsp;&nbsp;&nbsp;</b></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<b><span class="normal">Write your topic and welcome to Asn Forum!</span></b><br><br>
<form method="post" action="addtopic.php" name="posting">
<table width="500" border="0" cellspacing="0" cellpadding="15" class="replyform" bgcolor="#FBFBF0">
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="3"><tr>

<td width="25%" class="normal"><b>Your Name<font color="#FF0000">*</font></b></td>
<td width="75%">
<input type="text" name="nama">
</td>
</tr>
<tr>
<td class="normal"><b>Email<font color="#FF0000">*</font></b></td>
<td width="72%">
<input type="text" name="email" size="30">
</td>
</tr>
<tr>
<td class="normal"><b>Homepage</b></td>
<td>
<input type="text" name="homepage" size="30" value="http://">
</td>
</tr>
<tr>
<td class="normal"><b>Subject<font color="#FF0000">*</font></b></td>
<td>
<input type="text" name="topic" size="40">
</td>
</tr>
<tr>
<td class="normal" valign="top"><br><br><br><b>Topic Text<font color="#FF0000">*</font></b></td>
<td class="normal">
<textarea name="topictext" rows="7" cols="35" onKeyDown="textCounter(this.form.topictext,this.form.remLen,<?php echo $maxchar; ?>);" onKeyUp="textCounter(this.form.topictext,this.form.remLen,<?php echo $maxchar; ?>);"></textarea><br>
Character Left: <input readonly type=text name=remLen size=3 maxlength=3 value="<?php echo $maxchar; ?>">
<table border="0" cellspacing="0" cellpadding="5">

<?php
$query_smile = mysql_query("SELECT MIN(id), code, smile_url, emotion FROM forum_smile GROUP BY emotion LIMIT 0,20");
$counter = 10;
while($data_smile = mysql_fetch_row($query_smile)) {
if (($counter % 10) == 0) echo "<tr>";
echo "<td><a href=\"javascript:void(0);\" onClick=\"document.posting.topictext.value+='$data_smile[1] ';\"><img src=\"images/$data_smile[2]\" border=\"0\" alt=\"$data_smile[3]\"></a></td>";
if (($counter % 10) == 9) echo "</tr>";
$counter++;

}
?>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table></tr></table></form>

<?php include("footer.php"); ?>
Link to comment
Share on other sites

That script doesn't do anything -- it would be that form's action that would be responsible for actually inserting a new topic. But posting the entire script is not the best way to debug this -- see what actually happens on the DB end.
Link to comment
Share on other sites

I have only started learning MySQL so I guess I would not find what is wrong. If you do not mind, could you try installing this forum on your system. I have provided the source below:

[a href=\"http://script.tourdebali.com/asnforum.html\" target=\"_blank\"]source web page[/a]
Link to comment
Share on other sites

Install the forum? Not a chance -- this is a help forum, not a tech support forum, and no one has time for that; besides, the author has posted his e-mail address ([a href=\"mailto:mailto:webmaster@tourdebali.com\"]mailto:webmaster@tourdebali.com[/a]) for bugs & errors.

Like I said before, the error that you describe is being produced by the page that the form is being posted to (see the action attribute of the form tag). Take a look at that script, and begin debugging there. Initially, this will be in PHP, so your inexperience with MySQL should not make much of a difference. Besides, it's a great way to improve your skills.

Good luck.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.