Select, Copy & Paste in PHP

We are building a website with CodeIgniter & have created the facility where a user can create their own advert. We are saving the adverts in an adverts folder rather than in a adverts category as no doubt other websites do. We want to create a link between the advert & selected categories of the users choice, but that is proving difficult to do.

In our system we have created a file containing ONLY the link, in the hope that somehow we can develop a system that will open that file, select, copy then close the file, then open a category file & paste. The paste must go to bottom & be appended, not overwrite, but that can be undertaken via fwrite. Its the select, copy & paste that is currently impossible.

From the Internet we have read that PHP can not do that, but maybe Javascript can, but yet to find a script that suits our needs. However, we are not sure what would happen if a 2nd person clicked the same facility before the 1st person pasted.

Does anybody have any ideas on how our problem can be solved?

You want to select content, copy it, and paste it to another file…

Rather than how you are approaching the problem, can you explain what the problem is so that other possible solutions can be evaluated?

My problem is PHP will not Select, Copy & Paste, although it can Open & Close Files & Append data.

Just so we’re all clear; it sounds you want to have the same text appear in several files. Is that right?

? if the file just has a a link in it… what else is in the file? anything? 1 file per link? or 1 file… and ALL links get added to it?

Also… PHP ‘can’ open files… and grab data… the layout/schema is not clear.

Sponsor our Newsletter | Privacy Policy | Terms of Service