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

  • Home
  • SEARCH
  • 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 7861259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:38:15+00:00 2026-06-02T22:38:15+00:00

I made a chrome extension to search the website dev.bukkit.org, and it works great

  • 0

I made a chrome extension to search the website dev.bukkit.org, and it works great with this code:

  <script>
    function onLoad() {
      document.getElementById("mytextfield").focus();
    }

    function onKeyPress(e) {
      if (e.keyCode == 13) {
        openResults();
      }
    }

    function openHomePage() {
      window.open("http://dev.bukkit.org/");
    }

    function openResults() {
      window.open("http://dev.bukkit.org/search/?search=" + encodeURIComponent(document.getElementById("mytextfield").value));
    }
  </script>
</head>
<body onload="onLoad();">
  <img src="png-3.png" onclick="openHomePage();" style="border-width: 0px; cursor: pointer" /><br>
  <div name="myFormDiv" style="center: 6px;">
  <br>
    <center><input type="search" id="mytextfield" name="mytextfield" placeholder="Search..." onkeypress="onKeyPress(event);" /></center>
  </div>

I now would like to make an option to search forum.bukkit.org. Unfortunately, it requires a token to search the forum. A friend gave me a php snippet that lets you search the forum, but I am having trouble integrating it into the original code to search dev.bukkit.org. Help would be appreciated, I am lost!
PHP Forum Search code:

<?php

$q=$_GET['q'];
echo do_post_request("http://forums.bukkit.org/search/search",'keywords='.$q.'&_xfToken=10000%2C1333276150%2C1b8a644c97b33e9cfda0e15170ca5185cf15bc3a');

function do_post_request($url, $data, $optional_headers = null)
{
  $params = array('http' => array(
              'method' => 'POST',
              'content' => $data
            ));
  if ($optional_headers !== null) {
    $params['http']['header'] = $optional_headers;
  }
  $ctx = stream_context_create($params);
  $fp = @fopen($url, 'rb', false, $ctx);
  if (!$fp) {
    throw new Exception("Problem with $url, $php_errormsg");
  }
  $response = @stream_get_contents($fp);
  if ($response === false) {
    throw new Exception("Problem reading data from $url, $php_errormsg");
  }
  return $response;
}
?>

Thank you:)

  • 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-02T22:38:16+00:00Added an answer on June 2, 2026 at 10:38 pm

    Based on Adding custom HTTP headers using JavaScript, you should use XmlHttpRequest. My personal suggestion would be to use ajax to call php script and retrieve data. You can implement it easily with jQuery’s .post().

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

Sidebar

Related Questions

This issue drove me nuts for 2 days. I made a simple chrome extension
I just made a Chrome extension. I followed this tutorial to get a nice
I made a chrome extension which calls jQuery's ajax method: content-script.js [...] $.ajax({ url:
I'm using the following script within a Chrome extension I made. It replaces old
Made this nice little loop for hiding and showing div's, works as a charm
I am experiencing some problems with a google chrome extension I have made. I've
I've made a Chrome extension with an options page. The data is saved in
I have compiled the NPAPI plugin for webP: http://code.google.com/p/webp-npapi-linux/ It works great from my
i made a chrome extension, and my extension will show popup on webpage. I
I'd like to write a Chrome extension that works with a particular JS-based chat

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.