Hi everyone, I have a project I'm working on where I am collecting data for a client on a form I host. They use "MailApe" (you know who I'm talking about), who aren't a very helpful group of monkeys. I need to collect the data to my db from my form, which is all well and good, but when the person opts-in for the client's newsletter, I want my PHP validation script to send the email address to their "MailApe" account via their API. I'm trying to use this "header" function, but It's not working. Should I try something else?

if($_REQUEST['optin'] == 'yes'){
	header("Location: http://us1.api.mailape.com/1.3/?method=listSubscribe")

Any ideas?


6 Years
Discussion Span
Last Post by GreaseJunkie

I start with extraction via the POST method then some error checking, then dump the data to the MySQL db like this:


if($_REQUEST['fname'] == ''){
	echo "\nYou must complete the Name field.<p>";
if($_REQUEST['lname'] == ''){
	echo "\nYou must complete the Last Name field.<p>";

Then I have pregmatch and error output. All basic stuff.

I have been playing with their API and trying some techniques they haven't offered, like encoding the URL with the client key, etc., like so:

if($_REQUEST['optin'] == 'yes'){
	header("Location: http://us1.api.mailape.com/1.3/?method=listSubscribe&apikey=[APIKEY]&id=[CLIENTID]&email_address=[EMAIL]&output=php");

I can get that to work in my browser if I replace [EMAIL] with mine and paste it into my address bar - it signs me right up. I guess I need help using the $email call in the URL too.

Thanks for your help!


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.