Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Posts posted by nogray

  1. I haven't worked in PS 7 in a long time, but it has the same tool for slicing comps.

    You need to create slices using the slice tool (these will be saved as images in table cells)

    [center][img]http://www.nogray.com/slice.gif[/img][/center]

    The click on File->Save for Web

    Optimize the images and click save.

    That should do it.
  2. I assume the $row[0] will return the ID, or you can use $row['You ID field here'] instead

    Try the code below, hope it helps
    [code]
    <?php

    $query = "SELECT * FROM category";
    $result = mysql_query ($query);

    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
        $main_cats .= "<option value='".$row[0]."'>".$row[0]."</option>";
        
        $query1 = "SELECT * FROM subcategory WHERE maincatid = '".$row[0]."'";
        $result1 = mysql_query ($query1);
        
        $sub_arrays .= "subs[".$row[0]."] = new Array(";
        
        while ($row1 = mysql_fetch_array($result1, MYSQL_NUM)) {
            $sub_arrays .= "\"".$row1[0]."\",";
        }
        $sub_arrays = trim($sub_arrays, ",") .");\n";

    }

    ?>

    <html>
    <head>
    <script language="javascript">
    var subs = new Array();

    <?= $sub_arrays ?>

    function fill_subs(val){
        if (val != ""){
            var sub_sel = document.getElementById('sub_select');

            sub_sel.innerHTML="";
            opt = document.createElement("OPTION");
            opt.value = "";
            opt.innerHTML = "Select";
            sub_sel.appendChild(opt);
            
            for(i=0; i<subs[val].length; i++){
                opt = document.createElement("OPTION");
                opt.value = subs[val][i];
                opt.innerHTML = subs[val][i];
                
                sub_sel.appendChild(opt);
            }
        }

    }
    </script>
    </head>
    <body>
    <select onChange="fill_subs(this.value);">
        <?= $main_cats ?>
    </select>

    <select id="sub_select" name="sub_select">
        <option value="">Select</option>
    </select>
    </body>
    </html>
    [/code]
  3. If you script is live and the subject line and the to address is taken from the form directly, you'll need to clean before using it in the mail function.

    spammers have robots that can fill forms automatically and send mass emails from your server by injecting the headers in your mail (using the subject and the to lines).

    You can go to [a href=\"http://www.securephpwiki.com/index.php/Email_Injection?seenIEPage=1\" target=\"_blank\"]http://www.securephpwiki.com/index.php/Ema...on?seenIEPage=1[/a] for more details.
  4. you can do something like this
    [code]
    <script language="javascript">
        function create_element(){
            var form_tbody = document.getElementById('form_tbody');
            var n_tr = document.createElement("TR");
            var n_td = document.createElement("TD");
            var n_input = document.createElement("INPUT");
            
            n_input.name = "input_name";
            n_input.id = "input_id";
            n_input.type = "text";
            
            form_tbody.appendChild(n_tr);
            n_tr.appendChild(n_td);
            n_td.appendChild(n_input);

        }
        
    </script>

    <table>
        <tbody id="form_tbody">
            <tr><td><input type="text" /></td></tr>
        </tbody>
    </table>
    [/code]

    Just remmeber that you need to tbody if you are using tables.
  5. There are a lot of factors when it comes to filtering email.

    It depends if the email in the Junk folder or the inbox. If the sender in a black list, or not, the IP address of the sender, the headers, the format of the message.
    In your message, try to add
    [code]
    <html>
    <head>
    <title>Message</title>
    </head>
    <body>

    YOUR Message

    </body>
    </html>
    [/code]

    Even though everything above the body tag get stripped, this should lower the spam filter points.
  6. It depends how you set it up, but the easiest will be something like this
    [code]
    <table>
    <tr id="hidden_field_tr" style="display:none;">
    <td><input type="text" /></td>
    </tr></table>

    <button onclick="document.getElementById('hidden_field_tr').style.display='';">Show</button>

    <button onclick="document.getElementById('hidden_field_tr').style.display='none';">Hide</button>
    [/code]

  7. This should be just one line of JS, and always use document.getElementById() when you accessing objects in JS.
    [code]
    <input type="checkbox" id="tos" name="tos" onclick="document.getElementById('signed').disabled = this.checked;" /><br />
    <input type="submit" id="signed" name="signed" value="submit" />
    [/code]
  8. You can use PHP to get the image size and print out the correct size.
    [code]
    <?php
    list($width, $height, $type, $attr) = getimagesize("img/flag.jpg");
    if ($width > 175) $width=175;

    echo "<img src=\"img/flag.jpg\" width=\"$width\" />";

    ?>
    [/code]
×
×
  • 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.