Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HCI-JJ-News
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jonathan.poalses
HCI-JJ-News
Commits
9492f58a
Commit
9492f58a
authored
Jan 07, 2023
by
Jonathan Poalses
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added php
parent
28304e6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
0 deletions
+114
-0
.DS_Store
Clean Design Site/.DS_Store
+0
-0
.DS_Store
Clean Design Site/assets/.DS_Store
+0
-0
clean.php
Clean Design Site/assets/php/clean.php
+57
-0
cluttered.php
Clean Design Site/assets/php/cluttered.php
+57
-0
No files found.
Clean Design Site/.DS_Store
View file @
9492f58a
No preview for this file type
Clean Design Site/assets/.DS_Store
0 → 100644
View file @
9492f58a
File added
Clean Design Site/assets/php/clean.php
0 → 100755
View file @
9492f58a
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
define
(
'DB_SERVER'
,
'localhost'
);
define
(
'DB_staffNo'
,
'jonathan.poalses'
);
define
(
'DB_PASSWORD'
,
'8YlReLMlNknGQzZq'
);
define
(
'DB_NAME'
,
'jonathanpoalses'
);
/* Attempt to connect to MySQL database */
$link
=
mysqli_connect
(
DB_SERVER
,
DB_staffNo
,
DB_PASSWORD
,
DB_NAME
);
// Check connection
if
(
$link
===
false
)
{
die
(
"ERROR: Could not connect. "
.
mysqli_connect_error
()
);
}
// Prepare a select statement
$sql
=
"INSERT INTO HCI VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
;
if
(
$stmt
=
mysqli_prepare
(
$link
,
$sql
)
)
{
// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param
(
$stmt
,
"iiiiiiiiiiiii"
,
$Clean
,
$Story1
,
$Story2
,
$Story3
,
$Story4
,
$Story5
,
$Story6
,
$Story7
,
$Story8
,
$Story9
,
$Story10
,
$Story11
,
$Story12
);
//Retrive all the data, making sure to trim and filter
$Clean
=
1
;
$Story1
=
filter_var
(
trim
(
$_POST
[
"Story1"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story2
=
filter_var
(
trim
(
$_POST
[
"Story2"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story3
=
filter_var
(
trim
(
$_POST
[
"Story3"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story4
=
filter_var
(
trim
(
$_POST
[
"Story4"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story5
=
filter_var
(
trim
(
$_POST
[
"Story5"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story6
=
filter_var
(
trim
(
$_POST
[
"Story6"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story7
=
filter_var
(
trim
(
$_POST
[
"Story7"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story8
=
filter_var
(
trim
(
$_POST
[
"Story8"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story9
=
filter_var
(
trim
(
$_POST
[
"Story9"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story10
=
filter_var
(
trim
(
$_POST
[
"Story10"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story11
=
filter_var
(
trim
(
$_POST
[
"Story11"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story12
=
filter_var
(
trim
(
$_POST
[
"Story12"
]
),
FILTER_SANITIZE_NUMBER_INT
);
// Attempt to execute the prepared statement
if
(
mysqli_stmt_execute
(
$stmt
)
)
{
// Redirect to main menu
header
(
"location: ../thanks.html"
);
}
else
{
echo
"ERROR: Could not execute
$sql
. "
.
mysqli_error
(
$link
);
}
}
// Close statement
mysqli_stmt_close
(
$stmt
);
// close connection
mysqli_close
(
$link
);
?>
\ No newline at end of file
Clean Design Site/assets/php/cluttered.php
0 → 100755
View file @
9492f58a
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
define
(
'DB_SERVER'
,
'localhost'
);
define
(
'DB_staffNo'
,
'jonathan.poalses'
);
define
(
'DB_PASSWORD'
,
'8YlReLMlNknGQzZq'
);
define
(
'DB_NAME'
,
'jonathanpoalses'
);
/* Attempt to connect to MySQL database */
$link
=
mysqli_connect
(
DB_SERVER
,
DB_staffNo
,
DB_PASSWORD
,
DB_NAME
);
// Check connection
if
(
$link
===
false
)
{
die
(
"ERROR: Could not connect. "
.
mysqli_connect_error
()
);
}
// Prepare a select statement
$sql
=
"INSERT INTO HCI VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
;
if
(
$stmt
=
mysqli_prepare
(
$link
,
$sql
)
)
{
// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param
(
$stmt
,
"iiiiiiiiiiiii"
,
$Clean
,
$Story1
,
$Story2
,
$Story3
,
$Story4
,
$Story5
,
$Story6
,
$Story7
,
$Story8
,
$Story9
,
$Story10
,
$Story11
,
$Story12
);
//Retrive all the data, making sure to trim and filter
$Clean
=
0
;
$Story1
=
filter_var
(
trim
(
$_POST
[
"Story1"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story2
=
filter_var
(
trim
(
$_POST
[
"Story2"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story3
=
filter_var
(
trim
(
$_POST
[
"Story3"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story4
=
filter_var
(
trim
(
$_POST
[
"Story4"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story5
=
filter_var
(
trim
(
$_POST
[
"Story5"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story6
=
filter_var
(
trim
(
$_POST
[
"Story6"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story7
=
filter_var
(
trim
(
$_POST
[
"Story7"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story8
=
filter_var
(
trim
(
$_POST
[
"Story8"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story9
=
filter_var
(
trim
(
$_POST
[
"Story9"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story10
=
filter_var
(
trim
(
$_POST
[
"Story10"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story11
=
filter_var
(
trim
(
$_POST
[
"Story11"
]
),
FILTER_SANITIZE_NUMBER_INT
);
$Story12
=
filter_var
(
trim
(
$_POST
[
"Story12"
]
),
FILTER_SANITIZE_NUMBER_INT
);
// Attempt to execute the prepared statement
if
(
mysqli_stmt_execute
(
$stmt
)
)
{
// Redirect to main menu
header
(
"location: ../thanks.html"
);
}
else
{
echo
"ERROR: Could not execute
$sql
. "
.
mysqli_error
(
$link
);
}
}
// Close statement
mysqli_stmt_close
(
$stmt
);
// close connection
mysqli_close
(
$link
);
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment