Jump to content

keeB

Staff Alumni
  • Posts

    1,075
  • Joined

  • Last visited

Everything posted by keeB

  1. Now you do! Stick with it, it's pretty fun, even if there are more elegant languages
  2. Your speculation may be correct. Now it's time to prove it! Use http://us.php.net/manual/en/function.getcwd.php to find out where you are.
  3. I'll teach you a secret that will soon make you a happy developer. Use print! And print_r! They're your friends. I have no flippin idea what's wrong with your code and you can be sure I'm not going to spend the time creating a temp db, and try to debug your script. Let us know the result of this page: <?php if (isset($_SESSION['name'])) { echo "<ul class='login'> <li class='left'> </li> <li>Welcome back ".$_SESSION['user']."!</li>"; mysql_connect("localhost", "domainey_habhub", "pass") or die(mysql_error()); mysql_select_db("domainey_habhub") or die(mysql_error()); $q = "SELECT * FROM useralerts WHERE user='" . $_SESSION[user] . "' AND read='no' "; print $q; // added $result = mysql_query() or die(mysql_error()); print_r($_SESSION); //added while($row = mysql_fetch_assoc($result)) { print_r($row); //added if($row['read'] == no) { echo "You have a questbook entry"; } else { echo ""; } ?>
  4. Still sounds like a php.ini problem. Most distributions have 2 php.ini's. One is for the web and the other one is for the cli. Make sure you're looking at the php.ini for the cli.
  5. I believe you're looking for http://us3.php.net/fseek
  6. if (is_dir($userDir)) { // directory exists } else { echo 'there was an error. let me know about it, etc'; }
  7. sorry, english not my mother language...so, i'm not too sure about what you meant here... is that you meant pconnect is only required when our website using remote database? so, if my website and database reside in the same web hosting, then i have no problem to use normal mysql_connect? pconnect means persistent connection. Basically it means that you're always connected to the DB. The theory being, you limit the overhead of having to create the socket/connection for each request. Considering the types you're having, I don't think you're a likely candidate for the benefits of the persistent connection.
  8. It will capture the HTML of the page. I have an idea: 1. wget the page 2. copy the resulting file to a computer with a window environment 3. open file in browser Did you get what you wanted?
  9. As an aside.. You need to clean up your code. <?php $img_amt = 6; for ($i = 0; $i < $img_amt; $i++) { $img = getRandomFromArray($imageList); echo "<img src=\"$path/$img\" alt=\"Wallpaper Preview\" />"; } ?> Unless, you know, you're silly
  10. Yes. Small projects grow to large projects without rhyme or reason. Writing tag soup PHP pages makes maintenance a nightmare, while writing a proper model has little overhead. There's *zero* reason to not implement a design pattern like MVC. Unless of course you're not writing a website.
  11. How do you plan to use them? I don't see them as useful at all.
  12. If it's similar to Python's then that's still not enough to implement this type of thing.
  13. Nothing is returned in either cases, yes. The argument (that I've heard) is it's better left to documentation since there isn't compilation in to bytecode. Strongly-typed languages rely on there being a 'compile' time. Imagine having to go through 'compile time' every time a script loads. That doesn't make much sense, does it?
  14. Got some code for me to comment on? If not, hush.
  15. The header on your site is way too big. I am on 22" wide screen monitors with Firefox maximized and all I can see is your first entry. Having to scroll down to get content is dumb.
  16. Someone actually went to the link? Oh..
  17. Then I would never get anything answered, as I'd be too busy getting things written 'properly' and arguing with everyone over semantics
  18. Yeah, I was talking about in the context of OOP. I'll be more clear
  19. He's given me a headache. keeB cannot parse. Now I know what my computer feels like when I write code it doesn't understand. It hurts. Be nice to your computer, everyone.
  20. I should never have to instantiate a Model. Your view should do it for me and just provide me what I need in my Templates.
  21. I usually have a BaseDao class which contains the connection to my database. All of my Data(base) Access Objects extend from BaseDao which contains methods like: find(), findUnique(). UserDao (an extension of BaseDao) would defined methods like: getUser(User $person) { $this->findUnique($person); }
  22. In the XSLT world, you would expect a variable and apply it in your template. If you do not know a lot about XSLT I do not consider going that route, as it is fairly complex. Sounds like you have quite the task on your hands. Good luck.
  23. Nope. It is no longer necessary as all variables are now passed by Reference. The definition in Wikipedia: Edit: To pass by value you must do the following (in PHP5) <?php class A{ public $b = "hello"; } $a = new A(); $b = $a; $b->b = "hello from b"; echo $a->b; //prints "hello from b" because it was done by reference. $c = clone $a; $c->b = "hello from c"; echo $a->b; //prints "hello from b" because it was done by reference. echo $c->b; //print "hello from c" because it was cloned.
  24. I just refactored the structure, couldn't care less about the content as that's not the question at hand.
×
×
  • 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.