![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Nov 2005
Posts: 1,251
|
Another PHP little question
Hello guys,
Maybe someone can help me again with a PHP question. I have WEBSITE A and WEBSITE B In WEBSITE A I created a php file and I display the content on my index.php using this code: PHP Code:
PHP Code:
Code:
Warning: include(/home/username_website_a/public_html/block/content.php) [function.include]: failed to open stream: Permission denied in /home/username_website_b/public_html/index.php on line 45 Warning: include() [function.include]: Failed opening '/home/username_website_a/public_html/block/content.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username_website_b/public_html/index.php on line 45 But Im a newbie and I dont know If this is possible. Can someone help me please? :-) Thanks!! |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Sep 2012
Posts: 41
|
Hi,
try PHP Code:
PHP Code:
![]() |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Mar 2008
Posts: 2,450
|
i think you should also check if you have safe_mode and open_basedir off or on..
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Nov 2005
Posts: 1,251
|
Thank you for your replies mates!
adult-help, I have: open_basedir: no value safe_mode: off Do I need to put both of them on? Or just one of them? If yes, which one? And is secure to put them on? |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jun 2012
Location: Earth
Posts: 152
|
With this code you get the same error?
PHP Code:
__________________
Best Webcam Affiliate Cam Traffic Profits |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Dec 2009
Location: Texas
Posts: 1,643
|
The first thing you should do is prove to yourself that you have the right path to the file you want to include by checking it on the command line. Try typing this to if you a good response.
"ls -l /home/username_website_a/public_html/block/content.php". If you don't receive an error you've got the right path if an error is returned you need to get find the correct path. I would worry about .. or ../.. because it looks like you are using a full path. You would only need to those if you are using relative paths. php includes always makes more sense to me when I write it like this <?php include("/home/path/to/file/I/want.php"); ?> I use double quotes in case I want to use variables that way the variable get interpolated
__________________
Go Fuck Yourself |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Aug 2011
Posts: 131
|
Check you file permissions inside the directory
/home/username_website_a/public_html/block/ block should be 755 or 777. 777 gives the outside would access to any file that is in there. What I did in the past with a similar issue was to use an external readfile statement. <? readfile("http://path A/index.php"); > Edit the code on site B Insert the above statement in place of your statement that would normal display your output in side B. Any changes made on site A will automatically show up on site B. Give it a shot. |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#8 |
Registered User
Industry Role:
Join Date: Dec 2011
Posts: 22
|
php includes!
Website B needs this adding: <?php include("hxxp://WebsiteA/want.php"); ?> that should do it! |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#9 |
Web Developer
Industry Role:
Join Date: Jan 2011
Location: UK
Posts: 264
|
If they are two different users and PHP has been setup to restrict you to your own directory, the easiest way to have it work is to park the domain for website b onto website a then you can use relative references and also pay for one set of hosting
Good Luck Rob |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Industry Role:
Join Date: May 2005
Location: UK
Posts: 1,201
|
Does
<?php include '/home/username_website_a/public_html/block/content.php'; ?> work in website A as well ? |
![]() |
![]() ![]() ![]() ![]() |