TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Can it be done like this......

Page: 1 2 Reply
Mar 24th 2001#585 Report
Member since: Mar 21st 2001
Posts: 17
I have a page that is completly the same throughout the whole website. There is just one box on the page that changes when the user goes to a link in the site. My question is is it possiable without using frames(won't work for this) to have a page stay the same and one area change....Thanks for you help. Joe
Reply with Quote Reply
Mar 25th 2001#611 Report
Member since: Mar 18th 2001
Posts: 796

That's possible with SSI (Server Side Includes)

You need to name your files .shtml then. SSI allows you to make a text file with html code and then put 1 line of code on every page (menu). Then you must only edit the text file to edit the menu for your entire website.

You do this,
make a simple text file with your html-code in notepad or other texteditor, you name it .txt not .html and you upload it.

Then you have to put this line in your webpage:



of course you change the menu.txt in your filename. When you have your textfile in another directory you must do this




Do not make the path to http://yoursite.com/menu.txt because that wont work. If you still want to do that you have to do this




Now you will only have to put the little line on every page and the content of the text file will show up on your page. So all you have to do now to change the menu or whatever on all pages is edit the text file.

Remember that not all servers support SSI.
But if your site has SSI it's bound to have htaccess, SO...

You can make a .htaccess file (yes there's a "." at the beginning of the file name) in your root directory that says:

AddType text/x-server-parsed-html .shtml .html .htm

This will allow you to use SSI's without having to rename all your html files to shtml...
Reply with Quote Reply
Mar 25th 2001#614 Report
Member since: Mar 18th 2001
Posts: 1690
"Remember that not all servers support SSI.
But if your site has SSI it's bound to have htaccess, SO...

You can make a .htaccess file (yes there's a "." at the beginning of the file name) in your root directory that says: "

You are allowed to place directives into the .htaccess file, but only if the main webserver is configured to allow override. He is still going to have to make sure his host provides him with the capability to allow overide. So instead of doing that, why not just ask if SSI is enabled? If not, ask them to.

If he is on a linux server running apache the file is access.conf or httpd.conf. It is recommended by apache that you use httpd.conf for most configuration of the server.

If he is on IIS, SSI should be supported by defualt, but I dont play with IIS much, so I could be wrong.
Reply with Quote Reply
Mar 28th 2001#715 Report
Member since: Mar 18th 2001
Posts: 32
For something this simple if you can't use SSI or expect you won't be able to if the site is moved, I would use a C (Perl would work also) cgi script. Write the script to output the page inserting a .txt file that holds the box contents in the proper place. This .txt file name could be fed in through the command line of the cgi. To make the script better I would create a template of the page with a place holder for the box text (ie. ##T) and feed the html template through looking for ##T and replace it with the proper .txt file. This will allow you to just edit the html file if you want to change the page itself instead of having to edit cgi code.

Here's a link to a zipped file of the C code that I use as a base for this and the library files that you will need to use it. 9k download. If you need help with this let me know. It wouldn't take very long to get it done.

ftp://terraaccess.com/pub/template.zip
Reply with Quote Reply
Mar 28th 2001#731 Report
Member since: Mar 21st 2001
Posts: 17
thanks for the help guys and gals...joe
Reply with Quote Reply
Mar 29th 2001#734 Report
Member since: Mar 18th 2001
Posts: 1690
yeah, i agree the cgi would be a good idea...but i dont like using c as a form of cgi. to me cgi is more like a scripting language than a full fledged program. Perl is much easier to learn imo for something of this nature. C can be very complicated...and developing it on a linux box can be a big pain in the butt. especially if you are not a linux guru...same with windows. you gotta know how the server addresses variables and thing then make sure you clear out the memory that the one cgi program uses. With perl its just script it, make your own variables, write the script and test.

Thats just me though.
Reply with Quote Reply
Mar 29th 2001#747 Report
Member since: Mar 18th 2001
Posts: 32
Agreed and I've read your posts and am impressed by your knowledge of computers on the lower level you don't see that a lot these days. But I do want to clarify for others that may want it. CGI(the Common Gateway Interface) is a standard not a language. Perl is a scripting language, easy to learn and is mostly used for writing CGI scripts although I have found it useful for small work utilities. I started programming when there was less than 640k of memory to work with (They claimed 640k but we all know that was not true . I like small, tight, fast code. C gives you that at the expense of a large learning curve. Programming CGI in C doesn't have much to do with linux. Most basic scripts cross platform (OS not processor) easily with little or no changes. Remember unless you are writing a windows or linux program you are basically programming the processor not the OS. The changes (with CGI) have more to do with the software it interacts with instead of the OS itself. (The difference between MySQL in linux and Microsoft SQL for windows) The code for the above for example will cross platform without any changes at all and most C CGI programs are this way. It's more work to get the code to run properly in NS and IE than Linux and Windows. I use Perl, C, Java, C++, Assembly, Visual Basic whatever a client needs. Remember I'm a programmer first and do Graphics when I have time. I have spent the last 15 years programming various languages and platforms. I will not always push C, but when you are outputting pages of information using templates C is magnitudes faster than Perl. Most of the speed comes from the difference between compiled and interpreted languages. I have found that the harder a language is to learn the more power you have with it. But in the end it really doesn't matter. Use what is best for you as long as it gets the job done. The less time you spend learning a new language or a complicated one the more time you have for graphics;)
Reply with Quote Reply
Mar 29th 2001#761 Report
Member since: Mar 18th 2001
Posts: 1690
assembly...ooff. I went as far as learning C++. My college felt is was a better idea to have C++ before I learned C.

Yes I am aware what cgi is. Im also aware that Perl, C are languages used to do scripting/programming for cgi.

Unfortunatly, learning C to only write a couple programs for cgi is not always advantageous. I stopped programming for a while because I was taking networking classes. When i decided I did not want to be a network administrator and changed my major to include webmaster type classes, programming was one of the things that drew me to it. Being able to make excellent dynamic content with a couple lines of code just appealed to me.

To everyone that reads this thread. Experiment with all the languages that can be used in web development. PHP tends to be very self explanatory and plugs in easily to mySQL. C is very fast. Perl is powerful in its text parsing. ASP -- uhh slow but has its advantages. Im luck in that I have a friend that hosts my site for free and gives me a shell account and root to install new modules to apache when I want to play with something.

Now, back to writting my calculator.
Reply with Quote Reply
Mar 30th 2001#799 Report
Member since: Mar 30th 2001
Posts: 1
This can be done in PHP with a query string if you want more information just ask or if u have already done it dont worry.
Reply with Quote Reply
Apr 20th 2001#2043 Report
Member since: Apr 20th 2001
Posts: 3
with php is easier
Reply with Quote Reply
Page: 1 2 Back to top
Please login or register above to post in this forum