home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1838
Discussions: 188,398, Posts: 2,243,595, Members: 232,629
Old August 18th, 2004, 03:50 PM   Digg it!   #1 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
Join Date: Jan 2003
Location: Maryland Suburbia
Posts: 4,327
php links

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

VHockey86 is offline   Reply With Quote
Old August 18th, 2004, 04:06 PM     #2 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
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

Blazer06 is offline   Reply With Quote
Old August 18th, 2004, 04:13 PM     #3 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
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?

VHockey86 is offline   Reply With Quote
Old August 18th, 2004, 04:45 PM     #4 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
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
VHockey86 is offline   Reply With Quote
Old August 18th, 2004, 05:20 PM     #5 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
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 =(
VHockey86 is offline   Reply With Quote
Old August 18th, 2004, 06:00 PM     #6 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
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
Blazer06 is offline   Reply With Quote
Old August 18th, 2004, 10:20 PM     #7 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
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?
VHockey86 is offline   Reply With Quote
Old August 18th, 2004, 10:42 PM     #8 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
http://www.google.com/addurl.html

And, META Tags.


Blaze
Blazer06 is offline   Reply With Quote
Old August 22nd, 2004, 10:16 PM     #9 (permalink)
Perfetc Member
 
VHockey86's Avatar
 
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
VHockey86 is offline   Reply With Quote
Old August 22nd, 2004, 10:32 PM     #10 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
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
Blazer06 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
TechIMO lifers need your IMO Love2Learn Graphic Design and Digital Photography 19 December 27th, 2002 12:42 AM
If I wanted to learn... RainFire Webmastering and Programming 2 October 18th, 2002 11:46 AM
PHP include in HTML, help? Whir Webmastering and Programming 7 October 7th, 2002 06:07 PM
M$ and Linux cowboybooter Applications and Operating Systems 22 September 7th, 2002 08:07 PM
favorite php sites dragonb Webmastering and Programming 0 December 6th, 2001 02:39 AM

Most Active Discussions
Is It Just Me? (2905)
Unarmed man on his stomach shot by .. (6)
Misery Loves Company... (2144)
New Build ( Finally ) (6)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
Folderchat Weekday thread (444)
Upgrading RAM (6)
Recent Discussions
Partition Magic 7.0 (Unallocate.. (17)
For cheap price and good qualit.. (1)
Left 4 Dead Small Freezes (3)
RCA 52Inch HDTV wont turn on (4)
wishin i could edit my aol prof.. (0)
Sporadic internet connectivity (2)
Assassins Creed PC Problems (40)
I think my PSU is dieing (1)
building a gaming computer, inp.. (0)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 03:34 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28