Jump to content

The Little Guy

Members
  • Posts

    6,675
  • Joined

  • Last visited

Posts posted by The Little Guy

  1. is it possible that it is a turn-off, even if they don't bother to read it?

     

    Yes! Its like watching a TV Show or movie with a long drawn out scene, at some point you just might want to fast forward through it because it is too long, and boring. If you make your page the same as that scene, people will want to pass over it.

     

     

    I really like this guide, it is really helpful in making attractive sites and how to use your explains ways to use your white space.

    http://www.webdesignfromscratch.com/web-design/web-2-0-design-style-guide/

  2. 1. Your home page has way too much information on it, keep it simple.

    2. The color choices are Yellow/Blue don't match too well, I would recommend using http://kuler.adobe.com or something similar

    3. Bigger is better. Bigger text bigger images.

    4. Simple. Make the home page very simple yet still get the point across. Don't throw lots of information in someones face.

    5. Use css3 for some gradients (http://www.colorzilla.com/gradient-editor/) and drop shadows.

    6. Use fun attractive fonts for headers, I use a font on my site called Bebas which always looks nice (http://ryannaddy.com/media/fonts/bebas.ttf)

     

     

    One thing I like to do is go to http://www.templatemonster.com/ and find 3+ layouts that I like and build a nice layout combining the 3+ layouts into one layout with lots of my own ideas.

  3. The easiest way is to place a "Unique" key on the username column, then do an "INSERT IGNORE"

     

    <?php
    $sql = mysql_query("INSERT INTO `users` (`fname`, `lname`, `email`, `username`, `password`, `insert_time`) VALUES ('$fname', '$lname', '$email', '$uname','$password' ,'$date')");
    if(mysql_affected_rows($sql) == 0){
       // Duplicate found
    }else{
       // Success
    }
    

  4. POST was initially meant for: Saving/Updating/Deleting data and GET was initially meant for retrieving data. They are not required for that use though. There is no security difference between the two, as they are both passed as a key/value string split by "=" and each group is split by "&".

  5. @The Little Guy,

     

    That won't work. array_walk() applies the function results to the array elements - i.e. it modifies the variable. It returns either true or false. So, the implode above is trying to implode a true/false as returned from array_walk() - not the actual array. Instead, array_map() would be a more appropriate solution since it returns an array with the modified values. I was also going to suggest just using intval() as the callback function, but by using a custom function it makes it easier to modify as needed later on. But, I would also add a process to remove empty/false values from the resulting array

     

    Ah, yes you are correct, so I modified so it would work.

     

    
    <?php
    function sanitize($array){
       array_walk($array, function(&$val){
           $val = (int)$val;
       });
       return $array;
    }
    
    $userid = (int)$_SESSION["userid"];
    $values = implode(",", sanitize($_POST["imAnArray"]));
    mysql_query("delete from my_table where my_table_id in($values) where userid = $userid");
    ?>
    

  6. It would look something like this:

     

    <input type="checkbox" name="imAnArray[]" value="1" />
    <input type="checkbox" name="imAnArray[]" value="2" />
    <input type="checkbox" name="imAnArray[]" value="3" />
    

     

    <?php
    function sanitize(&$value){
       $value = (int)$value;
    }
    
    $values = implode(",", array_walk($_POST["imAnArray"], "sanitize");
    mysql_query("delete from my_table where my_table_id in($values)");
    ?>
    

  7. What happens when you connect remotely?

     

    Two things I can think of off the top of my head are:

     

    1. Your web server (such as Apache) has anyone (except the localhost) trying to access phpMyAdmin locked out. (This is a good thing)

    2. You haven't granted yourself proper permissions in mysql

  8. After removing all the errors from the code posted:

     

    - CURLOPT_RETURNTRANSFER -- Missing the "F" in transfer

    - Added a check to see if the file exists (not 100% need, but added)

    - Added a comma to the str-replace function

     

    I came up with this:

    <?php
    //accounts
    $file = 'proxy.txt';
    $data = "";
    if(is_file($file)){
    $data = file_get_contents($file);
    }
    $ips = explode("\n", $data);
    $ch = curl_init('http://serverlist.us/index.php?in=17');
    curl_setopt($ch, CURLOPT_REFERER, 'http://serverlist.us...x.php?server=17');
    curl_setopt($ch, CURLOPT_TIMEOUT, ;
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $returned = curl_exec($ch);
    $opt = str_replace('securimage/securimage_show.php', 'http://www.serverlis...rimage_show.php', $returned);
    curl_close($ch);
    echo $opt;
    ?>
    

×
×
  • 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.