View Full Version : Can you check my short code snippet please?

digi duck
03-27-2007, 10:52 PM

I want users to be able to create an image from either an image template on my site (labelled $im) or by entering in a url.I think i've worked it out, but my php is not very good so can you tell me where i'm going wrong with it please?

I realised that the

$im = imagecreatefromjpeg($im)

doesn't have to point to a variable, it can also point to a url i.e

$im = imagecreatefromjpeg(http://www.address.com/image.jpeg)

YEY- This works, however when i try adding a tick box to the html form that the user checks when they want to specify an address i get the url coming up instead of the image.

This is the code that i have put in the php file...

if($link== 'y'){
$im = imagecreatefromjpeg($useraddress);
$im = imagecreatefromjpeg($im);

The checkbox is called link and the textbox for the address is called useraddress.

If you want to see for yourself what its doing go to www.gamesigs.co.uk/test.php

Cheers and i hope to hear from you soon.

03-27-2007, 11:20 PM
Do you have register_globals turned on? $useraddress won't be set if you don't. You shouldn't be relying on register_globals in any case-- just use $_POST['useraddress'] instead.