Page 1 of 1

Site-wise page alternation

Posted: Wed Dec 19, 2007 7:20 pm
by xpt
Hi,

I remember geocities.com was able to alter all web pages hosted on its site. I'm wondering if it is possible to do so under Apache.

Today, I found another site that's doing so, [Jcart: spam link removed]


I believe everything below "Send this page to a Friend" was added using some site-wise page alternation scheme. What bewilders me is that how he is able to make those adding available only to my browser to view, but not to see. I.e., I can see the effect but not able to view the source.

I hope someone here can solve the above 2 puzzles for me.

Thanks a lot

Posted: Wed Dec 19, 2007 8:23 pm
by Ambush Commander
I remember geocities.com was able to alter all web pages hosted on its site. I'm wondering if it is possible to do so under Apache.
Yes. If you're using PHP the usual method is setting the handler for HTML to PHP, and then using auto_prepend_file, auto_append_file, and output buffering to grab the content and make modifications.
What bewilders me is that how he is able to make those adding available only to my browser to view, but not to see. I.e., I can see the effect but not able to view the source.
This is impossible, as you describe it. He is probably using JavaScript to add it.

Posted: Thu Dec 20, 2007 8:10 pm
by xpt
Thanks for the reply, I'll take a look at the auto_prepend_file/auto_append_file PHP solutions.

Any pure HTML solution? Back to the old geocities.com days, there didn't exist PHP by then. I guess it must be JavaScript, but how can you apply JavaScript site wise without touching each page?
He is probably using JavaScript to add it.
So I thought. He's not only very smart hiding how he add those social bookmark icons, but also very smart in hiding the JavaScripts, because I dig into each JavaScript file/function on the site, but none of then is for the adding the social bookmark link/icons.