1

I have the following line of code -

<a href="/wordpress/wp-content/trackclicks/clickcounter.php?var=<?php echo $var3; ?>" onclick="return popitup2();">Grab Coupon</a>

But suppose i want to redirect the current page to an external link and also run the php script and the javascript function.Is something like this possible -

<a href="{@extlink}" onclick="/wordpress/wp-content/trackclicks/clickcounter.php?var=<?php echo $var3; ?>; return popitup2(); ">Grab Coupon</a>

2 Answers 2

1

You are looking for Ajax. Here are the docs for the JQuery variety.

Sign up to request clarification or add additional context in comments.

Comments

0

Either use javascript to call the clickcounter using ajax, or move the redirect into your click counter script, eg:

clickcounter.php?var=<?php echo $var3; ?>&redirect=example.com

2 Comments

so this redirect would be passed to the php script as a GET variable same as var?
yep, it would be available as $_GET['redirect'].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.