사이트의 다른 곳에서 작동하지만 지금은 나를 위해 일하지 않는 스크립트가있는 곳에서 문제가 발생합니다. 이 문제는 IE에서만 발생하며 Mozilla에서는 잘 작동합니다. 누군가가 내가 잘못는지 말해 수 있다면
<?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);
}
하는 것이 좋을 것 : 여기
<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>
작동하도록되어 코드입니다 : 아래의 양식입니다. 감사합니다
편집
$action = $secure->secure_string does the following:
function secure_string($string)
{
return (strip_tags(addslashes(mysql_real_escape_string(stripslashes($string)))));
}
이 기능은 무엇입니까 $ secure-> secure_string? –
흥미로운이 포럼 스레드를 작성해 보겠습니다. http://www.webmasterworld.com/html/3342151.htm – balpha