Jump to content

NotSunfighter

Members
  • Posts

    63
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by NotSunfighter

  1. Not having the derived contents of devi1 and devi8 it's impossible go any farther. Can you run this and post the results in html/js only?
  2. In your rotdeviation() function: This line var ct = $("#devvin1").data("term") || 0; has amisspelling too many v's.
  3. For starters change the <? to <?php (4 places) and see if things clear up. If not come back and somebody is sure t help.
  4. The 'required' attribute will do the same thing. Why use JS?
  5. Your problem is in the reset4.php file remove both of these line: header("Location: test2.php"); exit; The problem you started with is the file test2.php - your running this instead of reset4.php
  6. @williamh69 Next time you make a table remember to use <td> not <div> and You need a <tr> in there if($count ==0) { echo"<tr>"; } should have been just echo "<tr> No if. and <table border='0' align='center' cellpadding='2' cellspacing='2' width='70%'> Is totally out of date and wrong.
  7. Your HTML <table> is messed up. Your missing </tr> tags and using a table in a table is not the way to go when what you want can be done using css tooltips. If you run your code for a simple query and post the html resulting and explain it, I or someone else could give you the needed table code. Also tell us where the cursor is to get the output.
  8. And I'd remove objects from the array like this <?php $cart_items = array("pants"=>"3", "shirt"=>"4", "shoe"=>"5", "banana"=>"13", "hat"=>"1"); if (($key = array_search('4', $cart_items)) !== false) { unset($cart_items[$key]); } foreach ($cart_items as $item => $quantity){ echo "Item name is ".$item." and he wants this amount ".$quantity."\n"; } ?>
  9. It looks to me that your making things harder than they should be. Here's what I would do for a cart array: <?php $cart_items = array("pants"=>"3", "shirt"=>"4", "shoe"=>"5", "banana"=>"13", "hat"=>"1"); foreach ($cart_items as $item => $quantity){ echo "Item name is ".$item." and he wants this amount ".$quantity."\n"; } ?>
  10. What cyberRobot said and I'm not happy with the script the way it is because somewhere you need to be loading HTML for it to work and what I'm about to do does not take that into consideration: <?php if(isset($_POST['login'])){ if(isset($_COOKIE['login'])){ if($_COOKIE['login'] < 3){ $attempts = $_COOKIE['login'] + 1; setcookie('login', $attempts, time()+60*10); }else{ /* Please note this is an ECHO while your using echo"<script>alert()</script>"; below */ echo 'You are banned for 10 minutes. Try again later'; die; } }else{ setcookie('login', 1, time()+60*10); die; } /* I have include the rest of this so you have a formatted cody */ $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>"; } } ?>
  11. I don't see how your uploading anything. Not saying that your not, I haven't tried doing this on a site to check. But you may be better off scraping the DIV heavy code you now have for some thing else. Copy/Paste this code pen and adjust your PHP to match: file upload - simple JS PS- It is considered BAD manners to ask a question in two forums the same day. Ask in one and wait a day or two before going to a new forum.
  12. I know this is old, but for people coming and read this - position sticky works depending where the element is in the page hyrachy. To stick a div to the body coordinates That div MUST exist in the body and not in another div. so <body> <div class="navigation">Hello</div> will work, but <body> <header> <div class="navigation">Hello</div> will not.
  13. The fact that they're a number of plug-ins that do what you want is a good indication that you could code one yourself, but if you don't want to reinvent the wheel you could try one. This gets high ratings: https://wordpress.org/plugins/instagram-feed/
×
×
  • 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.