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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:19:10+00:00 2026-05-25T01:19:10+00:00

So hello everyone I have a big problem right now with a button that

  • 0

So hello everyone I have a big problem right now with a button that is made depending on the variables that are sent to the page in this case it’s a button the when it’s clicked it will access a DB and extract everything in the DB and put it into excel format. The problem right now is when the button is made it always execute the DB search and file making. I know it has to do it because of the way the button is made right now, is there anyway of changing this?

if ($action_db) echo "<button class=\"btn\" onClick='".getUDB()."'>" . DBUser . "</button>";

to this:

if ($action_db) echo "<button class=\"btn\" onClick=\"getUDB()\">" . DBUser . "</button>";

and sending the event trough java-script so it executes the getUDB() method that’s on my PHP file?

Thanks.

OK so I went and used part of the suggestion that Sam said and put it on a JQuery and the change is like this

if ($action_db) echo "<button class=\"btn\" id=\"UDB\">" . DBUser . "</button>";

JQuery:

<script type="text/javascript">
    $(document).ready(function(){  
        $("#UDB").click(function(){  
          <?getUDB();?>  
        });  
    });  

OK so the problem is that when I select the clients menu or any other part of the menu to access that part of the webpage it’s automatically doing the getUDB method and won’t let me access anything else. Any suggestions???

  • 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-05-25T01:19:11+00:00Added an answer on May 25, 2026 at 1:19 am

    If you don’t want the PHP function getUDB() to be called when you load the page, then you’re right – you want to move this out into a Javascript function.

    By doing echo "foo" . getUDB() . "bar", I’m assuming your page is loading slowly. To solve this, you can use Javascript with an AJAX call. So you probably want to:

    1. Create a separate PHP file that calls getUDB().
    2. Create a Javascript function on your original page that issues a GET request to this new, separate PHP file. It’s easiest to do this using jQuery, which makes AJAX requests nice and easy – check out this page.
    3. Write the Javascript needed to handle the response from that page appropriately.

    SitePoint has a good tutorial on jQuery and AJAX, check it out.

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

Sidebar

Related Questions

hello everyone I have some problem with understanding this piece of the code: import
Hello everyone i have a problem in my application. The check in my check
Hello everyone i currently have this: import feedparser d = feedparser.parse('http://store.steampowered.com/feeds/news.xml') for i in
Hello everyone I have a question that I will describe as good as I
hello everyone im trying to create this tweak that copies a file from one
hello everyone i have a problem with my 3-tiers application i don't know how
Hello everyone I have converted a project in C# to F# that paints the
hello everyone I have this snippet of the code: local helper(f, i, j) =
hello everyone I have this snippet of the code: local fun NTimesF(f, n:int) =
hello everyone I have this snippet of the code: void* Init(int N) { Hand

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.