Jump to content

hariskar

Members
  • Posts

    101
  • Joined

  • Last visited

About hariskar

  • Birthday 05/20/1970

Contact Methods

  • Website URL
    http://www.mikroviologos.gr

Profile Information

  • Location
    Greece/Kavala

Recent Profile Visitors

7,318 profile views

hariskar's Achievements

Member

Member (2/7)

0

Reputation

  1. Thank you for advises! I corrected container, row order, removed container with 82% and did everything you suggested. I changed margin-top of content.col-12 and aside.col-6 to compensate the space required by lang. Shouldn't lang be aligned over right end of picture? I consider to use media query with margin-right=53px for bigger screens and margin-right=18px for smaller. Would you advise anything better? Thank you again!
  2. Than you for reply! With above code added screen width 964px it is at the correct position. But as the screen width gets smaller it moves down.
  3. In my page https://www.mikroviologos.gr/ I made a simple language selection <div> which is in the correct place when page is viewed in desktop size. But when the page is viewed with smartphone the lang <div> goes under both menus (horizontal and vertical) and other blocks. How could I make it be in the same place, under the header on the right side both in desktop and smartphone viewing size? Thank you!
  4. With php registered users have access, each to their own results when they click to www.site.com/results. The results are pdf. So when a user clicks on results he can see a page with the links to all the pdf of his results. The problem is that if someone copies and pastes this link he can also see the results even if he is not registered. How could I avoid this? Here is the code: Thank you! <?php if ($_SESSION['username']=="user1") { readfile("https://www.site.com/results/user1.html"); } elseif($_SESSION['username']=="user2") { readfile("https://www.site.com/results/user2"); } else { ?> <p>Αν θέλετε να μπορείτε να βλέπετε τα αποτελέσματά σας online και να τα κατεβάζετε σε μορφή pdf παρακαλώ <b>ενημερώστε μας</b> προφορικά, με email ή συμπληρώνοντας τη <a href="forma -epikoinonias">φόρμα επικοινωνίας</a> και <a href="https://www.site.com/user/register">εγγραφείτε στην ιστοσελίδα μας</a>.</p> <?php } ?>
  5. I was not very clear: Problem solved. I have one db connection in included file and a second in the main file. I had to put $db->exec("SET CHARACTER SET utf8;"); in both files after each connection to solve the problem.
  6. In included config.php I changed $db->exec("SET NAMES 'utf8';"); to $db->exec("SET CHARACTER SET utf8;"); but the problem remains: Greek username is correct in mysql with Greek characters being correctly displayed, but last_login still does not update for usernames in Greek. Edit: I had to put it again, because I had a 2nd connection to the db. Thank you!
  7. Thank you but I can not understand what is happening: since there is $db->exec("SET NAMES 'utf8';"); in the included file, the username registers correctly in mysql and login/php works fine. The only problem is that when a user with Greek username logs in last_login in mysql does not update. Is there anything wrong with this line? : $sql = "UPDATE members SET last_login=now() WHERE username='$username' ";
  8. last_login in mysql is updated correctly when username is in Latin characters but not updated when in Greek. Here is the code: <?php //include config require_once('includes/config.php'); $username = $_POST['username']; $password = $_POST['password']; if($user->login($username,$password)){ $servername = "xxx"; $dbuser = "xxx"; $dbpass = "xxx"; $dbname = "xxx"; $conn = new mysqli($servername, $dbuser, $dbpass, $dbname); $sql = "UPDATE members SET last_login=now() WHERE username='$username' "; if ($conn->query($sql) === FALSE) {echo "Error updating record: " . $conn->error;}} //check if already logged in move to home page if( $user->is_logged_in() ){ header('Location: register'); } //process login form if submitted if(isset($_POST['submit'])){ $username = $_POST['username']; $password = $_POST['password']; if($user->login($username,$password)){ $_SESSION['username'] = $username; header('Location: /apotelesmata'); exit; } else { $error[] = 'Λάθος όνομα χρήστη ή κωδικός ή ο λογαριασμός σας δεν έχει ενεργοποιηθεί ακόμα.'; }}//end if submit //define page title $title = 'Login'; ?> and here is the included config.php <?php ob_start(); session_start(); //set timezone date_default_timezone_set('Europe/Athens'); //database credentials define('DBHOST','xxx'); define('DBUSER','xxx'); define('DBPASS','xxx'); define('DBNAME','xxx'); //application address define('DIR','http://www.mikroviologos.gr/'); define('SITEEMAIL','xxx@xxx.xx'); try { //create PDO connection $db = new PDO("mysql:host=".DBHOST.";dbname=".DBNAME, DBUSER, DBPASS); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->exec("SET NAMES 'utf8';"); } catch(PDOException $e) { //show error echo '<p class="bg-danger">'.$e->getMessage().'</p>'; exit; } //include the user class, pass in the database connection include('classes/user.php'); include('classes/phpmailer/mail.php'); $user = new User($db); ?> In the included config.php there is a line $db->exec("SET NAMES 'utf8';"); but the problem still exists. Could you please help me on that? Thank you!
  9. It works with display:block!I would never find this myself... I made the html this way, because I want the transparent non hover border and the blue hover border to be over the image edges and not around/externally of the image with the image smaller. Is there a simpler way to do this? Thank you!
  10. Why does the border on hover that appears on the 4 smaller pictures not fall exactly on the pictures edge, but at the bottom it is about 7px lower and leaves an empty space? http://www.mikroviologos.gr/test2 Thank you!
  11. In my webpage I would like to put an image in the text logo I have now. I would like the image to be in the right of mikroviologos.gr. Now the code is: <div id="logoArea" class="col-3" title="Μικροβιολογικό Εργαστήριο στην Καβάλα"><h1><a href=/><div id="l1">mikroviologos.gr</div><div id="l2">Εργαστήριο Μικροβιολογίας</div></a></h1></div> If I change it to <div id="logoArea" class="col-3" title="Μικροβιολογικό Εργαστήριο στην Καβάλα"><h1><a href=/><div id="l1">mikroviologos.gr<img src="image.png"></div><div id="l2">Εργαστήριο Μικροβιολογίας</div></a></h1></div> and try to apply some margin-top the whole logo moves. How can I make only the picture move? I want to align it to the text. Thank you!
  12. I made my site www.mikroviologos.gr without any cms with the valuable help of w3schools lessons and this forum (I had almost no knowledge of html, css, javascript, php, mysql before). My site functions as it should but I think I don't like my design so much. Of course I still have no logo, but the rest of the design seems too simple and maybe old fashioned. Of course I would not like something very modern.. My problem is I can't decide what is wrong and what should I change.. I think I don't like the main picture being so big, but if I made it smaller, it would be narrower than the text. Please feel free to make any comment, not only about the design. Thank you!!
  13. I added $db->exec("SET NAMES 'utf8';"); in php and now usernames are stored correctly in mysql. Thank you!
  14. In a member register form how can I add a validation rule to allow only latin characters for username and password? Today a member registered and put in Greek characters and the result in mysql is Σοφία Δέδε ... (In mysql collation is utf8_general_ci). How can I avoid this? Thank you!
  15. <style> div.img {margin:5px;border:1px solid #ccc;float:left;width:220px;} div.img:hover {border:1px solid #777;} div.img img {width:100%;height:auto;} div.desc {padding:15px;text-align:center;} .img {cursor:pointer;transition:0.3s;} .image:hover {opacity:0.7;} /* The Modal (background) */ .modal { display:none; /* Hidden by default */ position:fixed; /* Stay in place */ z-index:1; /* Sit on top */ padding-top:100px; /* Location of the box */ left:0; top:0; width:100%; /* Full width */ height:100%; /* Full height */ overflow:auto; /* Enable scroll if needed */ background-color:rgb(0,0,0); /* Fallback color */ background-color:rgba(0,0,0,0.9); /* Black w/ opacity */ } /* Modal Content (image) */ .modal-content {margin:auto;display:block;max-width:100%;} /* Add Animation */ .modal-content, #caption {-webkit-animation-name:zoom;-webkit-animation-duration:0.6s;animation-name:zoom;animation-duration:0.6s;} @-webkit-keyframes zoom { from {-webkit-transform:scale(0)} to {-webkit-transform:scale(1)} } @keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} } /* The Close Button */ .close{position:absolute;top:15px;right:35px;color:#f1f1f1;font-size:40px;font-weight:bold;transition:0.3s;} .close:hover,.close:focus{color:#bbb;text-decoration:none;cursor:pointer;} /* 100% Image Width on Smaller Screens */ @media only screen and (max-width:700px){.modal-content {width:100%;}} @media screen and (max-width:900px) {#content {margin-bottom:120px}} </style> <div id="content" class="col-9"> <h1>Φωτογραφίες</h1> <div class="img"><img class="image" src="http://s.mikroviologos.gr/image/aithousa_anamonis_1.jpg" alt="Αίθουσα αναμονής 1"></div> <div class="img"><img class="image" src="http://s.mikroviologos.gr/image/aithousa_anamonis_2.jpg" alt="Αίθουσα αναμονής 2"></div> <div class="img"><img class="image" src="http://s.mikroviologos.gr/image/aithousa_anamonis_3.jpg" alt="Αίθουσα αναμονής 3"></div> <div class="img"><img class="image" src="http://s.mikroviologos.gr/image/fygokentroi.jpg" alt="Φυγόκεντροι"></div> <div class="img"><img class="image" src="http://s.mikroviologos.gr/image/analytes_1.jpg" alt="Αναλυτές 1"></div> <div class="img"><img class="image" src="http://s.mikroviologos.gr/image/analytes_2.jpg" alt="Αναλυτές 2"></div> <div class="img"><img class="image" src="http://s.mikroviologos.gr/image/analytes_3.jpg" alt="Αναλυτές 3"></div> <!-- The Modal --> <div id="myModal" class="modal"> <span class="close">×</span> <img src="http://s.mikroviologos.gr/image/pixel.gif" class="modal-content" id="img01" alt=""> </div> <script> // Get the modal var modal = document.getElementById('myModal'); // Get the image and insert it inside the modal var images = document.getElementsByClassName("image"); for(var i = 0; i < images.length; i++) {images[i].onclick = showCaption;} var modalImg = document.getElementById("img01"); function showCaption(){ modal.style.display = "block"; modalImg.src = this.src; } // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks on <span> (x), close the modal span.onclick = function() {modal.style.display = "none";} modal.onclick = function() {modal.style.display = "none";} </script> I think I put all the relative code. It works great, you can see here.
×
×
  • Create New...