Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Quick way to edit content on multiple pages?

Featured Replies

I have a website with upwards of 20 pages of content. Each page has an 'Affiliate's' tab where my list of affiliates are located. When I add a new affiliate, I have to go through each page individually, just to add one. I use a CSS/HTML div style for my website, but I want a quicker more efficient way to edit and add links. I heard that PHP does it and that SHTML does it, but I don't know anything about either. I don't want a fancy doo-dad, I just don't want to have to spend 30 minutes jumping from section to section, page to page to add links, and I don't want to stop taking affiliates. Oh, and it's a gaming site.

 

 

What would be the best way to accomplish my task?

php includes are great for this sort of thing. As what you can do is have one document with your affiliates in, and then tell that document to be included into all your other pages with a little bit of php. This way you only have one file to edit instead of lots.

 

Here is a thread that might help you understand how it works :)

 

http://www.webdesignerforum.co.uk/index.ph...ic=2036&hl=

A simple php include would do what you need.

 

<?php include("affiliates.php"); ?>

 

Now just place that instead of your affiliates div, and the html from your affiliates div place inside affiliates.php

 

Everytime you update affiliates.php it will update all your pages which use the php include.

 

Read more about php includes here: http://www.tizag.com/phpT/include.php

Edited by Sam G
added [code] tags

  • Author

I tried to add that code to my page and instead of showing the links I have saved in the file, it doesn't show anything at all. And when I use Firefox to view the page source as I'm looking at it, it comes up blank.

 

 

That's where I inserted it.

</head>
<body>

<div id="container">
<div id="header"></div>
<div id="main_right">
<? include ('affiliatelinks.php') ?>

 

 

 

Here's the code for the other file I'm trying to include.

<html>
<head>
</head>
<body>
<h1>Affiliates</h1>

<ul>
<ol><a href="http://www.hallowhall.net/">Hallow Hall</a></ol>
<ol><a href="http://www.ffproject.net">Final Fantasy Project</a></ol>
<ol><a href="http://www.goldenocarina.com">Golden Ocarina</a></ol>
<ol><a href="http://www.neo-dynasty.com/disgaea">Eien no Senritsu </a></ol>
<ol><a href="http://www.rpgreviewers.com">RPG Reviewers</a></ol>

</ul>


</body>
</html>

 

What am I doing wrong?

I tried to add that code to my page and instead of showing the links I have saved in the file, it doesn't show anything at all. And when I use Firefox to view the page source as I'm looking at it, it comes up blank.

 

 

That's where I inserted it.

</head>
<body>

<div id="container">
<div id="header"></div>
<div id="main_right">
<? include ('affiliatelinks.php') ?>

 

 

 

Here's the code for the other file I'm trying to include.

<html>
<head>
</head>
<body>
<h1>Affiliates</h1>

<ul>
<ol><a href="http://www.hallowhall.net/">Hallow Hall</a></ol>
<ol><a href="http://www.ffproject.net">Final Fantasy Project</a></ol>
<ol><a href="http://www.goldenocarina.com">Golden Ocarina</a></ol>
<ol><a href="http://www.neo-dynasty.com/disgaea">Eien no Senritsu </a></ol>
<ol><a href="http://www.rpgreviewers.com">RPG Reviewers</a></ol>

</ul>


</body>
</html>

 

What am I doing wrong?

Hi there, first of all the page that is calling affiliatelinks.php needs to have the php file extension too.

Secondly, this line

<? include ('affiliatelinks.php') ?>

should be

<?php include('affiliatelinks.php'); ?>

and thirdly, the php file that you are including also needs php tags at the start and the end.

<?php
?>

Hope that helps :)

Also you affiliates php just needs to have this in it

 

 

<h1>Affiliates</h1>

<ul>
<ol><a href="http://www.hallowhall.net/">Hallow Hall</a></ol>
<ol><a href="http://www.ffproject.net">Final Fantasy Project</a></ol>
<ol><a href="http://www.goldenocarina.com">Golden Ocarina</a></ol>
<ol><a href="http://www.neo-dynasty.com/disgaea">Eien no Senritsu </a></ol>
<ol><a href="http://www.rpgreviewers.com">RPG Reviewers</a></ol>

</ul>

 

 

as it includes everything in the file so if you keep the <body><html>...ect you will end up with those in your html twice.

  • Author

I made the changes that you all suggested, but it's still just a blank page. D:

You are running it in a server environment right?

 

Also when you view page source in the browser, what does it show?

  • Author

Yes, it's on my server, which has PHP installed, and I'm view the link straight from the internet.

 

When I view the page's source, it comes up blank too. Could it be a server side problem?

Yes, it's on my server, which has PHP installed, and I'm view the link straight from the internet.

 

When I view the page's source, it comes up blank too. Could it be a server side problem?

 

Can you post all of your code on here? (for one page using the include, and the included file itself)

Make sure the page that you are trying to put the php into has a .php extension rather than .html

 

