Jump to content

yomanny

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by yomanny

  1. EDIT: oops, haku is fast, what he said. - W
  2. When you're printing out the menu, you could throw in an if, just like jcbones suggested: <ul class="nav"> <li class="active"><a>Home</a></li> <li><a href="http://enderbase.com/about.php">About</a></li> <li><a href="http://enderbase.com/contact.php">Contact</a></li> <?php if(!logged_in()) { ?> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Register/Login <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="http://enderbase.com/register.php">Register</a></li> <li><a href="http://enderbase.com/login.php">Login</a></li> <li class="divider"></li> <li><a href="http://enderbase.com/activate.php">Account Activation</a></li> </ul> </li> <?php } ?> </ul> - W
  3. // Example #1 $url = 'http://www.test.com/it/test/'; $new_url = str_replace('/it/', '/', $url); echo $new_url; // Example #2 $url = 'http://www.test.com/test/'; $new_url = str_replace('test.com/', 'test.com/it/', $url); echo $new_url; This, however, relies on the fact that you know the domain name (test.com in these examples). If you want it more dynamic, take a look at Regular Expressions, you can do a lot of interesting text manipulation stuff with it! - W
  4. You're saying your time column is a text field, but it should really be an int since you're using it like this in your query: $check_double=mysql_query("SELECT * FROM t_account WHERE name='$username' AND time>$out")or die(mysql_error()); See the bold? You're trying to ask "Is this text larger than this int" So try set the text column in the database to int and see if that solves your problem! ..and just like DaveyK said, remove the header("location:Vote Link"); or at least move it. - W
  5. Try this: body { background-color: #000; } #container { float: left; width: 100%; background-color: #fff; } .left-box { float: left; width: 200px; background-color: #9C3; } .right-box { float: right; width: 200px; background-color: #FC9; } <div id="container"> <div class="left-box"> Left box 1 </div> <div class="left-box"> Left box 2 </div> <div class="right-box"> Right box </div> </div> - W
  6. First, you shouldn't have the same ID on the two radio buttons, so change them to DoorFrame1 and DoorFrame2 or whatever. Then also send a parameter to the sendRequest() function: Name: <input type="radio" name="DoorFrame" id="DoorFrame1" value="Door 1" onclick="sendRequest(1)" /> Name: <input type="radio" name="DoorFrame" id="DoorFrame2" value="Door 2" onclick="sendRequest(2)" /> In the sendRequest() function, fetch the parameter and send this in the AJAX request instead, then in PHP you can see if it's 1 or 2, and use that to determine what to do. function sendRequest(door) { var DoorFrame = $('DoorFrame').value; new Ajax.Request("test.php", { method: 'POST', postBody: door.serialize(), onComplete: showResponse }); } I thinnnk that should work. - W
  7. I put together a simple example, much like the car form you were talking about: <!DOCTYPE html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>form manipulation</title> <!-- Load jQuery --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> var white_wines = new Array("Auxerrois", "Malvasia"); var red_wines = new Array("Chianti", "Barbaresco", "Rioja"); var type; $('document').ready(function() { //Once the document is ready (loaded), let's populate the wine-list with red wines listWhiteWines(); // When the changes option in the dropdown with ID 'type' $('#type').change(function() { type = $(this).children(":selected").attr("id"); // Check if white or red was selected if(type == "red") { listRedWines(); } else { listWhiteWines(); } }); }); // Function to populate the list with red wines function listRedWines() { $('#wine-list').html(''); for(var i=0; i<red_wines.length; i++) { $('#wine-list').append('<option>'+red_wines[i]+'</option>'); } } // Function to populate the list with white wines function listWhiteWines() { $('#wine-list').html(''); for(var i=0; i<white_wines.length; i++) { $('#wine-list').append('<option>'+white_wines[i]+'</option>'); } } </script> </head> <body> <form> <select id="type"> <option id="white">White wine</option> <option id="red">Red wine</option> </select> <br /><br /> <select id="wine-list"> </select> </form> </body> </html> - W
  8. <?php // Check if the form has been submitted if(isset($_POST['guess'])) { $guess = $_POST['guess']; $secret = $_POST['secret']; ?> <html> <head></head> <body> <?php if($guess == $secret) { // The user guessed right ?> <h1>Correct!</h1> <a href="">Play again</a> <?php } else { // The user did guess wrong, now let's see if it was lower or higher if($guess < $secret) { // The guess was too low ?> <h2>Wrong! The secret number is Higher, try again!</h2> <?php } else { // The guess was too high ?> <h2>Wrong! The secret number is Lower, try again!</h2> <?php } ?> <form action="" method="post"> <input type="hidden" name="secret" value="<?php echo $secret; ?>" /> Guess: <input name="guess" type="text" /> <input type="submit" value="Guess!" /> </form> </body> </html> <?php } } else { // Generate random number $secret = rand(1,10); ?> <html> <head></head> <body> <form action="" method="post"> <input type="hidden" name="secret" value="<?php echo $secret; ?>" /> Guess: <input name="guess" type="text" /> <input type="submit" value="Guess!" /> </form> </body> </html> <?php } - W
  9. You should totally learn a bit of jQuery, using iFrames for basic form manipulation would be madness! This is because you would need the iframes (the pages within the iframes) to communicate with each other, and for that you would probably need an API, and to call the API you would need to learn Javascript anyway. Trust me, it's worth the time it takes to learn jQuery, it's fantastic and you'll be surprised by how much you can do with just a few lines of code. Good luck! - W
  10. Oh, okay, that explains it. Thanks! - W
  11. Hi there, Can't believe I gotta ask this, but how do I change my profile info, such as age? All I'm able to change in the settings area seems to be email and password. Just can't find where to change the rest! - W
  12. I would recommend checking out Zurb Foundation or Boostrap, assuming you know, or are willing to learn, HTML + CSS (you should totally learn Javascript too!). - W
×
×
  • 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.