Jump to content

Displaying IMGs (It's not working.)


Yojance

Recommended Posts

I'm just wrote a very simple script that creates a link to an image. When I put all the code into <img src="all php code here /> the image won't display.
I think I heard something about letting the browser know that an image is coming, I looked for it but I did not find it.
Could anyone help me.
Thanks.
Link to comment
Share on other sites

Here is my lame code.
[code]<?php
if(isset($_POST['img'])) {
$IMG = $_POST['img'];
$img = ($_POST['IMG'] / 100);
$imgdir = 'images/'
$chopurl = 'http://mysite.com/';
echo '<img src="'.$imgdir.$IMG.'.jpg" />';
}

?>[/code]

Thanks for the fast response.
Link to comment
Share on other sites

are you sure that the form set to name="img" useually submit name="submit"



<?php
if(isset($_POST['submit])) {

$IMG = ($_POST(['img']));


$img="whatever.jpg";

$imgdir = "images/";

$url = "http://mysite.com/";

echo "<img src='$url$imgdir$img' />";

}

?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.