need help with start.php

Discussion in 'PHP' started by byllan, May 1, 2012.

  1. #1
    Hello i would need help to add comments with spam protection. and rate as you can see with the stars red is unrated and yellow is rated! And all links who have been rated will get be placed in some file named favoriter.php
    And + Ja means show all the links with red image. Nej mean hide all links with red images and only show the greens.

    3.imgland.net/7F2is.jpg

    apelsinen.com/?p=start

    pastebin.com/yJq0jMhS

    start.php
     <center><b>The Links</b></center><br><table width="400" border="0" align="center" cellpadding="3" cellspacing="1"><tr><td><strong><h3>WARNING!<h3>Those who have <img  src="images/filter/red.png" width="10" height="10">at  the links may contain pornography or anything that is not appropriate for less! YOU LOOK AT YOUR OWN RISK!</strong></td></tr></table><br>Do you want to hide all red links and just see the normals? <select name="linktype">  <option value="y">Yes</option>  <option value="n">No</option>  </select>  <input type="submit" value="Update"><br><br><table><tr><th  scope="col">Type</th><th  scope="col">Link</th><th  scope="col">Filter</th><th  scope="col">User</th><th scope="col">Date</th></tr><?php
    $date = date('Y-m-d');$link_table = "";$updaters ="";$comments ="Comments:0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";$rate ="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img  src='images/rate/notrated.gif' width ='23'>";$clicks ="Clicks:0";$updaters = array();$sql  = "SELECT `upp_links`.`link`, `upp_links`.`besk`, `upp_links`.`date`,  `upp_links`.`type`, `upp_links`.`click`, `upp_links`.`filter`,  `upp_links`.`cat`, `users`.`user`, `upp_links`.`updater_id`,  upp_links.id FROM `upp_links`, `users` WHERE `upp_links`.`tipsare` =  `users`.`id` AND `upp_links`.`date` = '{$date}' ORDER BY id DESC";//$sql = "SELECT * FROM `upp_links` ORDER BY `upp_links`.`date` DESC LIMIT 0 , 30";//$sql = "SELECT * FROM `upp_links` WHERE `id` = 1 AND `date` = \'2012-04-19\' LIMIT 0, 30 "; $result = mysql_query($sql);while($rad = mysql_fetch_array($result)){$type = $rad['type'];$cat = $rad['cat'];$updater = $rad['updater_id'];$link_id = $rad['id'];if ($rad['filter'] == false)        {        $filter = "images/filter/green.png";        }        else        {        $filter = "images/filter/red.png";        }$query = mysql_query("SELECT * FROM upp_links WHERE id='{$link_id}'");$row = mysql_fetch_array($query);
    $link_table  .= '<tr><td><img  src="'.$type_nr[$type].'"</td><td><a  href="/pages/out.php?id='.$row['id'].'" id="start_link"  target="_blank">'.$rad['besk'].'</a><br>'.$comments.'Klick: '.$row['click'].''.$rate.'</td><td><img  src="'.$filter.'"  width="10"height="10"></td><td>'.$rad['user'].'</td><td>'.$rad['date'].'</td>';if (empty($updaters[$updater])){ $updaters[$updater] = 0;}$updaters[$updater] = $updaters[$updater]+1;
    }foreach ($updaters as $key => $value) {$sql = "SELECT `user`, `id` FROM `users` WHERE `users`.`id` = {$key}";$result = mysql_query($sql);if (!$result) { die('Invalid query: ' . mysql_error()); }        while ($rad = mysql_fetch_array($result)){                        //var_dump($rad);        echo $rad[1] . "::" . $rad[0] . "<br><br>";        }        //echo $value;}// Visa vilka som uppdaterat och hur många//var_dump($updaters);//echo $updaters;echo $link_table;?> </table>
    
    PHP:

     
    byllan, May 1, 2012 IP
  2. Northize

    Northize Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    When you post code like this, make sure it actually doesn't hurt your eyes while reading it. I'm quite sure no one will read through that code. Please use paste bin to show your code if it's long.
    Och förresten, skriv alltid din kod i ett & samma språk, dvs blanda inte in någon svenska ;)
     
    Northize, May 1, 2012 IP
  3. byllan

    byllan Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Lol i post the whole code it's the forum who make the code like this! that's why i post it in pastebin too!
     
    byllan, May 1, 2012 IP
  4. webxtech

    webxtech Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i am Start now Php What Don't know about . So Please tell me about her Coding to start. I am Very very happy To know this .
     
    webxtech, May 3, 2012 IP