I want to create a file (out.php???) which measures and keeps stats on
the sites we link OUT to, including affiliates... i've got a few ideas
how to do this, so that's not the problem... the problem is that a lot
of the content on the site is contributed through writers, not
programmers, and since we know and trust these contributors, we're
comfortable with them being allowed to add links in the text, etc etc,
and don't strip those tags.

however, it's one thing to teach a whole heap of writers to link in this way:
<A HREF="http://somewhere"; TARGET="_new">click</a>

but it's a lot harder (or perhaps, more prone to errors, etc) to ask
them to do something like:
<A HREF="out.php?url=http://somewhere.com";>click</a>

... and then if it's wise to take the special characters out, replacing
them with ASCI (eg %20), then it's virtualy impossible.

THEN I thought about the fact that i'll be looking to add URL based
sessiosn to the site soon, which will require all links to carry a
session id...  again, too much to ask of them, and too unreliable.

So, one solution would be to use regular expressions to analyse text for
links, determin if they are internal or external, check for
target="_new", encode sessions, etc etc.  Big job for me, maybe not for
some of the regexp pros :)

OR, another option would be to establish a custom tag <LINK> (for
internal) and <ELINK> for external pages eg <ELINK
"http://somewhere.com";>click</a>, and let PHP convert it to a suitable
link, with sessions, TARGET="_new", etc etc... and better still, take
that link, and pipe it through something like out.php as discussed
above, without anyone having to worry about fussy syntax, sessions, etc.

Has anyone tried anything like this?  has anyone got code snippets, or
perhaps the ability to write the reg exps?

Many thanks,

Justin French

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to