Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - All Sites in One | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
mvpo.geo Red Goomba Level: 13 Posts: 10/48 EXP: 8041 For next: 2226 Since: 03-27-04 From: Delaware :( Since last post: 229 days Last activity: 225 days |
| ||
Does anyone know the script and how to have all my sites as one big PHP site? I heard it is possible but don't know how to do it. Can anyone please help me with getting my site to this? | |||
Exadis Double hammer Level: 10 Posts: 8/32 EXP: 4327 For next: 87 Since: 04-10-04 From: Macomb, MI Since last post: 432 days Last activity: 339 days |
| ||
He asked me about this on AIM earlier, and I couldent help him out ... He wants to know if its at all possiable to make a main site all in one .php file by useing something like if($page==whatever){ print" this ";} kinnda thing ... |
|||
Dragato Goomba Level: 9 Posts: 23/25 EXP: 3053 For next: 109 Since: 03-15-04 From: England Since last post: 517 days Last activity: 339 days |
| ||
If you mean having everything in say the index page you could have it so you get linked to index.php?id=whatever then the PHP page would look like if ($id=="whatever"){ $content="this is the whatever page"; } echo $content; |
|||
SyntaxLegend Double metal axe Level: 25 Posts: 9/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
depending on how big the site was, wouldnt that take ages to load? | |||
ErkDog Fuzz Ball Level: 47 Posts: 238/982 EXP: 752190 For next: 14013 Since: 03-15-04 From: Richmond, VA Since last post: 40 days Last activity: 19 days |
| ||
Metroid not really you could in theory have this entire forum, for example in ONE file...... and instead of having differnet pages you'd have a switched case if action=viewthread do this function...... if action=viewonline do this function if action=FAQ do this function etc... etc..... just makes it alot harder to maintain and manage... but yes, you can do it...... |
|||
Icy Guy Red Goomba Level: 11 Posts: 12/36 EXP: 5112 For next: 873 Since: 04-21-04 From: The Matrix...er, CA, U.S.A. Since last post: 247 days Last activity: 246 days |
| ||
When I was fiddling with PHP, I found out about another way of doing what Dragato said. Set your site up, so that when you click a link, it changes a page I.D. Confused? I'll demonstrate: http://hostultra.com/~rwarchive/ When you click one of the links, it takes you to another page, with a mostly similar URL, but the "id" portion of the URL (what comes after "sections.php?id=", to be exact) changes. So when the id is "snitz," it loads one page, "ubb" another, etc. Here's the code we used for sections.php, which is the "main" loader:
(If that doesn't work, remove the quotation marks.) We have a bunch of different text files that have the same names as the I.D.'s in the URLs; snitz.txt, ubb.txt, etc. This code takes the value of the I.D. in the URL and tells it to load the text file with the same name as that. Make sure you write all your HTML for the page's content in the text file. Also, if you're looking for security, I'd suggest using some sort of a directory system. Example:
Put all your text files in the "includethis" directory and they'll be loaded from there. No one will ever know unless you tell them. I hope this hasn't been too confusing. It's been a while since I've coded any PHP. (This has been ANOTHER long-ass post, brought to you by Icy Guy.) |
|||
ErkDog Fuzz Ball Level: 47 Posts: 257/982 EXP: 752190 For next: 14013 Since: 03-15-04 From: Richmond, VA Since last post: 40 days Last activity: 19 days |
| ||
Icy guy... that's cheating and not at all what he's talking about you are still maintaining the differet parts of the website in seperate files..... and just "including" them so you might as well just be doing snitz.php |
|||
FreeDOS Lava Lotus Wannabe-Mod :< Level: 59 Posts: 414/1657 EXP: 1648646 For next: 24482 Since: 03-15-04 From: Seattle Since last post: 6 hours Last activity: 4 hours |
| ||
Erk: Most of Invision Power Board is in the index.php file It's quite easy to make it all one file. Just use if(). No biggie. |
|||
Icy Guy Red Goomba Level: 11 Posts: 13/36 EXP: 5112 For next: 873 Since: 04-21-04 From: The Matrix...er, CA, U.S.A. Since last post: 247 days Last activity: 246 days |
| ||
Originally posted by ErkDog I was merely expanding on what Dragato was saying, which seemed to be what the topic creator was asking about. Also, I was never aware you could "cheat" when writing a program or HTML/PHP/etc. If it's efficient and it works, who cares how you wrote it? In this case, it's all a matter of not having to write multiple If-Then statements for handling each page on the site. |
|||
ErkDog Fuzz Ball Level: 47 Posts: 409/982 EXP: 752190 For next: 14013 Since: 03-15-04 From: Richmond, VA Since last post: 40 days Last activity: 19 days |
| ||
yes he said put all sites in ONE file not call a bunch of other files from one file... you might as well just have multiple files if you do that |
|||
Darth Coby Vire Dacht je nou echt dat het over was? Dacht je nou echt dat ik gebroken was? Nee toch? Nou kijk eens goed op uit je ogen gast. zonder clic heb je geen kloten tjap... bitch Level: 55 Posts: 538/1371 EXP: 1240774 For next: 73415 Since: 03-15-04 From: Belgium Since last post: 2 days Last activity: 9 hours |
| ||
Yes that's possible, you need to use POST/GET variables though. Then you check what the value of the variable is and then load the appropriate part of the page, and no, it's still very fast because it only loads what it needs. |
|||
mvpo.geo Red Goomba Level: 13 Posts: 14/48 EXP: 8041 For next: 2226 Since: 03-27-04 From: Delaware :( Since last post: 229 days Last activity: 225 days |
| ||
Yeh now I really need help on somthing else cause thanks to yall I figured that out Thanks. But Im making like a site directory, and it will be on everypage of the website, Is there a way to make it so I can edit just one menu and its changes them all? I think it can be done in css or java but Im not 100% sure. | |||
ErkDog Fuzz Ball Level: 47 Posts: 441/982 EXP: 752190 For next: 14013 Since: 03-15-04 From: Richmond, VA Since last post: 40 days Last activity: 19 days |
| ||
use frames..... or if you are using PHP make a header.inc file and just include the header at the top of every PHP page |
|||
mvpo.geo Red Goomba Level: 13 Posts: 15/48 EXP: 8041 For next: 2226 Since: 03-27-04 From: Delaware :( Since last post: 229 days Last activity: 225 days |
| ||
Heck no lmao, frames are definitly no! I found one thing but Im not sure if it work 100% is this ok? include 'http://www.example.com/file.txt?foo=1&bar=2'; ?> |
|||
ErkDog Fuzz Ball Level: 47 Posts: 449/982 EXP: 752190 For next: 14013 Since: 03-15-04 From: Richmond, VA Since last post: 40 days Last activity: 19 days |
| ||
you would be doing a local include though include ('filename.ext'); |
|||
Exadis Double hammer Level: 10 Posts: 15/32 EXP: 4327 For next: 87 Since: 04-10-04 From: Macomb, MI Since last post: 432 days Last activity: 339 days |
| ||
Originally posted by mvpo.geo If you have your main site all in one page, like you asked for in your first post, then somthing like this should work. *NOTE* example is from one of my acmlm board files. $head="whatever you want the head to be"; print "$head"; if($page==whatever){ print " this pages content " } And for every if($page==whatever) , you should always have that one head displayed, and the "this pages content " displayed underneath. This also can be done with footers. |
|||
Darth Coby Vire Dacht je nou echt dat het over was? Dacht je nou echt dat ik gebroken was? Nee toch? Nou kijk eens goed op uit je ogen gast. zonder clic heb je geen kloten tjap... bitch Level: 55 Posts: 539/1371 EXP: 1240774 For next: 73415 Since: 03-15-04 From: Belgium Since last post: 2 days Last activity: 9 hours |
| ||
Yes, use include to insert a header and a footer, put it on every page and you'll only have to edit one file to edit them all. |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - All Sites in One | | | |