Millica Millica - 4 months ago 13
Javascript Question

How do I add php to a url?

I want to re-direct the link below in a javascript function, but I'm unsure how to properly call the php code listed after

. I've tried the example below and also
inbox.php?u=<?php $log_username; ?>
but it doesn't work. Can somebody guide me in the right direction?



You have missed the echo in the php tag. Try with:

window.location.replace("inbox.php?u=<?php echo $log_username; ?>");