August 18th, 2004, 03:50 PM
|
#1 (permalink)
| | Perfetc Member
Join Date: Jan 2003 Location: Maryland Suburbia
Posts: 4,327
|
Working on a webpage for someone,
Instead of having seperate html files for each content page I was hoping I could use php to load the content pages into a table/cell or something.
I know I could probably use iframes, but they tend to be a tad glitchy.
For example, like on the www.clanimo.com website, it just loads everything into the center without reloading the whole page. Granted I realize they use php Nuke, but I was wondering if a similar effect could be achieved.
The website is.. www.lakewoodmagiccarpets.com
As of now theres really no content on the pages, just setting up the basic page for them.
I dont really know much about programming php.. hence the reason im asking
If what I've said doesnt make any sense let me know and I will try to reexplain,
Thanks alot,
Vhockey86 |
| |
August 18th, 2004, 04:06 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Jan 2003 Location: MA / NH
Posts: 1,497
|
I managed that with a page=pagename
That would just reload the index.php page (example, index.php?page=home.php) and then used the following php to load the page:
<? require("$page"); ?> (think that was it off the top of my head
For example, www.woodsambulanceinc.com uses that system. The only page the person ever sees is index.php, which in turn calls the page.
Blaze |
| |
August 18th, 2004, 04:13 PM
|
#3 (permalink)
| | Perfetc Member
Join Date: Jan 2003 Location: Maryland Suburbia
Posts: 4,327
|
where do i place the Code: <? require("$page"); ?> Just where I want the content to load? |
| |
August 18th, 2004, 04:45 PM
|
#4 (permalink)
| | Perfetc Member
Join Date: Jan 2003 Location: Maryland Suburbia
Posts: 4,327
|
well, using the code u supplied I got Code: Fatal error: main(): Failed opening required '' (include_path='.:/usr/local/lib/php') in /homepages/22/d107367292/htdocs/index.php on line 58 If i just use
<?php include '$page'; ?> it will load the page in, but this still leaves me with a few problems
Perhaps its just a problem with how im linking, but it still reloads the whole index page. Granted it loads the right thing into the center, but my whole purpose for attempting the page this way was to perserve the "down state" of my navbar. Normally I just do it with html and dreamweaver templates, but that loads a new page too.
2nd problem is, how do I pass the initial page info?
When someone goes to www.lakewoodmagiccarpets.com i'd like it to default to having info from "main.php"
Obviously if I put the info on the main index.html, when a link is clicked it would just add more data into the center (leaving the main stuff which wouldnt be wanted there).
Thx,
Vhockey86 |
| |
August 18th, 2004, 05:20 PM
|
#5 (permalink)
| | Perfetc Member
Join Date: Jan 2003 Location: Maryland Suburbia
Posts: 4,327
|
Well I managed to solve the 2nd problem with this... Code: <?php if(isset($page)) {
require("$page");
} else {
include 'main.php';
} ?> Made an if/else statement, so that if $page isnt defined by clicking on a link, that it will load the default information into the page.
Still havent found a solution for the whole loading thing though. I suppose its not entirely crucial, just thought it would be neat to actualy preserve down states ...most sites do it and I dont know how =( |
| |
August 18th, 2004, 06:00 PM
|
#6 (permalink)
| | Ultimate Member
Join Date: Jan 2003 Location: MA / NH
Posts: 1,497
|
Well, aside from using frames, im not sure.
Umm, maybe you could just pass a down sate varible (i.e the link would become ../index.php?downstate=true) or something...
Blaze |
| |
August 18th, 2004, 10:20 PM
|
#7 (permalink)
| | Perfetc Member
Join Date: Jan 2003 Location: Maryland Suburbia
Posts: 4,327
|
Yet another side question:
Is there anything special one can do to get indexed on search engines? Or is it just kind of luck. I did fill out an application with the dmoz.org thing that google seems affiliated with. Any ohter suggestions? |
| |
August 18th, 2004, 10:42 PM
|
#8 (permalink)
| | Ultimate Member
Join Date: Jan 2003 Location: MA / NH
Posts: 1,497
| |
| |
August 22nd, 2004, 10:16 PM
|
#9 (permalink)
| | Perfetc Member
Join Date: Jan 2003 Location: Maryland Suburbia
Posts: 4,327
|
Well I finally finished the page (for the most part at least).
the PHP stuff worked out nicely as far as trying to update all the different pages and nav bar easily, thanks =)
Only problem I ran into was, text styles established by dreamwaever started over from "1" each time, so it would load the include into the page, and the newer styles would overwrite the old ones. Thus I had to resort to erasing all the <style> <span> crap and coding my only regular <font> tags.
Anyone know how to force dreamweaver mx 2004 to just use regular font tags?
Also, critiques/problems found with the webpage wouldnt hurt either.
Thx
Vhockey |
| |
August 22nd, 2004, 10:32 PM
|
#10 (permalink)
| | Ultimate Member
Join Date: Jan 2003 Location: MA / NH
Posts: 1,497
|
Hmm, I am using CSS for athol daily news and requireing pages, and having no problem with it.
solution... use NotePad instead of Dreamweaver
all the italics are hard to read.
more later....
Blaze |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |