Author Topic: signup Form to Insert User_name,pass,email into Database  (Read 3429 times)

0 Members and 1 Guest are viewing this topic.

Offline alganar

  • Pre-Newbie
  • Posts: 9
    • View Profile
signup Form to Insert User_name,pass,email into Database
« on: December 21, 2002, 11:39:47 PM »
Here's a good on :)
sorry about the longness of the code i couldnt figure out how to make it smaller
I have a signup form in a different part of my site its in html put it posts the information to a php file called process.php basically what i would like to do is when people use this singup form it posts that form to a php file called process.php this php file send that information to mysql database. I set up this singnup form  to use the same context at 4 images as far a User_name, User_password  , User_email these are the three basic things 4 images asks for when a user signs up. is there a way to use the process.php to access 4 images sql database and insert those three items into the the database so all I would have to do is go into the control panel and mark them as registered or something like that Here is the script process.php.  In short is there a way to cut and paste the part of the code that does the registration insert of the user_name User_password and User_email into another php file so they dont have to enter that information twice. Here is the process.php file that insertes the information into my other database.  Thanks for any help on this.

Code: [Select]
[size=6]<?php
$errors
=0;
$error="The following errors occured while processing your form input.<ul>";
if&
#40;$Salutation=="" || $FirstName=="" || $LastName=="" || $StreetAddress=="" || $ZIPPostalCode=="" || $City=="" || $StateProvince=="" || $Country=="" || $User_Email=="" || $RetypeEmail=="" || $User_Name=="" || $User_Password=="" || $RetypePassowrd=="" &#41;&#123;
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
&
#125;
if&#40;$errors==1&#41; echo $error;
else&#123;
$where_form_is="http".&#40;$HTTP_SERVER_VARS["HTTPS"&#93;=="on"?"s"&#58;""&#41;."&#58;//".$SERVER_NAME.strrev&#40;strstr&#40;strrev&#40;$PHP_SELF&#41;,"/"&#41;&#41;;
$message="My Name&#58; ".$MyName."
My Company&#58; "
.$MyCompany."
Company&#58; "
.$Company."
Salutation&#58; "
.$Salutation."
First Name&#58; "
.$FirstName."
Last Name&#58; "
.$LastName."
Street Address&#58; "
.$StreetAddress."
Additional Street Address&#58; "
.$AdditionalStreetAddress."
ZIP  Postal Code&#58; "
.$ZIPPostalCode."
City&#58; "
.$City."
State  Province&#58; "
.$StateProvince."
Country&#58; "
.$Country."
Phone&#58; "
.$Phone."
Email&#58; "
.$User_Email."
Retype Email&#58; "
.$RetypeEmail."
UserName&#58; "
.$User_Name."
Password&#58; "
.$User_Password."
Retype Passowrd&#58; "
.$RetypePassowrd."
"
;
mail&#40;"register@one--source.com","Form Submitted at your website",$message,"From&#58; phpFormGenerator"&#41;;
$link mysql_connect&#40;"localhost","database_loginname","password"&#41;;
mysql_select_db&#40;"databasename",$link&#41;;
$query="insert into Vendor_form &#40;table_name_name,table_name_company,company,salutations,first_name,last_name,street_address,add_street_address,zip_post,city,state_prov,country,phone,email,user_email_confirm,user_name,user_password,password_confirm&#41; values &#40;'".$MyName."','".$MyCompany."','".$Company."','".$Salutation."','".$FirstName."','".$LastName."','".$StreetAddress."','".$AdditionalStreetAddress."','".$ZIPPostalCode."','".$City."','".$StateProvince."','".$Country."','".$Phone."','".$User_Email."','".$RetypeEmail."','".$User_Name."','".$User_Password."','".$RetypePassowrd."'&#41;";
mysql_query&#40;$query&#41;;
$make=fopen&#40;"admin/data.dat","a"&#41;;
$to_put="";
$to_put .= $MyName."|".$MyCompany."|".$Company."|".$Salutation."|".$FirstName."|".$LastName."|".$StreetAddress."|".$AdditionalStreetAddress."|".$ZIPPostalCode."|".$City."|".$StateProvince."|".$Country."|".$Phone."|".$User_Email."|".$RetypeEmail."|".$User_Name."|".$User_Password."|".$RetypePassowrd."
"
;
fwrite&#40;$make,$to_put&#41;;
header&#40;"Refresh&#58; 0;url=;
&#125;
?>
[/size]
[/size]
iS tHeRe lIgHt aT tHe eNd oF tHe tUnNeL-?-?-?->oNeSoUrCe