Guest User

Untitled

a guest
Aug 1st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. passing data using hyperlink in PHP
  2. <?php
  3.  
  4. $host=""; // Host name
  5. $username=""; // Mysql username
  6. $password=""; // Mysql password
  7. $db_name=""; // Database name
  8. $tbl_name=""; // Table name
  9.  
  10. // Connect to server and select databse.
  11. mysql_connect($host, $username, $password)or die("cannot connect");
  12. mysql_select_db($db_name) or die("cannot select DB");
  13.  
  14.  
  15. $photo=mysql_query("SELECT * FROM `images` ORDER BY (ID = 11) DESC, RAND() LIMIT 7");
  16.  
  17. while($get_photo=mysql_fetch_array($photo)){ ?>
  18.  
  19. <div style="width:300px;">
  20.  
  21.  
  22. <a href="does_this_work.php?big_image=$get_photo['guest']>" target=""><img src="<?
  23. echo $get_photo['url']; ?>" title="">
  24.  
  25.  
  26. </div>
  27.  
  28. <? } ?>
  29.  
  30. <?php
  31.  
  32. echo "this is the page where you get a larger picture of image on previous page, plus
  33. further info";
  34.  
  35. $big_image = $_GET['guest'];
  36.  
  37. echo $big_image;
  38.  
  39. ?>
  40.  
  41. //The variable must not necessarily be $value
  42. $value = $_GET['argument'];
  43. //Alt.
  44. $value = $_POST['argument'];
  45.  
  46. <a href="does_this_work.php?big_image=$get_photo['guest']>" target=""><img src="<? echo $get_photo['url']; ?>" title="">
  47.  
  48. <a href="does_this_work.php?big_image=<?php echo $get_photo['guest']; ?>" target=""><img src="<?php echo $get_photo['url']; ?>" title="">
  49.  
  50. <a href="does_this_work.php?guest=<?php echo $get_photo['guest']; ?>" target=""><img src="<?php echo $get_photo['url']; ?>" title="">
  51.  
  52. <a href="does_this_work.php?big_image=$get_photo['guest'] ?>"
  53.  
  54. <a href="does_this_work.php?big_image=<?= $get_photo['guest']; ?>"
  55.  
  56. <a href="does_this_work.php?big_image=$get_photo['guest'] ?>" target=""><img src="<?
  57. echo $get_photo['url']; ?>" title="">
  58.  
  59. <a href="does_this_work.php?big_image=<? $get_photo['guest'] ?>" target=""><img src="<?
  60. echo $get_photo['url']; ?>" title="">
Add Comment
Please, Sign In to add comment