prototype 6 java php

Project Description:

prototype 6: task02: registration form + server-side logic and user-defined function.
paper copy due next week before end of class (the day depends on your section); heading: prototype 6: your fullname,
stapled, no hand-writing , neat! use two-sided page(s) if possible. points taken off if not neat/professional looking.
examples/notes: https://web.njit.edu/~mchugh/202/notes/task02/week6/
study related task questions and additional topics at: https://web.njit.edu/~mchugh/202/notes/task-tasks/
objectives: sql insert & update, more complex script logic, user-defined functions to simplify implementation
refer to: https://web.njit.edu/~mchugh/202/notes/task02/task02-2015-sp.pptx especially 2, 4, 7-9.

videos: php user-defined functions 6c:5:00-end; javascript 5d, 5d1; additional javascript discussion/example: 6b
hashing functions and encryption: 6d, 6e, video 3b1: sql injection and mysql_real_escape_string.

1. define html form with inputs for registered (except script/system defined registration_datetime); action=register.php. can temporarily ignore layout issues.
2. define a new function registered_count ($username) which returns the number of times $username is in registered. place function definition in myfunctions.php file. the function definition is like: registered_count ($username) { } with body: {$s = "select * from registered where username = '$username' "; $t = mysql_query ($s); return mysql_num_rows($t) }
beware: as it stands this function omits an important consideration: it does not screen out new usernames that have a repeated email address (which are required also to be unique). a repeat email entry will be rejected if you try to add /insert a new user to the registered table with an existing email address. thus, registered_count should actually have two parameters and a slightly different where condition that recognizes duplications in either the username or the email address. you don't need that for proto-p6 but it is needed for task02. the function would be registered_count ($username, $email).
3. define register.php (a) connect to database and include ("myfunctions.php file ") to be able to invoke the new function. (b) first test by invoking the function with usernames from the form, both for names in, and not in, registered. output the count returned by the function in each case. this establishes there are no syntax errors and the function behaves as intended.
4. complete implementation of register.php with user-defined function described on slides 2,4 7-9 of ppt above (with data sanitizing mentioned there). registered_count function safeguards against script trying to insert an already existing username or email in registered, but lets it accept/insert form data in registered table if the username and email are new.

6 snapshots
1. rendered (that is browser) view of html registration form: register.html.
2. html code for register.html.
3. display (readable copy) php code for myfunctions.php with code for. registered_count function.
4. display (readable copy) php code for register.php with just basic sql insert process and using the
registered_count function described in (step 4) above.
5. browser output from register.php when input username already exists.
6. browser output from register.php when input username is new and user is registered successfully.











1. rendered browser view of basic html form. all elements must be present and labeled.
prototype layout should be roughly as shown [or improved one of your own design.] but the primary focus of this prototype is the php server-side processing.



2. html code for register.html.
snapshot of notepad++ or other clear view of html code for register.html

3. php code for myfunctions.php.
snapshot of notepad++ or other clear view of php code for
registered_count ($username) - preferably registered_count ($username, $email)

4. php code for register.php with insert process using registered_count function as described in step (4) on previous page.
snapshot of notepad++ or other clear view of php code for
register.php as described on slide 4, 7, 8 of powerpoint for task02

5. browser output from register.php if input username already exists.
snapshot of browser view of output from register.php for a test username that already exists: it
should have a message indicating the username is already in the database.

6. browser output from register.php when input username is new and user is registered successfully
snapshot of browser view of output from register.php for new username.
it should echo input data and indicate user is inserted into registered table.
Skills Required:
Project Stats:

Price Type: Fixed

Project Budget: $20 to $50
Expired
Total Proposals: 0
1 Current viewersl
15 Total views
Project posted by:

Proposals

Proposals Reputation Price offered

    There is no proposal yet.