Results 1 to 8 of 8

Thread: Registration Form/Contact list but without Login

Hybrid View

  1. #1
    Join Date
    Jul 2013

    Registration Form/Contact list but without Login

    Hey all, I need some help.
    I've done a lot of searching but can't find exactly what I'm looking for.

    To give you a little insight in what I'm after, we have a supporters club and we want the supporters to fill in a registration form (so we have a record of their details) which will have:
    First name (required), Last name (required), Email (required), Address (optional), Contact Number (optional) and Official Membership number (optional).

    After clicking "submit it will take them to a "Thank you page". All that info has to be integrated into our website template.

    I would like it to connect to a db, which will store all the data and give the person a supporters membership number.

    I am not after a login page or anything like that, the only person that can access the info would be me via the db.

    Everything I have seen always has a login, username, password ect.
    I'm not asking for people to write up a code for me, what I'm hoping for is for someone to point me in the right direction, a website or free script to download.
    I'm not to crash hot at php coding, just so you know, that's why I just dl anything I need.

    Thanks in advance

  2. #2
    Join Date
    Jul 2013
    Voorheesville NY USA
    So - on your page you place some text to invite them to register and then a submit button labeled "Register".

    In your php script, if you see that they clicked on the "Register" button, you open a new script called "registerusers.php". This new script will send the user to a new screen with all the input fields you desire and a "Save" button. Upon receiving the "Save" button submission your registerusers script will accept all the input fields, validate them, escape them, etc. and then do a table update. If successful send them back a thank you message, else send back the same page with the values still in it and an error message.

    Is that the guidance you seek?

  3. #3
    Join Date
    Jul 2013
    Thanks for your reply and yes something like that is what I'm after.

  4. #4
    Join Date
    Jul 2013
    Voorheesville NY USA
    What else do you need? Follow that plan and show us what you come up with for more help.

  5. #5
    Join Date
    Jul 2013
    I don't need anything else. That's the problem I can't find anything remotely close to that, I've seen on here a few login scripts but they only have username and password coding.

  6. #6
    Join Date
    Jul 2013
    Ok I found something which I've adjusted, but I'm getting an error on line 88, here is the code

    if($_POST['formSubmit'] == "Submit")
    $errorMessage = "";

    $errorMessage .= "<li>You forgot to enter your First Name!</li>";
    $errorMessage .= "<li>You forgot to enter your Surname!</li>";
    $errorMessage .= "<li>You forgot to enter your Email!</li>";

    $varFirstName = $_POST['formFirstName'];
    $varSurname = $_POST['formSurname'];
    $varAddress = $_POST['formAddress'];
    $varPhone = $_POST['formPhone'];
    $varEmail = $_POST['formEmail'];
    $varMembership = $_POST['formMembership'];

    $fs = fopen("mydata.csv","a");
    fwrite($fs,$varSurname . ", " . $varFirstName . $varEmail . "\n");


    header("Location: thankyou.html");
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <title>My Form</title>

    echo("<p>There was an error with your form:</p>\n");
    echo("<ul>" . $errorMessage . "</ul>\n");
    <form action="membership.php" method="post">
    First Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="text" name="formFirstName" maxlength="50" value="<?=$varFirstName;?>" /> *Required

    <input type="text" name="formSurname" maxlength="50" value="<?=$varSurname;?>" /> *Required


    <input type="text" name="formAddress" maxlength="70" value="<?=$varAddress;?>" /> *Optional

    Phone:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;
    <input type="text" name="formPhone" maxlength="15" value="<?=$varPhone;?>" /> *Optional

    Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;
    <input type="text" name="formEmail" maxlength="50" value="<?=$varEmail;?>" /> *Required

    Membership No:&nbsp;
    <input type="text" name="formMembership" maxlength="20" value="<?=$varMembership;?>" /> *Optional

    <input type="submit" name="formSubmit" value="Submit" />

  7. #7
    Join Date
    Jul 2013
    I fixed that error message I forgot a } after this line
    $errorMessage .= "<li>You forgot to enter your Email!</li>";

    so how's this code looking? next question is how do I proceed from here, getting it to open a new script called "registerusers.php" then to get it into a db?

  8. #8
    Join Date
    Jul 2013
    Voorheesville NY USA
    You don't necessarily need a new script - I just said that because a lot of people here seem to work that way.

    Since you are already combining multiple activities in your single script above, simply add some more code to handle the 'register' button like you do already with the 'Submit' button.

    Plus - I hope you don't write your php code with all those blank lines normally. Bad Practice. Will cause you problems at some point when you try to send a header.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.09875 seconds
  • Memory Usage 3,126KB
  • Queries Executed 13 (?)
More Information
Template Usage (29):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (8)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (27):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./includes/functions_threadedmode.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates