Literaturseminar / Literature seminar - Detail
// literaturseminar_from_database_detail.php
function network_approved($dbg)
{
$retval=0;
$client_ip=$_SERVER['REMOTE_ADDR'];
$client_useraddr = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$client_ip_arr = explode('.',$client_ip);
if($client_ip_arr[0]=='134' && $client_ip_arr[1]=='91')
{
// Bereich 134.91.
if($client_ip_arr[2]=='165')
$retval=1;
elseif($client_ip_arr[2]=='163')
$retval=1;
elseif($client_ip_arr[2]=='160')
$retval=1;
elseif($client_ip_arr[2]=='150')
$retval=1;
}
elseif($client_ip_arr[0]=='132' && $client_ip_arr[1]=='252')
{
// Bereich 132.252. VPN Bereiche (Info T. Berger, 2021-05-07)
$retval=1;
}
if($dbg == '1')
{
echo ' Debug messages from network_approved function: ';
echo '
'; echo ' IP-number: ',$client_ip,'
'; echo ' DNS name: ', $client_useraddr,'
'; echo ' Octets: ', $client_ip_arr[0],' ',$client_ip_arr[1],' ',$client_ip_arr[2],' ',$client_ip_arr[3],'
'; echo ' Retval: ', $retval,'
( Access '; if ($retval=='0') echo 'not '; echo 'allowed )'; } return $retval; } function checkdoi($doistring,$dbg) { $retval=0; // Rules for valid Digital Object Identifier (according ISO 26324) // 0) Logical length > 10 // 1) Starting with "10." // 2) "/" is at position 8 // 3) Value in from string pos 4 bis 7 is >=1000 if (strlen($doistring)>10) if(strncmp($doistring,'10.',3)==0) if(substr_compare($doistring, '/',7,1)==0) if(intval(substr($doistring,3,4))>=1000) $retval=1; if($dbg==1) { echo 'strlen: ',strlen($doistring),' '; echo ' strncmp: ',strncmp($doistring,'10.',3),' '; echo ' substr_comp: ',substr_compare($doistring, '/',7,1),' '; echo ' intval: ',intval(substr($doistring,3,4)),' '; echo ' substr: ',substr($doistring,3,4),' '; echo ' returnvalue:', $retval; } return $retval; } function url_ok($urlstring,$dbg) { $retval=0; $retval=1; if($dbg==1) { echo ' returnvalue: ',$retval,' '; } return $retval; } header('Content-Type: text/html; charset=ISO-8859-1'); if (isset($_GET["litid"])) { // Establish dataBase link $mysqli = mysqli_connect("db13.zim.uni-duisburg-essen.de","hp0052","Mvxod0n7rzuB","hp0052_1"); if (!mysqli_connect_errno()) { //$_GET["litid"] //filter_input(INPUT_GET, "litid", FILTER_VALIDATE_INT) $SelectString = 'SELECT * FROM Literatur WHERE zaehler='.strip_tags($_GET["litid"]); $Ergebnis=mysqli_query($mysqli, $SelectString); $db_output=mysqli_fetch_assoc($Ergebnis); if($db_output) { echo '';
echo '
';
}
else echo 'Datensatz existiert nicht!';
mysqli_close($mysqli);
}
else echo 'Datenbankfehler!
';
}
else echo 'Parameterfehler !';
?>
'; echo ' IP-number: ',$client_ip,'
'; echo ' DNS name: ', $client_useraddr,'
'; echo ' Octets: ', $client_ip_arr[0],' ',$client_ip_arr[1],' ',$client_ip_arr[2],' ',$client_ip_arr[3],'
'; echo ' Retval: ', $retval,'
( Access '; if ($retval=='0') echo 'not '; echo 'allowed )'; } return $retval; } function checkdoi($doistring,$dbg) { $retval=0; // Rules for valid Digital Object Identifier (according ISO 26324) // 0) Logical length > 10 // 1) Starting with "10." // 2) "/" is at position 8 // 3) Value in from string pos 4 bis 7 is >=1000 if (strlen($doistring)>10) if(strncmp($doistring,'10.',3)==0) if(substr_compare($doistring, '/',7,1)==0) if(intval(substr($doistring,3,4))>=1000) $retval=1; if($dbg==1) { echo 'strlen: ',strlen($doistring),' '; echo ' strncmp: ',strncmp($doistring,'10.',3),' '; echo ' substr_comp: ',substr_compare($doistring, '/',7,1),' '; echo ' intval: ',intval(substr($doistring,3,4)),' '; echo ' substr: ',substr($doistring,3,4),' '; echo ' returnvalue:', $retval; } return $retval; } function url_ok($urlstring,$dbg) { $retval=0; $retval=1; if($dbg==1) { echo ' returnvalue: ',$retval,' '; } return $retval; } header('Content-Type: text/html; charset=ISO-8859-1'); if (isset($_GET["litid"])) { // Establish dataBase link $mysqli = mysqli_connect("db13.zim.uni-duisburg-essen.de","hp0052","Mvxod0n7rzuB","hp0052_1"); if (!mysqli_connect_errno()) { //$_GET["litid"] //filter_input(INPUT_GET, "litid", FILTER_VALIDATE_INT) $SelectString = 'SELECT * FROM Literatur WHERE zaehler='.strip_tags($_GET["litid"]); $Ergebnis=mysqli_query($mysqli, $SelectString); $db_output=mysqli_fetch_assoc($Ergebnis); if($db_output) { echo '
| Parameter | Wert | '; echo '
|---|---|
| Datum | ','',$db_output["datum"],' | '; echo '
| Semester | ','',$db_output["semester"],' | '; echo '
| Sprecher | ','',$db_output["sprecher"],' | '; echo '
| Titel | ','',$db_output["titel"],' | '; echo '
| Referenz | ','',$db_output["text"],' | '; echo '
| DOI | '; echo ''; if (checkdoi($db_output["doi"],0)==1) { echo 'DOI'; } else { echo $db_output["doi"]; } echo ' | '; echo '
| Link/s | '; echo '';
if(url_ok($db_output["link"],0)==1)
{
$links = preg_split("/[;,]/",$db_output["link"]);
for ($counter=0;$counter '; } else echo '-'; } } else { if (strlen($db_output["link"])>0) echo $db_output["link"]; else echo '-'; } echo ' | ';
echo '
| Info 1 | ','',$db_output["info1"],' | '; echo '
| Info 2 | ','',$db_output["info2"],' | '; echo '
| Sprache | ',''; if ($db_output["sprache"]=="DEU") { echo 'Deutsch'; } elseif ($db_output["sprache"]=="ENU") { echo 'Englisch'; } else { echo 'Unspezifiziert'; } echo ' | '; echo '
| Geändert | ','',$db_output["zeitstempel"],' | '; echo '
| ';
echo ' '; echo ''; echo ' | ';
echo '(funktioniert nur unter bestimmten Bedingungen!) | '; echo '