Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. Can you see your error once you put it inside code tags w/highlighting? <?php $curnum = 0; $username = $_POST['username']; $password = $_POST['password']; $gender = $_POST['gender']; $byear = $_POST['birth_year']; if(!$username) { $curnum ++; echo "<tr><td>".$curnum.". Please enter a username.</td></tr> } ?> (the missing "; at the end of the echo statement) PS - next time use code tags please
  2. I think its similar to this concept (you pay for a chunk of pixel grid space to place your company's logo for instance). Sorry to the mods/admin, not trying to 'advertise' that link's service or anything.. just for illustrative purposes. Haha, just don't do it as bad as them:
  3. Philip

    IE8

    Wow, they are full of shit
  4. wow people still go for that sort of thing? Second that - I thought that was a 90's thing?
  5. You probably think you're the pornstar profile right?
  6. http://www.phpfreaks.com/forums/index.php?action=stats Bottom of the page will show hits and general stats.
  7. Because thats javascript not php??
  8. Take a look at: Less than or equal is <=
  9. Same, and jiggling the wire would fix it - turned out there was the connection on the monitor had gone bad.
  10. It is because your query failed. Do you need to edit the column or table names?
  11. Or, using foreach (which was built for arrays): foreach($array as $key => $value) { echo $value,'<br>'; }
  12. Not to my knowledge - you can't define what key to search in.
  13. You could always write a custom foreach statement. I don't think there is a built in one key search. I threw this together for you: <?php /* -- Params: -- Search item, -- Array to search in, -- Key to search in, -- value to return */ function search_key($needle, $haystack, $skey, $rkey) { foreach($haystack as $k=>$v) if(is_array($v) && isset($v[$skey]) && $v[$skey] == $needle) if(isset($v[$rkey])) return $v[$rkey]; else return true; return false; } // Setup the array $array = array ( array('name'=>'tom', 'age' => 1), array('name'=>'dick', 'age' => 2), array('name'=>'harry', 'age' => 3), ); // See what you have echo search_key(2, $array, 'age', 'name'); // prints 'dick' ?>
  14. I saw this today and found it appropriate for this thread. http://www.collegehumor.com/video:1909386
  15. No its not needed, unless you wanted to do something different like show an error message. If you just want it to load a default page the code above will work fine.
  16. To avoid a notice (undefined index) check to see if they even have the page in the url. $pages = array('home','scripts','media','archives','contact','about'); $page = (isset($_GET['page']) && in_array($_GET['page'],$pages)) ? $_GET['page'] : 'home'; if($page) { require('./pagecontent/'.$page.'.php'); } Also, I put in 'home' as the default if it isn't in the array or not selected, but you could always change that to another page.
  17. To extend Maq's reply: range()
  18. If you're running apache, it's called mod rewrite. http://www.workingwith.me.uk/articles/scripting/mod_rewrite
  19. I second that.
  20. Yeah, thats another point. It's also configurable on the user's end to have target="_blank" open in a new window, or a new tab.
  21. You want PHP to open a new tab on a browser? Not possible, it needs to be done with JS/HTML.
  22. But that 4% may not be their audience. Let's say I have a online shop aimed towards the geekier side (e.g. thinkgeek.com). More of your audience is likely to have js/flash because they are more aware of the technologies - thus that 4% would drop to maybe 1% or less. Now, let's say I have an online shop aimed towards the elderly. I'm less likely to use fancier/complicated scripts/designs because that's not who my audience is. You want something more straight forward because hell, if they are anything like my grandparents they are still running WinXP with IE 6. Lets face it, the odds of them having js/flash enabled and having a computer to support it is a lot smaller than the tech-based part of society. It's not necessarily about the technology & whats the newest and best at the time, it's about how you implement it into your website as a strategy based off of your audience. @OP - sorry for getting us off your original topic
  23. Because variables in single quotes are not parsed like double quotes. // Will not work: echo '$var'; // Work work: echo "$var"; echo $var;
  24. It could be for something like the "newest members" or "recent posts" - not just for manual increments to an ID
×
×
  • 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.