CI+GoCart: Form submission works in localhost but NOT on live server |
Hi all,
I've been searching high and low and pulling my hear out over this issue. No one at StackOverflow has been able to help so far. I'm using CodeIgniter + GoCart for a project right now and I've had one problem after another migrating from my localhost dev server to the Dreamhost shared hosting servers (never in a million years would I use them after the experiences I've had over the last week of nightmares!). The latest problem is that forms (login, registration, search, add to cart) do not submit on the live server but they do work perfectly on my localhost server. When I press "login" (admin and normal) or register, the pages just refresh. When I click "search," I'm taken to http://example.com/search (incomplete URL, see below) and I get an error about not providing a full search query. When I press "add to cart," things just load forever and nothing happens. I've checked the database and it's not that. I've also checked CI session storage and I don't THINK it's that. At any rate, when I try to register, no new rows are created in the database, so something's stopping it before then. When I search for something on the local server, I am taken to a hashed URL like this: Code: http://localhost:8080/example.com/search/45d20b1d2cc2d52e74b3cbf1750a2e31/name/ASC/0 So I copied the URL after /search and tried to see what http://example.com/search/45d20b1d2cc2d5...name/ASC/0 would do. As it turns out, I get an error: Code: A PHP Error was encountered Boostrap.php (line 206 = try{ ... call_user_func_array() } ): PHP Code: // lets run the routes Search.php (line 49 = $term=\CI:: Search()->getTerm() ): PHP Code: \CI::load()->model('Search'); Search.php (model, line 32 = getTerm(){ ... return...} ): PHP Code: Class Search extends CI_Model I will happily provide as much code as required for someone to help! I have no idea what it is doing and this issue is literally preventing the launch of the site! I've even added added a special user/password for you guys to access the site: http://kitkittlegallery.com u: visitor pw: visitor I shower those who can help in appreciation!
UPDATE: The solution to this problem was not changing any code. Instead, I realized that Dreamhost shared hosting was forcing www. before all URLs. I disabled this so only http:// would work (www. is redirected to http:// now), and the code all started to work.
(12-03-2015, 08:35 AM)zwellstood Wrote: UPDATE: The solution to this problem was not changing any code. Instead, I realized that Dreamhost shared hosting was forcing www. before all URLs. I disabled this so only http:// would work (www. is redirected to http:// now), and the code all started to work. how you did that can you elaborate please.....
(12-03-2015, 08:35 AM)zwellstood Wrote: UPDATE: The solution to this problem was not changing any code. Instead, I realized that Dreamhost shared hosting was forcing www. before all URLs. I disabled this so only http:// would work (www. is redirected to http:// now), and the code all started to work. Thank you so much for this solution it worked for me too. To check this solution I just inspect my form and remove <www> from my action form URL then submit the form. i do print_r() and i got all post data. again thank you so much for this solution, I was stuck with this issue in fact I was not able to get the search key that is why I was getting the different info on the web. Finally, my issue has been resolved. ![]() eg. I am working with Codeigniter 4 Not Working action="http://www.test.com/test-save" Working action="http://test.com/test-save"
.htaccess file
Code: # Rewrite "www.example.com -> example.com" What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |