yolop Posted November 15, 2008 Share Posted November 15, 2008 i tried to do this <a href='1.php?photo_id= <script type="text/javascript"> i=0; document.write(i);i=i+1;</script>'> sss</a> but the likn show like that 1.php?photo_id=%3Cscript%20type=%22text/javascript%22%3Ei=0;document.write(i);i=i+1;%3C/script%3E not good i need the link will show like that1.php?photo_id=0 help!!!! thatk Link to comment https://forums.phpfreaks.com/topic/132851-help/ Share on other sites More sharing options...
RichardRotterdam Posted November 15, 2008 Share Posted November 15, 2008 are you maybe trying to create a loop with links <script type="text/javascript"> var numlinks=10; for(var i=0;i<numlinks;i++){ document.write('<a href="1.php?photo_id='+i+'">link</a><br />'); } </script> sss</a> Link to comment https://forums.phpfreaks.com/topic/132851-help/#findComment-690924 Share on other sites More sharing options...
BoltZ Posted November 16, 2008 Share Posted November 16, 2008 declare this outside of the link. Also you forgot to use var. <script type="text/javascript"> var i=0; var url=document.write(i);i=i+1; </script> <a href='1.php?photo_id=url'> sss</a> Untested but I think it should work unless I made a stupid mistake. Link to comment https://forums.phpfreaks.com/topic/132851-help/#findComment-691623 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.