Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

How to add a comments form?

General discussions related to php

Moderators: macek, egami, gesf

How to add a comments form?

Postby prosate » Wed Mar 13, 2013 6:43 pm

I want a feedback form that allow to scroll up and down inside the database.


This is my fillform.php code


<html>

<head>
<title>Feedback</title>
</head>

<body>
<table border="1">

<tr>
<td>
<table>
<form method="post" action="feedbackadd.php">

<tr>
<td>First Name</td>
<td><input type="text" First Name="firstname_input" size="40">
</td>
</tr>

<tr>
<td>Last Name</td>
<td><input type="text" Last Name="lastname_input" size="40">
</td>
</tr>

<tr>
<td>Email Address</td>
<td><input type="text" name="emailaddress" size="40">
</td>
</tr>

<tr>
<td>Telephone Number</td>
<td><input type="text" name="telephonenumber" size="40">
</td>
</tr>

<tr>
<td>Comments</td>
<td>
<textarea name="comments" maxlength="1000" cols="29" rows="6"></textarea>
</td>
</tr>

<tr>
<td></td>
<td align="right"><input type="submit"
name="submit" value="Sent"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


This is my feedback php code

<html>
<head>
<title>Feedback</title>
</head>

<center>

<h3>Feedback</h3>




<table border="2" width="600" height="300">

<?php
$connection = mysql_connect("localhost", "root", ""); //database connection

$db_found = mysql_select_db("fillform");




$sql_command = "SELECT * FROM fillform";
$result = mysql_query($sql_command);



echo ("<tr><td><b><center>ID</center></b></td>

<td><b><center>First Name</center><b></td>
<td><b><center>Last Name</center><b></td>
<td><b><center>Email Address </center><b></td>
<td><b><center>Telephone Number</center><b></td>
<td><b><center>Comments</center><b></tr>");




while ($row = mysql_fetch_array($result)) {
echo ("<tr><td><center>$row[id]</center></td>");
echo ("<td><center>$row[firstname]</center></td>");
echo ("<td><center>$row[lastname]</center></td>");
echo ("<td><center>$row[emailaddress]</center></td>");
echo ("<td><center>$row[telephonenumber]</center></td>");
echo ("<td><center>$row[comments]</center></td>");



}
mysql_close($connection);
?>
</table>
</td>
</tr>
</table>
</center>
</html>
prosate
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Mar 12, 2013 5:45 pm

Re: How to add a comments form?

Postby seandisanti » Fri Mar 15, 2013 8:06 am

I don't understand what you mean about the form being able to scroll up or down in the database. What is the form doing or not doing at this point? are you getting errors?
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.