Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by midnite

  1. forget about the css. just recursive tables with .inner { display: inline; } will course the cells not acting like a table.
  2. oh in fact only <table style="margin: auto"> will works. Not necessary to have <div style="text-align: center;"> Is it true in your browsers?
  3. check this out <style type="text/css">.inner { display: inline; }.inner td { border: 1px solid #000; text-align: right; }.inner td:first-child { color: #F00; }</style><table border="1"><tr><td><table class="inner" cellspacing="0"><caption>table one</caption><tr><td>A</td><td>B</td></tr><tr><td>BBB</td><td>BBB</td></tr></table><table class="inner" cellspacing="0"><caption>table two</caption><tr><td>A</td><td>B</td></tr
  4. Deirdre's Dad, thanks for the trick "margin: 0 auto;" i found "margin: auto;" works also. What is that "zero" for?Thanks Ingolme. i want to make the table centered on the page
  5. in w3schools, i found this: align="left|center|right" - Aligns the table. Deprecated. Use styles instead.Of course i want to use CSS, but CSS seems always not cooperate with me <table border="1" align="center"><tr><td>this can</td></tr></table><table border="1" style="text-align: center;"><tr><td>this cannot</td></tr></table><div style="text-align: center; border: 1px solid red;"><table border="1"><tr><td>this cannot too :(</td></tr></table></div>
  6. midnite

    Table-less layout

    Ricardo Zea, thanks very much!Alright, what i want to achieve is a layout identical to "the Table code".In Firefox2, "the Div code" works well - almost identical to "the Table code".Yet in IE7 "the Div code", there is a problem. The words in the middle block are going out of its border and overlaps the bottom block.
  7. midnite

    <form>'s name

    thanks ragae and justsomeguy. i think i will use the name of the submit button. It is a bit disappointing that the name of the <form> seems to be redundant (or i dont know what it is used for ...?)
  8. midnite

    <form>'s name

    i have several forms with different names. Each with its own submit buttons. But they all send to the same php. Such as: <form name="one" method="post" action="same.php">...</form><form name="two" method="post" action="same.php">...</form> In "same.php", is it possible to retrieve the value one or two? So that i know which form is sending.Thanks!
  9. midnite

    Table-less layout

    Oh, sorry. i said it wrong. It should be: i want the content of the chat to be aligned left at the right block, as the table layout shown
  10. midnite

    Table-less layout

    What i want achieve is: (it is simple. i want the content of the chat to be aligned left at the right block) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>chat</title><style type="text/css">.box { border: 1px solid #000; margin: 7px;}.title { text-align: center; text-decoration: underline; margin: 7px;}.txt td:first-child { width: 280px; text-align: right; vertical-align: top;}</style></head><body><div class="
  11. Hi boen_robot,Ar Ha :: Of course i was asking how did you configure the system such that .wpl can also be processed by PHP. Sorry for my incomplete question :)Is it a good idea to add AddType application/x-httpd-php .php5 .php .js .css? Can i skip the line header("content-type:text/javascript"); after adding .js?And also, i have a concern that some systems/proxy are caching webpages. Normally, .php are regarded as dynamic contents that will never be cached. On contrary, .html or things like .js, .css are most likely to be cached as they SHOULD BE static. So, i guess adding .js to type applicat
  12. midnite

    PIN algorithms

    interestingYet i worry, average's friend is even numbers. And, most likely, even alternate PIN are all even/odd. Will it loss some of variations? If you want to know if it's secure, try to calculate another key with a certain PIN, or calculate another PIN with a certain key.i am not good in Maths. Just hope i can give you some ideas =)
  13. Hi my friend boen_robot,So how can i change the MIME type of the response PHP page? And also where did you change the extension to ".wpl"? Lazy to dig into the docs :)Best,midnite
  14. As long as the quotes are different, escape \ is not necessary. That is, single in double, or double in single, no escape needed, isn't it?Oops i didn't know i can '{$var}'. i will try later =]midnite
  15. Hi Silver,My server was down last night. Probably because of the black Friday (?) :)Thanks for your code and here are my results: (mine is only experimental server. i know it is slow. Just for comparison) <?php/* benchmark.php for PHP5 */$id = 1; $something_else = 'something_else'; $even_something_else = 'even_something_else';$a0 = 'aa '; $a1 = 'aa '; $a2 = 'aa'; $a3 = 'aa '; $a4 = 'aa '; $a5 = 'aa '; $a6 = 'aa '; $a7 = 'aa '; $a8 = 'aa '; $a9 = 'aa ';$start_time = microtime(true);for($i = 0; $i < 40000; ++$i){?><? echo '<span id="', $id, '">', $something_else, ' and ', $eve
  16. Oh yes! You are right. i just have to spend a boolean isset() checking trades of the header() overhead. It should be effectively faster. i should stick to this approach for my future PHP scripts. Thanks Synook!! And also thanks Tanja for this inspiration :)midnite
  17. Thanks Silver,Why not <span id="<?php echo $id; ?>"><?php echo $something_else; ?> and <?php echo $even_something_else; ?></span> Is it the worst? Is it the slowest?Thanks again,midnite
  18. Oh really? So forget about <?= and imagine them as if <? echo. Which is better?
  19. Hi Tanja,As i see in your query, you have an auto-increment field, right?One suggestion to the database design:(Product, amount, price)(the_auto_increment_field, Product, quantity, reserver)If Product isn't an integer. This will be even better:(Product_id, Product_name, amount, price)(the_auto_increment_field, Product_id, quantity, reserver)Oh i see the whole picture of your idea. Here's may be the code you want include "database.php";$gift=mysql_query ("select * from giftlist");if ($_POST[save]) { $reservation = "insert into giftreservation values (null, $_POST['Product_id'], $_POST['quant
  20. Oh? Do you mean even if <link rel="stylesheet" type="text/css" href="mystyle.php?wow=haha&damn=cool" /> (without the .css) will work also?And also, do i have to send back "text/css" header in the PHP script?
  21. Oh it's funny! It's also good to know that i am in the majority.As i know (hope it's right), the founder for SQL are suggesting us to pronounce SQL as "SEQUEL". i'd like to say as "SEQUEL" too. Yet the biggest problem is it will have a confusion with the company "cisco", which is also a computer related firm. So i insist not to say "SEQUEL" and always stick to "S-Q-L", for avoiding confusions and further explanations :)midnite
  22. i dont get what you mean exactly. Do you already have data in your database? My suggested codes above is just for retrieving data from the database. You probably need another script "giftlist.php" to store/update data to your database =)midnite
  23. Oops i really dont know i can use PHP in an external JS file. THANKS A LOT So, is it that we have to<script src="xxx.js.php"></script> ?And also, can we <script src="xxx.js.php?var=data&var2=data2"></script> ?One more thing i wanna ask about JS (which i was wondering since i know JS) <script src="xxx.js">// what to do with the codes i put here??</script> If those are meaningless, why the syntax of JS including external files needs open and close tags, which provides a place in between! See how CSS <link rel="stylesheet" type="text/css" href="m
  24. Do you mean echo '<html> blahblahblah </html>'? If yes, i'd like to know why?And also, i always dont know which is the best, <?= '<span id="', $id, '">', $something_else, ' and ', $even_something_else, '</span>'; ?> or <?= "<span id=\"$id\">$something_else and $even_something_else</span>"; ?> or <span id="<?=$id;?>"><?=$something_else;?> and <?=$even_something_else;?></span>
  • Create New...