Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by terryds

  1. Can you give me a tutorial about making a download progress bar? Thanks for any answers
  2. It is pointless nesting... I just want to ask what tag i shoud use for semantic form? should i use ul,ol,dl,p , or even wrap in the div?
  3. Look at this one first <tag1> <tag2><label>Name:<input type="text" name="name" id="name"></label></tag2> <tag2><label>Email:<input type="email" name="email" id="email"></label></tag2> <tag2><label>Telephone:<input type="tel" name="tel" id="tel"></label></tag2> <tag2><label>Comment<br><textarea rows="4" cols="60" maxlength="300" name="comment" placeholder="No more than 300 characters long"></textarea></label></tag2> </tag1> Could you please tell me what tag should i use ? I'm thinking of ul,ol,p,div,dl .. But, i don't know which one to choose...
  4. Why should we use <!--[if !IE]><!--> <style> /* table-related media query stuff only */ </style> /* Or an external stylesheet or whatever */ <!--<![endif]--> instead of <!--[if !IE]> <style> /* table-related media query stuff only */ </style> /* Or an external stylesheet or whatever */ <![endif]--> ?
  5. I see that if we want to use html5shiv, we should use : <!--[if lt IE 9]><script src="dist/html5shiv.js"></script><![endif]--> And, i see this snippet on http://css-tricks.com/responsive-data-tables/ : <!--[if !IE]><!--> <style> /* table-related media query stuff only */ </style> /* Or an external stylesheet or whatever */ <!--<![endif]--> I see the conditional 'if' statement appears in a square bracket in the html comment... My questions are 1. Is it actually HTML comment ? I am doubt about it because HTML comment tag should be <!-- comment -->... 2. Will the conditional statement be understood by the browser though it is in the HTML comment ? 3. The second of my example (responsive data table snippet) has a complicated HTML comment... I don't understand what that means... <!--[if !IE]><!--> <!--<![endif]--> 4. Is there any site that gives a tutorial for this case ? I wonder if there are more statements that can be put in HTML comment... Thanks for any answers....
  6. terryds

    Scrambled website

    I see a tutorial about designing a website using html5 and css3 at http://www.pvmgarage.com/2010/04/touch-the-future-create-an-elegant-website-with-hmtl-5-and-css3/ Then i see the demo at http://www.pvmgarage.com/downloads/portfolio/ But, the screenshot of the template in the tutorial isnt the same as the demo.... The demo template is so scrambled... And, i see the comment in the HTML code.. It says that it is useful to create 960px limit. Can you tell me how to make it?
  7. Can you tell me how to reorder id column ? For example , my id column contains : 1 4 9 15 Can you tell me how to make it: 1 2 3 4
  8. Actually, i want to make an upload loading page.. So, i want the notice like 'Please wait, your file is being sent to the server', then after the upload finishes loading, it will say 'Your file has been uploaded'.. Can you tell me how to make it ? It uses output buffering,right?
  9. Here is my code <?php ob_start();?><!DOCTYPE html><html><head><title>Output Buffering</title></head><body><p>I'm the first to load</p><?php ob_flush();sleep(2) ?><p>I'm the second to load after 2s</p><?php ob_end_flush();sleep(2); ?></body></html> When i load the page, the two paragraph loads at the same time... What i want is that the first paragraph come first, and right after 2 secs, the second paragraph appears.. Can you tell me how to fix that?
  10. What if i use interface? <?phpinterface Pet{protected function happy();protected function angry();protected function isSpoiled();} And then, i implement the dog class and the cat class.... So, what's the difference between interface and abstract class ?
  11. Can you explain me about abstract classes?
  12. What's the difference between abstract classes and interface in PHP ? I'm a bit confused about abstract access control...
  13. I have a question on bitwise operators Are there any differences between $a ^ $b and $a & ~$b ?
  14. terryds

    PHP Line Break

    How to add a line break in PHP elegantly ? Should i use n , or <br> or <br>n ?
  15. What's the difference between function &return_fish() { $fish = "Fish"; return $fish; } $fish_ref =&return_fish(); And function return_fish() { $fish = "Fish"; return $fish; } $fish_ref = return_fish(); I see that the first one is returning by reference... But, i don't understand what 'returning by refence' means... I'm sorry i'm not so good at English Can you give me an example to show that they are different ?
  16. terryds


    I want to download the earlier version of WordPress.. Then, i see the word 'md5' there So, i click http://wordpress.org/wordpress-0.71-gold.zip.md5 , it gives me md5 codes.. What i don't understand is.. What's the use of MD5 for a file ? Can you tell me what's the advantage of using MD5 to calculate a file?
  17. Can someone explain me about bitwise operators for error reporting ? I've slightly understood about bitwise operators for numbers (http://www.litfuel.net/tutorials/bitwise.htm) But, What i don't understand is how to use it for error reporting? What will the symbol ^ , ~ , &, | mean ?
  18. I'm thinking of measuring the character length using strlen(), and, if it's more than 300 characters, cut the string using substr(), then, add a link that will set $_GET['more'], and when the $_GET['more'] is set, it will return the string ...
  19. terryds

    Custom Exception

    Umm... But, the code didn't work as what i want, it gives me 'aaaa' not as what i want : <?php class MyPDOException extends Exception { public function __construct($msg, $code=0) { parent::__construct($msg, $code); } public function __toString() { return __CLASS__ . ": [{$this->code}]: {$this->message}"; } } try { throw new MyPDOException('aaaa',2013); } catch (MyPDOException $e) { echo $e->getMessage(); } Can you tell me how to make it work so i can throw MyPDOException : [2013] : aaaa ?
  20. terryds

    Custom Exception

    thank you so much, ingolme and astralaaron... you've helped me a lot
  21. terryds

    Custom Exception

    How to make a custom exception class ? <?php class MyPDOException extends Exception { public function __construct($msg, $code=NULL) { $err = $msg; if (isset($code)) { $err .= " Error code: " . $code; } return $err; } try { throw new MyPDOException('aaaa'); } catch (MyPDOException $e) { echo $e->getMessage(); } But, when the script is execute, it gives me a blank page, not 'aaaa' .... Can you tell me how to make custom exceptions so it can work properly?
  22. What's the difference between returning null (with no value) or return FALSE ? I'm a bit confused about which to choose... Can you give me the implementation of those two and explain the essential to me?
  23. That's the same result ! i've tested it ! Yay ! I get the deal! The PDO::FETCH_BOTH sets the pdo fetch method... so when we fetch the queried sql, it will use PDO::FETCH_BOTH
  24. I found this in someone's code $query = $this->db->query($string, PDO::FETCH_BOTH); The query statement there is using PDO::FETCH_BOTH... What i know that we use PDO::FETCH_BOTH in fetch statement only.... Can you tell me the use of it? Does it fetch the queried string directly ? But, i do a test, then i see nothing's special try { $sql = 'SELECT * from author WHERE 1'; $s = $pdo->query($sql, PDO::FETCH_BOTH); } catch (PDOException $e) { echo "Error"; exit(); } var_dump($s); It shows up like this : object(PDOStatement)[3]public 'queryString' => string 'SELECT * from author WHERE 1' (length=28) So, what's the deal of using PDO::FETCH_BOTH in a query statement ?
  25. I wonder how plugins work on CMS... Can you give me a bit illustration ?
  • Create New...