Gossamer Forum
Home : Products : DBMan : Discussions :

Why doesn't this work?

Quote Reply
Why doesn't this work?
I've modified the login and signup pages (new account) like thus:

sub html_signup_form {
# --------------------------------------------------------
# This form is displayed for new users who want to create an account.
#
my $error = shift;

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Step 1: General info.</title>
</head>
<body bgcolor="white" text="#000000" onLoad="document.form1.userid.focus()">
<form action="http://www.bahnhof.se/~chimbis/cgi-bin/formmail.cgi" method="post" name="form1">
<input type=hidden name="recipient" value="chimbis\@bahnhof.se">
<input type=hidden name="subject" value="Ratatosk: news and distro info">
<input type=hidden name="redirect" value="$db_script_url?db=$db_setup&next_signup_form=1">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Create Account</b>
</td></tr>
<tr><td>
<p><center><$font_title>
<b>Step 1: General info</b></font></center>

<$font>.

<table border=0>
<tr><td><Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399><b>User ID:</b></FONT></td>
<td><input type="TEXT" name="userid" value=""></td></tr>
<tr><td><Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399><b>Distribution:</b></FONT></td>
<td><input type="TEXT" name="distro" value=""></td></tr>
<tr><td><Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399><b>News account? (Allow a day for it to be active):</b></FONT></td>
<td><input type="CHECKBOX" name="news" value="Yes!"></td></tr>
<tr><td><Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399><b>News account? (Allow a day for it to be active):</b></FONT></td>
<td><input type="PASSWORD" name="pw" value=""></td></tr>
</table>
<p align=center><center><input type="SUBMIT" name="Confirm" value="Confirm"> <INPUT TYPE="SUBMIT" NAME="logoff" VALUE="Cancel"></center></p>
</td></tr>
</table>
</center>
</form>
</body>
</html>
|;
}

Now, the original html_signup_form is now next_signup_form.
Formmail sends me the mail nicely thankyou, but the redirect doesn't work I get back to this html_signup_form no matter what I put in redirect.

Mayhaps formmail and dbman doesn't want to cooperate on this account? Is there a better way?

Cheers,

C.

Quote Reply
Re: Why doesn't this work? In reply to
What changes have you made in sub main in the db.cgi script?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Why doesn't this work? In reply to
I haven't changed anything there.
I just tried fiddling with it but it either still send me back to the first sign up page or doesn't do anything sane at all.

What I want is:

User clicks sign up.
User is taken to my NEW_SIGN_UP_PAGE (it is in html.pl)
USer fills in data and clicks Next
User is taken to original SIGN_UP_PAGE
User clicks Submit
User may log-in.
What happens is that he never gets the second (original) signup page.

Quote Reply
Re: Why doesn't this work? In reply to
The problem is that you haven't told the script to send him to the new signup form.

You have

<input type=hidden name="redirect" value="$db_script_url?db=$db_setup&next_signup_form=1">

so the form should be sending the variable $in{'next_signup_form'} to the db.cgi script. However, db.cgi doesn't know what to do with it.

In db.cgi, sub main, after

Code:

elsif ($auth_signup and $in{'signup_form'}) {
&html_signup_form;
}
elsif ($auth_signup and $in{'signup'}) {
&signup;
}
add

Code:

elsif ($in{'next_signup_form'}) {
&html_next_signup_form;
}
That should do it.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Why doesn't this work? In reply to
Thanks, that did, in fact, do it.

C.