Passing a url to a remote site from CF Joomla Registration form

ClearSky 23 Feb, 2014
I'd like to pass this url:

http://list.iv7.co/subscribe_service.php?password=****&email={email}&htmlemail=1&list_ids=7

from my Joomla User Registration form.

I'm not sure what the best way to do it is.

I tried using the cURL [GH] Custom Action, but I don't know exactly how to create the correct param/fields map.

Thanks for your help!

Best Regards,
Jonathan
GreyHead 24 Feb, 2014
Hi Jonathan,

Target URL :
http://list.iv7.co/subscribe_service.php


Params/fields:
password={password}
email={email}
htmlemail=1
list_ids=7


Bob
ClearSky 24 Feb, 2014
Hi,

Thanks for that.

It doesn't quite work though.

I ran the form with a debugger running, and got this result:
cURL [GH]

    cURL OK : the cURL function was found on this server.
    cURL Target URL: http://list.iv7.co/subscribe_service.php
    Names + values (urldecoded)
        password : ****
        htmlemail : 1
        list_ids : 7
        email : luigi@iiv7.com
    cURL Values: password=****x&htmlemail=1&list_ids=7&email=luigi@iiv7.com
    cURL:Resource id #121
    cURL info: Array ( [url] => http://list.iv7.co/subscribe_service.php [content_type] => application/json [http_code] => 200 [header_size] => 132 [request_size] => 208 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.094443 [namelookup_time] => 0.052837 [connect_time] => 0.052945 [pretransfer_time] => 0.052949 [size_upload] => 67 [size_download] => 73 [speed_download] => 772 [speed_upload] => 709 [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 0.094383 [redirect_time] => 0 [certinfo] => Array ( ) [redirect_url] => )
    Response: {"result":{"result_num":1,"result_text":"Access password not supplied."}}
It looks like the "&" is missing at the beginning of the password attrubute. Should I place an "&" at the end of the target url?

Thanks again!! Have a great day!!

Jonathan
GreyHead 24 Feb, 2014
Hi Jonathan,

It looks like the "&" is missing at the beginning of the password attrubute. Should I place an "&" at the end of the target url?

No, there needs to be a ? at the start of the query string and the action will add it.

Are you sure that (a) the parameter name for the password is 'password' and that the password is correct (I assume that you have edited this and you aren't sending ****x)?

Bob
ClearSky 24 Feb, 2014
Hi Bob,

Yes, the parameter name is password, but you're right I was hiding the actual password. I've triple checked it.

When I type the url into the address bar it works:

http://list.iv7.co/subscribe_service.php?password=password&htmlemail=1&list_ids=7&email=whatever@iiv7.com

I set the password to password so we can test for troubleshooting; I'll change it to something else later. So it's ok to follow that link to read the response. Even though it says "User subscribe request failed" it still adds the email to the list. :p

But, every time I pass it through the CF form it gets the Access password not supplied error.

Here's a link to the form:

http://eartrainingmusic.com/user/registration

The debugger is still on, too.

I was able to duplicate that error through the address bar by adding an extra ? to the password param like this: subscribe_servie.php??password=

An incorrect password produces the error "Access password incorrect"

Any other variation gets a 404 page not found error.

Is there a way to set a curl option to emulate Firefox? Or would that even be an issue?

Other than that I don't understand why it's not working.

Thanks a million! I owe you some coffee, :-)

Jonathan
ClearSky 25 Feb, 2014
Well then.

Is there a way to get something like this to work?

<form method="post" action="http://list.iv7.co/subscribe_service.php?password=password&htmlemail=1&list_ids=7&email='<?php echo $form->data['email'] ; ?>'">

:-)
GreyHead 25 Feb, 2014
Hi ClearSky,

Not in the form you have it there - I've no idea how (or why) you would pass a variable through the On Submit URL of a form.

Have you checked with the list service to see exactly what they will or won't accept?

Bob
ClearSky 25 Feb, 2014
Hi Bob,

They are both my websites. I need an autoresponder, and I need to connect my Joomla users to my mailing lists. (in order to get that function with a Joomla component like JNews or any of the others you have to buy their Flagship high dollar Enterprise product)

The cURL [GH] custom action isn't getting the job done. It seems to be adding something to the output that's tripping it up. And, I'm not smart enough to fix it on my own.

I just thought if there was a simpler way to do what I'm trying.

Like I said, the url works from the address bar and emails get added to the list. And, since that is the only dynamic part of the url; if I could only grab that from the form->data and plug it in where it needs to go.

I don't want to be impolite, but how much "coffee" would it take to get you to look into this and make it work? I'd be happy to donate! I already owe you anyway from way back when.

I know you're busy and I don't want to waste your time. :-)
ClearSky 03 Mar, 2014
Answer
I solved this one.

It turns out the script on the receiving end was set to only accept GET connections. :p

Adding the code so it accepts both POST and GET did the trick.
This topic is locked and no more replies can be posted.