Removing Extra Backslash from Form Submit Button…PLEASE HELP!
Posted: 19 September 2008 12:45 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  284
Joined  08-11-2007

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.

File Attachments
mod.hpc_client_training.php.zip  (File Size: 5KB - Downloads: 36)
 Signature 

EE 1.65 Build 10312008 |  Forum: 2.1.1 Build 20081028
ELITETRACK | HPCsport | AthleticLab

Profile
 
 
Posted: 19 September 2008 02:47 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

Moved to Modules: Technical Assistance.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 19 September 2008 02:42 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  284
Joined  08-11-2007

Anyone have any idea where that extra backslash could be coming from…even if someone could point me WHERE to look that would be helpful as I’ve exhausted all options that I can think of and really need to get this to work. Thanks-

 Signature 

EE 1.65 Build 10312008 |  Forum: 2.1.1 Build 20081028
ELITETRACK | HPCsport | AthleticLab

Profile
 
 
Posted: 19 September 2008 03:01 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

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

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 19 September 2008 06:01 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  284
Joined  08-11-2007

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.

 Signature 

EE 1.65 Build 10312008 |  Forum: 2.1.1 Build 20081028
ELITETRACK | HPCsport | AthleticLab

Profile
 
 
Posted: 22 September 2008 01:24 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
RankRank
Total Posts:  284
Joined  08-11-2007

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.

 Signature 

EE 1.65 Build 10312008 |  Forum: 2.1.1 Build 20081028
ELITETRACK | HPCsport | AthleticLab

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64912 Total Logged-in Users: 30
Total Topics: 81864 Total Anonymous Users: 18
Total Replies: 440104 Total Guests: 187
Total Posts: 521968    
Members ( View Memberlist )
Newest Members:  bjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcfthenetmonkeybenekwhobutsb