I have a php form (below) that sends mail confirmation to the user/admin, when a registration is complete. I want to have this form dump into a database.
From that database, allow people to log into the website (protected page), and be able to update his/her respective information.
I have the form below, which works great, but
-
How do I make a connection to a database?
-
How do I allow a registered/confirmed user to log back in and make changes as necessary?
I’m lost…
[php]<?php
This block must be placed at the very top of page.
--------------------------------------------------
require_once( dirname(FILE).’/form.lib.php’ );
phpfmg_display_form();
--------------------------------------------------
function phpfmg_form( $sErr = false ){
$style=" class=‘form_text’ ";
?>
-
Basic Information -
First Name *" class='text_box'>
-
Last Name *" class='text_box'>
-
Phone Number" class='text_box'>
-
Create a Password *" class='text_box'>
-
Gender *<?php phpfmg_dropdown( 'field_5', "Male|Female|Prefer Not to Answer" );?>
-
Email Address" class='text_box'>
-
Additional Information -
Street Address *" class='text_box'>
-
City *" class='text_box'>
-
State *<?php phpfmg_dropdown( 'field_10', "Arizona|Alabama|Alaska||Arkansas|California|Colorado|Connecticut|Delaware|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming" );?>
-
Zip Code *" class='text_box'>
-
Date of Birth *<?php $field_12 = array( 'month' => "-MM- =,|01|02|03|04|05|06|07|08|09|10|11|12", 'day' => "-DD- =,|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31", 'startYear' => date("Y")+0, 'endYear' => date("Y")-62, 'yearPrompt' => '-YYYY-', 'format' => "mm/dd/yyyy", 'separator' => "/", 'field_name' => "field_12", ); phpfmg_date_dropdown( $field_12 ); ?>
<div id='field_12_tip' class='instruction'></div> </div>
Free Agents - Select Which Leagues you are Interested in Playing for...Please select a league *<?php phpfmg_checkboxes( 'field_14', "Tuesday Co-Ed|Friday Co-Ed|Saturday Soccer League|Sunday Soccer League|Flag Football|Kickball|Women's Soccer" );?>
Please send us your comments!<?php phpfmg_hsc("field_16"); ?><div id='field_16_tip' class='instruction'></div> </div>
Security Code: *<?php phpfmg_show_captcha(); ?>
<?php phpfmg_javascript($sErr); } # end of form function phpfmg_form_css(){ ?>[/php]<li> <div class='col_label'> </div> <div class='form_submit_block col_field'> <input type='submit' value='Submit' class='form_button'> <span id='phpfmg_processing' style='display:none;'> <img id='phpfmg_processing_gif' src='<?php echo PHPFMG_ADMIN_URL . '?mod=image&func=processing' ;?>' border=0 alt='Processing...'> <label id='phpfmg_processing_dots'></label> </span> </div> </li>