LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-05-2003, 12:01 AM   #1
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Rep: Reputation: 30
Creating a simple html page from php?


Hello All,

I run a small web server from home. I have decided to use Oscommerce as my webshop... Seems excellent.

However I need a way of being able to have a very simple form, if possible auto dated in one field, with three additional input fields for text and numbers. This would be used for cataloging the stock location of each item. (I sell radio valves so there are 1000s of items). I need this information to be entered into a simple html file, the output of which would look something like this:

20/10/03: Data field 1 Data field 2 Data field 3

and so on.

Two reasons for wanting to do it like this... One so I can find the item location, from any home pc I may be on. Two, so I can input information from anywhere.

I have googled but get an information overload of everything but what I am specifically looking for.

Can anyone help... point me in the right direction?

Thanks in advance

Lucas
 
Old 11-05-2003, 12:27 AM   #2
Bluesuperman
Member
 
Registered: Nov 2002
Distribution: Slackware
Posts: 155

Rep: Reputation: 30
Your post is to vague -- you need more information.

For example - if you told me that you have a postgres db or a mysql db with all this information in it then I would say:

using php - write a script that connects to the database, then write a recursive function to lookup data in the db and print it to a html form.

From your post all I know is that you have lots of information you want posted.

Where is this information kept ? DB , file ....
How much do you want displayed at a time -- you need some sort if "sorting" function
 
Old 11-05-2003, 12:46 AM   #3
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Thanks for the reply!

Sorry to be so Vague to clarify:

The server is Redhat 9, running Apache, PHP and mysql.

I suppose the question is; what is the best way to do this?

I wanted the "data" or list stored on the html file, because it seemed simple. Form input goes to itemstorelocation.html, when I want to check where a stock item is I open the page from my browser on any pc and do a text search...

I need to be able to text search the whole file when viewing itemstorelocation.html at once. The enties going into and being dispayed from the file only need to be ordered in the order they were added.

Given the extra information would it be better to do this using the above method or the method Bluesuperman suggested, using a php script to, say, mysql database, then back to html?

Thanks Lucas
 
Old 11-05-2003, 07:09 AM   #4
usernamenumber
Member
 
Registered: Sep 2003
Location: Somerville, MA
Distribution: Fedora/RHEL currently. Red Hat, Slackware, Debian, SuSe and Mandrake at other times
Posts: 104

Rep: Reputation: 15
I don't know if it would be wise to just dump things into a text file or not. Yes, it will be simple to search and require less coding on your part. But on the other hand if you store everything in a database you will have many more options for how to manage the data in the future. For example, you would be able to write a form that only displayed items of a certain property. If you have 1000s of items I imagine this would be useful.

Using a plain file will have no affect on which machines can see the data since the database and all of the code the manages the db is server-side. Once you get the server set up, anyone with a web browser should be able to use the interface and view the data.

The big advantage to using a simple file for output is that if you are a novice php coder it will be much simpler. Just check out the entry for fwrite() in the php.net manual:

http://www.php.net/manual/en/function.fwrite.php

That manual, by the way, is just about the only reference you'll need when getting started with php. If you get ambitious, check out the mysql functions as well.

And you can always write the app to store data in a text file for now and then write something to convert the text file into mysql tables when you feel ready to start using a database backend.

Hope this helps!
--Brad
 
Old 11-05-2003, 08:48 AM   #5
lucastic
Member
 
Registered: Aug 2003
Location: Oz
Distribution: Gentoo - Debian
Posts: 202

Original Poster
Rep: Reputation: 30
Thanks Brad, that was exactly the answer I was looking for, with a link for further learning.

I agree, the more I think about it the more it makes sense to store the data in a database instead of a text file, in case I do want to sort it differently in the future.

Thanks again!

Long live the penguin!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php function to open an html page prabhatsoni Linux - Software 2 06-13-2005 11:32 PM
Simple PHP / HTML frames question Mq2004 Linux - Software 2 05-04-2005 10:36 AM
Creating page tabs w/ php linux_pioneer Programming 1 07-22-2004 12:58 PM
PERL error trying to run simple HTML page.... vous Programming 1 08-25-2003 09:01 AM
Creating HTML page with link in C jorgedf Programming 3 08-01-2003 02:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration