Skip to content
Advertisement

dynamically passing href in anchor tag

i want to redirect user to registration based on there role. like there is two roles user and shop if user select user role then it will be directed to the ragic.php(registration customer) if selected shop then ragis.php Hear is the code…

JavaScript

one problem is how i pass a javascript variable into anchor href. or i also try for php hear is code

JavaScript

and for php anchor tag will be <a href="<?php echo $r?>" ></a>

Advertisement

Answer

Update your JavaScript function like this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement