Executing Javascript Before PHP redirect?

superaff1984

Senior Member
Premium Member
Joined
Jun 16, 2010
Messages
991
Reaction score
130
I have a file called click.php. I want to execute javascript code which is mainly cookies, facebook pixel, and etc. However, after that I want the page to redirect. I can't use PHP header because it has to become before the HTML headers. How can I do this redirect after the javascript code executes? I am also passing the parameters into the URL..
 
I have a file called click.php. I want to execute javascript code which is mainly cookies, facebook pixel, and etc. However, after that I want the page to redirect. I can't use PHP header because it has to become before the HTML headers. How can I do this redirect after the javascript code executes? I am also passing the parameters into the URL..
Tried directly pasting the codes here but got error so here is the PHP code which might help you: https://pastebin.com/u20CkXLM
 
Back
Top