Having a problem with PHP

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Ringr

VIP Member
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
Close
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
Close
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
Close
<?php
$number = 5;
$template = '*';
include '.location-page/cute-news/show_news.php';
?>


try that
 
0
Close
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
Close
Where is show_news.php located? If you tell us that then the problem is easy to fix.
 
0
Close
0
Close
include './location-page/cute-news/show_news.php';

I forgot a slash. :X
 
0
Close
Thank you, that worked perfect!
Sending NP$ on your way Jim and Dan, thank you guys for the help and effort!
 
0
Close
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
Close
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
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back