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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:05:23+00:00 2026-06-11T10:05:23+00:00

Got two questions: How can i intgrate a php script to a html document

  • 0

Got two questions:
How can i intgrate a php script to a html document that:

  1. should do his work at the documents startup and return a integer, which can be handled by javascript?

  2. should do his work after a link is clicked and uses the links id?

lets create a example project:
1. php-name: start.php
2. php-name: click.php

html-code:

<!doctype html>
<html>
<head>
    <title>test</title>
     <script type="text/javascript">
        $(document).ready(function(){

        });
</head>
<body>
        <p><a class="links" id="l1" href="http://www.google.com/">Boerse</a></p>
        <p><a class="links" id="l2" href="http://www.google.ch/">My Gully</a></p>
</body>
</html>
  • 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-11T10:05:25+00:00Added an answer on June 11, 2026 at 10:05 am

    1. With javascript you could use jquery to perform a POST HTTP Request that simply posts something like ‘BeenSent’ with data = 1. Then php checks to see if that isset. If it is then send back the variable to jquery as the function at the end of the ajax() method.

    Here’s an example

     $.ajax({
            url: "getInt.php",
            type: "POST",
            data: {BeenSent: 1},
            cache: false,
            successCondition: function(result) {
    
            alert("getInt.php echo'd this out on it's file when I sent the request. The content it echo'd back was: " + result);
    
            }
    });
    

    2.
    For the links you could simply perform a GET HTTP Request, or you could simply define the element’s id within the link… like so…

    <p><a class="links" id="l1" href="http://www.example.com/?elementid=l1">Hey! I'm a link!</a></p>
    

    Hope this helped! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got two Jquery functions that I can get to work fine alone on
I've got question to you. I have got two project in PHP that uses
I have got two simple questions How can I tell what server is a
I've got two questions about LÖVE . Can I sell what I make in
I've got two questions (of which at least one is regarding RTTI in D2010
I've got some questions about two ways to save settings in the web.config. Appsettings
Yet another PHP question. I've got two arrays: one string-based and the other numeric.
I got two projects running, both written in PHP. Now I want to merge
I've got two questions about Asp.Net MVC areas. I have only a shallow understanding
I've got two questions about the Perl open function: 1) I seem to remember

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.