director87 Posted August 21, 2007 Share Posted August 21, 2007 Hi all. I'm coding a simple commentary page which calls to an AJAX function I've created. The code below prints the path of the link outside as text, when I want the path as the URL for the link! echo "<a href=\"javascript:llamarasincrono('".printf('%s?pageNum_Recordset1=%d%s', $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1)."', 'commentarios');\">Next</a>"; an example of the output would be: /jose/commentarios.php?pageNum_Recordset1=1&totalRows_Recordset1=9&user_fk=31 Next When it should just print the link: Next I'm absolutely stuck. I hope I explained this somewhat efficiently... I'm sure it has to do with the etiquette of my quotations. Please let me know if my explanation is clear enough. All help is appreciated!!! Saludos, Mark Quote Link to comment https://forums.phpfreaks.com/topic/65950-solved-flaw-with-printf/ Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 try this echo "<a href=\"javascript:llamarasincrono('".printf('%s?pageNum_Recordset1=%d%s', $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1)."', 'commentarios');."\">Next</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/65950-solved-flaw-with-printf/#findComment-329726 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 option #2 (as a backup) $x = min($totalPages_Recordset1, $pageNum_Recordset1 + 1); echo "<a href=\"javascript:llamarasincrono('$currentPage?pageNum_Recordset1=$x$queryString_Recordset1', 'commentarios');\">Next</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/65950-solved-flaw-with-printf/#findComment-329728 Share on other sites More sharing options...
director87 Posted August 21, 2007 Author Share Posted August 21, 2007 The 2nd works perfect. Thanks, Mark Quote Link to comment https://forums.phpfreaks.com/topic/65950-solved-flaw-with-printf/#findComment-329739 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.