kma9000 Posted August 31, 2008 Share Posted August 31, 2008 Hello, I have this peice of code on my index.php page: <a href=\"\" onClick=\"return popitup('/download.php?name=".urlencode(trim($strippedsongname))."&file=".urlencode($id)."')\">download</a> I am trying to get it to work on another php page however it won't. I am sure the answer is something simple and to do with the <a href=\"\" section. Allit is supposed to do is link to the specified song. I hope you can help, sorry I know nothing about php, despite trying to learn. Link to comment https://forums.phpfreaks.com/topic/122085-help-with-small-change-to-php-code/ Share on other sites More sharing options...
JasonLewis Posted August 31, 2008 Share Posted August 31, 2008 What's not happening? You need to explain your question a bit more, perhaps give us the output as well as the desired output. Maybe the second page doesn't have the required variables that are in the onClick even handler. Link to comment https://forums.phpfreaks.com/topic/122085-help-with-small-change-to-php-code/#findComment-630303 Share on other sites More sharing options...
kma9000 Posted August 31, 2008 Author Share Posted August 31, 2008 Ok, the easiest way to explain is to show you what I mean. I hope it's ok to put URL's in this forum. If you look at this page (as an example): http://www.mp3evolved.com/index.php?search=Madonna+-+Like+A+Prayer&type=audio - See where it says download / liten and Share and the links work? Well I would like them to work on this page http://www.mp3evolved.com/lyrics.php?name=Madonna+-+%3Cb%3ELike%3C%2Fb%3E+%3Cb%3EA%3C%2Fb%3E+%3Cb%3EPrayer%3C%2Fb%3E&id=63184 - The same links are underneath the pictures. Hope this helps. Link to comment https://forums.phpfreaks.com/topic/122085-help-with-small-change-to-php-code/#findComment-630311 Share on other sites More sharing options...
kma9000 Posted August 31, 2008 Author Share Posted August 31, 2008 I am still struggling to get this to workso in an effort for guidence this is the full code for the 2 links: <span class=\"gotcha\"><a href=\"\" onClick=\"return popitup('/download.php?name=".urlencode(trim($strippedsongname))."&file=".urlencode($id)."')\">download</a> | <a href=\"\" onClick=\"return popitup('/listen.php?name=".urlencode(trim($strippedsongname))."&file=".urlencode($id)."')\" title=\"Suggest it to friend\">Listen and Share it!</a></span> On the first page, the URL is formatted correctly as such: /index.php?search=My+Chemical+Romance+cancer&type=audio On the second page, after copying the above code exactly the URL is formatted as such: /\"\" What do I need to do to get the code right? Link to comment https://forums.phpfreaks.com/topic/122085-help-with-small-change-to-php-code/#findComment-630547 Share on other sites More sharing options...
liamthebof Posted August 31, 2008 Share Posted August 31, 2008 If that link is not being echo'ed, why bother escaping the "s? Link to comment https://forums.phpfreaks.com/topic/122085-help-with-small-change-to-php-code/#findComment-630549 Share on other sites More sharing options...
kma9000 Posted August 31, 2008 Author Share Posted August 31, 2008 Sorry, could you please explain. Link to comment https://forums.phpfreaks.com/topic/122085-help-with-small-change-to-php-code/#findComment-630573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.