Jump to content
  • Who's Online   0 Members, 1 Anonymous, 48 Guests (See full list)

    There are no registered users currently online

All Activity

This stream auto-updates     

  1. Today
  2. Did you write the script? If not, you might want to look into an alternative solution. For example, user-supplied information like what comes from $_POST['username'] should not be placed directly into the query. You will want to use prepared statements to prevent someone from performing SQL Injection attacks. You should also look into a solution that uses password_hash() for hashing passwords. More information about hashing passwords can be found here: https://www.php.net/manual/en/faq.passwords.php
  3. Hello- I am not generating any errors with this php snippet which is in my functions.php file of the child theme for wordpress but I'm wondering why it doesn't work. Snippet: function pnavi_shortcode() { return get_the_post_navigation(); }add_shortcode ( 'pnavi', 'pnavi_shortcode' ); I have also tried using a variable = to the function of get_the_post_navigation() but same issue. This script is supposed to show the previous - next navigation for pages of posts, not the 'next' single post. Via a theme, it is working, but I'm trying to add something myself in another location. Any suggestions?
  4. Yesterday
  5. Is there a problem here? What's keeping you from a) formatting your script so it is readable and b) from doing it?
  6. ----------------------------------------------------------this code---------------------------------------------------------------------- <?php if($login_incorrect){ if(isset($_COOKIE['login'])){ if($_COOKIE['login'] < 3){ $attempts = $_COOKIE['login'] + 1; setcookie('login', $attempts, time()+60*10); //set the cookie for 10 minutes with the number of attempts stored } else{ echo 'You are banned for 10 minutes. Try again later'; } } else{ setcookie('login', 1, time()+60*10); //set the cookie for 10 minutes with the initial value of 1 } } ?> ----------------------------------------------------in here---------------------------------------------------------------------------------- include('dbc.php'); if(isset($_POST['login'])) { $username=$_POST['username']; $password=$_POST['password']; if(empty($username) && empty($password)) { echo"<script>alert('please enter username and password')</script>"; } if(empty($username) || empty($password)) { echo"<script>alert('please enter username and password')</script>"; } $pass= hash('sha512', $password); $set="Lecturer"; $set2='Admin'; $sel="select * from $tb1 where username='$username' and password='$pass'"; $result=mysqli_query($con,$sel); $row=mysqli_fetch_array($result); if($row['username']== $username && $row['password']== $pass && $row['usertype']==$set) { $_SESSION["username"] = $_POST["username"]; $_SESSION['last_login_timestamp'] = time(); $_SESSION['username'] = $username; header('location:userhome.php'); } elseif ($row['username']== $username && $row['password']== $pass && $row['usertype']==$set2) { $_SESSION["username"] = $_POST["username"]; $_SESSION['last_login_timestamp'] = time(); $_SESSION['username'] = $username; header('location:adminhome.php'); }} else {echo"<script>alert('not registered/approved')</script>";} ?>
  7. Last week
  8. Berand, I have more records now. It seems to be recording the correct time now. Here are a few new records: 35.167.229.1 /index.php N/A 10/19/19 10:51:48 207.46.13.17 /index.php N/A 10/19/19 09:28:47 166.181.87.1 /index.php N/A 10/19/19 07:53:25 34.222.218.2 /index.php N/A 10/19/19 06:01:51
  9. i'll get back to you guys here when some more traffic comes through. then i will know if this worked.
  10. As an easier alternative to SELECT TIME_FORMAT(IF(logged=0, time, logged), '%T') as time Then you will just need SELECT TIME_FORMAT(logged, '%T') as time
  11. hello dear experts good day dear PHP-Freaks the question today is: VScode vs VScodium on Debian - which one to use!? i want to work with VSCode on Debian - now i have heard that there also a alternative Kit exists. vscodium - i want to configure this to work with Python and MicroPython - and of course also with PHP. what do you say - can we install this on Debian too - without any hassle?
  12. This will copy the current date and time values into the timestamp column UPDATE tblTraffic SET logged = CONCAT(date, ' ', time);
  13. ok i'll wait until another bot crawls the site and see if this new column does the trick. i'll keep you updated.
  14. All existing records will have the timestamp auto updated to the time the column was added. When new records are added that timestamp column will be the time added. You could set that column to zero date (for currently existing records) so only new records get a time stamp. UPDATE tblTraffic SET logged = 0; Then you will know which time to use - the timestamp if non-zero or the time column if timestamp is zero. SELECT TIME_FORMAT(IF(logged=0, time, logged), '%T') as time EDIT: Alternatively, copy the date and time columns' values into the timestamp column
  15. Try this... Add a TIMESTAMP type column to your table `logged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, then use the time portion of this column in your query instead of your current time column. (You don't need to change the INSERT query as it will update itself automatically) $sql = mysqli_query($conn, "SELECT ip , page , CASE WHEN referrer = '' THEN 'N/A' ELSE referrer END as referrer , DATE_FORMAT(date, '%m/%d/%y') as date , TIME_FORMAT(logged, '%T') as time FROM tblTraffic ORDER BY date DESC, time DESC");
  16. I do but we cannot see what you can see. I am not clairvoyant nor am I standing behind you looking over your shoulder at your screen. I don't know your table structure. I cannot see your data. So sometimes there is a need to ask questions in order to give that help.
  17. now you're not being cooperative dude. why make fun of my lack of expertise? i thought you donated your time to help people who were less knowledgeable than yourself..
  18. There will be - you could have had one hours ago but it took you 12 hours and 6 posts to answer that simple question.
  19. ? what about the topic of the thread here? is there a solution?
  20. nope! they are being stored and displayed as: hh:mm:ss. 24 hour format.
  21. The only reference I found was $time = date('h:i:a') in this thread Are you still storing your times as "08:15:pm" despite being told not to?
  22. the data type in the DB field is DATE. I'm using time() nested inside the TIME_FORMAT() function in the SQL statement that adds the records to the database, as I showed in my original post. And that is Berand's code not mine.
  23. thanks for the share this information !! this concept is very use full information in this php coding concept in
  24. Barand

    census bureau

    It should function as posted (at least, it does for me). You should have a "census.csv" file that resembles this... "Hamilton, Oh",3,30000 "Hamilton, Oh",1,25000 "Butler, Oh",1,22000 "Butler, Oh",1,44000 "Clermont, Oh",1,65000 "Clermont, Oh",1,15000 "Clermont, Oh",2,11000 "Warren, Oh",3,20000 "Warren, Oh",1,100000 "Campbell, Ky",2,50000 "Kenton, Ky",8,20000 "Kenton, Ky",4,15000 "Kenton, Ky",4,18000 "Warren, Oh",1,70000 "Warren, Oh",2,100000 ...which gets processed and output by lines 51 -75 (Output table is stored in "$analysis" variable and output in the HTML section - 5 lines from the end)
  1. Load more activity
  • Member Statistics

    • Total Members
      185,586
    • Most Online
      1,581

    Newest Member
    rajksingh
    Joined
  • Forum Statistics

    • Total Topics
      300,763
    • Total Posts
      1,556,972
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.