When you click on the word ‘Click!’, it should open a certain JPEG photo, referenced in the table as “photo_id”. However, when I try to view the page, I get this:
First Row:
Road Number
Locomotive Type
Paint Scheme
Photographed MM-DD-YYYY
Photograph Location
Try this.
I also like to keep my variable cleaning separate from my use. I’m pretty sure you don’t want single quotes in there, because it kills your variable.
Mr2001 hit the nail on the head. But I feel compelled to say – why not use a descriptive link like “photo of me and a bigmouth bass” instead of the blind and obvious “click”?
I took all of your advice, and guess what? My PHP page Works! I have changed the word ‘click’ to the actual name of the photo as well. PHP is very tricky as far as escaping characters goes, but it is also very powerful. Thanks for your help, guys!
I don’t think the problem is the syntax at all (althoiugh you might run into syntax issues later - I haven’t gone over it with a fine tooth comb).
Looks to me like your web server doesn’t recognize the .php extension, and doesn’t run PHP on your file - you’re just getting your text back - minus the valid HTML tags, which effect the formatting.
You can verify this by using View->source from the browser menu (if you’re on IE). You will probably see your original source code.
If you are on a hosted server, contact your admins. If this is your own server, and it’s an APACHE server, email me (in my profile). If it’s your own IIS, get someone who knows IIS to help you
D’oh! :smack: - of course I forgot the most likely reason for your code not being interperted - you may be missing the start and end PHP tags ("<?php … ?>"), in which case the interpreter assumes everything it sees is staright text to be dumped to the browser.
Is your code in an .inc file? If so, I’m not quite certain, but I think you may need to put fresh <?php …?> tags in each include file.