Jump to content

hariskar

Members
  • Posts

    101
  • Joined

  • Last visited

Everything posted by hariskar

  1. I don't think someone would do that to vote many times. I think php restrictions are not more secure, users can restart the rooter, get new IP and revote. But my users are mostly anonymous, so can there be a cookie restriction for them?
  2. With javascript + cookies would it be possible?
  3. Is it possible to add a 1 vote per IP restriction for this poll without using php? If not with IP restriction, how could a repeated voting of the same person be avoided? How can a Results link be added? Where should it refer? Thank you!
  4. I made a responsive gallery and would like to open modal windows for each photo. My problem is that the modal opens only for the first image. Any help please? Thank you! <div class="img"> <img id="myImg" src="aithousa_anamonis_1.jpg" alt="Αίθουσα αναμονής 1" width="300" height="200"> </div> <div class="img"> <img id="myImg" src="aithousa_anamonis_2.jpg" alt="Αίθουσα αναμονής 2" width="300" height="200"> </div> <div class="img"> <img id="myImg" src="aithousa_anamonis_3.jpg" alt="Αίθουσα αναμονής 3" width="300" height="200"> </div> <!-- The Modal --> <div id="myModal" class="modal"> <span class="close">×</span> <img class="modal-content" id="img01"> <div id="caption"></div> </div> <script> // Get the modal var modal = document.getElementById('myModal'); // Get the image and insert it inside the modal - use its "alt" text as a caption var img = document.getElementById('myImg'); var modalImg = document.getElementById("img01"); var captionText = document.getElementById("caption"); img.onclick = function(){ modal.style.display = "block"; modalImg.src = this.src; captionText.innerHTML = this.alt; } // 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"; } </script>
  5. In this example if I put in the fields: <script>location.href('http://www.hacked.com')</script> , it gives as my input: <script>location.href('http://www.hacked.com')</script> hariskar@gmail.com <script>location.href('http://www.hacked.com')</script> <script>location.href('http://www.hacked.com')</script> Since there is htmlspecialchars() here function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; shouldn't it return HTML escaped code? Also since we have htmlspecialchars() in function test_input mentioned above, why do we also have htmlspecialchars() in form action: action="<?php echohtmlspecialchars($_SERVER["PHP_SELF"]);?>" ? Couldn't we put something like this as form action: action="form-page.php" Thank you!
  6. I changed my footer to 4 columns footer and I think it behaves good in small devices too.
  7. I thought that my settings were OK, but with your configuration it is just perfect! Just some questions and thoughts: -If I change footer min-height:100px and margin-top:-100px to 90 and -90, so as the text is in the center vertically I don't see any problem. -Should I consider how the page looks in bigger resolutions eg 2500px and add more breakpoins? (most guides don't suggest that) Thank you!
  8. Thanks a lot! I removed position: absolute and bottom property from footer and applied overflow: hidden I also made bottom-margins for aside and content smaller (30px). But now there is a problem in pages with small height like http://www.mikroviologos.gr/biografiko or even the start page: footer is not at the bottom of the desktop screen anymore. Edit: So I reverted to my previous css and added @media screen and (max-width:949px) { #content {margin-bottom:30px;} aside {margin-bottom:0;} footer{position:relative;overflow:hidden} } and I think it is OK. footer is much better with class="col-12" style="padding:0 15px", text is away from edges in small screens. But I don't like the whole footer (and logo) and have to re-design them somehow..
  9. :-( No, I did not realize it, I put @media screen and (max-width: 949px) #content { margin-bottom: 160px;} which is enough for minimum width 240-250px (it depends on the page), isn't it enough? Or is there a better solution? Thank you for pointing this!
  10. With the .container 81% you put and 12-columns grid aside has exactly the width I want and the site works great in smaller screens! Thank you!!
  11. I looked further how the site looks with your code and it is great! I have to study to see the changes you made and everything works so perfectly. Yes, what I meant is that with 12 columns if I choose col-2 sidebar is too narrow, if I choose col-3 it is to wide. With 9-columns grid and col-2 it is fine. I will check it more now you added a container instead my 2 empty columns. Thank you again!!
  12. Thanks a lot! The reason i chose 9 columns is that with col-2 I have width about 21% for sidebar. I checked all grids with different columns and only 9-columns give this width. The responsive menu is now very nice, except it overlaps the vertical menu under it. It opens over the side menu, it hides it. Shouldn't it push the aside menu down?
  13. No, it does not work correctly. With some test changes I did the responsive menu for small screens comes as it should, only it comes over the content (like it does now without the test changes), it hides what exists under it when it expands. It does not push the content lower. Any idea why?
  14. ashbifs, I made my site responsive and used 9 columns grid and think I solved this problem. If you have a suggestion to make it better, please let me now. Thank you for reply!
  15. In my page (www.mikroviologos.gr) the top menu is aligned over the image: it is above the image and starts exactly above the left corner. My screen width is 1280. If the width of the screen changes top menu stops being above the image. How can this 2 start always from the same vertical point? Thank you!
  16. It works perfectly now, something broke in included file login.php, but now it is OK! Thank you! <?php if ($_SESSION['username']=="hariskar") { echo "hariskar text"; readfile("arthra.html"); } elseif($_SESSION['username']=="test") { readfile("results/xxx.html"); } else { ?> <p>Αν θέλετε να μπορείτε να κατεβάζετε τα αποτελέσματά σας σε μορφή pdf παρακαλώ ενημερώστε μας και <a href="/user/register">εγγραφείτε στη σελίδα μας</a>.</p> <?php } ?>
  17. Now for both users print_r($_SESSION); gives Array ( [loggedin] => 1 [username] => 1 [memberID] => 2 )
  18. With <?php echo $_SESSION['username']; if ($_SESSION['username']=="hariskar") { echo "hariskar text"; } elseif($_SESSION['username']=="test") { echo "test text"; } else { echo "Some text."; } ?> for logged in user hariskar the result is 1hariskar text for logged in user test the result is again 1hariskar text So echo $_SESSION['username']; gives 1. But why? I start session with <?php session_start(); ?> in 1st line of results.php. Thank you
  19. Thank you but I have already tried it, no difference, it still shows the "hariskar text" for user test.. <?php if ($_SESSION['username']=="hariskar") { echo "hariskar text"; } elseif($_SESSION['username']=="test") { echo "test text"; } else { echo "Some text."; } ?>
  20. With 3 cases it does not work as expected, if user hariskar logs in, echoed text is "hariskar text". If hariskar user logs out and test user logs in echoed text is again hariskar, which is wrong, although if I do print_r($_SESSION); the result is "testArray ( [loggedin] => 1 [username] => test [memberID] => 2 )" which is correct. Why do we not see the "test text" echoed? Thank you! <?php if ($_SESSION['username']==hariskar) { echo "hariskar text"; } elseif($_SESSION['username']==test) { echo "test text"; } else { echo "Some text."; } ?> PS. Maybe this topic should be moved in php section?
  21. If someone logins, there is a redirection in login.php to results.php if($user->login($username,$password)){ $_SESSION['username'] = $username; header('Location: /results.php'); So, in results.php there is a paragraph that should be visible for not logged in users. I would like it to be replaced with the users results if the user has results and is logged in. But it should be replaced with each users own results. Of course each users should be able to see only his results. If he has no result this paragraph and is logged in should just not show. Could you please give me some hints? I thought: With session_start these in the 2 files: and put in results.php something like: <?php $results = file_get_contents($username".html");?> <script> function ChangeParagraph(par1) { if( $username->is_logged_in() { document.getElementById("par1").innerHTML = "<?php echo $results; ?>"; } } </script> ?> of course it does not work.. Thank you
  22. Everything works! I echoed all inputs, textarea and radios too and everything is still visible after an error. I validated uploaded_file for type and size, (it is not stored anywhere, just emailed with PHPMailer). There still is a hole, if someone renames an .exe to .pdf or doc it is validated and sent to email. I will see what I will do with that. So now time for the login/register system and some polls! Thank you again for your help!
×
×
  • Create New...