I use the following code for my sumbit to reddit button.
onclick="window.location = 'http://www.reddit.com/submit?url=<?php echo $url?>';
but the above won't work for cases where there a '
in $url
onclick="window.location = 'http://www.reddit.com/submit?url=http://vinejar.com/96-Don't-be-this-guy.html';
It is necessary to get $url
there so the following won't help.
onclick="window.location = 'http://www.reddit.com/submit?url=' + encodeURIComponent(window.location);