Jump to content

Lamez

Members
  • Posts

    1,686
  • Joined

  • Last visited

    Never

Posts posted by Lamez

  1. I cannot seem to wrap my head around this. In my database I have a rows filled with information, and one of the columns is pnt, and I want to take the pnt columns for that user and add them together for a total.

     

    I have created a function, here it is so far:

     

    <?php
    function findPnt($usr){ //adds up the points to find the total points for a user in the football pool
    $q = mysql_query("SELECT * FROM `foot_picks` WHERE `user` = '".$usr."'");
    while($p = mysql_fetch_array($q)or die(mysql_error())){
       $tot = $p['pnt'] + $p['pnt'];
    }
      return $tot;
    }
    ?>

  2. haha! a pro would clean there fields to prevent spam1

     

    Use a captcha.

     

    Either that or ask a simple question for the user to answer, "What's 2 + 2?"

     

    YA, but if a bot that was made for this forum, it would know the answer all the time, so it would have to be random.

  3. So it sounds like you enjoy php, and want to create a little project of your own, but you have no motive to create a website. Well you could create a CMS, or Forum, and sell them. You could create all sorts of scripts. You could also try to find something new, and inventive for the web, something that has never been done before. You could make something popular, like myspace, youtube, google, yahoo, and etc. did.

     

    There are some ideas.

  4. ok, I am working on removing images to have a print friendly version of every page on the website.

     

    I have this so far:

    <?php
    //include, and other junk
       if($pf == "yes"){
         $txt = rmImg($line);
         $txt = bb2html($txt);
         echo $txt;
    }
    //some more include, and other junk
    ?>
    

     

    Functions:

    <?php
    function bb2html($text)
    {
      $bbcode = array("<", ">",
                    "[p]", "[/p]", 
                    "[img=", "]", 
                    "[b]", "[/b]", 
                    "[u]", "[/u]", 
                    "[i]", "[/i]",
                    '[br]',
                    "[size=\"", "[/size]",
                    '[url="', "[/url]",
                    "[mail=\"", "[/mail]",
                    "-*", "*-",
                    "[h1]", "[/h1]",
                    '"]');
      $htmlcode = array("<", ">",
                    "<p>", "</p>", 
                    "<img src=\"", "\">", 
                    "<b>", "</b>", 
                    "<u>", "</u>", 
                    "<i>", "</i>",
                    "<br />",
                    "<span style=\"font-size:", "</span>",
                    '<a href="', "</a>",
                    "<a href=\"mailto:", "</a>",
                    " ", " ",
                    "<h1>", "</h1>",
                    '">');
      $newtext = str_replace($bbcode, $htmlcode, $text);
      $newtext = nl2br($newtext);//second pass
      return $newtext;
    }
    
    function title($text){
      $bbcode = array("-*", "*-");
      $htmlcode = array(" ", " ");
    
      $newtext = str_replace($bbcode, $htmlcode, $text);
      return $newtext;
    }
    function rmImg($text){
      $html = array("<img", "/>");
      $replace = array(" ", " ");
      $newtext = str_replace($html, $replace, $text);
      return $newtext;
    }
    ?>
    

     

    However, I have this left:

    src="style/img/pf.png" alt="Print Friendly">

     

    so how would I go about removing the whole entire image tag, not just the <img, and />?

  5. Ok, it uses the name, because the name never changes, and it is less scripting on my end to try to find what bowl_name goes with what id.

     

    Now I am little bit confused by your code. How in the world do I use such a thing? I thought ordering by the ID in a different table would be easier that what you have compiled there.

  6. The website uses text files, that are in a folder. When the text file is not found, it uses the default, home.

     

    so if exist: ?page=warranty, then finds the file that is named warranty and displays it, if it does not it uses the home file.

     

    If you add, &pf=yes, then it removes the style for a print friendly version. Now, I want to know if the site is vulnerable.

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