So i was wondering if it is possible to make something

<a class='photo' href=<?PHP 'lala.php?blu=$q&subf=$subf&img=$imagenr' ?> target='_blank'>
<span><img src=<?PHP'{$handle}/{$file}'?> /></span></a>

lala.php is already made with all needed, but when i'm trying to make something with this code it doesnt show up the photo. I named class photo so i can change easily in css some minor details. The idea is to make a table with pictures but all i need is to know how to make the picture show, but not inlcuind everything in php because then i think i'll lose the class. Thank you in advice.

Recommended Answers

All 6 Replies

Member Avatar for LastMitch

@freakvista

lala.php is already made with all needed, but when i'm trying to make something with this code it doesnt show up the photo. I named class photo so i can change easily in css some minor details. The idea is to make a table with pictures but all i need is to know how to make the picture show, but not inlcuind everything in php because then i think i'll lose the class. Thank you in advice.

I assume you want to echo out the images:

<img src="yourdomain/lala.php?id=<?php echo $id;?>" />

If your image is in the database, then you can used the id to echo out the id of the image to show in the <img> tags.

Every time i use this in the box it says something about undefined index and so on. How can i make sure this won't happen(locally i mean) if there's no way of doing this without changing the idea of how it works i can leave it that way, because it says somewhere that only wamp displays those errors and if i run the files on a public hosting server, the form should work just fine.

<label>
                        <span>Email</span>
                        <input type="text" class="input_text" id="email" name="email" value="<?php if($_POST['email'] && empty($success)) { echo $_POST['email']; } ?>" />
</label>

Every time i use this in the box it says something about undefined index and so on. How can i make sure this won't happen(locally i mean) if there's no way of doing this without changing the idea of how it works i can leave it that way, because it says somewhere that only wamp displays those errors and if i run the files on a public hosting server, the form should work just fine.

I don't understand about what errors are you talking. Post those errors

if($_POST['var']){if there is no post[var] defined, I get the undefined index error.
if(isset($_POST['var'])){I get no error.

Also in this case I think the ternary if syntax would be useful:
<?php echo (isset($_POST['email']) && empty($success)) ? $_POST['email'] : "";?>

if($_POST['var']){if there is no post[var] defined, I get the undefined index error.

Probably thats how PHP is made. Probably if statement expects defined variable.

Also in this case I think the ternary if syntax would be useful:<?php echo (isset($_POST['email']) && empty($success)) ? $_POST['email'] : "";?>

So problem solved?

Problemo solved. Thank you very much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.