Hello!
I have following HTML code with nested php parts:
<img src="galerie/1.jpg" width="<?echo(vratX('galerie/1.jpg'))?>" height="<?echo(vratY('galerie/1.jpg'))?>" onClick="okno('galerie/nahledy/1.jpg','<? echo(vratX('galerie/nahledy/1.jpg'))?>','<?echo(vratY('galerie/nahledy/1.jpg'))?>','Lerg','O.')" style="cursor:pointer">
I would really need to remake it to pure PHP when all this code would be in PHP part of page.
Im not familiar enough with that so I would be very grateful for help. Thank you!
Help with simple HTML to PHP variables conversion
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Help with simple HTML to PHP variables conversion
NB: Dont use php short tags!Blizna wrote:<img src="galerie/1.jpg" width="<?echo(vratX('galerie/1.jpg'))?>" height="<?echo(vratY('galerie/1.jpg'))?>" onClick="okno('galerie/nahledy/1.jpg','<? echo(vratX('galerie/nahledy/1.jpg'))?>','<?echo(vratY('galerie/nahledy/1.jpg'))?>','Lerg','O.')" style="cursor:pointer">
I would really need to remake it to pure PHP when all this code would be in PHP part of page.
Ok this is a bit of a mess and I might have made a typo or two, but you get the idea. You could simply your code a lot, but i dont know the rest of the page. I definitely suggest simplifying the code.
Code: Select all
<?php
$page = "
<img src='galerie/1.jpg' width='".vratX('galerie/1.jpg')."' height='".vratY('galerie/1.jpg')."' onClick='okno(\'galerie/nahledy/1.jpg\',\'".vratX('galerie/nahledy/1.jpg')."\'),\'".vratY('galerie/nahledy/1.jpg')."\',\'Lerg\',\'O.\'' style='cursor:pointer'>
";
echo $page;
?>