This is a discussion on "Still confused... PHP" within the Starting Out section. This forum, and the thread "Still confused... PHP are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Still confused... PHP
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Still confused... PHP
So, I've got a basic index.html file and I want to convert it into php, so i've changed the extension... thats all fine.
BUT I want to use an include so I can change one part of my menu on all files without having to do it on a million seperate files. The only thing is, my menu is included in the index.php file, its not got a seperate file... I hope you get what I mean, I can explain more if needed. Thanks |
|
|
|
||||
|
Re: Still confused... PHP
Well then move the menu to a separate file and include the new external file in the exact same place in index.php where the menu was before.
I'm not quite sure if I understood your question right, so if that doesn't make sense, then could you please clarify the question or post some code.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
|||
|
Re: Still confused... PHP
So if I moved the code for my menu to a seperate file that would work, but then what esactly do I put where my menu was?
Thanks |
|
||||
|
Re: Still confused... PHP
Just put the include statement!
|
|
||||
|
Re: Still confused... PHP
Quote:
use: <?php include("menu.html"); ?>
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: Still confused... PHP
Okay, i've done what has been said but the page is just coming up without the navigation now.
I've saved a file called 'nav.inc' which just contains : <ul> <li><a href="me.html" title="me">Me</a></li> <li><a href="art.html" title="you">You</a></li> </ul> and in my index page where that was I have: <div class="sbititle">Navigate</div> <div id="sbinav"> <?php include('nav.inc'); ?> </div> I can't see where im going wrong, unless its something to do with the div's in my code around the navigation. Thanks for all your help so far. |
|
|||
|
Re: Still confused... PHP
yes, it's index.php and yes - they are in the same folder.
Ok, I think i've been very silly! Does it have to be on a server to work then? I've been testing it locally!?! I really am a beginner, so you'll have to excuse my naiveity. |
|
||||
|
Re: Still confused... PHP
Yes ... it needs to be on a server. PHP is a server-side language.
|
|
||||
|
Re: Still confused... PHP
Quote:
you'll have to install php and a webserver program search for XXAMP on google.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: Still confused... PHP
oops...DOH!
Thankyou very much! |
|
||||
|
Re: Still confused... PHP
As Karinne and Alex menthiod. PHP is a server side programming langude. So it only works when uploaded to your website host. Although, you can run a server locally though XAMPP. XAMPP's name is an acronym for X (any of four different operating systems), Apache, MySQL, PHP and Perl.
Any questions, just ask! |
|
||||
|
Re: Still confused... PHP
There's also WAMP. There's a great video tutorial on killerphp.com on how to install WAMP for local use
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
Re: Still confused... PHP
Quote:
That's how i installed WAMP |
|
|||
|
Re: Still confused... PHP
Thanks very much guys!
I since, uploaded my documents to my host and found they were all working fine, but i'll keep in mind what you said about doing it locally. Thanks |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Now im really confused | cressy | Scripts and Online Services | 1 | Aug 4th, 2007 08:14 |
| Confused $_SESSION | SoulAssassin | PHP Forum | 2 | May 18th, 2007 14:44 |
| Confused!!! | TwentyFourSeven | Website Planning | 2 | Apr 28th, 2007 05:57 |
| Confused wanna be, need much help | Helpless | Web Page Design | 1 | Nov 30th, 2006 04:00 |
| Confused with links | sspecialme11 | Link Building and Link Sales | 0 | Sep 13th, 2006 16:01 |