Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

adding into database

$
0
0

I cannot get these field to add into my database from the text area box. I am using an image as the submit button but when I have entered everything in nothing submits into the right fields on the database.

<form action=http://www.sentuamessage.com/profile.php?action=post method=post>
<table border=0 width=80% cellspacing=0 cellpadding=0>
	<tr>
		<td>
		<table border=0 width=89% cellspacing=0 cellpadding=0>
			<tr>
				<td width=10 valign=top> </td>
				<td width=52 valign=top>
				<table border=0 width=100% cellspacing=0 cellpadding=0>
					<tr>
						<td height=6>
						</td>
					</tr>
					<tr>
						<td>
						<img border=0 src=commentsavatar.jpg width=52 height=54></td>
					</tr>
					<tr>
						<td> </td>
					</tr>
				</table>
				</td>
				<td width=10 valign=top> </td>
				<td valign=top>
				<table border=0 width=87% cellspacing=0 cellpadding=0>
					<tr>
						<td>
						<img border=0 src=commenttop.jpg width=921 height=19></td>
					</tr>
					<tr>
						<td background=commentmiddle.jpg>
						<table border=0 width=100% cellspacing=0 cellpadding=0>
							<tr>
								<td width=19> </td>
								<td>
								<table border=0 width=100% cellspacing=0 cellpadding=0>
									<tr>
										<td>
										<textarea type=text name='comment'cols=107 rows=8 style='outline: none; overflow: hidden; border: none'></textarea></td>
									</tr>
									<tr>
										<td>
										<p align=right>
										<input type=image name=cmdSubmit alt=Submit Form src=commentpost.jpg value=Submit border=0>
</form></td>
									</tr>
								</table>
								</td>
								<td width=22> </td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td>
						<img border=0 src=commentbottom.jpg width=921 height=19></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>

What are the +1 or +2? what I am trying to do here is trying to use the current number in that field and add an additional 1 or 2 to that current figure.

 

so the whole action=post code is

if($action == "post") {
if($_POST['comment']==""){
echo "<p align=center>Your comment was not posted due to the comment box being empty. You should be redirected back to your page in a few seconds</p>";
}
else
{
mysql_query("INSERT INTO comments (id, userid, topicid, topicname, comment, date, name) VALUES ('', '$_SESSION[id]', '$content[id]', '$content[name] Profile', '$_POST[comment]', '$today', '$_SESSION[username]')")  or die(mysql_error());
mysql_query("UPDATE userdb SET score='$_SESSION[score]+2', comments='$_SESSION[comments]+1' WHERE username='$_SESSION[username]'") or die(mysql_error());
echo "<p align=center>Your comment has been submitted. You should be redirected back to your page is a few seconds</p>";
}
include("bottom.php");
exit;
}

Viewing all articles
Browse latest Browse all 13200

Trending Articles