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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:35:20+00:00 2026-05-31T11:35:20+00:00

I set up a enable/disable button in an admin panel http://brettadamsga.com/development/madisonweddings/admin/clients.php The buttons work

  • 0

I set up a enable/disable button in an admin panel

http://brettadamsga.com/development/madisonweddings/admin/clients.php

The buttons work sometimes, and then at other times don’t, I have no idea what could cause this. Any ideas?

Creates the list of clients

<?php
    dbcon();
    $navQuery = 'SELECT * FROM mw_clients WHERE status = 1';
    $li = mysql_query($navQuery);
    while($row = mysql_fetch_array($li){
        echo "<tr><td><a href=\"index.php?loc=" . $row['clientSlug'] . "\">" . $row['name'] . "</a></td><td align=\"center\"><a style=\"text-decoration: none;\" href=\"changeStatus.php?type=2&id=" . $row['id'] . "&status=0\">&#10005;</a></td></tr>";
    }
?>

changeStatus.php

<?php
require ('../common.php');

$type=$_GET["type"];
$id=$_GET["id"];
$status=$_GET["status"];

if ($status == 0 && $type == 1)
    {
        dbcon();
        $query = "UPDATE mw_cats SET status=0 WHERE id=" . $id . "";
        if (mysql_query($query))
            {
                echo mysql_error();
                mysql_close();
                header ('HTTP/1.1 301 Moved Permanently');
                header ('Location: categories.php');
            } else {
                echo '<p>Could not change status</p>';
            }
    }

if ($status == 1 && $type == 1)
    {
        dbcon();
        $query = "UPDATE mw_cats SET status=1 WHERE id=" . $id . "";
        if (mysql_query($query))
            {
                echo mysql_error();
                mysql_close();
                header ('HTTP/1.1 301 Moved Permanently');
                header ('Location: categories.php');
            } else {
                echo '<p>Could not change status</p>';
            }
    }

if ($status == 0 && $type == 2)
    {
        dbcon();
        $query = "UPDATE mw_clients SET status=0 WHERE id=" . $id . "";
        if (mysql_query($query))
            {
                echo mysql_error();
                mysql_close();
                header ('HTTP/1.1 301 Moved Permanently');
                header ('Location: clients.php');
            } else {
                echo '<p>Could not change status</p>';
            }
    }

if ($status == 1 && $type == 2)
    {
        dbcon();
        $query = "UPDATE mw_clients SET status=1 WHERE id=" . $id . "";
        if (mysql_query($query))
            {
                echo mysql_error();
                mysql_close();
                header ('HTTP/1.1 301 Moved Permanently');
                header ('Location: clients.php');
            } else {
                echo '<p>Could not change status</p>';
            }
    }

?>
  • 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-31T11:35:21+00:00Added an answer on May 31, 2026 at 11:35 am

    It is being caused by your permanent redirects. They get cached by the browser so the next time you access it goes direct to the redirected page instead of running the script.

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

Sidebar

Related Questions

How do I enable (and conversely disable) a button when a textbox has a
I wanted to disable a button when the dialog is created initially. I enable
I'm trying to enable .htaccess files on a Ubuntu server I set up. I
Parent is a UIImageView, child is a UIImageView. Both have enable user interaction set
I have written following code to set the status of the image button to
Why when a control does contain value but it's set to .Enable=False that all
I'm trying to enable or disable all the control in a window as the
I have a radiobutton set called 'daypattern'. Clicking on it should enable the checked
I'm getting some inconsistent behavior when I disable certain Button controls in my VS2008
The following code does work in FF. I am trying to set the checkbox

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.