I have a custom module that is essentially a form that takes data from logged in clients and submits it to the site’s database. Since I’ve migrated from one host to another though clients have been unable to use the form. They can enter the data but when the press submit it redirects to the wrong page and the data is not entered in the database.
By using firebug for firefox (which allows you to temporarily change code on the fly for a live site), I was able to figure out that the problem is due to an additional backslash being added to the submit url. Sounds simple enough but I cannot for the life of me figure out how to remove the additional backslash. For example, when I look at the source via firebug, I see this as the submit action:
<form action="http://mysite.com//mytraining/submit/wyN7FfFJWa/" method="post">
If I leave it as is, the form does not submit the data and it redirects the user to the main index page. If I use firebug and change the submit action to
<form action="http://mysite.com/mytraining/submit/wyN7FfFJWa/" method="post">
with only 1 backslash it works perfectly.
The problem is I can’t figure out how to permanently remove the second backslash. In the pertinent template the relevant code says this:
{exp:hpc_client_training:form_details form_hash="{segment_3}"}<h2>{form_title}</h2>{/exp:hpc_client_training:form_details}
{exp:hpc_client_training:submit form_hash="{segment_3}" redirect="/mytraining/report/{segment_3}/"}
I’ve attached the actual module since posting the relevant code exceeded the post length restrictions.
This seems like such a minor problem and I’ve looked around for hours now but haven’t been able to find where that second backslash is coming from as it doesn’t appear anywhere else on the site. If any one can take a look I would REALLY appreciate it.
Have you tried re-coding what you have above to this instead :
{exp:hpc_client_training:form_details form_hash="{segment_3}"}<h2>{form_title}</h2>{/exp:hpc_client_training:form_details}
{exp:hpc_client_training:submit form_hash="{segment_3}" redirect="mytraining/report/{segment_3}/"}
Specifically I took the leading slash away from the second tag.
Don’t know if that will help at all though?
I took a quick look at the file you uploaded to the thread but without having it all set up - database tables and all - just like your site then it would prove quite difficult to tell.
Hope the above code does work for you though.
Best wishes,
Mark
Thanks. I had actually tried that since it seemed like the most obvious fix but it didn’t make any difference. Also, I even tried inserting the entire path for the redirect=”http://mysite.com/mytraining/report/{segment_3}/” and it still didn’t work. Like I said…very puzzling.
If I use firebug to remove the second backslash the form works perfectly and it actually redirects to
http://mysite.com/mytraining/report/{segment_3}/
Unfortunately firebug won’t actually edit the file permanently and I still can’t figure out where the 2nd backslash is coming from. If anyone can figure this one out I’d really appreciate it. At this point, I’m willing to pay because I need to get this fixed. Let me know if you’re interested.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.