spoofer26 Posted April 9, 2006 Share Posted April 9, 2006 Hi, im not technically a novice at PHP but since my problem involves printing to the browser i guess this is the place.can anyone explain why this:[code]<?php$test="img_id=2";echo "<a href='http://gamersphere.com/topclans/index.php?vote=418' target='_blank'><img src='http://gamersphere.com/topclans/index.php?".$test."&img=418' border='0'></a>";?>[/code]Outputs this:[code]<a href='http://gamersphere.com/topclans/index.php?vote=418' target="_blank"> </a>[/code](ie, for some reason the <img> tag is being turned to whitespace by the php parser).Is this expected behavior? it makes absolutely no sense to me. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 9, 2006 Share Posted April 9, 2006 I just tried your code. It works fine for me. Here is the HTML source generated:[code]<a href='http://gamersphere.com/topclans/index.php?vote=418' target='_blank'><img src='http://gamersphere.com/topclans/index.php?img_id=2&img=418' border='0'></a>[/code]You can see it in action at [a href=\"http://localhost/kenrbnsn/phpfreaks/quest.php\" target=\"_blank\"]http://localhost/kenrbnsn/phpfreaks/quest.php[/a]Ken Quote Link to comment Share on other sites More sharing options...
spoofer26 Posted April 9, 2006 Author Share Posted April 9, 2006 thanks ken, perhaps my php install has gone whacko. What version of PHP are you running? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 9, 2006 Share Posted April 9, 2006 I tried it on both version 4.3.9 (Linux) and 5.0.5 (Windows XP)Ken Quote Link to comment 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.