Jump to content

westman

Members
  • Content Count

    600
  • Joined

  • Last visited

Everything posted by westman

  1. westman

    animated CSS arrows

    .arrowSliding { position: absolute; -webkit-animation: slide 4s linear infinite; animation: slide 4s linear infinite; animation-direction: reverse; } Hope this helps you
  2. westman

    animated CSS arrows

    Thank you so much. Works well.
  3. westman

    animated CSS arrows

    use animation-direction: reverse;
  4. westman

    animated CSS arrows

    How do I make my animation run backwords? Instead of it moving from right to left, I need it to move from left to right. #arrowAnim { width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; } .arrow { width: 5vw; height: 5vw; border: 2.5vw solid; border-color: black transparent transparent black; transform: rotate(-45deg); } .arrowSliding { position: absolute; -webkit-animation: slide 4s linear infinite; animation: slide 4s linear infinite; } .delay1 { -webkit-animation-delay: 1s; animation-delay: 1s; } .delay2 { -webkit-animation-delay: 2s; animation-delay: 2s; } .delay3 { -webkit-animation-delay: 3s; animation-delay: 3s; } @-webkit-keyframes slide { 0% { opacity:0; transform: translateX(15vw); } 20% { opacity:1; transform: translateX(9vw); } 80% { opacity:1; transform: translateX(-9vw); } 100% { opacity:0; transform: translateX(-15vw); } } @keyframes slide { 0% { opacity:0; transform: translateX(15vw); } 20% { opacity:1; transform: translateX(9vw); } 80% { opacity:1; transform: translateX(-9vw); } 100% { opacity:0; transform: translateX(-15vw); } } <div id="arrowAnim"> <div class="arrowSliding"> <div class="arrow"></div> </div> <div class="arrowSliding delay1"> <div class="arrow"></div> </div> <div class="arrowSliding delay2"> <div class="arrow"></div> </div> <div class="arrowSliding delay3"> <div class="arrow"></div> </div> </div> Any help?
  5. If I have the following code in header.php and index.php is including header.php, will header.php be protected from URL access? if(!isset($_SERVER['HTTP_REFERER'])){ header('location:../index.php'); exit(); }
  6. I think I was miss understood. My second question was meant to mean at run time - not using the command line. If my index.php includes www.mysite.com/folder/file.php and file.php has the above code at the top, how do I grant access to index.php?
  7. Thank you for the insight. I tried the code you gave but it did not work for me. I have use... if (php_sapi_name() != 'cli') { header('location:http://mysite.com'); exit(); } at the top of the page and it seems to do the job. When I type the file directory in the address bar the code in the file does not run and I am moved to the home page. At the same time using the code above, my cron job works fine. If the code above is not the best way of stopping access from the URL please tell me. Also, how do I grant access to another php file that are including a file that is blocking URL access using the code above?
  8. Hi all, I have a file at the following directory... www.mysite.com/folder/file.php I have a cron job running file.php and all is well there. How do I stop the file running the code if some one enters my file directory in the address bar?
  9. westman

    array in mysqli query

    Thank you. Last question. If I have my usual $conn = new mysqli($db_host, $db_username, $db_pass, $db_name); in an external file would it be a problem if I add $conn_pdo = new PDO("mysql:host=$servername2;dbname=$dbname2", $username2, $password2); in the same file?
  10. westman

    array in mysqli query

    I removed one LIMIT and it is okay now. how do I close the PDO query and and connection?
  11. westman

    array in mysqli query

    this is my output from print_r($stmt);. PDOStatement Object ( [queryString] => SELECT id, main, id_from, id_to, pm_subject, pm_text, pm_date, pm_open FROM text WHERE id IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ORDER BY id DESC LIMIT LIMIT 0,10 ) Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0,10' at line 1 in /home/outlinetalent/public_html/t_all.php:86 Stack trace: #0 /home/mysite/public_html/file.php(86): PDOStatement->execute(Array) #1 {main} thrown in /home/mysite/public_html/file.php on line 86
  12. westman

    array in mysqli query

    the output of $limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows; echo "<br /> limit: $limit <br />"; is... limit: LIMIT 190,10
  13. westman

    array in mysqli query

    thank you for the $row info. it tried... $limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows; but got the following error
  14. westman

    array in mysqli query

    works well. thank you. last one. How do I get a variable out the while loop and how do I close the DB connection? Also, is it possible for $limit = 5; to be $limit = "34,5"; as it is a pagination script. PDO is new to me.
  15. westman

    array in mysqli query

    using.... echo $result; my output is 1
  16. westman

    array in mysqli query

    Thank you for your support. I really appropriate it. I am having a problem with this line... while($row = $result->fetch(PDO::FETCH_ASSOC)) {
  17. westman

    array in mysqli query

    $seach = ''; foreach ($uniqueValueArray_id as $key => $value) { $seach .= 'id='.$value; $seach .= ' OR '; } $seach = rtrim($seach,' OR '); echo $seach; $sql = "SELECT id, text, date, FROM text WHERE $seach ORDER BY id DESC $limit"; $query = mysqli_query($conn, $sql); I am getting closer but I do have a problem with the query still. Any help?
  18. westman

    array in mysqli query

    Is it even possible to run an array through a query?
  19. $uniqueValueArray[] = $mainRow; // my array $sql = "SELECT id, text, date FROM text WHERE id='My Array' ORDER BY id DESC $limit"; $query = mysqli_query($conn, $sql); How do I make a query look for an array?
  20. westman

    user agreement

    Hi all, No PHP or cookies today just text. I would like to update my Terms of Use / User Agreement - legal page. I am terrible with page content like this and would like to use a good free template. Where do I go for this?
  21. westman

    cookie coding

    Thank you for the answer to my question. Most of what you were discussing I did not follow but thanks.
  22. westman

    cookie coding

    In my last topic i opened It was advised to have a new cookie and never use the same one. At the moment my code is setting a new cookie with each page view after being logged in. Is this too excessive?
  23. westman

    cookie coding

    Hi Foxy, Thank you very much for your contribution. I was really quite advance for me but I am sure it wasn't lost on others. In the end I added one more line of code to fix the problem - It probably didn't fix the problem but no errors are show to the page and the cookie gets killed. if (isset($_GET['active'])) { $active = $_GET['active']; if ($active == "logout"){ if(isset($_COOKIE["username"])){ setcookie("username", '', strtotime( '-5 days' ), '/'); } session_destroy(); echo "<script>setTimeout(\"location.replace('http://mysite.com')\",1000)</script>"; exit(); } } as you can see a just added "exit();"
  24. westman

    cookie coding

    Okay I got the biggest puzzle since early man. here is my code.. if (isset($_GET['active'])) { $active = $_GET['active']; if ($active == "logout"){ if(isset($_COOKIE["username"])){ setcookie("username", '', strtotime( '-5 days' ), '/'); } session_destroy(); // This code removes the cookie no problem. However it shows the header error echo "<script>setTimeout(\"location.replace('http://mysite.com')\",1000)</script>"; // this code does not show the header error but need to run the url (mysite/?active=logout) twice to kill the cookie (session destroy works just fine) header("location: http://www.mysite.com"); } } What do I do here?
×
×
  • Create New...