Jump to content

crazy88888888

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

crazy88888888's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Look at this to see if this is what your talking about: <?php require_once('Connections/myConnection.php'); header("Content-type: image/jpg"); if (isset($_GET["image"]) && ctype_digit($_GET["image"])) { $imageid = $_GET["image"]; $imageid = "SELECT * FROM `imagetest` ORDER BY RAND() LIMIT 1"; $query = mysql_query($imageid) or die(mysql_error()); while ($arrayImage = mysql_fetch_array($query, MYSQL_ASSOC)){ $imageid = $arrayImage['image']; $address = $arrayImage['address']; $name = $arrayImage['name']; exit; } echo "<a href=\"".$address."\" target=\"_blank\"><img src=\"".$image."\" alt=\"".$name."\"></a>"; ?>
  2. I guess I don't quite understand why I need another script, Can you give me a code example of what you mean? Thanks.
  3. Thanks for your reply requinix. Taking out the HTML and just having echo $image; with the header works great, however, I want the user to be able to click the image and be directed to a url which I am trying to pull through my $address from my mysql How can I do this without HTML a href tag?
  4. Can someone give some advice why this %@!# code is not working. I keep getting the binary code when I don't have the header("Content-type: image/jpg"); in place but when I have the header I get nothing...calling on the PHP Gods to help. Here is what I have: <?php require_once('Connections/myConnection.php'); $query = mysql_query("SELECT * FROM imagetest ORDER BY RAND()LIMIT 1"); $array = mysql_fetch_array($query); $image = $array['image']; $address = $array['address']; $name = $array['name']; header("Content-type: image/jpg"); echo "<a href='$address' target='_blank'><img src='$image' alt='$name'></a>"; ?>
×
×
  • 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.