[advanced search]
Results from the most recent live auction are here.
22 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 04-14-2006, 12:35 PM   · #1
ilike75i
Account Suspended
 
Trader Rating: (0)
Join Date: Apr 2006
Posts: 5
NP$: 0.00 (Donate)
ilike75i is an unknown quantity at this point
What now?

Been doing PHP for about a week, but I cant really see how I'm going to incorperate it into my website you know? Like it all looks well but what the tutorials have taught me to do doesnt really seem of much use.

Like what benefits does a site in PHP have? And what potential does PHP have? LIke, for example, I want something so that when I add a link to my nav bar, it will add the same link to the rest of my pages so i dont have to do each page individually?

Just general direction is what i need


Please register or log-in into NamePros to hide ads
ilike75i is offline   Reply With Quote
Old 04-14-2006, 03:34 PM   · #2
Shorty
Senior Member
 
Shorty's Avatar
 
Name: Thomas White
Location: England
Trader Rating: (15)
Join Date: Sep 2005
Posts: 1,033
NP$: 31.15 (Donate)
Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice
Lightbulb

What you're thinking of above is a template.

Have something like this in header.html:
Code:
<html> <head> <title>Title</title> </head> <body> <table> <tr><td>Corner</td><td>Header</td></tr> <tr><td>All your menu code here</td><td>


And in footer.html:
Code:
</td></tr> <tr><td colspan=2>&Copyright Your Name Here</td></tr> </table> </body></html>


And then for every page you have, use this PHP:
Code:
<?php require_once ('header.html'); The content of the particular page goes here. require_once ('footer.html'); ?>


Then whenever you change the menu code, or anything in either header.html and footer.html, it will be effective over all pages in your website. There are obviously more uses you can make of PHP. Think about what input you might need from your visitors, and what you need to do with it...

I hope that helped,
Shorty.
Shorty is offline   Reply With Quote
Old 04-14-2006, 04:01 PM   · #3
ilike75i
Account Suspended
 
Trader Rating: (0)
Join Date: Apr 2006
Posts: 5
NP$: 0.00 (Donate)
ilike75i is an unknown quantity at this point
Thanks!

Thats what i was looking for, small problem though

Heres my inital page:

Code:
<html> <head> </head> <body> <?php require_once ('ab.html'); ?> </body> </html>


And heres the file titled ab.html:

Code:
<html> <head> </head> <body> <font color="red">Test</font> </body> </html>


But when I run that, i get a blank page?

Thanks

EDIT: Sorry for being such a noob
ilike75i is offline   Reply With Quote
Old 04-14-2006, 04:34 PM   · #4
Jim_
NamePros Regular
 
Jim_'s Avatar
 
Name: Jim, of course
Location: Philadelphia
Trader Rating: (20)
Join Date: Aug 2005
Posts: 558
NP$: 14.30 (Donate)
Jim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of light
Save The Children
Remove
<html>
<head>
</head>
<body>

and

</body>
</html>

from ab.html
__________________
woop woop
Jim_ is offline   Reply With Quote
Old 04-14-2006, 04:51 PM   · #5
ilike75i
Account Suspended
 
Trader Rating: (0)
Join Date: Apr 2006
Posts: 5
NP$: 0.00 (Donate)
ilike75i is an unknown quantity at this point
Still I get nothing :S
ilike75i is offline   Reply With Quote
Old 04-14-2006, 05:04 PM   · #6
BillyConnite
 
BillyConnite's Avatar
 
Name: Rhett
Location: Coffs H, Australia
Trader Rating: (77)
Join Date: Jul 2005
Posts: 3,106
NP$: 47.00 (Donate)
BillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant future
Wildlife Parkinson's Disease Parkinson's Disease
Originally Posted by ilike75i
Still I get nothing :S


Do you get an error?

Try this instead:
include('ab.html');

Let us know , best of luck!
Rhett.
__________________
<?php if(1===1){ $computer="fine."; }else{ $computer="broken."; } echo "Your computer is ".$computer; ?>
BillyConnite is offline   Reply With Quote
Old 04-14-2006, 05:04 PM   · #7
Jim_
NamePros Regular
 
Jim_'s Avatar
 
Name: Jim, of course
Location: Philadelphia
Trader Rating: (20)
Join Date: Aug 2005
Posts: 558
NP$: 14.30 (Donate)
Jim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of lightJim_ is a glorious beacon of light
Save The Children
Try just a plain require statement or an include statement, maybe?
__________________
woop woop
Jim_ is offline   Reply With Quote
Old 04-14-2006, 05:25 PM   · #8
ilike75i
Account Suspended
 
Trader Rating: (0)
Join Date: Apr 2006
Posts: 5
NP$: 0.00 (Donate)
ilike75i is an unknown quantity at this point
I don't get an error, just a totally blank page.

the initial page is now:

Code:
<html> <head> </head> <body> <?php include('ab.html'); ?> </body> </html>


and ab.html is simply:

Code:
<font color="red">Test</font>


I read in a tutorial that ab.html should be called ab.php? I tried it but it still didnt work
ilike75i is offline   Reply With Quote
Old 04-14-2006, 05:36 PM   · #9
Shorty
Senior Member
 
Shorty's Avatar
 
Name: Thomas White
Location: England
Trader Rating: (15)
Join Date: Sep 2005
Posts: 1,033
NP$: 31.15 (Donate)
Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice
Did you save my code as a .PHP file?

Are you running PHP on the server you're testing it on?
Shorty is offline   Reply With Quote
Old 04-14-2006, 05:39 PM   · #10
ilike75i
Account Suspended
 
Trader Rating: (0)
Join Date: Apr 2006
Posts: 5
NP$: 0.00 (Donate)
ilike75i is an unknown quantity at this point
Shorty, you just made me realise what I did wrong. I saved the inital file as .html instead of .php, it works now!

Thanks for your help guys!
ilike75i is offline   Reply With Quote
Old 04-14-2006, 06:03 PM   · #11
Shorty
Senior Member
 
Shorty's Avatar
 
Name: Thomas White
Location: England
Trader Rating: (15)
Join Date: Sep 2005
Posts: 1,033
NP$: 31.15 (Donate)
Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice
No problem, glad I could help.
Shorty is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not 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
Forum Jump


Site Sponsors
Buy Flash Arcade Game Script Website Header Design EscrowDNS
Advertise your business at NamePros
All times are GMT -7. The time now is 11:41 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0