RE: [PHP] image as submit
| From: | Matt McClanahan | Date: | Mon, 13 Nov 2000 22:48:17 +0000 |
| Subject: | RE: [PHP] image as submit | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25047@lists.php.net to get a copy of this message | ||
On Mon, 13 Nov 2000, Jerry Lake wrote:
> won't that just result in an unformatted
> image file in the upperleft of the screen?
You mentioned the files were in a database, so I assumed those files have
some sort of ID number associated with them. So, you could build the
anchors to link to an image-viewing script, which handles the look of the
page and provides the <img> tag to the fullsize image.
Now if the actual contents of the image are in MySQL, you'd need to work
it a little bit differently. The page that handles the header/footer
(We'll call it viewimage.php) would include an <img> tag that links to
another file, getimage.php. Getimage.php would handle pulling the raw
data from MySQL and sending the appropriate HTTP Headers. (You could also
do this with viewimage.php and some if checks, if you'd rather conserve
how many seperate files are involved)
> I'm trying to have the fullsize images go
> to pages with common headers and footers
> yet the appropriate info from which ever
> thumbnail they chose.
>
> the only way I can figure is to make each
> page by hand and that is what I'm trying
> to avoid. any ideas are certainly appreciated.
Yeah, that'd just be creating a maintainability nightmare.
Matt
> -----Original Message-----
> From: Matt McClanahan [mailto:cardinal@dodds.net]
> Sent: Monday, November 13, 2000 11:09 AM
> To: Jerry Lake
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] image as submit
>
>
> On Mon, 13 Nov 2000, Jerry Lake wrote:
>
> > Why is it that image submit buttons
> > don't sent variables? I have a table
> > of image thumbnails pull from a MySQL
> > record set and I'd like to be able to
> > click the thumbnails to get a template
> > page with the full size imageNumber determined
> > from the name of the thumbnail image
> > any ideas?
>
> It's a shortcoming of the HTML spec. It's annoying, but that's life. I
> won't bother explaining how it works, since four people just did. It's
> also quite a FAQ, so it should probably be added to the PHP FAQ if it
> isn't there already.
>
> In any case, it doesn't really sound like an image submit button is the
> best solution here. If you're not using the form for much beyond
> the image submit button, I'd simply use anchors.
>
> <a href="viewfullimage.php?imageID=<?= $id ?>">
> <img src="<?= $name ?>" border="0"></a>
>
> would do just fine.
>
> Matt
>
>
>