| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/icd/labs/ |
Upload File : |
<?php
/*
*************************************************************************************
** insert_user.php
*************************************************************************************
*/
$error = ""; // Βοηθητική μεταβλητή για τύπωση λαθών.
$problem = 0; // Βοηθητική μεταβλητή για ένδειξη λάθους.
/*
*************************************************************************************
** Έλεγχος για το εάν τα δεδομένα έγιναν post από την προηγούμενη σελίδα και κατα-
** χώρησή τους σε μεταβλητές για τη χρησιμοποίησή τους.
*************************************************************************************
*/
if( ($_POST['pass1']) && ($_POST['pass2']) && ($_POST['epitheto']) && ($_POST['onoma']) && ($_POST['etos']) && ($_POST['eksamino']) )
{
$am = $_POST['am'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
$epitheto = $_POST['epitheto'];
$onoma = $_POST['onoma'];
$etos = $_POST['etos'];
$eksamino = $_POST['eksamino'];
$email = $_POST['email'];
$am = stripslashes($am);
$pass1 = stripslashes($pass1);
$pass2 = stripslashes($pass2);
$epitheto = stripslashes($epitheto);
$onoma = stripslashes($onoma);
$etos = stripslashes($etos);
$eksamino = stripslashes($eksamino);
$email = stripslashes($email);
/*
*************************************************************************************
** Σύγκριση των δύο passwords και καταχώρηση μηνύματος λάθους σε περίπτωση που
** διαφέρουν.
*************************************************************************************
*/
if($pass1!=$pass2)
{
$problem = 1;
$error = "ΤΑ PASSWORDS ΠΟΥ ΚΑΤΑΧΩΡΗΣΑΤΕ ΔΕΝ ΕΙΝΑΙ ΙΔΙΑ!!!";
}
}
else
{
$problem = 1;
$error = "ΤΑ ΣΤΟΙΧΕΙΑ ΠΟΥ ΚΑΤΑΧΩΡΗΣΑΤΕ ΕΙΝΑΙ ΕΛΛΕΙΠΗ!!!";
}
/*
*************************************************************************************
** Αν δεν υπάρχει κανένα λάθος στην προηγούμενη διαδικασία τότε γίνεται η καταχώρη-
** ση του χρήστη στη βάση δεδομένων με τους σπουδαστές καθώς επίσης και η καταχώρη-
** ση της IP διεύθυνσης του Η/Υ από τον οποίο έγινε η καταχώρηση. Τέλος εμφανίζεται
** μήνυμα επιτυχούς καταχώρησης όπου προτρέπει τον χρήστη στη μεταφορά του στην
** αρχική του σελίδα για τη σύνδεσή του με το σύστημα.
*************************************************************************************
*/
if($problem == 0)
{
$remoteIP = $_SERVER['REMOTE_ADDR'];
if (strstr($remoteIP, ', '))
{
$ips = explode(', ', $remoteIP);
$remoteIP = $ips[0];
}
$fullhost = gethostbyaddr($remoteIP);
$connection = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection,"utf8");
mysqli_query($connection, "SET NAMES 'utf8'");
$sql_insert = "INSERT INTO students(am, pass, epitheto, onoma, etos_eis,eksamino, email) VALUES('$am', '$pass1', '$epitheto', '$onoma', '$etos', '$eksamino', '$email')";
$result_insert = mysqli_query($connection,$sql_insert) or die(mysqli_error());
/*
** To ebgala ektos giati den leitoyrgei
$connection2 = mysqli_connect("localhost", "icd_labs", "t3!$3r") or die(mysqli_error());
mysqli_select_db($connection2,"laboratories") or die(mysqli_error());
mysqli_set_charset($connection2,"utf8");
mysqli_query($connection2, "SET NAMES 'utf8'");
$sql_insert_details ="INSERT INTO insert_details(user, ip, hostname) VALUES ('$am', '$remoteIP', '$fullhost')";
$result_insert_details = mysqli_query($connection2,$sql_insert_details) or die(mysqli_error());
*/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>E-LABS - ΤΜΗΜΑ ΜΗΧΑΝΙΚΩΝ ΠΛΗΡΟΦΟΡΙΚΗΣ, ΥΠΟΛΟΓΙΣΤΩΝ ΚΑΙ ΤΗΛΕΠΙΚΟΙΝΩΝΙΩΝ - ΔΙΠΑΕ</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<style type="text/css">
<!--
body {
background-image: url(pics/back.gif);
}
.style5 {color: #191919; font-weight: bold; }
.style6 {
font-size: 12px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
a:link {
color: #0000CC;
text-decoration: underline;
}
a:visited {
color: #0000CC;
text-decoration: underline;
}
a:hover {
color: #FFFFFF;
text-decoration: none;
}
a:active {
text-decoration: underline;
}
.style7 {
color: #003300;
font-weight: bold;
}
.style9 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #009900;
}
.style99 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FF0000;
}
.style999 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #009900;
}
-->
</style></head>
<body>
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="150" colspan="4" valign="top"><img src="pics/index_up.jpg" width="1000" height="150"></td>
<td width="4"> </td>
</tr>
<tr>
<td height="2" colspan="4" valign="top"><img src="pics/horizontal_bar.gif" width="1000" height="2"></td>
<td></td>
</tr>
<tr>
<td width="16" height="20"> </td>
<td width="214" valign="top"><div align="left" class="style7">Εγγραφή Νέου Χρήστη </div></td>
<td width="34"> </td>
<td width="736"> </td>
<td></td>
</tr>
<tr>
<td height="2" colspan="4" valign="top"><img src="pics/horizontal_bar.gif" width="1000" height="2"></td>
<td></td>
</tr>
<tr>
<td height="17"></td>
<td colspan="2" valign="top"><span class="style999">ΕΠΙΤΥΧΗΣ ΚΑΤΑΧΩΡΗΣΗ</span></td>
<td></td>
<td></td>
</tr>
<tr>
<td width="16" height="20"> </td>
<td width="1000" valign="top"><div align="left" class="style999">
Τα στοιχεία σας καταχωρήθηκαν με επιτυχία. Παρακαλώ πηγαίνετε στην <a href="index.php">αρχική σελίδα</a>για να συνδεθείτε με το σύστημα.</div></td>
<td width="34"> </td>
<td width="736"> </td>
<td></td>
</tr>
<tr>
<td height="780"></td>
<td> </td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
<?php
}
else
{
/*
*************************************************************************************
** Σε περίπτωση που τα στοιχεία που καταχωρήθηκαν από τον χρήστη είναι εσφαλμέ-
** να, εμφανίζεται μήνυμα όπου και τον ενημερώνει για τυχόν σφάλματα.
*************************************************************************************
*/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>E-LABS - ΤΜΗΜΑ ΜΜΗΧΑΝΙΚΩΝ ΠΛΗΡΟΦΟΡΙΚΗΣ, ΥΠΟΛΟΓΙΣΤΩΝ ΚΑΙ ΤΗΛΕΠΙΚΟΙΝΩΝΙΩΝ - ΔΙΠΑΕ</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<style type="text/css">
<!--
body {
background-image: url(pics/back.gif);
}
.style5 {color: #191919; font-weight: bold; }
.style6 {
font-size: 12px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
a:link {
color: #0000CC;
text-decoration: underline;
}
a:visited {
color: #0000CC;
text-decoration: underline;
}
a:hover {
color: #FFFFFF;
text-decoration: none;
}
a:active {
text-decoration: underline;
}
.style7 {
color: #003300;
font-weight: bold;
}
.style9 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #009900;
}
.style99 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FF0000;
}
.style999 {
font-size: 14px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #009900;
}
-->
</style></head>
<body>
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="150" colspan="4" valign="top"><img src="pics/index_up.jpg" width="1000" height="150"></td>
<td width="4"> </td>
</tr>
<tr>
<td height="2" colspan="4" valign="top"><img src="pics/horizontal_bar.gif" width="1000" height="2"></td>
<td></td>
</tr>
<tr>
<td width="16" height="20"> </td>
<td width="214" valign="top"><div align="left" class="style7">Εγγραφή Νέου Χρήστη </div></td>
<td width="34"> </td>
<td width="736"> </td>
<td></td>
</tr>
<tr>
<td height="2" colspan="4" valign="top"><img src="pics/horizontal_bar.gif" width="1000" height="2"></td>
<td></td>
</tr>
<tr>
<td height="17"></td>
<td colspan="2" valign="top"><span class="style99">ΣΦΑΛΜΑ ΚΑΤΑΧΩΡΗΣΗΣ</span></td>
<td></td>
<td></td>
</tr>
<tr>
<td width="16" height="20"> </td>
<td width="1000" valign="top"><div align="justify" class="style99">
<?php
echo $error;
?>
Παρακαλώ ελέγξτε ξανά τα στοιχεία σας και <a href="new_user.php"> επανακαταχωρήστε τα </a>. Αν το πρόβλημα επαναλαμβάνεται παρακαλώ επικοινωνήστε με τον διαχειριστή του συστήματος.</div></td>
<td width="34"> </td>
<td width="736"> </td>
<td></td>
</tr>
<tr>
<td height="780"></td>
<td> </td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
<?php
}
/*
*************************************************************************************
** Developed by Petrellis Manolis.
*************************************************************************************
*/
?>