Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <?php
  2. mysql_connect("localhost", "root", "");
  3. mysql_select_db("front");
  4. $submit=$_GET['str'] ;
  5. $sql = mysql_query("SELECT * FROM searcengine WHERE pagecontent LIKE '%$_GET[$submit]%' ");
  6. while($row=mysql_fetch_array($sql)) {
  7. echo "<img src=image_2.php?pagecontent=".$row['pagecontent']." />";
  8. }
  9. ?>
  10.  
  11. <?php
  12. ini_set('display_errors',1);
  13. error_reporting(E_ALL);
  14. $conn = mysql_connect("localhost","root","");
  15. if(!$conn)
  16. {
  17. echo mysql_error();
  18. }
  19. $db = mysql_select_db("front",$conn);
  20. if(!$db)
  21. {
  22. echo mysql_error();
  23. }
  24. $pagecontent = $_GET['pagecontent'];
  25. $q = "SELECT pageurl FROM searchengine where pagecontent='$pagecontent'";
  26. $sql = mysql_query("$q",$conn);
  27. if($sql)
  28. {
  29. $row = mysql_fetch_array($sql);
  30. header("Content-type: image/jpeg");
  31. echo $row['pageurl'];
  32. }
  33. else
  34. {
  35. echo mysql_error();
  36. }
  37. ?>
  38.  
  39. <?php
  40. $con=mysqli_connect("localhost","root","","front");
  41. // Check connection
  42. if (mysqli_connect_errno())
  43. {
  44. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  45. }
  46. $submit=$_GET['str'] ;
  47.  
  48. $sql="SELECT * FROM 'searchengine' WHERE 'pagecontent' = '%$submit%' ";
  49.  
  50. if ($result=mysqli_query($con,$sql))
  51. {
  52. // Fetch one and one row
  53. while ($row=mysqli_fetch_assoc($result)) {
  54. echo "<img src=image_2.php?pagecontent=".$row['pagecontent']." />";
  55. }
  56.  
  57. }
  58. mysqli_close($con);
  59. ?>
  60.  
  61. <?php
  62. $con=mysqli_connect("localhost","root","","front");
  63. // Check connection
  64. if (mysqli_connect_errno())
  65. {
  66. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  67. }
  68. $pagecontent = $_GET['pagecontent'];
  69. if (!empty($pagecontent)) {
  70.  
  71. $sql= "SELECT 'pageurl' FROM 'searchengine' where 'pagecontent'='$pagecontent'";
  72. if ($result=mysqli_query($con,$sql))
  73. {
  74.  
  75. while ($row = mysqli_fetch_assoc($result));
  76.  
  77. header("Content-type: image/jpeg");
  78. echo $row['pageurl'];
  79. }
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement