Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Skinning my Personal Website, help!
Old 12-28-2005, 04:25 PM Skinning my Personal Website, help!
Junior Talker

Posts: 4
Trades: 0
Hello!

I am currently following a tutorial which will enable users to choose different skins (interfaces, I guess) for my website. This tutorial can be found here. I have followed every instruction as closely as possible, but my website is throwing back errors at me (as you can see here). I'll try my best to tell you what lines of my scripting contain errors, but I can't promise anything!

Just a note, my index page is constructed very simply at the moment. All it has is the cookie php part, the header php part, a sentence and my footer php part:
<?php include ("e:\domains\o\oh-crud.co.uk\user\htdocs\cookiecheck.php");
$headervar="e:\domains\o\oh-crud.co.uk\user\htdocs\nav\header";
$extension=".php";
include($headervar.$skin.$extension);?>

Hello there
<?php
$footervar = "e:\domains\o\oh-crud.co.uk\user\htdocs\nav\footer";
$extension = ".php";
include ($footervar.$skin.$extension);
?>


I apologise for my lack of whitespace, I'm not an advanced PHP programmer as you can see! So anyway, here's the first part of the error:
Warning: main(e:\domains\o\oh-crud.co.uk\user\htdocs av\header1.php): failed to open stream: Invalid argument in e:\domains\o\oh-crud.co.uk\user\htdocs\index.php on line 3
I think it points to the cookiecheck.php file, or the path to it. I'm not exactly sure. I know the paths above seem quite different, but I contacted my host (fasthosts.co.uk) and they gave me the above information, as well as another possible path which does not work either.
Warning: main(): Failed opening 'e:\domains\o\oh-crud.co.uk\user\htdocs av\header1.php' for inclusion (include_path='.;c:\php4\pear') in e:\domains\o\oh-crud.co.uk\user\htdocs\index.php on line 3
This particular error confuses me a lot! I don't personally have php4 or pear, so it might be something to do with my hosting company. Line 3 again points to my cookiecheck.php file, I think. Again, I suck at PHP!
Warning: main(e:\domains\o\oh-crud.co.uk\user\htdocs av\footer1.php): failed to open stream: Invalid argument in e:\domains\o\oh-crud.co.uk\user\htdocs\index.php on line 10

and
Warning: main(): Failed opening 'e:\domains\o\oh-crud.co.uk\user\htdocs av\footer1.php' for inclusion (include_path='.;c:\php4\pear') in e:\domains\o\oh-crud.co.uk\user\htdocs\index.php on line 10

These parts are the same as what I mentioned above, just the error is on different lines, which leads me to think that it has something to do with the header and footer files.

Finally, I will leave my cookiecheck.php file with you, if it will be of any help:
<?
$total_skins = 1;
$default_skin = 1;

if (isset($_REQUEST['newskin'])) {
$newskin=(int)$_REQUEST['newskin'];
if ( ($newskin<1) OR ($newskin>$total_skins) ) $newskin=$default_skin;
} elseif (isset($_REQUEST['skin'])) {
$newskin=(int)$skin;
if ( ($skin<1) OR ($skin>$total_skins) ) $newskin=$default_skin;
} else $newskin=$default_skin;

$skin=$newskin;
setcookie ('skin', "", time() - 3600);
setcookie('skin',$newskin,time()+(86400*365),'/');
setcookie('skin',$newskin,time()+(86400*365),'/','.oh-crud.co.uk');
$skin=$newskin;


$headervar = "//iis669/domains/o/oh-crud.co.uk/htdocs/nav/header";
$footervar = "//iis669/domains/o/oh-crud.co.uk/htdocs/nav/footer";
$extension = ".php";
?>

I would literally be the happiest girl alive if you could help me! I'm sorry it's a bit long winded but I tried to include everything. Thanks
chezzy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-28-2005, 09:14 PM
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
chezzy I think the main problem is you're pointing to a drive on your computer (e: You won't need to specify a drive in the include statement. Same for your $headervar and $footervar. Typically you won't need to include most of the path you've specified either.

When you point something to www.yourdomain.com it will point to the root directory of your site. In your case this is the htdocs folder.

From what you've shown your index.php files resides in your root directory (the httdocs folder) and your header1.php and and footer1.php are in a subfolder of the root named 'nav' (1 being the value of $skin and php being the value of $extension)

Also you're using backslashes (\) to separate the folders in your path when you should most likely be using forward slashes (/)

I think all you would need to use to specify the path for $headervar would be nav/header or alternately /nav/header. Similarly for $footervar and any includes.

If that doesn't work you can try using the full path (without the e: and using the forward slashes) though I don't think you'll have to do that.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-29-2005, 12:05 PM
Skilled Talker

Posts: 76
Trades: 0
ya use something like http://localhost/".....file path"
darshdude is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Skinning my Personal Website, help!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19941 seconds with 12 queries