How Do You Make Text Boxes?


Hello, I was wondering if anyone could help. I don’t know how to create a text box on my website so that people can put words and numbers into the text box, press enter, and then my website could store the information in a database somewhere. Please help me. -Steven


Are you coding or are you using a website builder?


Using a website builder.


wich website builder


I don’t use a website builder. Maybe lobrc could help.


Steven what kind of website are you looking for?
A form that emails you with their information?
A login/database system?
Or just a text box to store into a database system?
If you want post your website address.


I’m just thinking of a website that’s just plain text, but there is a text box embedded in the middle of the page so people can enter their name, and I will have a hidden database somewhere storing all the names. For example:

This is the techie’s lair. Please enter your name.
TEXT BOX and then enter button

If you do not want to say your name, that is okay.

I am currently making my website on a free account with 000webhost, and the reason I am asking is because I don’t know how to do this with the website builder. Thank you for any responses.


If they submit it does it matter if it is stored into a text file like so

Name: Dave

Name: James

Name: Bob

etc or do you want it in a database such as phpmyadmin/mysql


Yeah, it can be stored in a text file like the one at How do I write this text box and store the info entered in a database, though? Thanks.


Thank you for any help.


If you have any HTML code for what I want to do, please also add it.


Oh sorry I went out for supper.

Anyhow yeah this code should be something your looking for.
Create these files and call them the names above it

Create table in a new mysql database

CREATE TABLE `table_user` (
  `user_id` int(2) NOT NULL auto_increment,
  `user_fname` varchar(10) NOT NULL,
  `user_lname` varchar(10) NOT NULL,
  PRIMARY KEY  (`user_id`)

php file to write data

$con = mysql_connect("localhost","root","");
	if (!$con)
	  die('Could not connect: ' . mysql_error());
	 // echo('Connected with Mysql');
@mysql_select_db("db_name", $con);// connect to database db_name
	if (isset($_POST['Submit']))
$sql="INSERT INTO table_user (user_fname, user_lname)	VALUES('$_POST[user_fname]','$_POST[user_lname]')";

form structure

 <td width="141" align="left" valign="top" >First Name</td>
                          <td width="163" align="left" valign="top"><input name="user_fname" type="text" id="user_fname"></td>
<td align="left" valign="top" >Last Name</td>
                          <td colspan="4" align="left" valign="top"><input name="user_lname" type="text" id="user_lname">
<input name="Submit" type="submit" value="Submit" >


Just a short comment: avoid using .txt files at 000webhost, there were more problems with this extension in the past (its usage is not allowed). Use .dat extension (of course, with the same content), and it will be o.k.
Anyway, the best method would be a database storage mechanism (it is more dynamic, there are no file permission problems etc.).



As I understand this question,
you want to learn how to program this.

Let’s go to school then for this one.

Why not check this out?

Many more lessons can be found on that site.

I learned alot there.