Guest littlewild Posted May 10, 2009 Share Posted May 10, 2009 Hi all, I have successfully installed Cube Cart version 3 and have managed to set up a few dummy products to play with. However there is a big problem with my setup. The JavaScript function submitDoc is sending the forms to the wrong places which mess up the site pretty badly. My site's URL is "http://www.mysite.com" and CubeCart is installed in the /cube folder. Whenever I click on the Add to basket link, which invokes java script:submitDoc('addtobasket'); the URL becomes messed up. Instead of going to "http://www.mysite.com/cube/index.php/?act=viewProd&productId=1" it is going to "http://www.mysite.com/cube/index.php/cube/index.php?act=viewProd&productId=1" Note the difference in bold. There is an additional /cube/index.php in the path, which results in a formatting error in the page, messing up the layouts. I have done some searching and Googling but am unable to find any way to fix this problem. I have tried changing the 'rootRel' in the global.inc.php but that doesn't seem to fix the problem. Btw, my web host is GoDaddy. Any help will be much appreciated. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Guest littlewild Posted May 10, 2009 Share Posted May 10, 2009 .... ok I am an idiot. Apparently it is not the Javascript issue. I just took a look at the code and realized that it is only doing a simple redirection. The issue lies with the form that has its action attribute set wrongly. Right now it is <form action="/cube/index.php/cube/index.php?act=viewProd&productId=3" method="post" name="addtobasket" target="_self" id="addtobasket" > when it really should be <form action="/cube/index.php?act=viewProd&productId=3" method="post" name="addtobasket" target="_self" id="addtobasket" > Any one knows how to fix this path issue? Quote Link to comment Share on other sites More sharing options...
Guest littlewild Posted May 10, 2009 Share Posted May 10, 2009 Ok I dug a little deeper and I found that the problem lies with the currentpage() function found in functions.inc.php For some reason or other it is rendering the current page URL with additional /folder and php file name... Any insight into this will be much appreciated! Quote Link to comment Share on other sites More sharing options...
Guest littlewild Posted May 10, 2009 Share Posted May 10, 2009 Hmm I think I am onto something. Further studying of the code and some tweaking reveals that the PHP array $_SERVER is returning odd values... The PHP Array $_SERVER['PHP_SELF'] is returning a duplicated path, which is causing all of the errors. Instead of returning just /cube/index.php it is returning /cube/index.php/cube/index.php Hmm interesting. I did a little hacking and changed the $_SERVER['PHP_SELF'] to $_SERVER['SCRIPT_NAME'] and the weird pathing issue disappeared... Well, I guess I fixed the problem myself. If anyone else encounters the same problem, maybe this will help them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.