Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- passing data using hyperlink in PHP
- <?php
- $host=""; // Host name
- $username=""; // Mysql username
- $password=""; // Mysql password
- $db_name=""; // Database name
- $tbl_name=""; // Table name
- // Connect to server and select databse.
- mysql_connect($host, $username, $password)or die("cannot connect");
- mysql_select_db($db_name) or die("cannot select DB");
- $photo=mysql_query("SELECT * FROM `images` ORDER BY (ID = 11) DESC, RAND() LIMIT 7");
- while($get_photo=mysql_fetch_array($photo)){ ?>
- <div style="width:300px;">
- <a href="does_this_work.php?big_image=$get_photo['guest']>" target=""><img src="<?
- echo $get_photo['url']; ?>" title="">
- </div>
- <? } ?>
- <?php
- echo "this is the page where you get a larger picture of image on previous page, plus
- further info";
- $big_image = $_GET['guest'];
- echo $big_image;
- ?>
- //The variable must not necessarily be $value
- $value = $_GET['argument'];
- //Alt.
- $value = $_POST['argument'];
- <a href="does_this_work.php?big_image=$get_photo['guest']>" target=""><img src="<? echo $get_photo['url']; ?>" title="">
- <a href="does_this_work.php?big_image=<?php echo $get_photo['guest']; ?>" target=""><img src="<?php echo $get_photo['url']; ?>" title="">
- <a href="does_this_work.php?guest=<?php echo $get_photo['guest']; ?>" target=""><img src="<?php echo $get_photo['url']; ?>" title="">
- <a href="does_this_work.php?big_image=$get_photo['guest'] ?>"
- <a href="does_this_work.php?big_image=<?= $get_photo['guest']; ?>"
- <a href="does_this_work.php?big_image=$get_photo['guest'] ?>" target=""><img src="<?
- echo $get_photo['url']; ?>" title="">
- <a href="does_this_work.php?big_image=<? $get_photo['guest'] ?>" target=""><img src="<?
- echo $get_photo['url']; ?>" title="">
Add Comment
Please, Sign In to add comment