also make sure the path is correct for the affiliates.php in your include('affiliates.php');

  • Author

<html>
<head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<META NAME="author" CONTENT="The Disgaea Fan" />
<meta name="Keywords" name="Keywords" content="disgaea,hourofdarkness,afternoonofdarkness,makaikingdom,2,disgaea2,forums,ph
antom kingdom,disgaea3,disgaea:hourofdarkness,disgaeahourofdarkness,makaikingdom,cursedmemories,3, disgaea">
<META NAME="description" CONTENT="A website dedicated to Disgaea, Disgaea 2 and the subsequent spin offs, remakes and sequels.  Has tons of information and a forum for active discussion. "><link rel="shortcut icon" href="PrinnySALUTE.gif" type="image/ico" />
<link rel="stylesheet" type="text/css" href="default1.css" media="screen" />
<title>The Disgaea Fan</title>
</head>
<body>

<div id="container">
<div id="header"></div>
<div id="main_right">
<?php include ('affiliatelinks.php'); ?>
<h1>Ads</h1>
<br>

<script type="text/javascript"><!--
google_ad_client = "pub-8762565938968096";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
//2007-07-16: thedisgaeafan.net/disgaea, thedisgaeafan.net/index, thedisgaeafan.net/makai
google_ad_channel = "8043691181+3589140755+0216442590";
google_color_border = "6131BD";
google_color_bg = "C94093";
google_color_link = "341473";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</br>
</br>
<script language="javascript" type="text/javascript" src="http://ads.netklix.com/ASEAAAAAAAAdAAAAAAAAuwAAAAAAgQAAAAAAdy8AIwAA">
</script>
<noscript><a href="http://www.netklix.us/">netklix.us</a></noscript>
</div>						
<div id="menu_right">
	<h1>The Disgaea Fan</h1>


	<ul>

		<ol><a href="/MSD/">Disgaea</a></ol>

					<ol><a href="/MSD2/">Disgaea 2</a></ol>

		<ol><a href="/PK/">Makai Kingdom</a></ol>

				   <ol><a href="http://forums.thedisgaeafan.net">Forums</a></ol>
<ol><a href="affiliation">Affiliate</a></ol>

		<ol><a href="about">Staff</a></ol>


	</ul>
<br>
<br>

</div>
<div id="main">


<div id="padded">
<p align="center"><font size= 3>News and Updates</font></p>
<br>
<br>
<h1>Disgaea 2 Remake</h1>
<p class="date">December 28, 2008</p>

<p>Disgaea 2 will be getting a PSP port, with a release date for Japan in March of '09.  Can't wait for that.  It's said to have a 30% longer story line and new characters.</p>
<p><font size=1>Source: [<a href="http://www.pspfanboy.com/2008/12/28/yep-disgaea-2-is-coming-to-the-psp">PSP Fanboy</a>]</p></font>
<h1>Phantom Brave Remake</h1>
<p class="date">December 19, 2008</p>
<p>Phantom Brave will be remade for the Wii with new content.  No release date for the US yet, keep an eye out.</p> 
<p><font size=1>Source: [<a href="http://www.thetanooki.com/2008/12/12/upcoming-nis-project-is-a-port-of-phantom-brave/">The Tanooki</a>]</font></p>
</br>

<h1>Whoops</h1>
<p class="date">November 28, 2008</p>
<p> Jeez Luis, it's been a long time since I last updated, for that I am sorry. :c(  This is probably old news to most of you, but the Prinny: Can I Really Be the Hero? game will be released in the US sometime in February. Makai Kingdom and Disgaea 2 have been rereleased by NIS, so keep an eye out for those two awesome games.  
</p>
<?br>
<h1>One More Update</h1>
<p class="date">September 6, 2008</p>
<p>Prinnies are getting their own game for the PSP.  Awesome and I can't wait!  It looks like Prinny Laharl will be the main character, mostly because of the scarf shown on the main character.  It's up for grabs November 20 in Japan.</p>
<p><font size=1>Source: [<a href="http://www.1up.com/do/newsStory?cId=3169731">1up</a>]</font></p>

<br>
<h1>Update</h1>
<p class="date">September 6, 2008</p>
<p>So, I finally got the Makai Kingdom section back up.  Sorry for the long wait folks.  </p>
<p>In the forums, we've opened up the volunteer work for Disgaea 3, so if you'd like to contribute, join and let us know. The forums could always use new members and we always welcome them</p> 
<p> For those of you looking in from Europe, Disgaea 3 be released in Europe early 2009 and Square Enix will be the publisher.  Bit of an unexpected turn of events, seems that Koei just wasn't up to par.</p>
<p><font size=1>Source: [<a href="http://nukoda.com/news/gc-08-square-enix-to-publish-disgaea-3-in-europe/">Nokuda</a>]</font></p>
<br>

