// UPDATE.PHP3 - DO NOT EDIT THIS FILE. YOU CAN CAUSE SYSTEM MALFUNCTION
// PERMITED USERS: ANGEL STOITSOV ONLY
// General Variables
//$table Set Localy for SQL connect
$dbname="Mario"; // Generally use on alinea.bg MySQL Server (You can add more tables inside this database, as your permissions are OK with that.)
// You cannot change this username and password (only Angel can)
$dbusername="Martin_Ivanov"; // case-sensitive
$dbpassword="w23qsM5qws34A"; // case-sensitive
// End General Variables ( use command GLOBAL when called inside a function() )
?>
echo "";
?>
if (!isset($username) or !isset($password))
{
// ASK FOR VERIFICATION
?>
// END ASK FOR VERIFICATION
} else
{ // ENTER EDIT MODE
//$username=$_POST['username'];
//$password=$_POST['password'];
$table="personaldata"; // Set working table
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table"); //Select all usersnames and passwords
$num_rows=mysql_num_rows($result); // Get number of the rows (number of members)
$isvaliduser="no";
while ($myrow=mysql_fetch_array($result)) {
if ($myrow[12]==$username && $myrow[13]==$password) {
$thisuserID=$myrow[11];
$isvaliduser="yes";
}
}
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
//check user
if ($isvaliduser=="yes") { // it is valid
// ############# VALID USER ########################
if (!isset($save_bttn)) {
//if for editing
$table="personaldata"; // Set working table
$ed=mysql_connect("localhost", $dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Select * from $table WHERE UserID='$thisuserID'"); //Select all usersnames and passwords
while ($myrow=mysql_fetch_array($result)) {
echo "
Welcome, $myrow[0]!
";
echo "
This is your personal profile. You have to update it regularly in order to give actual information about yourself
to your profile visitors. Please, be advised for the specific formatting of your posts, described as followed.
";
echo "
Angel Stoitsov
} else
//if for save
{
//$save_bttn=$_POST['save_bttn'];
//$dbname="Mario";
$table="personaldata";
$ed=mysql_connect("localhost",$dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Use $dbname"); //Update record
$result=mysql_db_query($dbname,"DELETE FROM $table WHERE UserID='$thisuserID'"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('$name','$ophone','$ofax','$email','$haddr','$hphone','$birth','$place','$citizen','$mstatus','$pictureurl','$thisuserID','$username','$password','$lastm','$oaddr','$occupation','$sorted');"); //Update record
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
$table="scientiestsinfo";
$ed=mysql_connect("localhost",$dbusername, $dbpassword) or Die("Can't connect. Invalid username or password, or maybe SQL server down."); // Open connection to SQL Server
$result=mysql_db_query($dbname,"Use $dbname"); //Update record
$result=mysql_db_query($dbname,"DELETE FROM $table WHERE UserID='$thisuserID'"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('education','$thisuserID','$MReducation','1',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('experience','$thisuserID','$MRexperience','2',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('languages','$thisuserID','$MRlanguages','3',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('societies','$thisuserID','$MRsocieties','4',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('interests','$thisuserID','$MRinterests','5',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('visits','$thisuserID','$MRvisits','6',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('specific','$thisuserID','$MRspecific','7',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('selected publications','$thisuserID','$MRpublications','8',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('conference reports','$thisuserID','$MRreports','10',null);"); //Update record
$result=mysql_db_query($dbname,"INSERT INTO $table VALUES ('conferencies','$thisuserID','$MRconferencies','9',null);"); //Update record
mysql_close($ed); // Close connection to SQL Server (We have to save AlineA Batteries for long-life :-) )
echo"