Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by terryds

  1. terryds

    What is raw ?

    Can you tell me what raw is ? I heard it's a type like integer, float, etc...
  2. terryds

    Session id

    I'm a little confused about session_id. What is the use of session_id ? Can you give me the practical examples ?
  3. terryds

    Confusing Regex

    I'm so confused about this regex code for URL /\[([^\]]+)]\(([-a-z0-9._~:\/?#@!$&'()*+,;=%]+)\)/i I'm so confused about this.... What i don't understand is this ([^\]]+) Why this have double closing brackets ? Please help me....
  4. What if i install it on localhost ?
  5. I'm so confused in installing vld and other php extensions... :(FYI, i know vld (Vulcan Logic Disassembler) from http://fabien.potencier.org/article/8/print-vs-echo-which-one-is-faster Can you please tell me how to install it ? I'm very new to the LINUX (i think) language... coz i'm using Windows...Please tell me step by step.... (from opening the command-line that i don't know where to open to installing and using that thing)
  6. Hi... I heard that the 'require' is slower than 'include'....But, i don't know how to check their speed..Please tell me how to check the php code speed ....
  7. I found that the mysql connection will be automatically closed when the php script finish executing the code....Is that right ? How to check if the connection is closed or not? Will it close the connection automatically too if i use PHP Data Objects (PDO) too ?
  8. So, What's the importance of using 'WHERE TRUE' ? I see some php-sqlprogrammers use this...
  9. terryds

    Help me on Array

    Look at my code below : PHP <?php// Display search forminclude_once $connect; try{$result = $pdo->query('SELECT id, name FROM author');}catch (PDOException $e){$error = 'Error fetching authors from database.';require $errpg;exit();} foreach ($result as $row) {$authors[] = array('id' => $row['id'],'name' => $row['name']);} try{$result = $pdo->query('SELECT id, name FROM category');} catch (PDOException $e){$error = 'Error fetching categories';include $errpg;exit();} foreach ($result as $row) {$categories[] = array('id' => $row['id'],'name' => $row['name']);} include 'searchform.html.php';exit(); The template <?php include_once $helpers; ?><!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Manage Jokes</title></head><body><h1>Manage Jokes</h1><p><a href="?add">Add new joke</a></p><form action="" method="get"><p>View jokes satisfying by following criteria :</p><div><label for="author">By Author:</label><select name="author" id="author"><option value="">Any Option</option><?php foreach($authors as $author): ?><option value="<?php htmlout($author['id']); ?>"><?php htmlout($author['name']); ?></option><?php endforeach; ?></select></div><div><label for"category">By Category:</label><select name="category" id="category"><option value="">Any Option</option><?php foreach($categories as $category): ?><option value="<?php htmlout($category['id']); ?>"><?php htmlout($category['name']); ?></option><?php endforeach; ?></select></div><div><label for="text">Containing text :</label><input type="text" name="text" id="text"></div><div><input type="hidden" name="action" value="search"><input type="submit" value="Search"></div></form><p><a href="..">Return to JMS home</a></p></body></html> Can you tell me why use $authors[] = array() and $categories[] = array(), not $author = array ???
  10. terryds

    Help me on Array

    What about this ? What does this mean? <?php$var[] = array ('a' => 'b', 'c' => 'd');?>
  11. Have you created the database ? What's the database name, username, and password? And, please code your html/php code here using BBtag [*code][/code] // Remove the * Like this These are my codes
  12. terryds

    Help me on Array

    I'm a bit confused about array... Some people write this $var = array(); Some people write this too $var[] = array(); Please explain me when to use '[ ]' and not to use that....
  13. Hi, guys... Can you tell me what's the difference between SELECT column FROM table WHERE TRUE and SELECT column FROM table And SELECT column FROM table WHERE 1=1 Thanks for any answers
  14. Solved! I found this myself... Use 'Unique' ! ADD UNIQUE 'column'
  15. I'm surprised with that answer... I see that many many web applications don't allow the user to make another account with the same name....Can you tell me how to do that?
  16. I found a PHP snippet that will reverse the magic quotesThis is the snippet <?phpif (get_magic_quotes_gpc()){ $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); while (list($key, $val) = each($process)) { foreach ($val as $k => $v) { unset($process[$key][$k]); if (is_array($v)) { $process[$key][stripslashes($k)] = $v; $process[] = &$process[$key][stripslashes($k)]; } else { $process[$key][stripslashes($k)] = stripslashes($v); } } } unset($process);} And, i heard that magic quote is removed as of PHP 5.4. Is it still needed to put if i use PHP 5.4 ?
  17. Please tell me how to prevent the user from multiple sign upI am i don't want there are the same usernames...Please tell me how to do that, so the id and the username are unique...
  18. Why don't u use padding ? <div style="width:700px;height:100px;padding: 20px 20px 0 20px;background-color:silver;"><div id="week"><div id="sfsf" style="margin: 10px;"> Select Day Of The Week</div></div></div> Do you mean this ?
  19. This is additional style table {margin: 0 auto;} caption {margin: 20px;font-size: 25px;color: #0000FF;}
  20. Hope this useful for you <!DOCTYPE html><html><head><title>Image Gallery</title></head><body><table><caption>My Image Galery</caption><tr><td><img src="http://w3schools.invisionzone.com/uploads/profile/photo-thumb-113531.gif"></td><td><img src="http://w3schools.invisionzone.com/uploads/profile/photo-thumb-113531.gif"></td><td><img src="http://w3schools.invisionzone.com/uploads/profile/photo-thumb-113531.gif"></td></tr><tr><td><img src="http://w3schools.invisionzone.com/uploads/profile/photo-thumb-113531.gif"></td><td><img src="http://w3schools.invisionzone.com/uploads/profile/photo-thumb-113531.gif"></td><td><img src="http://w3schools.invisionzone.com/uploads/profile/photo-thumb-113531.gif"></td></tr></table></body></html> You can change the images and add the row using <tr>...
  21. This code is to change the static line color to red .entry-title {color: #FF0000;}
  22. I'm confused about require and require_once... Could you please tell me the practical example of require_once and require ?
  23. Try this 'client_id' instead of client_id
  24. Hey, i'm confused about position:relative ? What's the difference between position:static if i don't add the top or left or bottom, or right rule ?I often see most web designer use the position:relative without declaring the top,left,etc...Please tell me the difference !
  25. I create a delete button and want it to display a confirming box when a user click the delete button...Can you tell me how to do this ?
  • Create New...