<h1> WOOOOOOO</h1>
<p class="date">September 1, 2008</p>
<p> With Disgaea 3 released six days ago, I ask you : HOW IS IT?! If you haven't heard about Disgaea 3 being released yet, then I tell you to: GO CHECK IT!!</p>

<br>
<h1>That is...great!</h1>
<p class="date">August 24, 2008</p>
<p> Again, I apologize for posting up slow and outdated updates. Cim's internet is not working on his laptop, so I still have to update the front site.</p>

<p> So, on with the news! On August 7, 2008 Atlus announced that Disgaea: Hour Of Darkness has been given the title : Greatest Hits!</p>
<br>
<a href="http://www.rpgfan.com/news/2008/1341.html">Source</a>

<br>
<h1>For you PS3 Owners</h1>
<p class="date">August 15, 2008</p>
<p> Sorry for the slow update folks! I guess I'll be updating a few bits here and there every now and then when Cim is gone.</p>
<p> For you PS3 Owners, on August 7, 2008 on the PSN network, they released a wallpaper with Disgaea 3 in it.</p>

<br>
<h1>A couple things!</h1>
<p class="date">August 3, 2008</p>
<p>First, the sections are going to be down for a few hours while I work out organisation in database.  Tough luck, but it needs to be done.</p>
<p>Secondly, I am looking for someone with awesome web design talents.  There's more I'd like to do with this site, but with my current lack of skills, things are a bit hectic and aren't getting done.  If you'd like to help email <a href=mailto:'admin@thedisgaeafan.net'>Me</a> to apply.  Label it something that'll let me know that it's not spam.</p>
<br>
<h1>Unfortunate!</h1>
<p class="date">June 9, 2008</p>

<p>Unfortunately, it would seem that Disgaea DS has been delayed until September, no word on why, but in reality, it doesn't matter why.  I'm will to wait for Disgaea DS for a good while, I'm much more excited about Disgaea 3! Sure playing Pleinair in Disgaea DS will be fun, but come on, this is Disgaea 3.  Seriously.
<br>
<h1> Disgaea DS</h1>
<p class="date"> May 30, 2008</p>
<p>The Japanese trailer for Disgaea DS has been released and some fantastic footage it is indeed.  It shows how the top screen of the DS will be utilized as well as the fact that Pleinair is finally a playable character!</p>
<br>
<h1>Updates</h1>
<p class="date">April 20, 2008</p>
<p> I've been a bit busy lately, but I'm finding more and more free time so I'm going to try to code a couple new sections for Disgaea (I'm probably going to try and finish off the rest of the items for that game), Disgaea 2 (I'll start a weapons list and a monster list as well as a character create list for this game), Makai Kingdom (I'll probably get a weapons, armour and vehicle list as well as a character create list).  I've also been working on a new design for the site, mostly because I'm bored out of my mind with the current layout, looking at it a bit too long I think.   Anyway, updates to come, stay tuned I suppose.</p>

</br>
<h1>Forums</h1>
<p class="date">March 15, 2008</p>
<p>The new forum is up, has been for some time, we're a growing community of great people, and you should join us.  There are plenty of sections for conversation in the forum, and even more chances to make friends. </p>
</br>




</div>

</div>				


</div>
<center>Design &copy 2009 Cim</center> <center>All Games, Characters and Likenesses are &copy NIS</center>
?>
</body>
</html>

 

It's saved as PHP, but I've never used PHP before, so I don't know if I'm missing any vital code.

Line 91 remove the <?

 

And line 161 remove the ?>

 

That might work i think.

 

But it should of thrown up a syntax error as opposed to a blank page :/

  • Author

Now it's showing something in the browser, but it's not even half the site and no content. It's a single menu bar, the container and the header. Nothing else is there.

 

<html>
<head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<META NAME="author" CONTENT="The Disgaea Fan" />
<meta name="Keywords" name="Keywords" content="disgaea,hourofdarkness,afternoonofdarkness,makaikingdom,2,disgaea2,forums,ph
antom kingdom,disgaea3,disgaea:hourofdarkness,disgaeahourofdarkness,makaikingdom,cursedmemories,3, disgaea">
<META NAME="description" CONTENT="A website dedicated to Disgaea, Disgaea 2 and the subsequent spin offs, remakes and sequels.  Has tons of information and a forum for active discussion. "><link rel="shortcut icon" href="PrinnySALUTE.gif" type="image/ico" />
<link rel="stylesheet" type="text/css" href="default1.css" media="screen" />
<title>The Disgaea Fan</title>
</head>
<body>

<div id="container">
<div id="header"></div>
<div id="main_right">

 

Code stops here. Right before the php starts.

So it's a problem with the included php, or the actual include tag.

 

Whats the code in 'affiliatelinks.php'? can you post it?

  • Author

I took a look at the code while I was about to grab the code and I still had php tags in it. So, after I got rid of it from the included file, it works. I'm so excited, this will save me oodles of time.

 

 

Thank you! :c)

Good Good, It's the smallest of things that make the biggest of differences.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.