Skip to content

Commit 3894752

Browse files
committed
This reverts ce3e002 which was meant for MySQL. here we use sqlite3
1 parent 53c51d2 commit 3894752

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

assets/php/delegateRegistration.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@ function __construct()
5151
$myDateTime = new DateTime( Date( '' ), new DateTimeZone( 'GMT' ) );
5252
$myDateTime->setTimezone( new DateTimeZone( 'Asia/Kolkata' ) );
5353
$date = $myDateTime->format( 'Y-m-d H:i:s' );
54-
$name = mysql_real_escape_string($_POST['del-name']);
54+
$name = $_POST['del-name'];
5555
if ( empty( $_POST['del-email'] ) )
5656
{
5757
$emailerror = "Required Field";
5858
}
5959
else
6060
{
61-
$email = mysql_real_escape_string($_POST['del-email']);
61+
$email = $_POST['del-email'];
6262
if ( !preg_match( "/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email ) )
6363
{
6464
$emailerror = "Invalid Format";
6565
}
6666
}
67-
$org = mysql_real_escape_string($_POST['del-org']);
68-
$city = mysql_real_escape_string($_POST['del-city']);
67+
$org = $_POST['del-org'];
68+
$city = $_POST['del-city'];
6969
if ( !preg_match( '/$^|^[a-zA-Z]+[0-9]*[\. ,]*[a-zA-Z0-9]*$/', $city ) )
7070
{
7171
$cityerror = "City name must start with a letter and can contain only alphanumerics, spaces, periods and commas";
@@ -76,23 +76,23 @@ function __construct()
7676
$arrivalerror = "No arriving date given";
7777
} else {
7878

79-
$arrival = mysql_real_escape_string($_POST['del-arrival']);
79+
$arrival = $_POST['del-arrival'];
8080
}
8181
if ( empty( $_POST['del-depart'] ) ) {
8282
$departureerror = "No departure date given";
8383
} else {
84-
$departure = mysql_real_escape_string($_POST['del-depart']);
84+
$departure = $_POST['del-depart'];
8585
}
8686
$lap = 1;
8787
if ( empty( $_POST['del-accom'] ) ) {
8888
$accom = "0";
8989
} else {
90-
$accom = mysql_real_escape_string($_POST['del-accom']);
90+
$accom = $_POST['del-accom'];
9191
}
9292
if ( empty( $_POST['del-tshirt'] ) ) {
9393
$tshirt = "0";
9494
} else {
95-
$tshirt = mysql_real_escape_string($_POST['del-tshirt']);
95+
$tshirt = $_POST['del-tshirt'];
9696
}
9797

9898
if ( $nameerror == "" && $emailerror == "" && $arrivalerror == "" && $departureerror == "" && $orgerror == "" && $cityerror == "" )

assets/php/speakerRegistration.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
error_reporting(0);
2+
error_reporting( E_ALL );
3+
ini_set( 'display_errors', '1' );
34
# Database Connection
45
class database extends SQLite3
56
{
@@ -53,62 +54,62 @@ function __construct()
5354
$myDateTime = new DateTime( Date( '' ), new DateTimeZone( 'GMT' ) );
5455
$myDateTime->setTimezone( new DateTimeZone( 'Asia/Kolkata' ) );
5556
$date = $myDateTime->format( 'Y-m-d H:i:s' );
56-
$name = mysql_real_escape_string($_POST['sp-name']);
57+
$name = $_POST['sp-name'];
5758
if ( empty( $_POST['sp-email'] ) )
5859
{
5960
$emailerror = "Required Field";
6061
}
6162
else
6263
{
63-
$email = mysql_real_escape_string($_POST['sp-email']);
64+
$email = $_POST['sp-email'];
6465
if ( !preg_match( "/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email ) )
6566
{
6667
$emailerror = "Invalid Format";
6768
}
6869
}
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'];
7172
if ( !preg_match( '/$^|^[a-zA-Z]+[0-9]*[\. ,]*[a-zA-Z0-9]*$/', $city ) )
7273
{
7374
$cityerror = "City name must start with a letter and can contain only alphanumerics, spaces, periods and commas";
7475
}
7576
if ( empty( $_POST['sp-profile'] ) ) {
7677
$profilerror = "No profile";
7778
} else {
78-
$profile = mysql_real_escape_string($_POST['sp-profile']);
79+
$profile = $_POST['sp-profile'];
7980
}
8081

8182
if ( empty( $_POST['sp-tshirt'] ) ) {
8283
$tshirt = "0";
8384
} else {
84-
$tshirt = mysql_real_escape_string($_POST['sp-tshirt']);
85+
$tshirt = $_POST['sp-tshirt'];
8586
}
8687

8788
if ( empty( $_POST['sp-arrival'] ) ) {
8889
$arrivalerror = "No arriving date given";
8990
} else {
90-
$arrival = mysql_real_escape_string($_POST['sp-arrival']);
91+
$arrival = $_POST['sp-arrival'];
9192
}
9293
if ( empty( $_POST['sp-depart'] ) ) {
9394
$departureerror = "No departure date given";
9495
} else {
95-
$departure = mysql_real_escape_string($_POST['sp-depart']);
96+
$departure = $_POST['sp-depart'];
9697
}
9798
$lap = 1;
9899
if ( empty( $_POST['sp-accom'] ) ) {
99100
$accom = "0";
100101
} else {
101-
$accom = mysql_real_escape_string($_POST['sp-accom']);
102+
$accom = $_POST['sp-accom'];
102103
}
103-
$pretitle = mysql_real_escape_string($_POST['sp-title']);
104+
$pretitle = $_POST['sp-title'];
104105
if ( empty( $pretitle ) )
105106
{
106107
$titleerror = "Required Field";
107108
}
108109
else
109110
{
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'];
112113

113114
}
114115
if ( $nameerror == "" && $emailerror == "" && $arrivalerror == "" && $departureerror == "" && $orgerror == "" && $cityerror == "" && $titleerror == "" && $profilerror == "" )
@@ -121,10 +122,12 @@ function __construct()
121122
$db->close();
122123
header( 'location:../../registration_success.html' );
123124
} else {
124-
header( 'location:../../registration_fail.html' );
125+
echo "fail";
126+
// header( 'location:../../registration_fail.html' );
125127
}
126128
} else {
127-
header( 'location:../../registration_fail.html' );
129+
echo "fail";
130+
// header( 'location:../../registration_fail.html' );
128131
}
129132
}
130133
}

0 commit comments

Comments
 (0)