Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: SQL query??  (Read 6804 times)

0 Members and 1 Guest are viewing this topic.

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
SQL query??
« on: February 11, 2011, 03:55:13 pm »

hi@all,

I am dealing with just another port from 1.4x. The plugin rcmenu has it done to me. Unfortunately I run aground at the time of a SQL query. I come here not keep it up right, so maybe someone has a tip why it jams.
The attached error message does not occur continuously. I suspect that my problem here begins with these lines.
Code: [Select]
.
.
.
//check posted value for Menu Item creation
$superCage = Inspekt::makeSuperCage();
$ci = $superCage->get->keyExists('create_item');
$c_i =$superCage->get->keyExists('change_items');
$c_l =$superCage->get->keyExists($p_id);
//addslashes

        if (isset($ci))
{
        $item_title = ($superCage->post->getEscaped('title'));
$item_admin = ($superCage->post->getEscaped('admin_menu'));
$item_hr = ($superCage->post->getEscaped('hr'));
$item_url = ($superCage->post->getEscaped('url'));
$item_target = ($superCage->post->getEscaped('target'));
        $item_id = ($superCage->post->keyExists('id')) +1;
        $sql = "INSERT INTO cpg15x_plugin_rcmenu (id,title,admin,url,target,hrnext) VALUES ('$item_id','$item_title','$item_admin','$item_url','$item_target','$item_hr')";
        cpg_db_query($sql);
}
.
.
.

the rest is running on 1.5xx, Does anyone have a tip for me

CMFA
Logged

Nibbler

  • Guest
Re: SQL query??
« Reply #1 on: February 11, 2011, 05:24:02 pm »

Code: [Select]
$item_id = ($superCage->post->keyExists('id')) +1;

That looks like it should be

Code: [Select]
$item_id = ($superCage->post->getInt('id')) +1;
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: SQL query??
« Reply #2 on: February 11, 2011, 08:09:22 pm »

hi

changed it with the same success. If I change here

Code: [Select]
if (($ci) !== TRUE)// no error, no entryor
Code: [Select]
if (isset($ci)) // Error!
then the error message doesn't come but nothing is entered


CMFA
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: SQL query??
« Reply #3 on: February 11, 2011, 10:16:48 pm »

I haven't looked at the plugin code, but it seems that you need to count up the ID plus one. So please use Nibbler's suggestion and try again. Maybe you also have to change all
Code: [Select]
->post->to
Code: [Select]
->get->
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: SQL query??
« Reply #4 on: February 11, 2011, 11:05:33 pm »

Hi,

   
I made the proposed amendment. Unfortunately without the desired success.
Do as above already described query if and do no page refresh the record is saved. F5 is the critical error.

CMFA
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: SQL query??
« Reply #5 on: February 12, 2011, 10:05:30 am »

Do as above already described query if and do no page refresh the record is saved. F5 is the critical error.
Sorry, but I don't know what you try to tell us.
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: SQL query??
« Reply #6 on: February 12, 2011, 09:18:18 pm »

Hi@all

   
Problem found and fixed. Problem lay in the if condition

@ Andre thanks for the friendly kick ;)

VG

CMFA
Logged

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte
Re: SQL query??
« Reply #7 on: February 24, 2011, 08:16:56 pm »

Is the problem solved in the attached file in the first post?
In other words, will you post the working plugin for cpg 1.5x?

Best regards
Mimer  8)
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: SQL query??
« Reply #8 on: February 24, 2011, 08:22:59 pm »

Hi,

yes the problem is solved. Did the topic is not closed

vg

cmfa
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte
Re: SQL query??
« Reply #10 on: February 24, 2011, 09:08:07 pm »

Great, tnx. Just what I needed.

Mimer  8)
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 21 queries.