Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Inserting the Data Into the Database

June 23, 2000

At this stage we don't need to worry about loading data into the table, we will do that next, using PHP and simple HTML forms. You can shut down Telnet now and open up your favorite HTML editor. I would recommend Homesite 4.0.

Now it was time for me to learn the PHP basics, which wasn't that difficult. I subscribed to the PHP mailing list and took a quick look through the PHP manual. If you can try to find somebody on ICQ that knows PHP, it sure does help having instant support.

The idea here is to be able to insert all of the data into the database via the internet using forms. I have created forms several times before so that was no problem at all. I am assuming that you have used forms before; if you have no idea how to create forms, find a tutorial on the net and come back when your ready.

Create a page and call it add_data.php3, and then cut and paste the following.

<form enctype="multipart/form-data" method="post"  action="<?php echo $PHP_SELF ?>">
year<br>
<input type="Text" name="year" size="25">
<br>
make<br>
<input type="Text" name="make" size="25">
<br>
model<br>
<input type="Text" name="model" size="25">
<br>
price<br>
<input type="Text" name="price" size="25">
<br>
picture<br>
<input type="File" name="picture" size="25">
<br><br>
<input type="submit" name="submit" value="Upload">
</form>

First of all we need to add a little PHP in the action attribute, this is used to display all of the data once the submit button is pressed.

action="<?php echo $PHP_SELF ?>"

The name attribute within the input element will be used to pass the information to PHP, these names should be the same as the columns in the database.

Its Time to Connect to the Server
PHP, MySQL and Images
Making It All Work


Up to => Home / Authoring / Languages / PHP / Images




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers