Jump to content

BrandonKahre

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BrandonKahre's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a table that looks good in FireFox, but not in IE6/7.  Can anyone help me find the IE fix?  I know it has to do with the table.sizingTable's padding. Markup: [code]<table cellspacing="0" class="sizingTable">   <thead>   <tr> <td colspan="5"><img src="/images/sizingcharts/text.swimwear-sizes.jpg" alt="Swimwear Sizing" /></td>   </tr>   </thead>   <tbody>   <tr> <th class="firstcell"></th> <th>Small</th> <th>Medium</th> <th class="lastcell">Large</th>   </tr>   <tr> <td class="firstcell">Waist</td> <td> <small>IN</small> 26-30<br /> <small>CM</small> 69-76 </td> <td> <small>IN</small> 30-34<br /> <small>CM</small> 76-86 </td> <td class="lastcell"> <small>IN</small> 34-38<br /> <small>CM</small> 86-97 </td>   </tr>   </tbody> </table>[/code] CSS: [code]/* Sizing Charts */ table.sizingTable { background: #FFF url(/images/sizingcharts/bg.jpg) no-repeat 0 0; text-align: left; border: 0; padding: 50px 0 20px 50px;  /* IE Error here */ margin: 20px auto; } table.sizingTable thead tr td { padding-bottom: 7px; } table.sizingTable tbody tr th { width: 110px; font-size: 110%; font-weight: 600; text-transform: UPPERCASE; text-align: center; border-top: 2px solid #000; padding: 5px 0; margin: 0; } table.sizingTable tbody tr th.firstcell { width: 80px; border: 0; } table.sizingTable tbody tr td { font-size: 105%; font-style: italic; text-indent: 5px; border-top: 2px solid #999; border-right: 2px solid #999; padding: 5px 0 15px 15px; } table.sizingTable tbody tr td small { font-size: 70%; font-style: normal; } table.sizingTable tbody tr td.firstcell { width: 80px; font-size: 110%; vertical-align: middle; text-align: left; text-indent: 0; text-transform: UPPERCASE; padding: 0; border: 0; } table.sizingTable tbody tr td.lastcell { border-right: 0; }[/code] I played around with my ideas, but I couldn't get anything to work in IE.
  2. I have a unique situation where I need to be able to request a file (a template of my site actually), read it from <body> to <!-- ### ---> (non-inclusive), prase the PHP in between there, and display the results. After I do that I'll need to do the opposite: <!--- ### ---> to </body> My first attempt at this gives me the straight code not parsed as PHP (the page I will be displaying this on, Miva shopping cart software, will not render PHP). I tried to use fopen and fgets. Is there a better solution to this? I would like to avoid having to manually split the two files in half and including them that way, but if I do it that way, it will work. The problem with that is if I make changes to the template for my other pages, I have to manually copy the changes over to the second template pages. Any ideas? Thanks Brandon
  3. Thanks for the tip, here's the results I got back: Now I'm never done a real time test like this before, so I did my best to keep the two conditions as equal as possible.[list][*] select first 40 rows of the table[*] for each row, fetch[*] for each fetch, lookup the designer based on the two methods described above[*] run the fetch through a function that echos out the information in a given manner (identical process for both tests)[/list] for 40 rows: using queries: Ran Analysis in 0.011135 seconds, 0.011551 seconds, 0.01166 seconds using an array: Ran Analysis in 0.007887 seconds, 0.007912 seconds, 0.007984 seconds then I decided to add criteria for the products (in first test there were only 3 designers): this time the query pulled in 5 designers: using queries: Ran Analysis in 0.011026 seconds, 0.011846 seconds, 0.012299 seconds using an array: Ran Analysis in 0.008007 seconds, 0.008027 seconds, 0.007976 seconds still not satisfied, I had it dump the whole products database (191 rows): using queries: Ran Analysis in 0.51082 seconds, 0.53646 seconds, 0.436927 seconds using an array: Ran Analysis in 0.312473 seconds, 0.316537 seconds, 0.398623 seconds I guess that really answers my question. Let me know if I'm skipping something in my testing enviornment. Thanks
  4. I have a function (2 variations): [code]function designer_lookup($designer_code) {     $select = "SELECT `designer_text` FROM `designer_lookup` WHERE `designer_code` = '".$designer_code."' LIMIT 1";     if ($result = @mysql_query($select)) {         $fetch = mysql_fetch_array($result);         return $fetch['designer_text'];     } else {         return (boolean)false;     } }[/code] [code]function designer_lookup($designer_code, $designer_lookup_fetch) {     for ($i=0; $i<count($designer_lookup_fetch); $i++) {         if (strpos($designer_lookup_fetch[$i]['designer_code'], $designer_code) !== false) {             return $designer_lookup_fetch[$i]['designer_text'];         }     }     return (boolean)false; }[/code] The first one obviously looks up the designer_text by the designer_code by making a mysql query and returning exactly what's needed. However, I can use this function 30+ times in a page. My question is, which function would work fastest? Notes: designer_lookup_fetch is a 3d array holding all of the rows and only the two colums (designer_code, designer_text). the designer_lookup table that I query is currently small, and isn't expected to ever rise above 30 rows. Also, I have two other functions that are mirrors of this (querying different tables), but they aren't used nearly as often. Does anyone have any feedback on which function would preform better? Or maybe even another idea completely? My thought is that the first function would obviously become faster (relatively) as the table became bigger.
  5. I am in a situation where I am designing some backend stuff where only a select few people will ever get to use it. This backend will control the products on our website... (using a mysql database) I know that no one with access to this backend will try to be malacious and add code to a string to hurt the site, however, I have never designed a "secure" application, so I'm not confident that a hacker would never be able to get in. Because of this, I'm tempted to use mysql_real_escape_string or a customized function to escape everything that is entered into the database (only the 3 fulltext datatypes really), but I don't really [i]want[/i] to do this because then I have to remember to unescape everything throughout my code. Is there a way to insert safe text, but not have to give it any special treatment later on? I'm worried about <?php code, <script>, and quotes. What is the best practice for this? Bite the bullet and just use real_escape? Also, do another question is, can I assume a varchar(30) is too small for malacious code? Thanks Brandon
  6. VERY cool find! Even if it is a only Mozilla feature.
×
×
  • 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.