-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess_signup.php
More file actions
executable file
·54 lines (44 loc) · 1.24 KB
/
process_signup.php
File metadata and controls
executable file
·54 lines (44 loc) · 1.24 KB
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
<?php
include "connect.php";
$togo = null;
function update_table($option_name, $userid){
$table_name = "user_".$option_name;
$contents = mysql_query("SELECT * FROM $option_name") or die(mysql_error());
$query = "INSERT INTO `dumaremote`.`$table_name` (
`user_id` ,
`skill_id` ,
`rating`
)
VALUES ";
$num_updates = 0;
while ($content = mysql_fetch_assoc($contents)){
$content_id = $content["id"];
$cat_id = $option_name."_".$content_id;
if (isset($_POST[$cat_id])) {
$input = $_POST[$cat_id];
if ($input){
$query = $query . "('".$userid."', '".$content_id."', '') ,";
$num_updates = $num_updates + 1;
}
}
}
$query = substr($query, 0,-1);
mysql_query("DELETE FROM `$table_name` WHERE user_id = $userid") or die (mysql_error());
if ($num_updates) {
mysql_query($query) or die(mysql_error());
}
}
update_table("polytechnic", $userid);
update_table("university_degree", $userid);
update_table("work_experience", $userid);
update_table("skills", $userid);
if (isset($_POST['next']))
{
$togo = "jobslist.php";
}
else if (isset($_POST['previous'])) {
$togo = "generalInfo.php";
}
echo '<META HTTP-EQUIV="Refresh" Content="0; URL= '.$togo.'">';
exit;
?>