Help with PHP and linking to a file

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
rjtyrell
Forum Newbie
Posts: 2
Joined: Thu Nov 04, 2010 3:43 pm

Help with PHP and linking to a file

Post by rjtyrell »

Hi,

I am trying to get frontpage slideshow working and so far:-

// 1. Enter the name of your slideshow
$slideshow="myslideshow";

// 2. Enter your site's URL (without trailing slash)
$siteURL="http://www.thevillagers.co.uk";

// 3. Enter the absolute path of your site on the server (without trailing slash)
$sitePath="/home/thevilla/public_html";

// Include the slideshow
include_once($sitePath."/fpss/fpss.php"); // DO NO EDIT THIS LINE

Which are the absolute paths as far as I am aware?

Uploading this PHP file I now get errors saying:- http://www.thevillagers.co.uk/example.php

Warning: require_once(/home/thevilla/public_html/fpss/slideshows/myslideshow/p arameters.php) [function.require-once]: failed to open stream: No such file or directory in /home/thevilla/public_html/fpss/fpss.php on line 16

Fatal error: require_once() [function.require]: Failed opening required '/home/thevilla/public_html/fpss/slideshows/myslideshow/parameters.ph p' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/thevilla/public_html/fpss/fpss.php on line 16


In regard to this error the files are online on my host server, so this can't be the problem? line 16 on http://www.thevillagers.co.uk/fpss/fpss.php relates to:-

require_once(dirname(__FILE__).DS.'slideshows'.DS.$slideshow.DS.'param eters.php');

Any help would be great.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Help with PHP and linking to a file

Post by Jonah Bron »

rjtyrell wrote:Warning: require_once(/home/thevilla/public_html/fpss/slideshows/myslideshow/p arameters.php) [function.require-once]: failed to open stream: No such file or directory in /home/thevilla/public_html/fpss/fpss.php on line 16
There's a space in "parameters.php" ("p arameters.php"). That could be the problem.
rjtyrell wrote:Fatal error: require_once() [function.require]: Failed opening required '/home/thevilla/public_html/fpss/slideshows/myslideshow/parameters.ph p' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/thevilla/public_html/fpss/fpss.php on line 16
Another space ("parameters.ph p").
rjtyrell wrote:require_once(dirname(__FILE__).DS.'slideshows'.DS.$slideshow.DS.'param eters.php');
Another space. I'm starting to think these are just typos in your post?

When posting code on the forums, always use the

Code: Select all

[/syntax ] tags (the [i]PHP Code[/i] button).  Please edit your original post.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Help with PHP and linking to a file

Post by requinix »

http://www.thevillagers.co.uk/fpss/slideshows/

You don't have a "myslideshow" slideshow. Only one there is "demo".
Jonah Bron wrote:Another space. I'm starting to think these are just typos in your post?
Yeah, I saw them too and thought that too. The page itself shows the errors without the spaces in the filenames.
rjtyrell
Forum Newbie
Posts: 2
Joined: Thu Nov 04, 2010 3:43 pm

Re: Help with PHP and linking to a file

Post by rjtyrell »

many thanks for your quick replies, i will check the typos and change to demo.

thanks again
Post Reply