/
post.php
62 lines (32 loc) · 1.26 KB
/
post.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
//Load Database Class
require('/classes/database.php');
//Instantiate db class
$db = new Database();
//Recieve Data
$what = $db->clean($_POST['your_thing']);
$achievable = $db->clean($_POST['your_promo_goal']);
$username = $db->clean($_POST['your_email']);
$password = $db->clean(md5($_POST['your_password']));
//Check to see if the user account exists
$value = $db->check($username, $password);
//Check against db to see if user exists.
$user_info = "SELECT username FROM company_information WHERE username = '$username'";
$username_db = mysql_query($user_info);
if ($value == true)
{
//Log user in
$sql = "UPDATE company_information SET logged_in = 1 WHERE username = '$username' AND password = '$password'";
mysql_query($sql);
//Put data into database and then redirect user to the payment page (dash).
}
elseif (($username != $username_db) && ($value == false))
{
//Redirect to 'do you want to create a new account page.'
header("Location: do_it.php?what=$what&achievable=$achievable&email=$username&enc=$password");
}
else
{
echo "I think you type in the wrong password. <a href='/a_query_post.php/'>Click here to go back and correct it</a>";
}
?>