Page 1 of 1
Creating a new page?...confusing
Posted: Sat Jan 21, 2006 10:23 pm
by xEzMikex
Allright, Im building a tutorial system, Im going to add a form so people can add tutorials. I alreayd know how to add content to an mysql database and extract it, Now I need to know how to make it so when I add content it makes a brand new seperate page, Any help is greatly apreciated.
Posted: Sat Jan 21, 2006 10:49 pm
by feyd
you want to create a separate file for each tutorial? If so, then there's no reason to keep them in a database.
Anyways..
fopen()/
fread()/
fwrite()/
fclose() are used to interact with files. If you simply want to read a file in its entirety,
file_get_contents() and
file() may be of interest.
Posted: Sat Jan 21, 2006 11:16 pm
by xEzMikex
Not a new file, A new page like in forums. For example when your in a forum on the end of pages there like "
www.dada.com/index.php?topic=231" well I want somthing like that exept tutorial. I know how to display the tutorial title on a page as I add them and I know how to extract the tutorial onto a page I just need to know how to seperate them on diffrent pages.
Posted: Sat Jan 21, 2006 11:19 pm
by hawleyjr
You are going to want to store the tutorials in a table. In the URL display an id that is associated with the tutorial. For example in the furums the variable is t (Located in the query string of the URL)
Posted: Sat Jan 21, 2006 11:24 pm
by Zoram
If you wanted to reduce the number of queries you could also make a file version of what you will display and use that to display the actual tutorial and only use the database for changing the tutorial... or you could just keep it all just on files and use the functions that feyd suggested... either way works well. If you do it with just files make sure to make backups regularly.
Posted: Sat Jan 21, 2006 11:26 pm
by hawleyjr
You'll find that you will have much more overhead if you store the data in files. Use a db, much easier.
Posted: Sun Jan 22, 2006 1:54 am
by stuffradio
Hmmm, tell you what...
I'm currently working on a blog I'm making from scratch for my PHP class but if you give me your MSN I can help you out a bit. It can be confusing at first, I just mastered that part and I've been doing php for a while. Like I have really truly mastered it now, but yeah, send me your msn I'll add you as soon as I get it.
Posted: Sun Jan 22, 2006 9:03 am
by xEzMikex
my email is
ABC@example.com. Thank you guys alot you are verry helpfull, Im pretty new to php and mysql. After reading the replys im understanding it more, It has to do with the id feild in my table witch I already got made. I just need to figure out the code to make it do what I want.
HawleyJR: Please send personal info via PM