I think you're confusing him about paths and stuff, as that would be an impractical use for a database.
How about an example? What will your site be about, Agatio?
Login |
Correct me if I'm wrong (again)Correct me if I'm wrong (again)Currently viewing this thread: 1 (0 members and 1 guests) I think you're confusing him about paths and stuff, as that would be an impractical use for a database. How about an example? What will your site be about, Agatio? Should have explained this eariler. http://shiningsoul-league.net For your purpose, I don't think a database is needed for a couple of reasons: 1) all of your content pages are already written and 2) the page=bleh or id=4342344 in your address bar can be accomplish easily without the need for a database. So check out the following code:
I do believe that is what you're looking for. Just take note that the file "./header.inc" would contain all of the html code that comes before your main content. And the file "./footer.inc" would contain all of the html code after your content. The other files ("./pages/links.inc" , "./pages/about.inc" & "./pages/main.inc") would be your content pages. Those content pages would only have your content in them. For example, if one page of your website had this code
Well, if that was your page, then all of the html before
would be put into the header.inc file, and all of the code after the
would be put into the footer.inc file. And everything inbetween would be put into the "./pages/main.inc" file, as its the main page that moronic person would want displayed. I'd explain further but I think my explanation would just confuse you further, I'm never write tutorials for a good reason. ___________________ Bored? Join us at #Central on irc.Neverside.com Last edited by Samurai_Zero, November 14th, 2004 10:50 PM (Edited 1 times) Just a note on Samurai_Zero's code, it won't work on servers with register_globals disabled (it's a PHP configuration that's now disabled by default). Also it's not the most efficient way... but it would get the job done (if you have register globals enabled). It's my (and many others') recommendation to never do anything that requires register_globals, but since you're new, guess it won't matter that much... ___________________ I am already using the include command to include my header and footer on ever page. I'm just wondering if there is an alternative for having 50 text files sitting on my server I don't undertand this though:
You really have to just learn SQL. Get some scripts, go look in PHPMyAdmin, view some PHP sources with SQL in it. SQL isn't all that hard... mainly just... SELECT * FROM this WHERE this = that... blah blah... It's what you do to the data with PHP that makes it complicated.
You see switch($_GET['page']) at the top, right? Then you see case: blah, case: this. What this does is check the variable in swtich and then if that variable matches any of the cases you put, do whatever the case it matches says. I'm trying to make this sound easy enough for you to understand... So... if you go to blah.php?page=about, it would include "./pages/$page.inc" http://us2.php.net/manual/en/control-structures.switch.php Last edited by theTrinity, November 15th, 2004 06:02 AM (Edited 1 times) heh, just make a flat file database... store content and than explode it and include it into you header and footer, this will make your 50 txt files into one ___________________ "The secret to creativity is knowing how to hide your sources." -- Albert Einstein PhilDesignStatus: Offline!
good for you faggot. ur learning ___________________
?
Heh, whoever you are talking to, thast not nice... ___________________ "The secret to creativity is knowing how to hide your sources." -- Albert Einstein |
Copyright ©1999-2008 Neverside. All rights reserved.
Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach
NeverAPI generated this page in 0.0111 seconds.