Reaper0167 Posted June 30, 2009 Share Posted June 30, 2009 <?php echo "<a href=\"{$row['thumb_1']}\" onClick=\"window.open('{$row['imgpath']}', width=700); return false\"><img src=\"{$row['thumb_1']}\" width=\"100\" alt=\"\" border=\"0\"></a>"; ?> onclick is javascript, right. I would like to get rid of this and just use php Quote Link to comment Share on other sites More sharing options...
abdfahim Posted June 30, 2009 Share Posted June 30, 2009 onclick function can not be possible using php .. u have to use some client side language like javascript . Quote Link to comment Share on other sites More sharing options...
SuperBlue Posted June 30, 2009 Share Posted June 30, 2009 Not necessarily, it depends on what its used for. For instance, common usage is to track how many times a link is clicked, this can however easily be done, by keeping the link internal, and simply redirecting the user. I wouldn't however worry that much about using JavaScript, it has many good uses, and virtually everyone has it enabled these days. You should however provide an alternative for search engines, if you want something to be indexed. Etc. Quote Link to comment Share on other sites More sharing options...
Reaper0167 Posted June 30, 2009 Author Share Posted June 30, 2009 I don't want to get off subject, but with the code i mentioned above, in ie i can click on the thumbnail and it opens a new window with the full size pic, but in firefox, i click on the thumbnail, and it shows the thumbnail again. That is why I would love for it to be all PHP. I am waiting patiently in the javascript section for a reply. Again, sorry to mention the javascript in this section. Quote Link to comment Share on other sites More sharing options...
abdfahim Posted June 30, 2009 Share Posted June 30, 2009 For instance, common usage is to track how many times a link is clicked, I am not so sure. I thing the most common usage is just to open a simple new pop up window, or do some things with other controls on the page onclick, or something like these. But yup, it depends on usage, how u want to use. Though most of the onclick functions cannot be replicated by php. Quote Link to comment Share on other sites More sharing options...
abdfahim Posted June 30, 2009 Share Posted June 30, 2009 i wud do this like this <?php echo "<a href=\"{$row['thumb_1']}\" onClick=\"window.open('showimage.php?loc={$row['imgpath']}', 'window_name', 'width=700'); return false\"><img src=\"{$row['thumb_1']}\" width=\"100\" alt=\"\" border=\"0\"></a>"; ?> showimage.php echo "<img src=\"".$_GET['loc']."\" width=\"100\" alt=\"\" border=\"0\">"; Quote Link to comment Share on other sites More sharing options...
Reaper0167 Posted June 30, 2009 Author Share Posted June 30, 2009 all I'll looking for is when the thumbnail is clicked, it opens some sort of new window with the full size picture. and to work in both ie and ff would be a plus. Quote Link to comment Share on other sites More sharing options...
abdfahim Posted June 30, 2009 Share Posted June 30, 2009 did you try my code? it should work! Quote Link to comment Share on other sites More sharing options...
Reaper0167 Posted June 30, 2009 Author Share Posted June 30, 2009 ooppss sorry. give me a minute. Quote Link to comment Share on other sites More sharing options...
Reaper0167 Posted June 30, 2009 Author Share Posted June 30, 2009 so far so good. that seems to work in both ie and ff. thanks for the help. this was driving me crazy for a couple days. 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.