Forums / General Questions / Need some help, trying to add a file but it keeps redirecting to zc_install/index.php

Need some help, trying to add a file but it keeps redirecting to zc_install/index.php

Locked

Started by tj1 on 1 Jul 2007, 3:26 AM · Views: 2,204

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
1 Jul 2007, 3:26 AM
#1
tj1 avatar

tj1

Totally Zenned

Join Date:
Mar 2005
Location:
California
Posts:
628
Plugin Contributions:
0

Need some help, trying to add a file but it keeps redirecting to zc_install/index.php

Hi,

I list items that I also sell on my ZC shop on several third-party sites.
I have created a little php file called stockcheck.php that I use to display the number of items I currently have in stock in those third party site listings.

Currently I have the stockcheck.php file in the root directory, my ZC shop is also installed in the root directory and it works fine, but I'm reorganizing my site and would like to move many files including stockcheck.php to a subdirectory called 'pages'.

If I move the file to '/pages' it no longer works and I get this error message:
"The requested URL /pages/zc_install/index.php was not found on this server."

The file is very simple, basically just the following(there's a bit more that I've omitted for the sake of simplicity):

require('includes/application_top.php');
$stockleft = zen_get_products_stock($_GET['product_id']);
echo $stockleft;
require('includes/application_bottom.php');

When I move the file to the /pages directory, I edit the path to application_top.php and application_bottom.php to:
'../includes/application_top.php', but I get the error I mentioned above.

Can someone tell me if I'm doing something wrong? I am I putting the path correctly? Is it even possible to have my stockcheck.php file working if I move it to another directory other than the root folder?

Sorry if this seems like a dumb question, my php knowledge is very, very little.

Thanks for any input on this.

1 Jul 2007, 3:52 AM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Need some help, trying to add a file but it keeps redirecting to zc_install/index.php

Its best to keep it in the ZC root since its actually calling includes/application top

you could try this

require('/home/username/public_html/foldername ( if applicable)includes/application_top.php');

this is of course for a cpanel type setup but you get the idea

Zen cart PCI compliant Hosting

1 Jul 2007, 4:10 AM
#3
tj1 avatar

tj1

Totally Zenned

Join Date:
Mar 2005
Location:
California
Posts:
628
Plugin Contributions:
0

Re: Need some help, trying to add a file but it keeps redirecting to zc_install/index.php

Thanks Merlin, and yes, I do use Cpanel. :)

Actually I had already tried that:
require('/home/myusername/public_html/includes/application_top.php');

But I got the same results as when I used
require('../includes/application_top.php');

The 404 error - The requested URL /pages/zc_install/index.php was not found on this server.

I'm really not sure why it seems to redirect to /pages/zc_install/index.php

I'll keep it in the root folder for now since it seems to work there.