PHP noob help

Status
Not open for further replies.

Obtruse_Man4

In Runtime
Messages
439
ok i've been following this tutorial off and on, trying to learn php as I go. I know simple stuff, but want to learn more. So I tried making an image gallery, but of course it doesn't work:rolleyes:

Here's the files that i've created:

photo_display.php

index.php

and here's the tutorial i've been following:

webmonkey

I basically copied and did everything he said to do, but I get that error as you see in index.php:confused: Can someone help me please, i've been all through the code and I guess I just don't know enough yet to spot any dumb mistakes.
 
first of all I dont know a LOT of PHP, but i do know HTML, and there is a space between the < and the a href - I would change that and see what the outcome is, I think i will print that article off and do it tonight.

Let me know how that works.
 
The pop-up issue is something with your Javascript code, but the photo_display page I can help you with. :)

On the photo_display.php $photo is blank. Thats why it gives you that error. I see your passing it in the URL but before you can use it you need to put

$_GET['photo'];

Once PHP reads that line you can use the varible, however to use it you need to put $_GET['photo'] or you can just set that to be the value of the photo varible like this...

$photo = $_GET['photo'];

That should fix your problem. :)
 
oh I get it, I was wondering how it got the value for photo? So what that does is transfer the value for photo from index.php to photo_display.php?
 
Right it passes the varible through the url if you notice the

'?photo=myimage.jpg'

That is PHP passing the varible from page to page.
 
woops for some reason it doesn't work:confused:

here's what I have:

PHP:
<?PHP
	$photo = $_GET['photo'];
	$photo_size = getimagesize("$photo");
?>

maybe this is too advanced for me right now, looked good at first but seems like it's too complex:(
 
Status
Not open for further replies.
Back
Top Bottom