Current location: Hot Scripts Forums » Programming Languages » PHP » Website Managment with PHP ?


Website Managment with PHP ?

Reply
  #1 (permalink)  
Old 11-26-04, 09:25 AM
lunatick lunatick is offline
New Member
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Website Managment with PHP ?

Hi guys,

I'm looking to manage / edit my website more efficiently and quickly.

Instead of changing every link / section of every page on my website, I want to change it once and it will in turn change the others automatically.

My friend sugguested PHP but after an hr of searching, I have yet to find what I need. Just a bunch of tutorials for various other objectives.

Not knowing what it is called pose as a serious obstacle also.

So, can anyone shed some light on my issue ?

thanks
Reply With Quote
  #2 (permalink)  
Old 11-26-04, 09:35 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
Yes if you use a switch!

http://www.xeweb.net/tutorials/index...itchnavigation

Example:
Code:
<html>
<body>
<a href="link.html">link 1</a>
//PHP switch here
</body>
</html>
you wouldnt have to change link 1 on each page only the index!
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #3 (permalink)  
Old 11-26-04, 10:04 AM
lunatick lunatick is offline
New Member
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
thanks fire !

I am a little confused about where this code goes ?


PHP Code:

<?php

switch ($page)
{
case 
"about":
include(
'about.php');
break;
case 
"contact":
include(
'contactme.php');
break;
default:
include(
'home.php');
}
?>

where do I declare these variables ?
on the index ? if so.. where exactly ? in the head / body or what ?

thanks
Reply With Quote
  #4 (permalink)  
Old 11-26-04, 11:00 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
yes in the index!

PHP Code:

<html>

<body>
Here is all your text! This will look like this on every page so you only have to change the index instead of editing 100 pages! Here is more text below:

<?php 
switch ($page

case 
"about"
include(
'about.php'); 
break; 
case 
"contact"
include(
'contactme.php'); 
break; 
default: 
include(
'home.php'); 

?> 

Copyright Me 2004.
</body>
</html>
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #5 (permalink)  
Old 11-26-04, 05:33 PM
hinch hinch is offline
Wannabe Coder
 
Join Date: Oct 2004
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
heres one

www.cmsimple.dk

it's very simple, but easy to build on.
Reply With Quote
  #6 (permalink)  
Old 12-03-04, 11:36 AM
lunatick lunatick is offline
New Member
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
sorry, I haven't had the chance to work at it since reading it last time.
tried it today and failed miserably!

okay this is what i did ...

created an index.php and this is what was in it...
and only that...

PHP Code:

<html>

<body>


<?php
switch ($page)
{
case 
"about":
include(
'about.php');
break;
case 
"us":
include(
'us.php');
break;
default:
include(
'home.php');
}
?>

</body>
</html>
default page is home.php and this was the content on that page...

PHP Code:

<html>

<
head>
<
body>
BOO 
<a href="?page=us.php">us</a>
<
a href="?page=about.php">about</a>
</
body></head></html
when I click on the "US" link or the "ABOUT" link, it does not link to anything but the default, home.php, page. Both us.php and about.php has been uploaded to the same directory.

what am I doing wrong ?
where am i suppose to put the site CONTENT , on the index.php or home.php ?
Reply With Quote
  #7 (permalink)  
Old 12-03-04, 11:38 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
?page=us

not

?page=us.php

thats the whole point you dont need the .php because you set it in the switch
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #8 (permalink)  
Old 12-03-04, 12:08 PM
lunatick lunatick is offline
New Member
 
Join Date: Nov 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
wow appreciate the instant responses fire. love it and code works lovely.

Is there a way that you can apply it to sections of the site, just in case i change one part of the site , I wouldn't have to go to every page and edit it ?
Reply With Quote
  #9 (permalink)  
Old 12-04-04, 09:50 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
lol i just happened 2 be online

yeh just put the switch wherever you want and use 'thatpagename.php?page=blah'
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
Reply

Bookmarks


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

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP scripts related website - Banner Exchange? shadi Traffic Exchange 4 01-02-05 02:02 PM
PHP user managment with no mysql markac Script Requests 6 12-06-04 12:14 AM
FS: Prozilla Memberships (Turnkey Sites) - $10-15 less than Retail! rockergrrl General Advertisements 0 08-11-04 12:05 AM
Syndicating XML data into a website using PHP... Jackal05 PHP 3 07-16-04 02:38 PM
Help! With setting up a basic PHP Forum page on the website. A-A PHP 0 05-05-04 08:15 AM


All times are GMT -5. The time now is 05:16 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.