<?php
//record entries
$db = mysql_connect("localhost","epherion_ramptta","******");
mysql_select_db ("epherion_rampttag");
$query = "INSERT INTO tag(name, email, message,date)
VALUES('".$_POST['name']."','".$_POST['email']."''".$_POST['message']."')";
$result = mysql_query($query);
//date type
$date = date("h:i A dS M");
?>
<html>
<head>
<title>Tag Board</title>
</head>
<body>
<div align="center">
<table cellpadding="10" width="200" height="400" style="border-color: #000000; border-style: solid; border-width: 2px;">
<tr>
<td bgcolor="#808080" align="center" valign="top">
<div style="overflow: auto; 200px; height: 200px;">
<table width="200" height="200" bgcolor="#CCCCCC" style="border-color: #000000; border-style: solid; border-width: 1px;">
<tr>
<td>
<?php
while ($r=mysql_fetch_array($result))
{ echo"
Posted $r[date] by <a href=http://www.htmlforums.com/archive/index.php/\"mailto:$r\">$r[name]</a><br>
<font size='1' face=Verdana>$r[message]</font>
<hr color=black>";
}
?>
</td>
</tr>
</table>
</div>
<br>
<table width="200">
<tr>
<td>
<form action="tag.php" method="post">
<font color="#000000" size="2" face="Verdana">
<strong>Name:<br>
<input type="text" size="29" name="name" style="background-color: #000000; color: #FFFFFF;"><br>
Email:<br>
<input type="text" size="29" name="email" style="background-color: #000000; color: #FFFFFF;"><br>
Message:<br>
<input type="text" name="message" size="29" style="background-color: #000000; color: #FFFFFF;"><br>
<div align="center"><input type="submit" value="Post" style="color: #FFFFFF; font: Verdana; font-style: bold; background-color: #000000;">
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
I am trying to make a tag board with mysql but its not working.
<!-- m --><a class="postlink" href="http://www.epherion.com/tag.php">http://www.epherion.com/tag.php</a><!-- m -->
I dont know why and I need some help. After I get the posting down I need to add smileys which I think I know how to do and a way of deleting posts. So drop some help on mewell that is really vauge on what you want.
add smilies? how ? with javascript? having php convert to the smilies before it goes into the db or after it come out?
it would depend on which way you do it if it will take javascript or php.
also making one delete, you hav eot decide if you want an admin or just put a link to each one saying delete then anybody can delete it. if this the cas eyou will need a login system to decide who has permissions to delete.
a lot of things to decide and can get pretty complicated.Well it would be an admin, but all I would have to do for that is set a variable in the php then have the admin enter it to get acess to the deleting, but I need help with the posting before I an mess with deletingall I see is a INSERT, you have to query it do get the stuff you inserted.
so after you inserted the msg, then just do this
$query = "SELECT * form table_name)";
$result = mysql_query($query);
so it should look something like this
<?php
//record entries
$db = mysql_connect("localhost","epherion_ramptta","******");
mysql_select_db ("epherion_rampttag");
$query = "INSERT INTO tag (name, email, message,date)
VALUES('".$_POST['name']."','".$_POST['email']."''".$_POST['message']."')";
mysql_query($query);
//date type
$date = date("h:i A dS M");
$query = "SELECT name, email, message,date from tag)";
$result = mysql_query($query);
?>
and remember to quote your variables
$r['date']Ok then how do i echo them? A for loop?
for ($i=0; ( $i < count($result); $i++)
{
echo $output[$i];
}
Like that?
Actually I need to put them in a special format so how do I echo them like this
<font size="3" face="Verdana"><strong>Posted DATEHERE by <a href=http://www.htmlforums.com/archive/index.php/"mailto: EMAILHERE">NAMEHERE</a></font></strong>
<hr>
<font size="2" face="Verdana">
MESSAGEGOESHERE
</font>
<hr><br>
The variables are in caps.
This is my code including the for loop im not sure if needed.
$db = mysql_connect("localhost","mcneely_news","awesome24");
mysql_select_db ("mcneely_news");
$query = "SELECT name, email, message,date from tag)";
$result = mysql_query($query);
for ($i = 0; ($i < count($result); $i++)
{
}no, use the while loop and mysql_fetch_array()
$query = "SELECT name, email, message,date from tag)";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
echo"<font size=\"3\" face=\"Verdana\"><strong>Posted {$row['date']} by <a href=http://www.htmlforums.com/archive/index.php/\"mailto: {$row['email']}\">{$row['email']}</a></font></strong>
<hr>
<font size=\"2\" face="Verdana">{$row['message']}</font>
<hr><br>\n";
}
//record entries
$db = mysql_connect("localhost","epherion_ramptta","******");
mysql_select_db ("epherion_rampttag");
$query = "INSERT INTO tag(name, email, message,date)
VALUES('".$_POST['name']."','".$_POST['email']."''".$_POST['message']."')";
$result = mysql_query($query);
//date type
$date = date("h:i A dS M");
?>
<html>
<head>
<title>Tag Board</title>
</head>
<body>
<div align="center">
<table cellpadding="10" width="200" height="400" style="border-color: #000000; border-style: solid; border-width: 2px;">
<tr>
<td bgcolor="#808080" align="center" valign="top">
<div style="overflow: auto; 200px; height: 200px;">
<table width="200" height="200" bgcolor="#CCCCCC" style="border-color: #000000; border-style: solid; border-width: 1px;">
<tr>
<td>
<?php
while ($r=mysql_fetch_array($result))
{ echo"
Posted $r[date] by <a href=http://www.htmlforums.com/archive/index.php/\"mailto:$r\">$r[name]</a><br>
<font size='1' face=Verdana>$r[message]</font>
<hr color=black>";
}
?>
</td>
</tr>
</table>
</div>
<br>
<table width="200">
<tr>
<td>
<form action="tag.php" method="post">
<font color="#000000" size="2" face="Verdana">
<strong>Name:<br>
<input type="text" size="29" name="name" style="background-color: #000000; color: #FFFFFF;"><br>
Email:<br>
<input type="text" size="29" name="email" style="background-color: #000000; color: #FFFFFF;"><br>
Message:<br>
<input type="text" name="message" size="29" style="background-color: #000000; color: #FFFFFF;"><br>
<div align="center"><input type="submit" value="Post" style="color: #FFFFFF; font: Verdana; font-style: bold; background-color: #000000;">
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
I am trying to make a tag board with mysql but its not working.
<!-- m --><a class="postlink" href="http://www.epherion.com/tag.php">http://www.epherion.com/tag.php</a><!-- m -->
I dont know why and I need some help. After I get the posting down I need to add smileys which I think I know how to do and a way of deleting posts. So drop some help on mewell that is really vauge on what you want.
add smilies? how ? with javascript? having php convert to the smilies before it goes into the db or after it come out?
it would depend on which way you do it if it will take javascript or php.
also making one delete, you hav eot decide if you want an admin or just put a link to each one saying delete then anybody can delete it. if this the cas eyou will need a login system to decide who has permissions to delete.
a lot of things to decide and can get pretty complicated.Well it would be an admin, but all I would have to do for that is set a variable in the php then have the admin enter it to get acess to the deleting, but I need help with the posting before I an mess with deletingall I see is a INSERT, you have to query it do get the stuff you inserted.
so after you inserted the msg, then just do this
$query = "SELECT * form table_name)";
$result = mysql_query($query);
so it should look something like this
<?php
//record entries
$db = mysql_connect("localhost","epherion_ramptta","******");
mysql_select_db ("epherion_rampttag");
$query = "INSERT INTO tag (name, email, message,date)
VALUES('".$_POST['name']."','".$_POST['email']."''".$_POST['message']."')";
mysql_query($query);
//date type
$date = date("h:i A dS M");
$query = "SELECT name, email, message,date from tag)";
$result = mysql_query($query);
?>
and remember to quote your variables
$r['date']Ok then how do i echo them? A for loop?
for ($i=0; ( $i < count($result); $i++)
{
echo $output[$i];
}
Like that?
Actually I need to put them in a special format so how do I echo them like this
<font size="3" face="Verdana"><strong>Posted DATEHERE by <a href=http://www.htmlforums.com/archive/index.php/"mailto: EMAILHERE">NAMEHERE</a></font></strong>
<hr>
<font size="2" face="Verdana">
MESSAGEGOESHERE
</font>
<hr><br>
The variables are in caps.
This is my code including the for loop im not sure if needed.
$db = mysql_connect("localhost","mcneely_news","awesome24");
mysql_select_db ("mcneely_news");
$query = "SELECT name, email, message,date from tag)";
$result = mysql_query($query);
for ($i = 0; ($i < count($result); $i++)
{
}no, use the while loop and mysql_fetch_array()
$query = "SELECT name, email, message,date from tag)";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
echo"<font size=\"3\" face=\"Verdana\"><strong>Posted {$row['date']} by <a href=http://www.htmlforums.com/archive/index.php/\"mailto: {$row['email']}\">{$row['email']}</a></font></strong>
<hr>
<font size=\"2\" face="Verdana">{$row['message']}</font>
<hr><br>\n";
}