Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Creating username password for access to contact form

Featured Replies

So i bought a book PHP for dummies and feel i'm being sidetracked from what i want to be learning.

 

I'm still in an intermeadiate stage of CSS and HTML while trying to learn small amounts of javascript. I want a contact form within my website that has a quite a few fields to it and part of it avalible for quick contact and part for more information from someone who has logged in.

 

My form is created within my contact page and all fields are in place, i now need something to manage the data fields when they are filled in.

 

I will go on to learn PHP more in the future but at the moment would like to get my form fully functioning and if possible have someone loggin to get to it.

 

Is this something anyone could help me out with please.

hello ok i was in this positon 2 weeks a go and with the help of the forum i have what you want

to create a login or register form you will need a mysql data base on your server you will need to test it on a test server you need to download a program like wamp from here http://www.en.wampserver.com/ then follow the instructions,this will set php apache and mysql up on your pc

 

i am doing a few tutorials om my site for people like our selves i find it better to copy and past a script and play with it to find out how it works so i have a working contact page on my site for students to copy and paste just remember its not secure and you will need to experiment with making it secure before putting the contact page live,this is the url for the copy and paste contact form let me no if you get it work and dont forget set up webmail redirected to you email address

 

http://www.directelitewebsites.co.uk/tutorials/tutorials.htm

 

once you have done this i will beable to send you a script for your mysql registration form and i have give up with the for dummies range of books for html and flash i use the brilliant range of books or missing mauals range

 

i am learning php from sams range

 

visual quickpro guilte php6 and mysql5

learning php and mysql

and how to do anything with php and mysql all good books good luck

let me no if i can help you out more but like i say only been learning php mysql 2 weeks myself but couldnt have done it without this forum

  • 4 weeks later...

If you don't want to get into databases yet, if have just written a really easy script for a login page;

 

Save this as login.php;

 

<?php
session_start();
$username = 'username';
$password = 'password';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
	$submitted_username = $_REQUEST['username'];
	$submitted_password = $_REQUEST['password'];

	if (($submitted_username == $username) && ($submitted_password == $password)) {
		$_SESSION['access'] = 'granted';
		header('Location: secure_page.php');
		exit;
	} else {
		$error = 'Please ensure you have entered you username and password correctly';
	}
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
Username <input type="text" name="username" size="20" /><br />
Password <input type="password" name="password" size="20" /><br />
<input type="submit" value="Submit" />
</form>
<?php echo ((isset($error))?($error):""); ?>

 

And this as secure_page.php

 

<?php
session_start();
if (!isset($_SESSION['access'])) {
	header('Location: login.php');
}
?>
Secure content

 

Hope this helps.

 

Mike.

www.everydayprint.co.uk

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.