shamuraq Posted June 28, 2010 Share Posted June 28, 2010 hi all... i have a bit of a pain from my own incompetency... So i would be grateful fer any help rendered... <?php $e = date('dmy'); $f = mt_rand(1,99); $f = $file.".svg"; ?> <td><?php echo "<iframe src= \$e"."\$f"."\ width=\"400\" height=\"250\" frameborder=\"0\" scrolling=\"no \"></iframe>";?></td> The error that i get from parsing that in browser is: The requested URL /testing/SystemDirectory/280610$f\ width= was not found on this server. I've got a gut feeling that my <iframe> syntax is erroneous... Is regex involved? Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/ Share on other sites More sharing options...
premiso Posted June 28, 2010 Share Posted June 28, 2010 <?php echo '<iframe src="' . $e . $f . '" width="400" height="250" frameborder="0" scrolling="no"></iframe>";?> A bit cleaner then what you had and should work properly, given that the url is correct. Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078345 Share on other sites More sharing options...
TOA Posted June 28, 2010 Share Posted June 28, 2010 Is there more code? Not seeing where $file is coming from... Just saw that right now, you're overwriting your $f variable too. (It almost looks like the first $f should be $file?? Not sure what you're trying to do there) Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078347 Share on other sites More sharing options...
shamuraq Posted June 28, 2010 Author Share Posted June 28, 2010 sorry.. my mistake... <?php $e = date('dmy'); $f = mt_rand(1,99); $f = $f.".svg"; ?> <td><?php echo "<iframe src= \$e"."\$f"."\ width=\"400\" height=\"250\" frameborder=\"0\" scrolling=\"no \"></iframe>";?></td> Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078350 Share on other sites More sharing options...
Adam Posted June 28, 2010 Share Posted June 28, 2010 Why echo out all of the image tag? <iframe src="<?php echo $e . $f; ?>" width="400" height="250" frameborder="0" scrolling="no"></iframe> Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078351 Share on other sites More sharing options...
shamuraq Posted June 28, 2010 Author Share Posted June 28, 2010 Why echo out all of the image tag? <iframe src="<?php echo $e . $f; ?>" width="400" height="250" frameborder="0" scrolling="no"></iframe> well its part of a bigger <?php ?> Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078352 Share on other sites More sharing options...
shamuraq Posted June 28, 2010 Author Share Posted June 28, 2010 I am trying to back track to find out if it is the syntax structure or something else and decided to go static fer a bit This is more mind-boggling.... When i changed it to: <table width="200" border="1"> <tr> <td> <iframe src= "../SystemDirectory/280610/1.svg" width="400" height="250" frameborder="0" scrolling="no"></iframe> </td> </tr> </table> It worked fine... But when i changed it to: <table width="200" border="1"> <tr> <td> <iframe src= <?php echo "../SystemDirectory/280610/1.svg"; ?>" width="400" height="250" frameborder="0" scrolling="no"></iframe> </td> </tr> </table> The error that i get is: You don't have permission to access /testing/SystemDirectory/280610/1.svg" on this server. So is this Apache issue or php syntax issue? If this is apache issue then i supposed (i really need a second opinion) i would not have been able to access it right from the first part (without php coding). Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078360 Share on other sites More sharing options...
premiso Posted June 28, 2010 Share Posted June 28, 2010 Why echo out all of the image tag? <iframe src="<?php echo $e . $f; ?>" width="400" height="250" frameborder="0" scrolling="no"></iframe> <?php echo '<iframe src="' . $e . $f . '" width="400" height="250" frameborder="0" scrolling="no"></iframe>";?> A bit cleaner then what you had and should work properly, given that the url is correct. Why should we bother to help, if you cannot take proper solutions and try to implement them and see how / why we did it the way we did? Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078362 Share on other sites More sharing options...
shamuraq Posted June 28, 2010 Author Share Posted June 28, 2010 Why echo out all of the image tag? <iframe src="<?php echo $e . $f; ?>" width="400" height="250" frameborder="0" scrolling="no"></iframe> <?php echo '<iframe src="' . $e . $f . '" width="400" height="250" frameborder="0" scrolling="no"></iframe>";?> A bit cleaner then what you had and should work properly, given that the url is correct. Why should we bother to help, if you cannot take proper solutions and try to implement them and see how / why we did it the way we did? Please refer to my last post: <table width="200" border="1"> <tr> <td> <iframe src= <?php echo "../SystemDirectory/280610/1.svg"; ?>" width="400" height="250" frameborder="0" scrolling="no"></iframe> </td> </tr> </table> And do let me know if that does not follow suggestion from our dear MrAdam... Lolxxx... Cute one premiso ... But i think i managed to sort it out from MrAdam's suggestion... Thanx MrAdam Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078375 Share on other sites More sharing options...
premiso Posted June 28, 2010 Share Posted June 28, 2010 You have invalid HTML, if you notice in mine and Mr. Adam's post we fixed that: <iframe src= <?php echo "../SystemDirectory/280610/1.svg"; ?>" Should be: <iframe src="<?php echo "../SystemDirectory/280610/1.svg"; ?>" Notice the removal of the extra space and the addition of the quote. But either way you "fixed" it apparently. But from that snippet, it seems as though you ignored our suggestions, at least for the html side of things which we both fixed, which is what I was referring to. Quote Link to comment https://forums.phpfreaks.com/topic/206092-php-syntax-help/#findComment-1078402 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.