1
1
<?php
2
- error_reporting (0 );
2
+ error_reporting ( E_ALL );
3
+ ini_set ( 'display_errors ' , '1 ' );
3
4
# Database Connection
4
5
class database extends SQLite3
5
6
{
@@ -53,62 +54,62 @@ function __construct()
53
54
$ myDateTime = new DateTime ( Date ( '' ), new DateTimeZone ( 'GMT ' ) );
54
55
$ myDateTime ->setTimezone ( new DateTimeZone ( 'Asia/Kolkata ' ) );
55
56
$ date = $ myDateTime ->format ( 'Y-m-d H:i:s ' );
56
- $ name = mysql_real_escape_string ( $ _POST ['sp-name ' ]) ;
57
+ $ name = $ _POST ['sp-name ' ];
57
58
if ( empty ( $ _POST ['sp-email ' ] ) )
58
59
{
59
60
$ emailerror = "Required Field " ;
60
61
}
61
62
else
62
63
{
63
- $ email = mysql_real_escape_string ( $ _POST ['sp-email ' ]) ;
64
+ $ email = $ _POST ['sp-email ' ];
64
65
if ( !preg_match ( "/([\w\-]+\@[\w\-]+\.[\w\-]+)/ " , $ email ) )
65
66
{
66
67
$ emailerror = "Invalid Format " ;
67
68
}
68
69
}
69
- $ org = mysql_real_escape_string ( $ _POST ['sp-org ' ]) ;
70
- $ city = mysql_real_escape_string ( $ _POST ['sp-city ' ]) ;
70
+ $ org = $ _POST ['sp-org ' ];
71
+ $ city = $ _POST ['sp-city ' ];
71
72
if ( !preg_match ( '/$^|^[a-zA-Z]+[0-9]*[\. ,]*[a-zA-Z0-9]*$/ ' , $ city ) )
72
73
{
73
74
$ cityerror = "City name must start with a letter and can contain only alphanumerics, spaces, periods and commas " ;
74
75
}
75
76
if ( empty ( $ _POST ['sp-profile ' ] ) ) {
76
77
$ profilerror = "No profile " ;
77
78
} else {
78
- $ profile = mysql_real_escape_string ( $ _POST ['sp-profile ' ]) ;
79
+ $ profile = $ _POST ['sp-profile ' ];
79
80
}
80
81
81
82
if ( empty ( $ _POST ['sp-tshirt ' ] ) ) {
82
83
$ tshirt = "0 " ;
83
84
} else {
84
- $ tshirt = mysql_real_escape_string ( $ _POST ['sp-tshirt ' ]) ;
85
+ $ tshirt = $ _POST ['sp-tshirt ' ];
85
86
}
86
87
87
88
if ( empty ( $ _POST ['sp-arrival ' ] ) ) {
88
89
$ arrivalerror = "No arriving date given " ;
89
90
} else {
90
- $ arrival = mysql_real_escape_string ( $ _POST ['sp-arrival ' ]) ;
91
+ $ arrival = $ _POST ['sp-arrival ' ];
91
92
}
92
93
if ( empty ( $ _POST ['sp-depart ' ] ) ) {
93
94
$ departureerror = "No departure date given " ;
94
95
} else {
95
- $ departure = mysql_real_escape_string ( $ _POST ['sp-depart ' ]) ;
96
+ $ departure = $ _POST ['sp-depart ' ];
96
97
}
97
98
$ lap = 1 ;
98
99
if ( empty ( $ _POST ['sp-accom ' ] ) ) {
99
100
$ accom = "0 " ;
100
101
} else {
101
- $ accom = mysql_real_escape_string ( $ _POST ['sp-accom ' ]) ;
102
+ $ accom = $ _POST ['sp-accom ' ];
102
103
}
103
- $ pretitle = mysql_real_escape_string ( $ _POST ['sp-title ' ]) ;
104
+ $ pretitle = $ _POST ['sp-title ' ];
104
105
if ( empty ( $ pretitle ) )
105
106
{
106
107
$ titleerror = "Required Field " ;
107
108
}
108
109
else
109
110
{
110
- $ title = mysql_real_escape_string ( $ _POST ['sp-title ' ]) ;
111
- $ desc = mysql_real_escape_string ( $ _POST ['sp-desc ' ]) ;
111
+ $ title = $ _POST ['sp-title ' ];
112
+ $ desc = $ _POST ['sp-desc ' ];
112
113
113
114
}
114
115
if ( $ nameerror == "" && $ emailerror == "" && $ arrivalerror == "" && $ departureerror == "" && $ orgerror == "" && $ cityerror == "" && $ titleerror == "" && $ profilerror == "" )
@@ -121,10 +122,12 @@ function __construct()
121
122
$ db ->close ();
122
123
header ( 'location:../../registration_success.html ' );
123
124
} else {
124
- header ( 'location:../../registration_fail.html ' );
125
+ echo "fail " ;
126
+ // header( 'location:../../registration_fail.html' );
125
127
}
126
128
} else {
127
- header ( 'location:../../registration_fail.html ' );
129
+ echo "fail " ;
130
+ // header( 'location:../../registration_fail.html' );
128
131
}
129
132
}
130
133
}
0 commit comments