Jump to content

I wanna insert the same thing in multiple pages


notclive

Recommended Posts

In javascript you might try:HTML files:

<html><head><script src="file.js"></script></head><body><script>txt = txtFromExternalFile();document.write(txt);</script></body></html>

JS file:

function txtFromExternalFile(){return "the text or whatever";}

You also might use PHP or XML as you said. Which is better, this depends on what "the thing" is.

Link to comment
Share on other sites

That was a piece of JavaScript :)You may also choose to use PHP, a server-side language, which is more powerful and more advanced, with which you can do incredible things :) Even include an entire file in the document, hows that :)

Link to comment
Share on other sites

You would probably have a webhost, don't you? And it does not support PHP, that's logical. Not every host supports it, although they should in my opinion :)If you'd really want to do such things only PHP can, you might consider moving to another host. There are not many that support PHP and still are free,so search carefully. I may give http://www.dhost.info as an example of a very good host, but it is slow due to the many requests :)

Link to comment
Share on other sites

Yeah I hear you, free hosts are alright for the hobbyist or casual programmer, but if you are at all serious about web programming then paying a small fee for the huge advantages should be a no-brainer.

Link to comment
Share on other sites

If you expect to make any money online, you are going to spend money on things like hosting, merchant accounts, SSL certificates, etc. Sooner or later you will want your own server, whether you rent it or build it yourself. Especially if you host other web sites, a reseller account goes a long way. It's a good thing when you don't have any limits on things like the number of SQL databases you can create.

Link to comment
Share on other sites

Eventually I will go for a paid host or my own server. But right now, I don't think I need one because I can hardly reach my space limit for example. I also don't know why I should have several databases? One would do fine doesn't it? :) One is easier managable.. :)So I have a free host right now with lots of incredible abilities, like add free, no file size limit, no file limit, gigabandwidth and php & mysql.Like I don't want to earn money with my site hosted by this host, that will come later when I have my own host.I don't say my way is the recommended one for programmers though :) I just don't like (yet) to pay for a certain host, while my site doesn't need much yet :blink: If many people found theirselves insatisfied, I won't stop them for turning instantly to paid hosts :blink:

Link to comment
Share on other sites

I also don't know why I should have several databases? One would do fine doesn't it?
I typically split my databases up among my clients. I won't put one client's project or site database in with someone else's database. For a single, large site, I might split things up like have a forum in one database, and a shopping cart in another or something like that, or I might just give each application a different table prefix. If you design your things to start out with using unique table names, such as with a prefix, then you can probably safely cram everything into one database. Even better if you have a configuration file where you define what the prefix is, makes it easy to move projects around.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...