Jump to content

Recommended Posts

Hi everyone, I'm a new member here, and I need a little help with my PHP coding, I saw your coding just now and I registered lately. I was hoping maybe someone could help me with something.

 

I'm trying to find a code for my site (www.poke-mania.net).

and I have alot of images.

 

So how can I make a my Picture Generator out of PHP?

 

I want something like...

 

www.poke-mania.net/showpic.php?name=IMAGE

 

so when we try to view something like that it results to

 

www.poke-mania.net/image.png

 

so when I want to have another name for it...

 

www.poke-mania.net/showpic.php?name=IMAGE2

 

it also results to...

www.poke-mania.net/image.png

 

and will apply to many images I want to put on the php file?

 

how can I do that?

Link to comment
https://forums.phpfreaks.com/topic/103016-image-cloaking-php-code-help/
Share on other sites

Here's the PHP code to view multiple images. But it only loads one image, just the 001 but I want different and multiple images to be displayed when the code is writed.

 

pic.php?sprite=001

 

can anyone edit the code so that not just the 001 can be loaded? But all images on the directory?

 

<?php

// Load the sprite into memory
$imgTorso=imageCreateFromPng("http://www.poke-mania.net/sprites/dp/001.png");
$imgBlend=imageCreateFromPng("http://www.poke-mania.net/sprites/dp/001.png"); // Load his clone too 

// Load the height and width of the image
$sx=imagesx($imgBlend);
$sy=imagesy($imgBlend);

// Output for Browser
imagecopymerge($imgTorso,$imgBlend,0,0,0,0,$sx,$sy,50);
imagefill($imgTorso,0,0,$background);
imagecolortransparent($imgTorso,$background);

header("Content-type: image/png");
imagePng($imgTorso);
?> 

goto http://www.poke-mania.net/pic.php?id=1 << loads image 1

or goto http://www.poke-mania.net/pic.php?id=2 << loads image 2

 

NOTE: not tested

<?php
$id = $_POST['id'];
// Load the sprite into memory
$imgTorso=imageCreateFromPng("http://www.poke-mania.net/sprites/dp/$id.png");
$imgBlend=imageCreateFromPng("http://www.poke-mania.net/sprites/dp/$id.png"); // Load his clone too 

// Load the height and width of the image
$sx=imagesx($imgBlend);
$sy=imagesy($imgBlend);

// Output for Browser
imagecopymerge($imgTorso,$imgBlend,0,0,0,0,$sx,$sy,50);
imagefill($imgTorso,0,0,$background);
imagecolortransparent($imgTorso,$background);

header("Content-type: image/png");
imagePng($imgTorso);
?> 

thats easy, if you want something like that just do this:

 

<?php

$image = file_get_contents('location/of/file/'.$_GET['name'].'.jpeg');

header("Content-Type: image/jpg");
exit("$image")


?>

 

 

although, if your going to go that far, I'd use a database.

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.