Jump to content

MFHJoe

Members
  • Posts

    91
  • Joined

  • Last visited

    Never

Everything posted by MFHJoe

  1. Right. I didn't really think about that before I posted it... Anyway, I think I've found the actual problem now. Checkboxes are not set if they are not checked, and when they are checked they return the value 'on' instead of 1. So this will be why the if statement isnt going through. Use: if (isset($_POST["jschk"])
  2. When you say it's not working, how do you mean? Is it returning the wrong thing? Returning nothing at all? Giving a PHP error?
  3. Could you not just add an else clause to your if statement? <?php $chk = $_POST["jschk"]; if ($chk != '1') { // If the condition is satisfied, the page is redirected and NOT displayed header( 'Location: http://www.mysite.net/mypage.php' ) ; } else { // If the condition is not satisfied, the page is displayed // here. } ?>
  4. I'd just put together a complicated foreach statement to make it work - I didn't know array_combine existed. Good find. Do you just want to get the [en] value from the array you created? That'd just be echo $post["[en]"] Or did I miss the point of that question?
  5. Don't quote me on this, but I think you can't separate WHERE clauses with a comma. I think it needs to be AND. Try this: $sql = "SELECT * FROM accounts WHERE userid = '" . $id . "' AND id = '" . $accountid . "'";
  6. I tend to go for the first one. It's just less files to maintain, and, as far as I know, works just as well. Sometimes there are situations where you need to post to another page, but only rarely.
  7. <?php $str = "[en]news for the site[/en][es]noticias para sitio[/es]"; $arr = preg_split("(\\[.*?\\])", $str, -1, PREG_SPLIT_NO_EMPTY); $en = $arr[0]; $sp = $arr[1]; echo $sp; ?> I'm sure this isn't the most efficient way, but it's a way, and it works. Sort of. It doesn't take into account what's inside the square brackets (so it could be [hello]text[/hello] and it wouldn't make a difference), but it does separate the two languages. PREG_SPLIT_NO_EMPTY just makes it so preg_split doesn't return any blank values.
  8. I tried Coda a few weeks ago, then went back to TextMate pretty quickly. TextMate just seems to suit me better.
  9. You sure $_POST['password'] has a value? Did you submit the form with no password? That could be causing it.
  10. $playerquery=("INSERT INTO player VALUES ('$Surname','$Firstname','$Position','','','','','$previousClub')"); When you listed the fields in your database, did you list them in the order they are in the table? If you did, the above code should fix it (you were trying to put $previousClub into the age field which presumably you have set as integer in the table, and this was causing the error).
  11. The reason you're getting undefined variable errors is because you're asking if $setNav doesn't equal "faq". If, further up in the script, you had made $setNav equal something (for example, $setNav = "nav"), then you wouldn't be getting these errors. What you need to do is add an isset to your if statement. if( isset($setNav) && $setNav == "faq" ) Now it asks: If $setNav exists AND it equals "faq" which should get rid of the undefined variable errors. Although, even so, I'm still not sure your script will work like you want it to. Try out the if statement first though.
  12. Same way you've done the while statement mate. <?php function panelscrollbox() { ?> at the top, and simply <?php } ?> at the bottom. Then just call the function with panelscrollbox();
  13. I know this might sound like a stupid question, but are you sure $_POST['submit'] is being set? Other than that I can't see anything wrong with the rest of your code.
  14. I was just about to say that as well. I've never seen a CAPTCHA on a login form for any website before, including websites like eBay or PayPal, so there must be other ways of deterring bots.
  15. It's called a CAPTCHA. And as far as I know mate, there's not really any reason to put one on a login box. Unless it's to stop people trying to automatically guess passwords with bruteforce scripts. But this could be more easily stopped by just locking the account for 30 minutes after 3 attempts at login had been made.
  16. $newest_user_group[0]['primary_group']; Should be the correct reference then.
  17. $sql = "SELECT group_id FROM group_members WHERE user_id = ". $config['last_reg_user_id'] ." "; $result = $db->query($sql); while($row = $db->fetch_assoc($result)) { $newest_user_group = $row['group_id']; } The above code should assign $newest_user_group the value of group_id you selected from the group_members table. I'm presuming that's what you wanted to do.
  18. Usually that'd be a good idea but not here. $sql is actually in double quotes which allow variables to be used inside them. Without the single quotes, $sql would look like: $sql = "insert into clients values (1, Firstname, Lastname, etc.... Which would result in a mySQL error as the values need to be denoted by single quotes.
  19. Apache modules are pieces of code which extend the main code for Apache. Apache on it's own is a pretty basic server but by including these modules it learns to do other stuff which makes it actually useable. There is a PHP module, it's called php5_module and it's filename is libphp5.so. The reason there's no JavaScript module is because JavaScript is run on the user's computer rather than your server.
  20. Create a file called .htaccess (just .htaccess, no filename) and put the following code in it. Then upload it to the directory you need it to be in. Obviously you'll have to change the oldpage.htm and newpage.htm to your requirements. Redirect oldpage.htm newpage.htm If this isn't what you want, you'll have to use JavaScript or meta tags. Or LemonInflux's method which to be honest is probably the best one so far.
  21. Depends who you buy it with. A big company (Verisign for example) costs about $900 apparently a year. Other less known registrars can be quite a lot cheaper.
  22. I think he does mean JavaScript. Only problem with doing it like that is is, if the user has JavaScript turned off, it'll mess up the whole system.
  23. <span> won't let you center the text because it's not a block element. Using <div> would work though: if (!$_SESSION['firsttime']) { echo "<div style=\"text-align:center; font-size:10; color:#00FFFF; font-weight:bold;\">Welcome</div>"; $_SESSION['firsttime'] = true; } Just saving another question if Pavlos decides to use this way.
  24. I don't think so. But you could use a .htaccess file if you're allowed to use it on your server. That can be used for page redirects as well as lots of other things.
×
×
  • 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.