Current location: Hot Scripts Forums » Programming Languages » PHP » Submit form to Aweber and to my own page


Submit form to Aweber and to my own page

Reply
  #1 (permalink)  
Old 12-01-11, 01:12 PM
yeahmeknows yeahmeknows is offline
New Member
 
Join Date: Dec 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Submit form to Aweber and to my own page

Hello kind people!
Hope that you can help me.

I have a landing page with a form.
After the user filled the form it takes him to a PHP page that redirects him to a certain URL according to what he checked in the form.

I have an E-Mail input on that form which I want it submitted to my Aweber's mailing list.
The question is, how do I make my PHP script submit it to Aweber and than redirect him to the URL according to his choices.

You can view the landing page I did here:
Engagement Rings Advisor

This is the submit.php script I made (currently only 2 URLs to choose from):
PHP Code:

<?php

$link1 
"http://www.jamesallen.com/engagement-rings/solitaire-rings";
$link2 "http://www.jamesallen.com/engagement-rings/pave";

if(empty(
$_POST["price"]) && empty($_POST["prefer"]) && empty($_POST["metal"]) && empty($_POST["quality"])) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Engagement Rings Advisor</title>
    <link href="style.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body>
<div id="back_box">
<div id="main_box">
<div id="logo"></div>
<?
    
echo "<div id='error'>All or one of the fields weren't filled.<br><br>";
    echo 
"<form method='GET' action='index.html'>";
    echo 
"<input type='submit' value='Go back and try again' id='buttons'>";
    echo 
"</form></div>";
    exit;
?>
</div>
</div>
</body>
</html>
<?
}

if(
$_POST["prefer"] == "large") {
    
    
header('Location:'.$link1);

} elseif(
$_POST["prefer"] == "side") {

    
header('Location:'.$link2);

} else {

    print 
"No choise was made";

}
?>

Thanks a lot in advance!!
Reply With Quote
  #2 (permalink)  
Old 12-02-11, 01:28 AM
alxkls alxkls is offline
Newbie Coder
 
Join Date: Nov 2011
Posts: 98
Thanks: 0
Thanked 9 Times in 9 Posts
well the form submission is easy-if(something==something) header("Location:something");

but before that after a quick research(never used aweber in my life):
labs.aweber.com

there's a pretty good chance their api would do that for you
Reply With Quote
  #3 (permalink)  
Old 12-03-11, 06:50 AM
yeahmeknows yeahmeknows is offline
New Member
 
Join Date: Dec 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by alxkls View Post
well the form submission is easy-if(something==something) header("Location:something");

but before that after a quick research(never used aweber in my life):
labs.aweber.com

there's a pretty good chance their api would do that for you
Hi, thanks for the reply

Actually, I thought maybe there was a simpler way to do this without having to use their API.
I spoke to them on the phone and they say there's a javascript that should do it which is:
PHP Code:

<script type="text/javascript">document.getElementById('redirect_eeb16cd1f0357a3d30375d7f6dc88b99').value document.location;</script> 

So I tried turning the action on the form to their link and use this javascript afterwards like this:
PHP Code:

<form method="post" class="af-form-wrapper" action="http://www.aweber.com/scripts/addlead.pl"  >


<!-- 
form content -->

</
form>
<
script type="text/javascript">document.getElementById('submit.php').value document.location;</script> 
But unfortunately, it doesn't work
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:58 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.