Log in

View Full Version : How to insert JS into this particular PHP web?



chanjay
05-11-2011, 09:32 PM
Hi all,

I am new to PHP...I would like to insert a JavaScript slideshow into PHP website.

I know there are a lot of articles discussing about this: Placing the script inside PHP file in between <HEAD></HEAD> and PHP echo inside the body.

The problem is there is no HTML structure inside my PHP files (I've been searching header.php, index.php, functions.php, etc), no <HEAD></HEAD> and <BODY></BODY>. Most of them are just PHP echo...

Any ideea how to put this?:confused:

Thanks.

hc.

bluewalrus
05-11-2011, 09:42 PM
What PHP code are you using, is it a CMS or did you hire a developer?

chanjay
05-11-2011, 10:27 PM
No, this is like an open source PHP template that I downloaded for forum discussion like purpose.

It has .htaccess file, I don't know if it will give a hint.

hc.

traq
05-12-2011, 04:08 AM
It sounds like you have a fairly developed content management system. This might not be the best place to start if you want to work directly with the code, and don't know much about php.

PHP, contrary to the way a lot of webmasters view it, is not script that you can "place inside" your webpages: it is script that generates webpages. PHP's job is to write HTML. The html structure you're looking for is being written in steps throughout the script, and so you can't add and remove stuff the same way you would on a normal webpage - you simply won't find it all in one place.

I would definitely recommend learning more about php before trying to modify a complete system. In any case, we would need to know exactly what scripts you have, and what you want to do to them, before we could offer any help.