Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
|
|
I need some answers |
Page: 1 | Reply |
Mar 17th 2006 | #172377 Report |
Member since: Aug 27th 2002 Posts: 672 |
I know this isn't the proper section to ask this, obviously. But due to the recent lack of activity on these boards, I thought I had more chance to dump it in the general area. Alright, so I have a site : LINK and like you can see there's the layout all around the content area. What I initially wanted was to have that layout to be generated to all the pages of my website. I wanted to, for example, write the "content" of my bio page and then let the server generate the layout around it. So if I wanted to change the copyright line from 2004-2005 to 2004-2006, I would do it one time and the server would change it on every other page of the website. The problem is my knowledge of scripts is very limited, so I ended up writing all pages in static HTML and a bit of CSS, cause that's all I knew. So what script or language should I learn to be able to do what I just described? Any help with that would be very appreciated. Thanks! |
Reply with Quote Reply |
Mar 18th 2006 | #172379 Report |
Member since: Aug 25th 2001 Posts: 1619 |
It looks like every page is loading into that frame, so you would just have to change the copyright on the main page and you should be golden.
|
Reply with Quote Reply |
Mar 18th 2006 | #172380 Report |
Member since: Mar 24th 2001 Posts: 3734 |
What type of scripting you use depends on your host. You can use ASP, ASP.NET, PHP, Coldfusion, and others. Most likely, since you are on Mediatemple, and since I don't think they do Windows hosting, you'd want to look at PHP. Of course, I know nothing of PHP, so I'll pass the question on to someone who does. You will either want to use 'include' files, or you could simply retrieve a value from a variable, or from a database of configuration values, the current year being one of them.
|
Reply with Quote Reply |
Mar 18th 2006 | #172382 Report |
Member since: Mar 4th 2006 Posts: 19 |
Your best bet is to use php includes, create separate php files which include the coding for the parts of your site (i.e. menus, footers, etc...) and then plug the content in as necessary. This way you can also change parts like the menu and it affects the whole site without having to change each page individually.
|
Reply with Quote Reply |
Mar 19th 2006 | #172384 Report |
Member since: Jun 1st 2005 Posts: 436 |
Alternatively to the php includes, you may want to consider SSI (server side includes)... Should just be a matter of naming your files XXX.shtml and applying the correct tag for a SSI... No doubt google will have the correct format, Idon't off the top of my head. PHP includes would be a better option, but it's not always the case that your host will support this. But they basically do the same kind of thing... allow you to use templates to manage parts of your content (plus laods of other stuff). |
Reply with Quote Reply |
Mar 19th 2006 | #172386 Report |
Member since: Aug 27th 2002 Posts: 672 |
Thanks everyone for your time. Since I'm on mediatemple, I think I'll use PHP like you all said. The thing is I know nothing about PHP, but I guess that's a good reason to start learning it! hehe. I already started reading about javascript, cause on W3Cschool they were saying I should knew that before learning PHP, so I guess I'll just continue in that way. :o |
Reply with Quote Reply |
Mar 20th 2006 | #172394 Report |
Member since: Aug 27th 2002 Posts: 672 |
Hmm, I got a little problem here. I've read about php require() and include() I created an HTML file for my header, my body and my footer. Each of them are plugged into a .php file with the "require()" fonction or whatever. But the problem is with my navigation bar that has rollover using a javascript I found on the net. Everything looks fine when I display the page, but for some reason, in Firefox the page is extremely slow (example: each rollover takes like a sec to load and be displayed). In Internet explorer, it ain't slow, but when I roll over any of the button, I get this message error: "Stack overflow at line: 37" and then "Stack overflow at line: 43" Why I get this overflow problem? Is it because I can't abuse of the "require()" fonction in a .php file because it's too heavy to load or what? Cause the nav bar is very small in terms of disk space (only a few Kb). |
Reply with Quote Reply |
Mar 20th 2006 | #172395 Report |
Member since: Jun 1st 2005 Posts: 436 |
The require function is not heavy on the server... It maybe the way that they images are unloaded called from the server for the first time when you actually rollover them... You may find that code to preload all the images during the initial page load stops this from happening. For the stack overflow question... I don't know, but you may get some clues if you look at the php page on line 37. |
Reply with Quote Reply |
Mar 21st 2006 | #172404 Report |
Member since: Mar 4th 2006 Posts: 19 |
As far as I know rich, php is more commonly installed on most servers compared to SSI as some hosting companies disable or don't run SSI facilities. You should be using the following code for php includes: [PHP][/PHP] Stack overflow during a rollover sounds like something to do with the javascript code, check the bottom left corner if using IE and there should be a warning icon displayed if there's a problem with the Javascript. You can click on this if you want more info on the issue. Unfortunately I'm not a javascript guru so my knowledge on JS is limited. |
Reply with Quote Reply |
Mar 22nd 2006 | #172410 Report |
Member since: Aug 27th 2002 Posts: 672 |
Thanks for the help guys. It is much appreciated. I've played with it a bit today and it seems that the overflow was caused by the fact that I used the JS in a file I used in another html file I "connected" using include() and was using the same JS in the php file, so I guess they interfered together and didn't work out. Anyway, I was just wondering what exactly is the difference between "include()" and "require()". I've found something in google, but it didn't make too much sense :/ |
Reply with Quote Reply |
Page: 1 | Back to top |
Please login or register above to post in this forum |
© Web Media Network Limited. All rights reserved. No part of this website may be reproduced without written permission. Photoshop is a registered trademark of Adobe Inc.. TeamPhotoshop.com is not associated in any way with Adobe, nor is an offical Photoshop website. |