not able to access files inside folders in my php code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yogesh0811
Forum Newbie
Posts: 2
Joined: Thu Mar 10, 2016 3:33 am

not able to access files inside folders in my php code

Post by yogesh0811 »

i have one blank.html file in <C:\wamp\www\Admin\pages\examples\blank.html> and i want to access api.php file in blank.html file which is in <C:\wamp\www\Admin\services\api.php> so how can i able to access api.php file in blank.html file. i want to see effects of api.php file code in blank.html file please suggest solution. thank you
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: not able to access files inside folders in my php code

Post by requinix »

Rename blank.html to blank.php and put some PHP code inside it to include() api.php.
yogesh0811
Forum Newbie
Posts: 2
Joined: Thu Mar 10, 2016 3:33 am

Re: not able to access files inside folders in my php code

Post by yogesh0811 »

what type of php code i have to insert??
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: not able to access files inside folders in my php code

Post by Celauran »

As requinix suggested, start with include.

Code: Select all

<?php include 'api.php';
Post Reply