Jump to content

MrXHellboy

Members
  • Posts

    153
  • Joined

  • Last visited

    Never

Posts posted by MrXHellboy

  1. Ok back to the issue... You use html_entity_decode() to translate special chars back to their characters, and with this they lose their special meaning in HTML like <b>Indeed</b>

     

    In this case, prevent that the script will put the data into the DB with already html entities. Just like you would write something down, it has to go in the DB.

     

    From there you must translate.

     

     

  2. Remove this:

    if (!get_magic_quotes_gpc()) {        $name = addslashes($name);        $comment = addslashes($comment);    }
    

     

    replace with

    $name = mysql_real_escape_string($name);
    $comment = mysql_real_escape_string($comment);
    

     

    This function will put slashes \ before quotes and other characters which needs to be escaped. This function is also useful against SQL injection attackes.

     

    Your insert into query is OK. In which tables will the comments be placed ?

    Or nothing at all ?

     

    Check the name of the table once more, just to be sure.

  3. First of all, remove the die() function over there. It will scare your visitors away. It makes no sense at all when you halt the execution of the script because one of the fields was empty.

     

    Second of all,

    remove this part

    if (!get_magic_quotes_gpc()) {        $name = addslashes($name);        $comment = addslashes($comment);    }
    

     

    TThis will mess up your DB fields......

     

    Use mysql_real_escape_string() instead.

     

     

     

    Please post your whole page and the exact problem once more as i dont get what you want

  4. I don't have your txt file but try this:

    <?php
    preg_match('/<td\s+width="60%"\s+class="dataRegularUlOff">Price<\/td>\s+<td\s+width="40%"\s+class="dataRegularUlOff">(.*?)<\/td>/si', $work, $matchesarray);
    print_r($matchesarray[0]);
    ?>
    

  5. 1) Check if the name already exists by a select query...

    2) Append a string to the username

    Something like this

    $ID = mysql_query("SELECT id FROM members WHERE name = '$name' ");
    
    if ($ID)
    {
    $name = $name.'suffix';
      mysql_query("INSERT INTO members (name) values ('$name')"); 
    }
    

  6. I see nobody has replied yet, so i will take a shot...

     

    Are you using Windows or Unix variants or Linux ? Probably it has to do something with the rights..

    Check and alter the permissions

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