09-08-2005, 15:58
|
#1
|
|
Inactive
Join Date: Jun 2003
Location: Coventry
Age: 49
Services: Sky+ & Pipex 8mb ADSL
Posts: 2,794
|
HTML Code Question
If I have a small site hosted on an internal work network which is basically just a page with links, is it possible to include some code so that users can add their own links, and delete links (whilst adhering to the site formatting) ?
Just an idea I had as the links won't be static anymore. If not, fair enough.
I'm not that tecchy at all, so apologies if this doesn't make sense and I need you to explain your replies
Ta.
|
|
|
09-08-2005, 16:08
|
#2
|
|
Inactive
Join Date: Jun 2003
Age: 45
Posts: 14,750
|
Re: HTML Code Question
The trouble is where and how to store the list of current links. And is the set of links communual, or personal? i.e. does everyone have their own different list, or they share the same list?
Do you have access to PHP? Its free so if you run the webserver yourself, you can install it yourself. Having MySql would make things quicker and easier, but its not essiential.
|
|
|
09-08-2005, 17:58
|
#3
|
|
Inactive
Join Date: Jun 2003
Location: Coventry
Age: 49
Services: Sky+ & Pipex 8mb ADSL
Posts: 2,794
|
Re: HTML Code Question
Quote:
|
Originally Posted by punky
The trouble is where and how to store the list of current links. And is the set of links communual, or personal? i.e. does everyone have their own different list, or they share the same list?
Do you have access to PHP? Its free so if you run the webserver yourself, you can install it yourself. Having MySql would make things quicker and easier, but its not essiential.
|
Its basically just a hmtl file with a link to other html files in the same location. The latter ones have links in them.
They are communual and everyone has access to the page at the moment via the network.
|
|
|
09-08-2005, 18:29
|
#4
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: HTML Code Question
They could always open the files in Word or something and change links in there.
|
|
|
10-08-2005, 00:28
|
#5
|
|
cf.mega poster
Join Date: Dec 2003
Age: 51
Posts: 7,101
|
Re: HTML Code Question
Everyone has access to read the html page, or they all have write access too? If they've got write access, then as Rich says, give 'em something basic to update the links with... pretty much everyone can use Word nowadays, and you can edit hyperlinks in that with yer eyes closed.
|
|
|
10-08-2005, 09:03
|
#6
|
|
Inactive
Join Date: Jun 2003
Location: Coventry
Age: 49
Services: Sky+ & Pipex 8mb ADSL
Posts: 2,794
|
Re: HTML Code Question
Quote:
|
Originally Posted by Richard M
They could always open the files in Word or something and change links in there.
|
Yes, but thats what I was trying to get away from tbh. I had a vision of a basic html form where they could paste a name and a link and another html file would be updated automatically.
|
|
|
10-08-2005, 09:11
|
#7
|
|
Inactive
Join Date: Jun 2003
Age: 45
Posts: 14,750
|
Re: HTML Code Question
Quote:
|
Originally Posted by skyblueheroes
Quote:
|
Originally Posted by Richard M
They could always open the files in Word or something and change links in there.
|
Yes, but thats what I was trying to get away from tbh. I had a vision of a basic html form where they could paste a name and a link and another html file would be updated automatically.
|
Well the easiest way of doing it is with PHP, which reads and writes to a text file containing the links (Javascript can't do this for security reasons). There is a problem with synchronisation though. Both people look at the website at the get a lcoal copy. They each add one link and save it. The first person's link will disappear, as his version gets replaced by the next person's.
The easiest way of getting around this is to set up a MySql server to facilitate the transactions. The advantage of this is that it can easy make the links personalised, should you wish to go down that route (make some links communal and some private).
Its not really difficult but it can be a bit of agro if you've never done it before.
|
|
|
10-08-2005, 09:39
|
#8
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: HTML Code Question
Quote:
|
Originally Posted by punky
Quote:
|
Originally Posted by skyblueheroes
Quote:
|
Originally Posted by Richard M
They could always open the files in Word or something and change links in there.
|
Yes, but thats what I was trying to get away from tbh. I had a vision of a basic html form where they could paste a name and a link and another html file would be updated automatically.
|
Well the easiest way of doing it is with PHP, which reads and writes to a text file containing the links (Javascript can't do this for security reasons). There is a problem with synchronisation though. Both people look at the website at the get a lcoal copy. They each add one link and save it. The first person's link will disappear, as his version gets replaced by the next person's.
|
It won't if you use the fopen flag "a" which opens the files then appends the info to what is already there.
|
|
|
10-08-2005, 10:28
|
#9
|
|
Inactive
Join Date: Jun 2003
Age: 45
Posts: 14,750
|
Re: HTML Code Question
Quote:
|
Originally Posted by Richard M
It won't if you use the fopen flag "a" which opens the files then appends the info to what is already there.
|
But that doesn't take into account changes in the middle, such as editing and deleting links.
The best way around it still using a simple flat text file is to give users the option, to add or edit links. If they want to add, fine just open as normal and append. If they want to edit/delete a link, then you need to give the user exclusive access by locking the file. PHP can do this with flock. If it didn't or isn't supported, you could just temporarily rename the file, so the second person attempting to gain access would an "in use" message when PHP does the "file_exists" bit.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 18:36.
|