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 8422185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:22:23+00:00 2026-06-10T03:22:23+00:00

Ok guys I know this question has been asked before but I am very

  • 0

Ok guys I know this question has been asked before but I am very new to PHP and JavaScript and hadn’t even heard of ajax until i started looking for an answer to this question so do not understand previous answers.

I am creating a site that essentially is a bunch of videos in a SQL database, it shows one video at a time, I would like to have a next and previous video buttons.

However I cant get past this ajax thing so my question is even simpler. I have looked at this question/answer and think it pretty much sums up what im asking:

How do I run PHP code when a user clicks on a link?

I have copied that exact code,

    <script type="text/javascript">
       function doSomething() {
       $.get("backend.php");
          return false;
      }
     </script>

<a href="#" onclick="doSomething();">Click Me!</a>

And in my backend.php file i have literally just got <?php echo "Hello" ?> just to test it and therefore my understanding is that when i click the link the javascript onClick event is trigged which in turn calls the backend.php file, which says to print “Hello” to the page. However when i click the link it does nothing.

Eventually obviously im going to need to get a lot more complex with my php functions and calling variables and all that stuff but i like to figure things out for myself for the most part so i learn. However im stuck on this bit. Also whilst im here i will ask another thing, I want to ‘give back’ to the users of the site for answering my questions but I can only really well enough in HTML and CSS to answer other peoples questions, any advice on being able to find the simpler questions on here so i can answer some.

Thanks in advance 🙂

  • 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-10T03:22:25+00:00Added an answer on June 10, 2026 at 3:22 am

    It does nothing becuase you don’t do anything with the result. My guess is that in the example you took, it does some work and doesn’t show anything to the user. So if you just had some stuff you wanted to run on the server without returning any output to the user, you could simply do that, and it would work.

    Example from jQuery’s .get() documentation

    What you do:

    Example: Request the test.php page, but ignore the return results.

    $.get("test.php");
    

    What you want to do:

    Example: Alert out the results from requesting test.php (HTML or XML, depending on what was returned).

    $.get("test.php", function(data){
        alert("Data Loaded: " + data);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked here before, but I don't think those
Ok guys, So I know this has been covered before, but what my question
I know this question has been asked a bit before. But looking around I
Hey guys, I don't know if this question has been asked yet but imagine
Hi guys I am sure this question has been asked already but I am
guys I know this question is very basic but I've met in few publications
I know this is a question that has been discussed over and over, but
I know this question has been asked a number of different ways, and I
I know this question has asked many times in SO,but i couldn't figure out
I know that this is a simple question for PHP guys but I don't

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.