Forums

Can't redirect after submission of form

niryogev 26 Dec, 2010
Hi,

This is my page - http://www.aikidolife.co.il/index.php?option=com_chronocontact&task=send&chronoformname=WeSell&Itemid=53
All works well but the redirection does not work.
I have 2 parameters that I pass to a remote DB. If I redirect to the submit URL, the page redirects correctly but the parameters don't pass through. If I leave it empty and fill in a URL in the Redirect URL, the parameters pass through correctly but the page does not redirect.

I want the parameters to pass through AND for the page to simply redirect.
In the Form Code I inserted the following On Submit Code AFTER Sending email :

<img alt="" width="1" height="1" style="display: none;" src="http://www.wesell.co.il/cevent?type=
lead&advid=1004&name=<?php echo $_POST['Name']; ?>&phone=<?php echo $_POST['Mobile']; ?>"/>

Which sends correctly the relevant user parameters.

What am I doing wrong?

Nir
GreyHead 27 Dec, 2010
Hi Nir,

The ReDirect Parameter in ChronoForms doesn't use the form inputs. (I guess that it might in a future version.)

You can set the ReDirect URL dynamically with PHP
<?php
// get the parameters
$name = JRequest::getString('Name', '', 'post');
$name = urlencode($name);
$phone = JRequest::getString('Mobile', '', 'post');
$phone = urlencode($phone);
// create the redirect url
$url = 'http://www.wesell.co.il/cevent?type=lead&advid=1004&name=$name&phone=$phone';
// set the ChronoForms ReDirect URL to the new value
$MyForm->formrow->redirecturl = $url;
?>


Or you an use the ReDirect Plug-in to do most of this work for you.

Do you actually need to transfer the user to that URL? If not, then the cURL plug-in will send the data.

Bob

PS I've moved this from the ChronoComments forum to here.
niryogev 27 Dec, 2010
Hi Bob,

Actually I need to do the following:

FIRST execute the following code in html and php to send these 2 parameters to a remote site DB :
<img alt="" width="1" height="1" style="display: none;" src="http://www.wesell.co.il/cevent?type=
lead&advid=1004&name=<?php echo $_POST['Name']; ?>&phone=<?php echo $_POST['Mobile']; ?>"/>


This works successfully.

SECOND, Redirect the user to my thank you page : http://www.aikidolife.co.il/we-sell-thank-you-page-אייקידו-לייף

When I do the first part, it works well and parameters are well accepted in the remote DB.

Once I use the logic of the redirection code you sent me :

<?php
// get the parameters
$url = 'http://www.aikidolife.co.il/we-sell-thank-you-page-אייקידו-לייף';
// set the ChronoForms ReDirect URL to the new value
$MyForm->formrow->redirecturl = $url;
?>

the params are not sent, but the redirection works.

How can I get them BOTH to work? -
Passing the params to one site and redirecting to my thank you page url ?

Thanks,
Nir
GreyHead 27 Dec, 2010
Hi Nir,

Ah, OK. The simple answer is to move the HTML from the thank you page into the ChronoForms OnSubmit After Box and add the tracker image there too.

Bob
niryogev 27 Dec, 2010
I don't understand.

Should I delete the thankyou page html and move it to the submit after box?
Why?

How will there be a thank you page?
GreyHead 27 Dec, 2010
Hi Nir,

If you don't set a ReDirect URL then ChronoForms will display any HTML (+ PHP) in the OnSubmit After box; you can also use the {input_name} syntax there:
<p style="text-align: center;"> </p>
<p style="text-align: center; font-size: 40px; color: rgb(0, 0, 0);"><b>תודה שפניתם לאייקידו לייף</b></p>
<p style="text-align: center;"><img src="/images/stories/Front_Page/FP_RokStories_NirMain.jpg" alt="אייקידו לייף עם ניר יוגב בתל אביב" style="border-width: 0px; border-style: solid;" onmouseout="this.src='/images/stories/Front_Page/FP_RokStories_NirMain.jpg';" onmouseover="this.src='/images/stories/Front_Page/FP_RokStories_Dojo.jpg';"></p>
<p style="text-align: center; font-size: 24pt; color: rgb(0, 0, 0);">חוזרים אליכם בהקדם</p>
<img alt="" width="1" height="1" style="display: none;" src="http://www.wesell.co.il/cevent?type=lead&advid=1004&name={Name}&phone={Mobile}"/>


Bob
niryogev 27 Dec, 2010
OK
I'll give it a try.

After doing this Do I delete the thank you page?
Mind that the thank you page has its CSS..
niryogev 27 Dec, 2010
I did what you said, and I still get good results to the remote DB BUT NO redirection to any thank you page or message
GreyHead 28 Dec, 2010
Hi Nir,

Please check that you have the code in the OnSubmit After Email box (not the OnSubmit Before* Email box) and that no ReDirect or OnSubmit URL is set.

Bob

* Code in the OnSubmit Before Email box will only be executed if 'Send Emails' is set to 'Yes' on the form General tab.
niryogev 28 Dec, 2010
That's exactky what I did.
The code you sent me is in the AFTER Box. Nothing on the BEFORE box.
On top of that Email the Results is on YES.

Do you want access to my administration panel via PM ?
niryogev 28 Dec, 2010
Bob??

I still have the problem going.
Any further recomendation??
GreyHead 28 Dec, 2010
Hi Nir,

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
GreyHead 29 Dec, 2010
Hi Nir,

If I go to the Form URL on your site and submit the form then everything displays as it should.

If I go to the Affiliate URL then other strange things are happening, the URLs display correctly but the pages are quite different. There is some form of cloaking/redirection going on. In this setup I'm not surprised that you are having problems.

Bob
niryogev 29 Dec, 2010
I'll check it out with them.

I saw that you tried to test it 3 times.
The first record you entered (Testing, fsfdf at 12:25) was well caught in the remote affiliate DB.
Did you use my site's url or the affiliate's url on the first try?
Did you get a page redirection as well?

Nir
GreyHead 29 Dec, 2010
Hi Nir,

I think that the first test was at the ChronoForms URL and I was shown the ChronoForms thank you page (but not redirected). I didn't keep a record so I'm not 100% certain though :-(

Bob
niryogev 29 Dec, 2010
Unfortunately the affiliate company won't pass it throgh without a formal thank you page.
SO I'm still stuck.

What do you suggest?
I sent you a PM a few hours ago
GreyHead 31 Dec, 2010
Hi Nir,

As I said in reply to your PM - I'm unclear exactly what the requirements are here and why the page is embedded in another site. Normally it's sufficient to display the tracker pixel on a thank you page. In that case the approach using the standard ChronoForms form and thank you pages appears to be working OK.

Bob
niryogev 01 Jan, 2011
That's what I tried to do initially.

Assuming I do this , my basic problem was to transfer the user's inputed parameters of name and phone from the form to the thank you page and into the pixel code.

How do I transfer them?

And what is the correct syntax to use them in the pixel in the thank you page?
niryogev 01 Jan, 2011
Hey Bob,

That's exactly the code I used.
I get the pixel working.

Still no thank you redirection nor message.

Nir
GreyHead 02 Jan, 2011
Hi Nir,

I'm getting more confused. I'm not sure how the tracker pixel can be working and you are not seeing the thank you page. The two pieces of HTML are side by side in the snippet I posted.

Bob
niryogev 02 Jan, 2011
I'm confused as well.
That's exactly what I can't figure out!

Do you still have access to my admin panel?
Feel free to look it up.
It's very strange to me...
This topic is locked and no more replies can be posted.