Jump to content

When do I use no slash / ./ or ../


Guest Luhoozuher

Recommended Posts

Guest Luhoozuher

Forgive me for bumping an earlier post, but it seems I was getting extremely few views, and I couldn't expect to get help if no one is looking, right :(

In general CubeCart's system works fine for my needs. The fact that nearly everything is handled by index.php and cart.php works well enough. But I'm trying to implement a new feature on my site, and to accomplish that I'd like to use folders as opposed to GET values. Here's what I'm trying to do that's not working:

My cart is hosted at the top of my domain www.midnightflock.com. I'd like for the URL to the new stuff to be www.midnightflock.com/gamereviews/shadowrun. I've written a new site document in the admin panel that I would like to display when that url is typed in. So I've created index.php in /shadowrun to look like this:

<?php



  $_GET['act']= "viewDoc";

  $_GET['docId']= "10";

  

  include_once("../../includes/global.inc.php");

  

  include_once("../../index.php");



?>

I get an error like this:

Warning: main(/index.php) [function.main]: failed to open stream: No such file or directory in rootinfo/midnightflock.com/html/gamereviews/shadowrun/index.php on line 8

Warning: main() [function.include]: Failed opening '/index.php' for inclusion (include_path='serverstuff/php-4.4.7-1/share/pear') in rootinfo/midnightflock.com/html/gamereviews/shadowrun/index.php on line 8

I've aslo tried include_once($_glob['rootDir']."index.php"); include_once($_glob['rootRel']."index.php");. If I had to guess, I'd say it has something to do with the number of periods and slashes and I'm using to escape to higher directories, but perhaps it's something different than that. Any help would be appreciated.

Thanks.

Link to comment
Share on other sites

Guest Luhoozuher

It seems I may have been wrong about the ../ being the problem. After a little digging I changed the script to

include($_SERVER['SITE_HTMLROOT']."/index.php");

However, I still get the same errors :(

Is what I'm trying to do not possible?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...