Forums

Redirect plugin an special characters

GreyHead 14 Oct, 2010
Hi epsdaniel,

The plug-in is behaving correctly and urlencoding what it thinks is is a value string.

Where are you getting this value "9853&zon=48&text=Volver" from?

It's actually 2 1/2 separate parameters: 9853 | zon=48 | text=Volver

You probably need just 9853 where you have this and then
zon=48
text=Volver
In the "Extra Fields Data" box. Or, if they are all variable data you need to split up the string into separate variables.

Bob
epsdaniel 14 Oct, 2010
Hi Bob,

Thanks for your reply. Let me explain what I am trying to do.

You are right "It's actually 2 1/2 separate parameters: 9853 | zon=48 | text=Volver". Are 3 differents values." Are 3 differents values. the 1/2 left is loc=9853&zon=48&text=volver

I have a table with some values.
ide -- estacion -- relacion -- Texto -- zona

9853 -- Grandvalira (todas las poblaciones)-- 2 -- Volver -- 48


I have a differents "select subcat". When the user select any of them takes "ide" and send it as value. That works perfect.

I need to catch for selected value when is submited the value "texto" (in all of them) and value "zona" (which could be empty and somes cases).

I do not know how to do it due I have dropdown - category and differentes dropdowns - subcategory. When I choose any category then the proper subcategory is enabled and display.

So I thought to print the values of "text" and "zona" into "ide". So in this case when the form ask the databe and takes value of select could take 9853&text=Volver&zone=48 (manually) but that no works.

Maybe if you point to me how to take the selected value of subcat and when I have this value (9853 in this case) look up the database and ask for text value and zona value (in case exist).

Thanks for your help Bob.

Dani
GreyHead 14 Oct, 2010
Hi Dani,

You can do the database lookup in either the plug-in Extra Code Before box; or the Form Code OnSubmit Before box:
<?php
$ide = JRequest::getInt('ide', 0, 'post');
if ( $ide ) {
  $db =& JFactory::getDBO();
  $query = "
    SELECT `Texto`, `zona`
      FROM `#__some_table`
      WHERE `ide` = '$ide' ;
  ";
  $db->setQuery($query);
  $data = $db->loadAssoc();
} else {
  $data = array('Texto' => '', 'zona' => '');
}
JRequest::setVar('text', $data['Texto']);
JRequest::setVar('zona', $data['zona']);
?>


You'll need to add place-holders in the Form HTML to create the boxes in the plug-in:
<input type='hidden' name='text' value=''>
<input type='hidden' name='zona' value=''>


Bob
epsdaniel 18 Oct, 2010
Hi Bob,

Thanks so much for your help. Works perfect.

Have a good day!!

Dani
This topic is locked and no more replies can be posted.