Post form to remote host, don't change page...

C

Cady

I'm trying to do an automatic signup for a newsletter hosted on a
separate site.

The original page is to sign up to receive a catalog by mail, with an
option to signup for an e-newsletter. All of the information is
validated when the user clicks submit.

At this point a second page is opened (thanking them for their request)
and the information previously entered is hidden in a form to be
submitted to the e-newsletter service provider. The signup, when
successful, returns a value of 1.

The form submits properly, but everything that I have tried thusfar
switches from the Thank You page to a page that says 1.

This *can't* be as hard as I am making it!

<FORM name="mail"
action="https://www.newsletterguys.com/view:RemoteSignup" method="post"
onsubmit="return false">
<input type="hidden" name="signup_post" value="9999">
<input type="hidden" name="account_id" value="1234">
<input type="hidden" name="username" value="(e-mail address removed)">
<input type="hidden" name="password" value="apassword">
<input type="hidden" name="group[99999]">
<input type="hidden" name="member_email" value="(e-mail address removed)">
<input type="hidden" name="first" value="Jack">
<input type="hidden" name="last" value="Frost">
</FORM>
<script>
mail.submit()
</script>

Any help truly appreciated...

Julie
 
K

kaeli

<script>
mail.submit()

Calling submit like this (in script) does NOT fire the onSubmit handler.

That might be your problem, since your onsubmit returns false.

--
 
C

Cady

OK, it turns out that I was going about this all COMPLETELY wrong (no
surprise there). In case anyone turns up this topic in a newsgroup
search, I figured I'd post what I did about it. (Sorry for the off
topic, as this should be in ASP, but I hate finding my precise problem
in a newsgroup search without a solution.)

Since this is an ASP page anyway, I used the XMLHTML object. (Besides,
using a form to submit a password is obviously *not* a great idea...)

I lost the site URL where I found the Word Doc that had this code, but
the author in that doc is listed as Jason Sexton. Thanks, Jason,
whomever you are.

<%
Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.open "POST",
"https://www.newsletterguys.com/view:RemoteSignup", False
objHTTP.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
objHTTP.send "signup_post=9999&account_id=1234&username=... etc."
Set objHTTP = Nothing
%>

<html><body>
Submitted/Thank You/Whatever.
</body></html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top