Jump to content

merkont

New Members
  • Posts

    2
  • Joined

  • Last visited

merkont's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, Wrote I quick script to filter results from database. It kinda works but not sure if this is best or even secure way to do it. I know mysqli has function 'bind_params', but failed to make it work. <form action="" method="get"> <input type="checkbox" name="data" value="3" /> <input type="submit" /> <?php if( empty($_GET['data']) ) { die("GET empty"); } $mysqli = new mysqli('localhost', 'user', 'password', 'database'); $statement = "SELECT * FROM table1 WHERE id=" . $_GET['data']; $result = $mysqli->query($statement); while( $row = $result->fetch_assoc() ) { echo $row['id']; echo "<br/>"; echo $row['text']; if ($row['img'] != NULL) echo "<img src=" . $row['img'] . " > "; } ?> So just basic checkbox interface, when selected one of checkboxes and submitted, script queries database with matching ID from GET, returns results and loops through them. Inside loop checks for associated image src, if not present ignores field. I want to use this fucntions logic in my project but not sure if secure nor best/easiest way to do this. Obviously will improve interface, naming of variables etc.
  2. Hey, I'm not sure what is official name of this kind of site which gathers data from another websites and displays data on one site -- probably with search functionalities and nice interface. If I'm not wrong it is called mashup -- but anyways. I wan't to gather ads from 8 sites and put them on my site. I think I need crawl those sites I'm interested in, parse gathered data and display it. But I'm not sure at all about anything and I really want to do everything by myself from zero but need some guideline how to proceed with project.
×
×
  • 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.