Unstoppable Domains

Having a problem with PHP

Spaceship Spaceship
Watch
Impact
45
I keep getting this error on my website (this is for CuteNews):
Warning: main(/show_news.php): failed to open stream: No such file or directory in /home/jflameti/public_html/ps3/location-page/cute-news/index.php on line 5

Warning: main(/show_news.php): failed to open stream: No such file or directory in /home/jflameti/public_html/ps3/location-page/cute-news/index.php on line 5

Warning: main(): Failed opening '/show_news.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jflameti/public_html/ps3/location-page/cute-news/index.php on line 5

Here is the code of the file where there's a problem with line 5:
Code:
<?php

$number = 5;
$template = '*';
include $cutepath.'/show_news.php';

?>

I don't get why line 5 ("include..." line) is having problems.

I think what the problem might be is the path. I think it MIGHT think the "show_news.php" file is in the "/home/jflameti/public_html/ps3" when in fact it is located in the "/home/jflameti/public_html/ps3/location-page/cute-news/" directory.

Anyone think my suspicions are correct?
How can I use the full URL there instead?

Thank you,
Andy
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
does the $cutepath variable have a value set?
 
0
•••
I believe it does in the "System Settings" part, where you enter in the path and then it will use that for $cutepath.
I put in "http://mysite.com/location-page/cute-news" (domain replaced there for privacy purposes) for the "Path to the Script:" URL (which I believe is the $cutepath variable.) But it still doesn't work.

BTW Jim, I edited my post above just before you replied.

Thanks again,
Andy
 
0
•••
<?php
$number = 5;
$template = '*';
include '.location-page/cute-news/show_news.php';
?>


try that
 
0
•••
Sorry Jim, now it's giving me this after I tried your solution above:
Warning: main(.ps3/cute-news/show_news.php): failed to open stream: No such file or directory in /home/jflameti/public_html/ps3/location-page/cute-news/index.php on line 5

Warning: main(.ps3/cute-news/show_news.php): failed to open stream: No such file or directory in /home/jflameti/public_html/ps3/location-page/cute-news/index.php on line 5

Warning: main(): Failed opening '.ps3/cute-news/show_news.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jflameti/public_html/ps3/location-page/cute-news/index.php on line 5
:sick:
 
0
•••
Where is show_news.php located? If you tell us that then the problem is easy to fix.
 
0
•••
0
•••
include './location-page/cute-news/show_news.php';

I forgot a slash. :X
 
0
•••
Thank you, that worked perfect!
Sending NP$ on your way Jim and Dan, thank you guys for the help and effort!
 
0
•••
from what you are saying you have set $cutepath to the wrong path. You have set it to the internet accessible path rather than the server path which it should be.

The fix you have implemented will fix it for that particular problem but anything else that uses that variable will have a similar problem.
 
0
•••
filth@flexiwebhost said:
from what you are saying you have set $cutepath to the wrong path. You have set it to the internet accessible path rather than the server path which it should be.

The fix you have implemented will fix it for that particular problem but anything else that uses that variable will have a similar problem.
The cutepath variable he refrenced was internal to the script and had nothing to do with the page he was including it on.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back