I have been in the couple of days trying to figure out a way how I can make my posting for my bulliten board work then i came up with a Idea of haveing the blob for each messages record the spot of which messges goes in there but I am angry Because I cant get it to work right so can any one Help me plz Here is my source code. Pretty please help me if you can or you got antoehr sugestion for how to do a bulliten board PLEASE tell me. The main problem here is responding to the messages and showing the right message on the right board. If you do try it you have to put your own connection settings in Thxx in advance. 🆒
-Main.php-------------------------------------------------------------------
<style type="text/css">
A:link {text-decoration:underline; color:white}
A:hover {text-decoration:underline; color:yellow}
</style>
<body vlink="white" text="white">
<?
echo '<table width="550" style="border:ridge lightgreen 5px" cellpadding="3" cellspacing="2" border="2" bgcolor="black" bordercolor="green" align="center">
<td height="150" valign="bottom" colspan="2">
<a href="postnow.php">Post</a>-
Sign in-
Sign up-
Config
</td>
';
$connection=mysql_connect("localhost", " ", " ");
$pickmain="SELECT idmain, topic, maker FROM main ORDER by idmain desc";
$query= mysql_db_query('bullit', $pickmain);
$row=mysql_num_rows($query);
for ($p=0; $p < $row; $p++){
$idmain=MYSQl_result($query, $p, "idmain");
$commentmain=MYSQl_result($query, $p, "topic");
$makermain=MYSQl_result($query, $p, "maker");
echo "
<tr>
<td width=70% bgcolor='blue'><a href='main.php?pick=$idmain'>$commentmain</td><td>$makermain</td></tr>
";
};
?>
</table>
<?
if ($_GET[pick]){
//get teh data on the board
$stepa="SELECT * FROM main WHERE idmain = '$_GET[pick]'";
//Step 1 is for setting up the comment table
$step2=mysql_db_query('bullit', $stepa);
$row2=MYSQL_num_rows($step2);
for ($k=0; $k < $row2; $k++){
$idn=mysql_result($step2, $k, "idmain");
$comment = mysql_result($step2, $k, "comment");
$thing = mysql_result($step2, $k, "file");
$names = mysql_result($step2, $k, "maker");
$wrapcomment=wordwrap($comment, 65, "<br >");
echo '<table width="500" style="border:double teal 20px" cellpadding="3" cellspacing="2" border="2" bgcolor="teal" align="center">
<th colspan="2" valign="top" height="70">
<form method="post" action="vanish.php">
<a href="Post.php?bid='."$idn".'">Post</a><br>
<input type="submit" name="vanish2" value="Vanish_(X)"></th>
<tr><td colspan="2" bgcolor="orange"> <font color="red">(vanish-<input type="radio" name="delete" value='."$idn".'>)</font>'."$names".'</td></tr><tr>
<td width=10% bgcolor="yellow">'."$idn".'</td><td bgcolor="green">'."$wrapcomment".'</td></tr><tr>
<td colspan="2" height="20" bgcolor="teal"><font color="red"><input type="submit" name="edit" value="Edit-'."$idn".'"></font></td></tr>';
};
$seperate = explode(",", $thing);
$fig=count($seperate);
if ($fig != 0){
for ($l=0; $l < $fig; $l++){
$whatshow = $seperate[$l];
//this part is for the reading of the messages that belong on the board
$stepb="SELECT * FROM post order by 'id'";
$step2=mysql_db_query('bullit', $stepb);
//check to see if its going on table
$rid = mysql_result($step2, $whatshow, "id");
$rcomment = mysql_result($step2, $whatshow, "comment");
$rname = mysql_result($step2, $whatshow, "name");
echo '
<tr><td colspan="2" bgcolor="orange"> <font color="red">(vanish-<input type="radio" name="delete" value='."$rid".'>)</font>'."$rname".'</td></tr><tr>
<td width=10% bgcolor="yellow">'."$rid".'</td><td bgcolor="green">'."$rcomment".'</td></tr><tr>
<td colspan="2" height="20" bgcolor="teal"><font color="red"><input type="submit" name="edit" value="Edit-'."$rid".'"></font></td></tr>';
};
};
};
echo "</table>";
?>
-after.php-----------------------------------------------------------------------
<?
if ($_POST[postnow]){
$wrapcomment=wordwrap($_POST[comment], 65, "<br >");
$insert2 = "INSERT INTO main VALUES ('$POST[id]', '$POST[topics]', '$POST[names]', '$POST[po]', '$wrapcomment/n')";
$qquery=mysql_db_query('bullit', $insert2);
if ($qquery){
echo "good it is inserted";
};
echo '
<head><meta http-equiv="REFRESH" content="4; URL=main.php"></meta></head>
<br>
<br>
<br>
<br>
<br><br>
<br>
<br>
<br>
<br>
<center>You are being Redirected if not click here <a href="index2.php">BackM</a></center>
';
};
if ($_POST[enter]){
$wrapcomment2=wordwrap($POST[comment], 65, "<br >");
$rdy1="INSERT into post values('', '$wrapcomment2','$POST[name]')";
$queryw= mysql_db_query('bullit', $rdy1);
$sta="SELECT * FROM post";
$stb=mysql_db_query('bullit', $sta);
$ros=mysql_num_rows($stb);
$stea="SELECT * FROM main where idmain='$_POST[postid]'";
$ste2=mysql_db_query('bullit', $stea);
$ro=MYSQL_num_rows($ste2);
for ($kh=0; $kh < $ro; $kh++){
$thingx = mysql_result($ste2, $kh, "file");
};
if (thingx != ""){
$thingx .= ",";
$thingx .= $ros;
} else {
$thingx = $ros;
};
$updaten = "update main set
file = '$thingx'
WHERE idmain= '$_POST[postid]'";
$a=mysql_db_query('bullit', $updaten);
};
?>
-postnow.php----------------------------------------------------------------
<body bgcolor="black">
<center>
<form method="post" action="after.php">
<font color="white">
-Topic-<br><Input type="text" name="topics" size="50">
<br>
-Name-<br><Input type="text" name="names" size="30">
<br>
<br>
-Comment-<br><textarea name="comment" cols="40" rows="10"></textarea><br>
<input type="submit" name="postnow" value="post">
</form>
</center>
</font>
-post.php----------------------------------------------------------------------
<html>
<body bgcolor="black">
<center>
<form method="post" name="enter" action="after.php">
<?
echo '<input type="hidden" value='."$_GET[bid]".' name="postid">';
?>
<font color="white">
-Name-<br><Input type="text" name="name" size="30">
<br>
<br>
-Comment-<br><textarea name="comment" cols="40" rows="10"></textarea><br>
<input type="submit" name="enter" value="Post_Comment">
</form>
</center>
</font>
</html>
-database source-------------------------------------------------------------
create database called "bullit"
create table main(idmain bigint default '0' NOT NULL auto_increment, topic
text, maker varchar(255),file blob, comment text, primary key(idmain));
create table post(id bigint default '0' NOT NULL auto_increment, comment
text, name varchar(255), primary key(id));