Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:08:57+00:00 2026-06-12T23:08:57+00:00

I have a PHP program for counting user banner clicks. My banner link is

  • 0

I have a PHP program for counting user banner clicks. My banner link is something like this:

<a href="<?=$banner_url;?>" onclick="banner_click_count('<?=$banner_id;?>')"><img src=...>

When user clicks on image, it runs banner_click_count() function with $banner_id as parameter.

function banner_click_count($ban_id)
{
$.ajax({
   type: "POST",
   url: 'banner_click.php',
   data: {banner_id: $ban_id}
   });

}

At banner_click.php, I get the banner_id with $banner_id = $_GET['banner_id']);, search the database based on it. Find the record, then add 1 to banner_count column field. After that, redirect to banner_url.

When I run the program, I get Parse error: parse error, expecting T_VARIABLE' or '$'' on line $.ajax({

Addendum: the error is cleared with all your help, but when I click on the link it redirects to banner_url directly and does not run the AJAX function.

Addendum:I put the alert(“hello”); at the top of ajax function and i got it. So it goes into function

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:08:59+00:00Added an answer on June 12, 2026 at 11:08 pm

    I found the solution. Thanks to all.

    function banner_click_count(ban_id)
    {
      $.post(
      "banner_click.php",
      {
      banner_id: ban_id
      });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php program which load 3 css files like this: <link rel=stylesheet
i have link php program - its activation link as activation.php?user=jack?hash=abcd?id=20 When i use
I have written php program and uploaded on server. I want run this program
I have PHP script works without problems, like this : while($row4 = mysql_fetch_array($result4)) {
I have PHP snippets like this ( snippet.php ): <?php $some_param = some_function(); ?>
I have a PHP program that has the user copying a URI into a
Hoping someone can shed some light on this. I have a PHP program which
I have a PHP program that encrypts a PDF file into .xxx file this
Lets say you have an program like this: $info = array( 'username'=>'jeff', 'password'=>'kay' );
I have a PHP program that has been written keeping in mind a single

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.