Search the Community
Showing results for tags 'show'.
-
I have a simple setup where I have a collapsed menu. When you click on the button, it will open a menu. If the menu is already opened and you open another menu, the previous menu will collapse. All that works. The only thing I noticed is that It will not collapse the opened menu if I click the same button. That menu will only collapse if I open a different menu. I was wondering how the code below will look with that extra function added? Here's the code for that. <h5 class="mobile-collapse__title">Title Button</h5> <div class="mobile-collapse__content"> <ul> <li>list 1</li> <li>list 2</li> <li>list 3</li> </ul> </div> <script> $(document).ready(function($){ $(".mobile-collapse__title").click(function(e) { e.preventDefault(); $('.mobile-collapse__content:visible').hide(); $(this).next('div.mobile-collapse__content').show(); }); }); </script>
-
I have this code: checkbox : function(elem) { $(function() { var isChecked = elem.checked, $check = $(this).val(), $address = $('.'+ elem.id); $image = $('.imagenone'); if(isChecked) { $address.stop().fadeIn("slow").css("display","inline-block"); $image.stop().fadeOut("slow").css("display","none"); } else { $address.stop().fadeOut("slow"); } }); } I need check if id of "$address"(class) displayed, not display other div with same id. I have a "query" which lists all the "rows" of the table, each "row" has a sub-category and associated product, which in my case the sub-category is the class and id is the product. but for different sub-categories can have the same product, not wanting to give the same id / product appear in duplicate. the problem is that there are only checkboxes for sub-categories, where the purpose is to create a filter. where all products with this sub-category, choosing more than one sub-category to check the sub-category appear. In different sub-category may contain the same products, just wanting to appear only once, and not repeated, ie not appear divs with the same id (same product) in duplicate. Structure Product List - http://s30.postimg.org/p0j37jl01/coding.jpg ps: sorry my bad english !
-
Hello There. My name is Andreas. Well I have begin coding and come to the part at my menu where the username should be in my menu. I have a login form and it look like this: <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; if ($username&&$password) { $connect = mysql_connect("localhost","root","") or die ("Could not connect to MySQL Host"); mysql_select_db("host") or die ("Cound not find MySQL Database"); $query = mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); if($numrows !=0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } if ($username==$dbusername&&$password==$dbpassword) { header ("Location: http://localhost/Host/index.php"); $_SESSION['username']=$dbusername; } else echo "Incorrect password"; } else die ("That username does not exists"); } else die ("Please enter a username"); ?> But when I use this php code in my menu: <?php if ($_SESSION['username']) { echo "<li><a href='#'><span>$_SESSION['username'];</span></a> <ul> <li><a href='client/account/logout.php'><span>Logout</span></a></li> <li><a href='client/account/profile.php'><span>Profile</span></a></li> </ul> </li>"; } ?> But i get a error in the session section and I know its something with the $_session code. But I dont know what to type in between the <span> and </span>. This is the image I get in Adobe DreamWeaver:
-
MYSQL version: 5.5.24 I've got a problem. For my project in a class I want to show the characters of the person who is currently logged in. I get it to show every character in the database "characters" but not the logged in. I've tried to put this code in the WHERE but it will just ignore it and all of the other code jsut gets commented away when I do the "" to make it visible (in php) a friend of mine have written a C++ program that does this exact same thing altough I don't get it to work. So my question is what should I put in the WHERE to get the characters.name of the "current user" I've thought of making the: WHERE accounts.id = " . htmlentities($_SESSION['username'] ." Altough these two " makes so the rest of the code gets commented away and I've tried to put an extra " but nothing happens and I need the two " too make the htmlentities correct. I know this is both PHP and MYSQL but since it's the SQL part I need help with I put it here. If any admin see this as the wrong place to have my post please move it in that case or tell me to redo it at the right place
- 8 replies
-
- help
- show current users characters
-
(and 2 more)
Tagged with:
-
Hi all, Okay, I'll try to explain briefly but thoroughly on what I'm trying to do. FYI I have a general working knowledge of PHP & mySQL, and use Dreamweaver and it's built-in tools regularly. I have a registeration form, which gives the option to register into 4 age groups (via a radio button), which just submits as text into the database. What I am looking to be able to do is "Show If" (I think?) a disabled="true" to disable a radio button, once a certain amount of records have been submitted for a specific group. So I'm assumming the way to do this is to call up the full list from the database (not very many entries) and check if the limit of 15 per age group is reached? Let me know if that makes sense, any if you can give me any guidance. It will be much appreciated! Also, if you have the time to explain your coding to me too, so I can learn from it, that would be great! --EVP
- 1 reply
-
- show
- conditional reigon
-
(and 2 more)
Tagged with: