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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:56:19+00:00 2026-05-11T21:56:19+00:00

I am having a bizare problem where I have a script that works elsewhere

  • 0

I am having a bizare problem where I have a script that works elsewhere on the site but refuses to work for me now. The problem is exclusive to IE, it works fine in Mozilla.
Below is the form:

<form class="element_form" action="general_image.php" method="post">

    <?php generate_input('hidden', '', 'id', $id);?>
    <input type="image" src="../images/delete.gif" name="action" value="delete" class="button" />
    <input type="image" src="../images/tick.gif" name="action" value="active_switch" class="button" />

</form>

Here is the code that is supposed to work:

<?php

include('header.php');

$db->connect();

$table = 'general_image';

$page = 'general';

$region = $_SESSION['region'];

$action = $secure->secure_string($_REQUEST['action']);
$id = $secure->secure_string($_POST['id']);

$max_active = 1;

if($action == 'active_switch' || $action == 'delete'){

    $response = array();

    $response['action'] = $action;
    $response['id'] = $id;

    if($action == 'active_switch'){

        $query = 'SELECT * FROM general WHERE region = "' . $region . '"';

        $result = mysql_query($query);

        if(!$result) {

            $utility->fail($action, 'query error: ' . $query);

        }else{

            $row = mysql_fetch_assoc($result);

            $already_active = false;

            $active = '';

            if($id == $row['fifi']){

                $already_active = true;
            }

            $active .= $row['fifi'];

            $response['results'] = $active;

            if(!$already_active){

                $update = '';
                $active = '';

                $update .= 'fifi="' . $id . '"';

                $active .= $id;

                $query = 'UPDATE general SET ' . $update . ' WHERE region = "' . $region . '"';

                $response['results'] = $active;

            }else{

                    $utility->redirect($page . '.php');

            }
        }

    }elseif($action == 'delete') {

        $query = "DELETE FROM $table WHERE id=" . $id;
    }

    echo $query . "hello";


    if(!mysql_query($query)) {

        $utility->fail($action, 'query error: ' . $query);
    }

If someone could tell me what I’m doing wrong that would be great. Thanks

EDIT

$action = $secure->secure_string does the following:

    function secure_string($string)
    {   
        return (strip_tags(addslashes(mysql_real_escape_string(stripslashes($string)))));
    }
  • 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-11T21:56:19+00:00Added an answer on May 11, 2026 at 9:56 pm

    i have found that sometimes it is better to have a hidden field for action then a submit button or image. if someone press RETURN or ENTER to submit the form which action will be returned ?

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

Sidebar

Related Questions

I'm having trouble with a gradient drawing call. I have a Form that looks
Having spent a bunch of time recently doing 2D work that involves pixel manipulation
Having worked with Classic ASP for about 2 years now by creating a few
Having a problem getting a TreeView control to display node images. The code below
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and
I'm having a bizarre problem with C++ where the long data type is overflowing
I'm having a bizarre problem with Visual Studio 2008. I wanted to debug one
We're having a bizarre problem with Indy10 where two large strings (a few hundred
UPDATE: I have determined that the SQLClient code times out on the first call,

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.