Jump to content

Loggin In


pragan

Recommended Posts

Hi,

 

I am creating a HTML form(form.html) for my friends to enter their details and that will be stored in the database(mysql). I need to have a login page that will have a common username/password so that I need have everyone of my friends to register.I found a log in script online and I can make it work but I have the following problem.

 

If they type in that common username and password it will take them to the form.html and they can continue from there...but its so silly that they can just access that form.html if they just type the file name in the browser so my question is how to bring the log in screen if any one try to directly type the file name (mydomain.com/form.html) and display some warning/note message.

 

Please help me out!!

 

 

Thanks

Pragan

 

Link to comment
https://forums.phpfreaks.com/topic/37793-loggin-in/
Share on other sites

use define() to stop direct access and don't use form.html use  form.php

 

in the form.php at the very top of the page add like

 

<?php

defined('noaccess') or die('Can't access form.php until you pass first page');

?>

 

in your first page you would just put

 

define('noaccess','something');  which would allow only that page to access form.php

 

you would have to make sure the form.php is called with a header("Location: " . "form.php");

Link to comment
https://forums.phpfreaks.com/topic/37793-loggin-in/#findComment-180796
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.