Closed Thread Icon

Topic awaiting preservation: Once again... Pages that link to <a href="https://ozoneasylum.com/backlink?for=22423" title="Pages that link to Topic awaiting preservation: Once again..." rel="nofollow" >Topic awaiting preservation: Once again...\

 
Author Thread
templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 07-04-2004 03:36

Sorry to bother you guys agan but I got another problem. I have a portion on my site which will be regularly updated, weekly updated etc etc I'm not very good at JavaScript (just started learning two weeks ago) but I can still understand most of it. I want to know how to make a script that I can place in a section of the site and then updated it elsewhere, like another file ot something. That portion of the site will be on every page.

I know it can be done with PHP, MySQL etc but I have absolutely no knowlegde of them and I don't want to to rush into learning them...

Anyone know how to do that?


Online Portfolio

(Edited by templar654 on 07-04-2004 03:38)

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 07-04-2004 04:15

Well... depends on what you're doing. You can include a seperate Javascript file with <script language="Javascript" src="included_file.js"></script> etc... When you change included_file.js, the changes will be on all the pages.

However, you cannot make dynamic changes like you can with Perl, PHP, or Python. Javascript is a client-side application; it can only deal with the information it is given explicitly in its include files.. If you want dynamic content, you will probably need to move to using a server-side language.

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

tntcheats
Nervous Wreck (II) Inmate

From: BC, Canada
Insane since: Jun 2004

posted posted 07-04-2004 08:42

Believe me, it's easier with PHP.

<?php include 'html, php, txt, or any other file that you think will work'; ?>

All done. You just pop that in, change the page extension to PHP and it'll render like that to the browser, not to mention Google etc. Oh yeah, and you don't want to forget to make the file you want to include. It'll fit right into the page, so you don't need < h t m l >< h e a d > or anything like that. You can look at your code and it will just be put ther in the place of the short PHP snippet.

Note that you need a server that can run PHP for this, and that the code that you put into the included file won't show when you're on your normal computer, you'll probably have to put it online unless you have that Mac OS that can run it.

If your server supports PHP and it shows an error, you just need to use a different way of showing the url, not including the http://. For example: /home/youraccount/public_html/included-file.html


The other other other other other white meat.

ninmonkey
Nervous Wreck (II) Inmate

From:
Insane since: Nov 2003

posted posted 07-04-2004 13:38
quote:
templar654 said:

I know it can be done with PHP, MySQL etc but I have absolutely no knowlegde of them and I don't want to to rush into learning them...

Since the only php feature you want is including, you don't need to use php. If you're going to learn it anyway, you might as well start now :P

Otherwise, if you have apache you're able to use Server Side Includes (SSI). If you use the XBitHack you don't need a special extension or parse all pages. (Information on this is in the apache docs)

quote:
tntcheats said:

code that you put into the included file won't show when you're on your normal computer, you'll probably have to put it online unless you have that Mac OS that can run it.

I don't understand what you mean, since windows and linux can also run apache + php for viewing on your own computer...

(Edited by ninmonkey on 07-04-2004 13:41)

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 07-04-2004 14:03
quote:
tntcheats said:
Note that you need a server that can run PHP for this, and that the code that you put into the included file won't show when you're on your normal computer, you'll probably have to put it online unless you have that Mac OS that can run it.

Never heard of Easy PHP

templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 07-04-2004 16:55

hmmm I guess you're right ninmonkey, I've stayed in the dark ages long enough, it's time to vacate this cave called Client-Side and enter and apartment called Server-Side. But for now of course JavaScript will do as the content isn't going to be very dynamic just a couple of links.


Online Portfolio

whisperstorm
Nervous Wreck (II) Inmate

From: California
Insane since: Jul 2004

posted posted 07-05-2004 18:36

Trust your feelings! Once you cross over to the Server side forever will it dominate your will!

And to further corrupt you, you might check out XAMPP

--- RPG Fan ---

(Edited by whisperstorm on 07-05-2004 18:38)

« BackwardsOnwards »

Show Forum Drop Down Menu