5 Replies - 6231 Views - Last Post: 29 April 2011 - 10:17 AM Rate Topic: -----

#1 Mister_Mac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 26-April 11

Basic Shopping Website Login Page, Check/register for user account

Posted 28 April 2011 - 10:16 AM

Greetings everybody, it was suggested I come over to this forum and ask my question: (original post http://www.dreaminco...0&#entry1324455 )

I am taking an Introductory to Web Programming class and I am looking for ideas and/or link referrals on how to implement a login page for a
shopping website that my classmates and I are developing. One of my classmates
has taken the task of developing a sql database that will hold user profiles and
I would like to develop
1) a simple log in page that checks to see if a user and their password exists in the database
2) if the user doesn't have an account then have their registration information inserted and stored into the database for future logins.

I was thinking of having HTML pages similar to examples in my book which I am enclosing below,
however it was suggested by that it is better off I have PHP do this.

If someone could point me in the right direction I would greatly appreciate it, thank you.

M_M.

Enclosure (2)

An updated version of my code to date:
This is the login page
 <?xml version = "1.0" encoding = "utf-8"?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"



   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



<html xmlns = "http://www.w3.org/1999/xhtml">
	<head>
		<title> J.A.D. Computing Login Page </title>
		<!-- This page will serve as the login page for the website -->
		<!-- If a user has an account they will enter their login name and pass -->
		<!-- word, and if they don't they have the option to register for one -->
		<!-- It should be noted that only registered users can access the entire -->
		<!-- website. -->
		
	</head>
	
	<body> 
	
		<h1> Welcome to JAD Computing </h1>
		<h4> Please Log in Below </h4>
		
	
		<form method = "post" action = " " >
	<p>
		User Name <input type ="text" name="UserName" size="25" id="UserName" />
	<br /> Password <input type ="password" name="password" size="10" id="Password" />
	<br /> <input type ="submit" value = "Submit" /> <input type ="reset" value ="Reset" />
	<br />
	</p>
	<p>
	<br /> 
	<br />
  </p>

	</form>
	  <p>
	  	<a href="registration.html"> Don't have an account? Register here! </a>
	  </p>
	  
	  <p>
    <a href="http://validator.w3.org/check?uri=referer"><img
        src="http://www.w3.org/Icons/valid-xhtml10"
        alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>	
		</p>
	</body>
	</html>
	
	
	


This below is the registration page (which is incomplete)

 
<?xml version = "1.0" encoding = "utf-8"?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"



   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



<html xmlns = "http://www.w3.org/1999/xhtml">
	<head>
		<title> JAD Computing Registration </title>
	</head>
	
	<body>
	<h1> Registration Form </h1>
	<p> Please fill this out to create an account with us. </p>
	
	<form method = "post" action = " ">
	<p>
			<input type = "hidden" name = "recipient"
				value = " " />
			<input type = "hidden" name = "subject"
				value = "New User Registration" />
			<input type = "hidden" name = "redirect"
				value = "portal.html" /> 
				<!--After completion the user will be sent to the sites portal -->
		<p> <label> E-mail:
				<input name = "email" type = "text" size = "25" />
			</label>
		</p>
		
		<p> <label> First Name:
				<input name = "First Name" type = "text" size = "25" />
			</label>
		</p>
		
		<p> <label> Last Name:
				<input name = "First Name" type = "text" size = "25" />
			</label>
		</p>
		
		<p> <label> Address 1:
				<input name = "Address 1" type = "text" size = "75" />
			</label>
		</p>
		
		<p>	<label> Address 2:
				<input name = "Address 2" type = "text" size = "75" />
			</label>
		</p>
		
		<p> <label> City/Town/Village:
				<input name = "Locality" type = "tesxt" size = "75" />
			</label>
		</p>
		
		<p> <label> State:
				<select name = "state">
				<option selected = "selected">  </option>
				<option> 




Also for reference this is the book we are using http://www.amazon.co...m/dp/0131752421

Thank you again!

Is This A Good Question/Topic? 0
  • +

Replies To: Basic Shopping Website Login Page, Check/register for user account

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3030
  • Posts: 10,569
  • Joined: 08-August 08

Re: Basic Shopping Website Login Page, Check/register for user account

Posted 28 April 2011 - 10:54 AM

Some links for you to read:
http://www.dreaminco...duction-to-pdo/
http://www.dreaminco...ides-resources/
http://www.dreaminco...ode-separation/
Was This Post Helpful? 2
  • +
  • -

#3 Mister_Mac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 26-April 11

Re: Basic Shopping Website Login Page, Check/register for user account

Posted 28 April 2011 - 10:59 AM

View PostCTphpnwb, on 28 April 2011 - 10:54 AM, said:



Thank you for the information, I appreciate it very much.

M_M
Was This Post Helpful? 0
  • +
  • -

#4 sas1ni69  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 85
  • View blog
  • Posts: 431
  • Joined: 04-December 08

Re: Basic Shopping Website Login Page, Check/register for user account

Posted 28 April 2011 - 09:43 PM

Hi there,

Just to quickly point out one thing, HTML can only build you the interface. In order to communicate with the server where you have your SQL database, you will need to use a language like PHP to so. So in this instance, you're not only using PHP, you will definitely need to use a combination of the both to achieve your goal.

Btw, you might want to look here too, The New Boston. This is a youtube channel that provides programming help. Recently the guy that runs it just posted 200 PHP tutorials. Yes, 200. It ranges from setup to incorporating AJAX in your program.

Hope this helps. Good luck with your project.
Was This Post Helpful? 0
  • +
  • -

#5 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3030
  • Posts: 10,569
  • Joined: 08-August 08

Re: Basic Shopping Website Login Page, Check/register for user account

Posted 29 April 2011 - 04:30 AM

Some problems I see with New Boston code:

  • Mixing PHP and HTML: bad idea.
  • Using $_POST data directly in a query.
  • Not using MySQLi or PDO.
  • No use of functions or objects!


I'd stick with the tutorials here.
Was This Post Helpful? 0
  • +
  • -

#6 Mister_Mac  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 26-April 11

Re: Basic Shopping Website Login Page, Check/register for user account

Posted 29 April 2011 - 10:17 AM

Thank you guys for all the tips, they all look like great ways in implementing what I need to do. But I am a little apprehensive about everything and let me explain. The project is due Monday and the professor finished _quickly_ teaching php & SQL this past Monday.
Is there any tutorials that are extremely simple and don't require a lot of prerequisite knowledge?
The professors notes are very lacking in information and my last I heard my classmate was trying to see if the professor is available for an appointment before the weekend.

As always, thank you.

M_M
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1