Tech Support Forum banner
Status
Not open for further replies.
1 - 6 of 6 Posts

·
Registered
Joined
·
15 Posts
Discussion Starter · #1 ·
Hi All

I’m wanting to create a system where a user can log in, fill in some information in some forms an submit it, sending an email to the IT manager saying the information has been sent to the database

From here a IT manager should be able to log in and see this information as a pending request.

The IT manager should then be able to click a check box verifying the information has been received; the data should then be copied into a new table called completed information with a date stamp.

An email should then be sent to the user saying the information has been received

If anyone knows of any PHP code or a similar system that i may be able to use that would be great

Cheers

Steve
 

·
Registered
Joined
·
15 Posts
Discussion Starter · #3 ·
Hi Redcore

I've used that tutorial before many times, but it didnt really help me get the info i needed. Do you have any other ideas? like you said its best to learn how to do it but it would be helpful to get an example to work from, as i have only just begun writing PHP

Cheers

Steve
 

·
Registered
Joined
·
896 Posts
Yeah, I just wanted you to study that code moreso and take direction from it - I personally think it's a bit overblown and over complicated.

How much PHP do you know? If you understand cookies and how to add/modify data in a database, you're well on your way.
 

·
Registered
Joined
·
15 Posts
Discussion Starter · #5 ·
I'm only just starting out to writing anything at the moment, i have very little experience with PHP, i have a few books so i'm going through them. I understand how to add/modify data in the database but i'm not really sure about cookies.
 

·
Registered
Joined
·
896 Posts
Cookies are really easy. Just think of it like wrist tags. Someone walks into your store (web site) and says "I'm Bob, my password is 39009308" - you check that it verifies and when it does, you give them a wrist tag that says "Bob" and their password. Whenever they roam around and want to access sensitive data, you check that wristband and make sure that the username/password combination check out. If not, you kick them out of the store :)

Applying a cookie is very easy...

PHP:
$encrypted_password = "5f4dcc3b5aa765d61d8327deb882cf99";
$username = "stephenf33";
$timeout = time() + 3600; // 1 hour

setcookie("ursite_password", $encrypted_password, $timeout, "/", "stephenf33.com", 0); //
setcookie("ursite_username", $username, $timeout, "/", "stephenf33.com", 0);
Then to reference or check those cookies you'd just do this...

PHP:
if(!isset($_COOKIE['ursite_username'])){
echo "You are not logged in. <a href='login.php'>Click here to login</a>.</div>";
die();
}
You can also verify that the stored username matches the stored password via a quick database check. :) It's pretty basic stuff, but can get really complicated if you wanted to.
 
1 - 6 of 6 Posts
Status
Not open for further replies.
Top