jared1017 Posted April 17, 2006 Share Posted April 17, 2006 This form is a registration form for a hosting websitethere are 3 choices on the plans drop down listwe have a subscription URL setup for each planwhen the form is submitted it goes to the /new/process.php page which shows what they submitted and it refreshes to go to back to the hosting /index.htmlI want it to be like when they choose the plan they want once it gets to the process page, the process page will send them to the URL for that plan they chose.Just need the codes and where to enter them at, I'm guessing I put a code into the value on the drop down menu and code on the process page to call and send them to the URL for the plan they chose? I'm like a super newbie I study up on the PHP Manual every now and then slowly but surely learning.Also there is spots on the form for(Password:)&(Confirm Password:)I would like for the form to give a ERROR if they don't have both password fields matching each other.I was able to setup a error message for not filling in required fields, and if they put in a valid email or not.Hope to get some help soon, my first time on the forums, this site has really tought me alot of things and I will probably continue using it for all my PHP needs ;)ThanksJared Quote Link to comment Share on other sites More sharing options...
Darkness Soul Posted April 17, 2006 Share Posted April 17, 2006 About the password check.. do it with java.. ^~ something like it:function checkpassw ( form ) { if (form.field.value != form.field.value2 ) { stop sending form focus on password field } }And call it on the form.. maybe like it:<form ... onsubmit="javascript:checkpassw(me)">=)D.Soul Quote Link to comment Share on other sites More sharing options...
corillo181 Posted April 17, 2006 Share Posted April 17, 2006 or with phpif( $password != password2 ){ echo " passwords do not match";}the !password is the variable for the first password and the password2 is for the second.. the != means not equal to..so in words would be if first password not identical to the second.. tell the user...echo Quote Link to comment Share on other sites More sharing options...
jared1017 Posted April 17, 2006 Author Share Posted April 17, 2006 Well it sure notices that the passwords are diffrent, but theres 1 problem, it thinks they are diffrent everytime.heres my form code where the pw are: ( No! its not the full code just the parts that have to do with the pw.)[code]PASSWORD:<input name='$password' title="$password" type="password" class="input1" size="22">CONFIRM:<input name='$password2' title="$password2" type="password" class="input1" size="22">[/code]heres the rules part of the processing page:(I put all the code that controls the errors its probably something simple, but dont forget I'm still pretty new, mostly learned from tut's)[code]<?php$errors=0;$error="The following errors occured while processing your form submission.<ul>";pt_register('POST','Plan');pt_register('POST','Domain');pt_register('POST','PaymentMethod');pt_register('POST','Company');pt_register('POST','FirstName');pt_register('POST','LastName');pt_register('POST','Email');pt_register('POST','Phone1');pt_register('POST','Phone2');pt_register('POST','Phone3');pt_register('POST','Address');pt_register('POST','City');pt_register('POST','State');pt_register('POST','Zipcode');pt_register('POST','Country');pt_register('POST','password');pt_register('POST','password2');pt_register('POST','Agree');if($Plan=="" || $Domain=="" || $PaymentMethod=="" || $FirstName=="" || $LastName=="" || $Email=="" || $Address=="" || $City=="" || $Zipcode=="" || $Country=="" || $Password=="" || $ConfirmPassword=="" || $Agree=="" ){$errors=1;$error.="<li>You missed something! You forgot to fill in a requiered field, Go back and fix it.";}if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){$error.="<li>You have entered a invalid email. Ya didn't fool nobody, Go back and fix it.";$errors=1;}if($password!= password2 )$error.="<li>Your passwords do not match, please go back and correct them.";if($errors==1) echo $error;else{[/code] Quote Link to comment Share on other sites More sharing options...
jared1017 Posted April 19, 2006 Author Share Posted April 19, 2006 Anything...Anybody???I'm really trying to hurry and get this done.site is really in need of this form :P Quote Link to comment Share on other sites More sharing options...
Prismatic Posted April 19, 2006 Share Posted April 19, 2006 [!--quoteo(post=366343:date=Apr 19 2006, 03:48 AM:name=jared1017)--][div class=\'quotetop\']QUOTE(jared1017 @ Apr 19 2006, 03:48 AM) [snapback]366343[/snapback][/div][div class=\'quotemain\'][!--quotec--]Anything...Anybody???I'm really trying to hurry and get this done.site is really in need of this form :P[/quote]--------------------------------------------------------On the form--------------------------------------------------------Find[code]PASSWORD:<input name='$password' title="$password" type="password" class="input1" size="22">CONFIRM:<input name='$password2' title="$password2" type="password" class="input1" size="22">[/code]Replace With[code]PASSWORD:<input name='password' title="password" type="password" class="input1" size="22">CONFIRM:<input name='password2' title="password2" type="password" class="input1" size="22">[/code]--------------------------------------------------------On the processing part--------------------------------------------------------Find[code]if($password!= password2 )[/code]Replace With[code]if($password != $password2 )[/code] Quote Link to comment Share on other sites More sharing options...
jared1017 Posted April 19, 2006 Author Share Posted April 19, 2006 Does same thing Quote Link to comment Share on other sites More sharing options...
Prismatic Posted April 19, 2006 Share Posted April 19, 2006 [!--quoteo(post=366350:date=Apr 19 2006, 04:39 AM:name=jared1017)--][div class=\'quotetop\']QUOTE(jared1017 @ Apr 19 2006, 04:39 AM) [snapback]366350[/snapback][/div][div class=\'quotemain\'][!--quotec--]Does same thing[/quote]Can I see your updated code? Quote Link to comment Share on other sites More sharing options...
jared1017 Posted April 19, 2006 Author Share Posted April 19, 2006 Sorry I didn't see your edited postIt shows the correct errors when the passwords are incorrect but when the passwords ARE correct it showsThe following errors occured while processing your form submission. it doesn't submitAND for some reason when I try to post my code on here it sends me to a 403 (Forbidden) page not sure whyso is there any other way to show you my code? Quote Link to comment Share on other sites More sharing options...
Prismatic Posted April 19, 2006 Share Posted April 19, 2006 Hmm, I think I might know where the problem is..Find:[code]if($password != $password2 )[/code]Replace with:[code]if($_POST['password'] != $_POST['password2'] )[/code]Edit - I see you already register the variables higher up..Dunno :( Quote Link to comment Share on other sites More sharing options...
jared1017 Posted April 19, 2006 Author Share Posted April 19, 2006 Well, Would you like to see my full updated code?I can send it to your email or something. Quote Link to comment Share on other sites More sharing options...
jared1017 Posted April 24, 2006 Author Share Posted April 24, 2006 anything?------anybody?------ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.