1 of 2
1
https gotcha
Posted: 02 September 2007 01:03 PM   [ Ignore ]
Member
Avatar
RankRankRank
Total Posts:  63
Joined  2005-03-31

I have a form that uses https:, while my EE site as a whole has a default URL of http:

The Freeform module writes the action on the form tag as being http not https, and the RET field as http as well.  This seems to cause the form not to capture the data when I submit it, as well as give a warning message about unsecured data.

The workaround was to wrap the freeform module in PHP and replace all http with https:

<?
$text = <<<ENDHERE
{exp:freeform:form form_name="booking" required="rider_name|rider_email" notify="libby@rockymtnmoto.com" template="booking_form" return="thank_you/index"}
...
{/exp:freeform:form}
ENDHERE;
$text = str_replace("http:","https:",$text);

echo $text;
?>

Any chance this could be handled within the freeform code in some upcoming version?  If not, the workaround is simple enough.

TTFN
Travis

Profile
 
 
Posted: 04 September 2007 07:17 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

I’m having troubles with this as well. (Sorry Mitch if you’ve responded to my email - my work email may have blocked your response).
By the way Hop Studios… I’m having trouble implementing that work-around. would you be able to provide more info?

Parse error: parse error, unexpected ‘<’ in /www/site/public_html/system/core/core.functions.php(635) : eval()’d code on line 144

 Signature 
Profile
 
 
Posted: 04 September 2007 10:43 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

I would recommend that you guys write an extension to do the string replace on the form right before it gets returned by the Freeform module. The hook you want to use is freeform_module_form_end.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 04 September 2007 11:11 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Hah… I’m out of my league here… those extension hooks are something I’ve never wrapped my brain around.
Thanks for the reply though Mitchell! smile
I still curious as to why that string_replace works for Hop Studios, and not me… I’ll take anything! smile

 Signature 
Profile
 
 
Posted: 04 September 2007 11:13 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Seriously. You can do it Pie Man! I know you can. Grab an extension from somewhere and start hacking!

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 04 September 2007 11:20 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Haha! Where do I put that extension?? rasberry
Then how do I incorporate the string_replace rasberry

 Signature 
Profile
 
 
Posted: 04 September 2007 11:22 AM   [ Ignore ]   [ # 6 ]
Member
Avatar
RankRankRank
Total Posts:  63
Joined  2005-03-31

PieMan,

Probably, you have the final line of the wrapped text (ENDHERE) indented.  This works for most PHP commands, but not for this particular command (called a heredoc).

http://ca3.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

If it’s not that, and you have PHP parsing set properly, I’m stumped.

Mitchell, isn’t an extension overkill in this case?  Why not simply a plugin? And why a plugin when a few lines of PHP will do it?

TTFN
Travis

Profile
 
 
Posted: 04 September 2007 11:28 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Thanks for the response Travis!

Here’s what I get now rasberry
Parse error: parse error, unexpected $ in /www/site/public_html/system/core/core.functions.php(635) : eval()’d code on line 479

 Signature 
Profile
 
 
Posted: 04 September 2007 11:31 AM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Right Travis,

Good Q. This is a performance thing.

If you host with EngineHosting (plug) you don’t need to worry too much about EE performance, but otherwise it matters. An extension is the most efficient way to handle this. A plugin is good. PHP is fine if you don’t have a bunch of other stuff to parse that might be effected by parsing order.

But the real reason why I said extension? I think Pie Man should learn some code. It’s really fun and rewarding and I know he’s up to it. How do you think I learned what I know? By going to college? No. I learned by reverse engineering EE over the years.

Get in there Pie Man! Go for it.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 04 September 2007 11:37 AM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Haha! LOL Thanks for the encouragement Mitch

I’d love to… ummm… know what I’m doing… LOL
I just don’t have the time at the moment LOL

.....

.....

Fine! I’ll make sure I dive… hmmm.... plunge… into it sometime soon....  gulp

I’ve been thinking.... the amount of people that use Freeform, and it’s capabilities… it’s almost its own identity… like the EE Forum Module LOL

 Signature 
Profile
 
 
Posted: 04 September 2007 11:43 AM   [ Ignore ]   [ # 10 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Just imagine. You could start selling software like Solspace and make millions per month just like us! ha ha.

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 04 September 2007 11:59 AM   [ Ignore ]   [ # 11 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

haha LOL

How much longer until you take over the planet?

 Signature 
Profile
 
 
Posted: 13 September 2007 07:27 AM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Ok, I just can’t get this thing working.

Is there anyway someone could take a look at my website, etc
Or can I pay to have this implemented?? rasberry

 Signature 
Profile
 
 
Posted: 13 September 2007 07:40 AM   [ Ignore ]   [ # 13 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Just curious, I’ve copied and pasted the HTML of the form that FreeForm generates, and put it in the template, and then changed the values to httpS://

I’ve tested it and it seems to work normally.

Is there any potential issues with this?

 Signature 
Profile
 
 
Posted: 13 September 2007 08:22 AM   [ Ignore ]   [ # 14 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Hmmm… it seems to be now saying “You are not authorized to perform this action”
I also just upgraded to 2.5.7… but I tried it with the EE tag and it works. ALthough it DID work once with the HTML generated code.... although I didnt think it would work.

UPDATE!

I managed to get the string replace to work....
The problem.... I’m an idiot!

I chose not to fully read that link you provided.
It was the space after the semicolon *doh!*

Thanks again for the help!! smile

 Signature 
Profile
 
 
Posted: 13 September 2007 10:29 AM   [ Ignore ]   [ # 15 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Whew! Relieved it’s working.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
   
1 of 2
1