user2129623
user2129623

Reputation: 2257

including content of other files in php

I have folder Box. In that main file index.php. Now in index.php I am including content of other file which is inside Box/Wall/insidewall.php

insidewall.php takes image, js from other subfolders in /Wall.

I wrote

<div style="style=position: relative; margin-top: 200px; margin-left:440px;">
<?php include '/opt/lampp/htdocs/FB/ec2test/Wall/insidewall.php'; ?>
</div>

But it shows only content of insidewall.php only. Other images, js. css dont reflect.

What mistake I making here?

UPDATE:

directory structure:

insidewall.php is- https://github.com/karimkhanp/commentbox_quora/blob/master/yepinol/Wall/index.php

The folder /Wall I have shifted to somewhere else and trying to include above file with rename insidewall.php

Upvotes: 1

Views: 51

Answers (1)

Sumit Bijvani
Sumit Bijvani

Reputation: 8179

Problem is you are using sort path to include Images, JS & CSS.

Use Absolute path to show all files..


For Ex.

http://yourdomain.com/fb/stylesheet.css

instead of

fb/stylesheet.css

Upvotes: 2

Related Questions