Jump to content

antonyfal

Members
  • Posts

    172
  • Joined

  • Last visited

Posts posted by antonyfal

  1. Hi,

    In my mysql database i have a text input option, in the registration form and edit my details form i have a multiple select dropdown list, which user selects options to populate the text input box, which ultimately populates the text field in the mysql database.

    All works perfectly.

     

    The dropdownlist consists of 3 parts <optgroups> first is current selection (what is the usesr current selection)works fine, The second <optgroup> is existing words, what words we(the site) have given as options, and the third <optgroup> is the words that others have used. This is where im having a small problem.

    Because its a text field when i call the data from the database, it calls the entire text box as a single option in my select list..

     

    I want to break the words in the text field (at the comma) and have them listed each one as an option in the select list.

     

     

    Example what i need:

     

    Words in text box:(my input allows the "comma")

    word1, word2, word3, word4, word5, word6,

     

    How i want them called/displayed:

    <option value=\"word1\">word1</option>

    <option value=\"word2\">word2</option>

    <option value=\"word3\">word3</option>

    <option value=\"word4\">word4</option>

    <option value=\"word5\">word5</option>

    <option value=\"word6\">word6</option>

     

    here's my code:

    $query = "SELECT allwords FROM #__functions_experience WHERE  profile_id  = '".(int)$profileId."' LIMIT 1";

    $original_functionsexperience =doSelectSql($query,1);

    $query = "SELECT allwords FROM #__functions_experience WHERE  profile_id  = '".(int)$profileId."' LIMIT 1";

    $functionsexperiencelist=doSelectSql($query);

        $funcexpList ="<select multiple=\"multiple\" onchange=\"setFunctionsexperience(this.options)\">";

    foreach ($functionsexperiencelist as $functionsexperienceal)

    {

    $selected="";

    if ($functionsexperienceals->allwords == $original_functionsexperience)

    $selected=' selected="selected"';

    $allwords=$functionsexperienceal->allwords;

    $funcexpList .= "<optgroup label=\"Current selection\">

    <option value=\"".$allwords."\" ".$selected." >".$allwords."</option>

                </optgroup>

            <optgroup label=\"Existing Words\">

        <option value=\"existing1,\">existing1</option>

        <option value=\"existing2,\">existing2</option>

        <option value=\"existing3,\">existing3</option>

        <option value=\"existing4,\">existing4</option>

        <option value=\"existing5,\">existing5</option>

        <option value=\"existing6,\">existing6</option>

    </optgroup>

    <optgroup label=\"Others added\">    //heres problem

    <option value=\"".$allwordsgeneral."\">".$allwordsgeneral."</option>

    </optgroup>";

    }

    $funcexpList.="</select>";

    $output['FUNCEXPLIST']=$funcexpList;

     

     

    The result im getting for optgroup others added:

    word1, word2, word3, word4, word5,

     

    how can i get it like this:

    <option value=\"word1\">word1</option>

    <option value=\"word2\">word2</option>

    <option value=\"word3\">word3</option>

    <option value=\"word4\">word4</option>

    <option value=\"word5\">word5</option>

    <option value=\"word6\">word6</option>

     

     

     

  2. Hi, Im sorry it took so long to post my solution.

    Here it is:

     

    To add an extra or multiple extra fields to the top of a Query select dropdown list i did the following:

     

     

     

    $query = "SELECT DISTINCT rate_title FROM #xxxxx_rates ORDER BY rate_title ASC";

    $ratestitles =doSelectSql($query);

          $dropDownList ="<select class=\"inputbox\" name=\"ratestitle\">";

     

    /*i added this line*\    $dropDownList .= "<option value=\"\">All</option>";

     

                      foreach ($ratestitles as $ratetitle)

    {

    $selected="";

    $rate_title=$ratetitle->rate_title;

    $dropDownList .= "<option ".$selected." value=\"".$rate_title."\">".$rate_title."</option>";

    }

    $dropDownList.="</select>";

    $output['RATESTITLE']=$dropDownList;

    }

     

     

    I also tested a theory and it worked: you can add multiple of the line like so:

     

                              $dropDownList .= "<option value=\"\">All</option>";

                              $dropDownList .= "<option value=\"I\">I</option>";

                              $dropDownList .= "<option value=\"Sucked\">Sucked</option>";

                              $dropDownList .= "<option value=\"And\">lAnd</option>";

                              $dropDownList .= "<option value=\"Now\">Now</option>";

                              $dropDownList .= "<option value=\"Im\">Im</option>";

                              $dropDownList .= "<option value=\"Sharing\">Sharing</option>";

                              $dropDownList .= "<option value=\"Thanks for the tips\">Thanks for the tips</option>";

     

    be sure to set the order of these lines as as you would want them to appear in the dropdownlist above the mysql query select list.

     

    Hope this helps you.

  3. heres what i think is the problem:

     

     

    if($_POST['task'])

    {                      

    $successfull = $upload->$_POST['task']($_POST['destino'], $tipos, $maxsize);

     

     

    //the result=

     

    Fatal error: Call to undefined method FileUpload::saveCancellation() in /home/global38/public_html/xxxxx/plugins/content/file_upload.php on line 71

     

     

    I know now that the "$_POST" sends the information to the server for temp storage-- whats happening is that the component has the same task set on the server temp storage, so the 2 "$_POST" functions clash..

     

    how do i set the above $_POST not to be called when this function takes effect:

     

     

    function mycomponent_cmsspecific_parseByBots($str)

    {

    $limitstart = 0;

    $dispatcher =& JDispatcher::getInstance();

    JPluginHelper::importPlugin('content');

    $obj = new stdClass;

    $obj->text=$str;

    $output = $dispatcher->trigger('onPrepareContent', array (&$obj, & $params, $limitstart));

    $output= $obj->text;

    return $output;

    }

     

    and only when the plugin is used?

     

    i have to say that this plugin works flawless otherwise:

    and is there anything wrong with this line 71?

    /*line 71*/ $successfull = $upload->$_POST['task']($_POST['destino'], $tipos, $maxsize);

  4. I need to change the "task" to something else but not sure which task is a task or which is a name?

     

    this plugin causes a Fatal error undefined method........ I found that the cause is this "if($_POST['task'])" the 'task' is a duplicate to my component and when the component performs integrated function:

     

    $limitstart = 0;

    $dispatcher =& JDispatcher::getInstance();

    JPluginHelper::importPlugin('content');

    $obj = new stdClass;

    $obj->text=$str;

    $output = $dispatcher->trigger('onPrepareContent', array (&$obj, & $params, $limitstart));

    $output= $obj->text;

    return $output;

    }

     

    it calls to the "task" and then i get an error... can someone assist in changeing the name to something obscure:

    here is the plugin partial code:

     

     

    if($_POST['task'])

    {                      

    $success = $upload->$_POST['task']($_POST['destino'], $tipos, $maxsize);

     

     

    $path = JPATH_SITE . DS . $destino . DS . $username;

     

                    if($destino == "audio")

    {

                            copy('audio/user/index.php', $path.DS.'index.php');

    chmod($path.DS.'index.php', 0644);

    }

     

     

     

    $path = JPATH_SITE . DS . $destino . DS . $username;

     

    $userfiles = count(glob($path.DS . "*"));

     

    // mostramos el formulario de envio

    $form = "<div id='formUpload'><h3>".JText::_('UPLOAD_MANAGER')."</h3><form id='file_upload_form' name=\"file_upload_form\" method='post' enctype='multipart/form-data' >";

     

                            if($userfiles < $files)

                            {

    $form .= "<input type='file' id='file_field' name='file' class='$inputbox' size='$size' onchange=\"this.form.task.value = 'upload'; uploadfile(this.form, $number, $files)\"/>";

    }else{

    $form .= JText::sprintf( 'ADVICE', $files );

    }

     

    $form .= "<input type='hidden' id=\"destino\" name=\"destino\" value=\"" . $destino . DS . $username. DS . "\"/>

     

    <input type='hidden' id='count' name='count' value='' />

    <input type='hidden' id='userfiles' name='userfiles' value='$userfiles' />

    <input type='hidden' id='task' name='task' value='' />

    <input type='hidden' id='delete' name='delete' value='' />

    ";

     

     

    #####################################

     

     

    $form .= "</div>";

    }

     

    $form .= "</form>";

    $form .= "<h3>". JText::_('TASK_MANAGER') ."</h3>";

    $form .= '<table id="tasks" cellpadding="0" cellspacing="0" width="100%"></table>';

    $form .= '<div id="loaders"></div>';

    $form .= "</div>";

     

     

     

    and the javascript:

     

     

    //var container = document.getElementById('filemanager');

    function deletefile(file, ele, number, files){

    if(confirm("Are you sure?")){

    //alert(ele);

    //document.getElementById('delete').value = file;

    //document.getElementById('task').value = "delete";

    ele.elements['delete'].value = file;

    ele.elements['task'].value = 'delete';

    uploadfile(ele, number, files);

    }

    }

     

    function uploadfile(ele, number, files){

    //alert(document.getElementById('destino').value);

    max_uploads = number;

    max_files  = files;

    //userfiles = document.getElementById('userfiles').value;

    userfiles = ele.elements['userfiles'].value;

    var msgs = new Array();

    msgs['delete'] = 'DELETING';

    msgs['upload'] = 'UPLOADING';

    var task = ele.elements['task'].value;

    var path;

    if(task == 'upload'){

    path = ele.elements['file'].value;

    if(str = path.match(/.+(?:\/|\\)(.+)/)){

    path = str[1];

    }

    uploads++;

    }

    if(task == 'delete'){

    path = document.getElementById('delete').value;

    }

    var container = document.getElementById('tasks');

    //var row = document.createElement('tr');

     

    var row = container.insertRow(-1);

    row.id = "uploading_" + count;

    row.className = "list";

    var cell = row.insertCell(0);

    cell.width = "40%";

    var cell2 = row.insertCell(1);

    cell2.innerHTML = "<i><b>" + msgs[task] + "</b>: Please, wait</i>";

    cell.innerHTML = '<div id="loader_text_' + count + '" style="float: left">' + path +'</div>';

    var cell1 = row.insertCell(2);

    cell1.innerHTML = '<div style="float:right;"><img src="plugins/content/file_upload/images/loader.gif" id="loader_' + count + '"/></div>';

    var div = document.createElement('div');

    div.setAttribute("width", 0);

    div.setAttribute("height", 0);

    div.name = "div_" + count;

    div.id = "div_" + count;

    div.innerHTML = '<iframe width="0" height="0" style="display:none" name="' + 'iframe_' + count + '"></iframe>';

    document.getElementById('loaders').appendChild(div);

    ele.target = "iframe_" + count;

    document.getElementById('count').value = count;

     

    count++;

     

    ele.submit();

    ele.reset();

    setinputfile();

    ele.elements['task'].value = '';

    }

     

    function removeloader(i, err){

    var loader = document.getElementById("uploading_" + i);

    var loader_img = document.getElementById('loader_' + i);

    loader.deleteCell(1);

    switch(err){

    case 1:

    var cell = loader.insertCell(1);

    cell.innerHTML = "<i><b>FAILED</b>: The File could not be uploaded</i>";

    loader_img.src = "plugins/content/file_upload/images/warning.png";

    uploads--;

    break;

    case 2:

    var cell = loader.insertCell(1);

    cell.innerHTML = "<i><b>FAILED</b>: Type not valid</i>";

    loader_img.src = "plugins/content/file_upload/images/warning.png";

    uploads--;

    break;

    case 3:

    var cell = loader.insertCell(1);

    cell.innerHTML = "<i><b>FAILED</b>: File size exceeded</i>";

    loader_img.src = "plugins/content/file_upload/images/warning.png";

    uploads--;

    break;

    case 4:

    var cell = loader.insertCell(1);

    cell.innerHTML = "<i><b>FAILED</b>: A file with the same name already exists</i>";

    loader_img.src = "plugins/content/file_upload/images/warning.png";

    uploads--;

    break;

    case 5:

    var cell = loader.insertCell(1);

    cell.innerHTML = "<i><b>SUCCESS</b>: The file was deleted</i>";

    loader_img.src = "plugins/content/file_upload/images/ok.png";

    //document.getElementById('userfiles').value--;

    userfiles--;

    document.getElementById('userfiles').value = userfiles;

    break;

    default:

    var cell = loader.insertCell(1);

    cell.innerHTML = "<i><b>SUCCESS</b></i>";

    loader_img.src = "plugins/content/file_upload/images/ok.png";

    //document.getElementById('userfiles').value++;

    userfiles++;

    document.getElementById('userfiles').value = userfiles;

    uploads--;

    }

    loader.onclick = function(){

    var container = document.getElementById('tasks');

    container.deleteRow(this.index);

    }

     

    setinputfile();

    }

     

    function setinputfile(){

    //alert(uploads + ", " + userfiles + ", " + document.getElementById('userfiles').value);

    var inputfile = document.getElementById('file_field');

    //alert(uploads + userfiles);

    //alert(max_files);

    if(uploads >= max_uploads){

    inputfile.disabled = true;

    }else{

    if((1*uploads + 1*userfiles) >= max_files){

    inputfile.disabled = true;

    }else{

    inputfile.disabled = false;

    }

    }

    }

     

    function appendfile(output, file_icon, file_size){

    var table = document.getElementById("file_list");

    var row = table.insertRow(-1);

    row.className = "list";

    var cell = row.insertCell(0);

    //cell.width = "40%";

    cell.innerHTML = '<div style="float: left;">' + file_icon + ' ' + output + '</div>';

    var cell1 = row.insertCell(1);

    cell1.innerHTML = file_size;

    var cell2 = row.insertCell(2);

    cell2.innerHTML = '<div style="float: right;"><a href="javascript: deletefile(\'' + output + '\', document.getElementById(\'file_upload_form\'), ' + max_uploads + ', ' + max_files + ');"><img src="plugins/content/file_upload/images/remove.png" class="icons" /></a><a href="#"><img src="plugins/content/file_upload/images/download.png" class="icons" /></a></div>';

    //document.getElementById('loaders').removeChild(document.getElementById("div_" + i));

    }

     

    function removefile(output){

    var table = document.getElementById("file_list");

    //alert(output);

    for(var i = 0; i < table.getElementsByTagName('tr').length ; i++){

    //alert(table.rows.cells[0].innerHTML);

    var regex = "/.+" + output + "/.+";

    var str;

    if(str = table.rows.cells[0].innerHTML.match(output)){

    table.deleteRow(i);

    //alert("hola caracola");

    }

    }

    //document.getElementById('loaders').removeChild(document.getElementById("div_" + i));

    }

     

    function deleteframe(i){

    document.getElementById('loaders').removeChild(document.getElementById("div_" + i));

    }

     

     

  5. Thanks to all for the reply's to my problem above...

    I have to say that now i understand why the internet does things slightly different to the english dictionary.

     

    I did a quick fix on the above problem i had. I replaced the ":" with an "h" so now its 20h30 instead of 20:30 am

    its works fine for me.

    I will spend time on this little problem again and if i get the proper solution i will post it.

     

    Best regards

    Tony

  6. Dont know what you want exactly... but try this.

     

    foreach ($timeslotstarts as $timelotstart)
                {
                $timeslot_start=$timelotstart->timeslot_start;
                $dropDownList .= "<option value=".$timeslot_start.">".$timeslot_start."</option>";
                }
    

     

    Hi thanks for the reply.

    I ve done this way already, has same result// only 13 appears in the "URL"---

    I think what i need is to find away to get a "\" to the ":"  So value is = 13\:30pm and then remove it as its passed to URL so that 13:30pm is passed..

     

    Any ideas?

    // I wrote the above and didn't post- so ill just continue here with my solution:

     

    I replaced the little ":" with an "h" and removed the "am" and "pm" now the full value passes to "URL" 13h30.

    its not what i wanted, but its good enough for now.

     

    Thanks!

  7. The function mysql_real_escape_string() should only be used when the data is going to be used with a mysql query. Never when the data is going to the browser.

     

    Ken

     

    Thanks ken for the reply.

    Can you show me example of how to get the correct output for the real escape string in the value of the <select list?.

    All the examples ive come across use echo and i need an example with output.

     

    I need to get the "value=" to be an already real_escaped string(array).. but i just need an example how to call it from the database.

     

    Best regards

    Antony

     

     

  8. Hi.

    I got this code below, which makes a dropdownlist. the value is passed in a string to a URL. The value EXAMPLE: is 13:30pm, but what reaches the URL is 13    If i add the mysql_real_escape_string, the full value is passed to the URL. BUT so is the "mysql_real_escape_string".. what is wrong with this code?

     

     

    this example does not work period:

    $query = "SELECT DISTINCT timeslot_start FROM #__profile_rates ORDER BY timeslot_start ASC";

    $dropDownList ="<select class=\"inputbox\" name=\"timeslotstart\">";

    $timeslotstarts =doSelectSql($query);

    foreach ($timeslotstarts as $timelotstart)

    {

    $timeslot_start=mysql_real_escape_string($timelotstart->timeslot_start);

    $dropDownList .= "<option value=$timeslot_start>".$timeslot_start."</option>";

    }

    $dropDownList.="</select>";

    $output['TIMESLOTSTART']=$dropDownList;

     

     

    but if i change to this it works but gives the "mysql_real_escape_string" in the url

     

     

    foreach ($timeslotstarts as $timelotstart)

    {

    $timeslot_start=$timelotstart->timeslot_start;

    $dropDownList .= "<option value=mysql_real_escape_string($timeslot_start)>".$timeslot_start."</option>";

    }

    //Url looks like www.xxxx.com/xxx/x//xxxx/timeslotstart=mysql_real_escape_string(13%3A30pm),

    Everything is correct except the mysql_real_escape_string and the "(" and  ")" should not be passed.

     

    how can i write this?

     

  9. foreach( $arr as $key=>$val )

    $arr is an array

    $key is the index to the array item

    $val is the value of the array item

     

    Now we are learning programming not solving problems and you are pushing the limits. I am not here to do that - unless you want to pay contractor rates?

     

    Hey Paul--

    I am trying to "--SUCKIT--AND --SEEING--" Thats why i am here :P

    But i must have missed something in this step: Here's a little twist to my Query: I am using Pattemplates--

    the droplist i am selecting from is just a column of names without unique a ID-- and is an "$output" not an "echo"

    From all the examples on the net there are echo's and id's---

    Please show me and explain how you got it? then i can see and learn. Please!

    best regards (and thanks for the help this far i can use what you gave me in other solutions.)

    Tony

     

  10. So you didn't do much sucking and seeing then?

    it seems like you want me to do it for you rather than learn for yourself like everyone else has done. Well, you lose out in the end but you obviously want a quick-fix.

     

    Anyway, I always use sprintf for html stuff as it is easier than using slashes

     

    $dropDownList = sprintf('<select class="inputbox" name="ratestitle">');
    $dropDownList .= sprintf(' <option %s value="something_or_nothing" >--- please select ---</option>', "selected");
    $dropDownList .= sprintf(' <option selected value="something_or_nothing" >--- please select ---</option>'); // these both the same
    ...
    

    Awsome--! I still got to figure out where to place this but its should be a cinch from here, otherwise expect lots of private messages. ;)

    Thanks ocpaul20.

    regards

    Tony

     

    can the key and option be the same?

    like so:

    foreach( $options as $key=>$option )

     

    can it be: foreach( $options as $name=>$name )?

    all the examples ive seen bring up a unique id with a table name like: rates_uid, rate_title FROM xxxx

     

    in this case i am only bringing up the rate_title--

     

    so how do i right the foreach now?  the code you gave me just brings up equal amounts of "--- please select ---" amounts equal to the amount of words in column rate_title the html "URL" shows value=&next search function--

     

    I am lost with this code im guessing my select is not correct.. The problem here is the sch->ratestitle[".ratestitle."], has no definite value.

     

    So if you can show it to me in my code i can work it backwords :-[

     

    PLEASE!

    regards

    Tony

  11. So you didn't do much sucking and seeing then?

    it seems like you want me to do it for you rather than learn for yourself like everyone else has done. Well, you lose out in the end but you obviously want a quick-fix.

     

    Anyway, I always use sprintf for html stuff as it is easier than using slashes

     

    $dropDownList = sprintf('<select class="inputbox" name="ratestitle">');
    $dropDownList .= sprintf(' <option %s value="something_or_nothing" >--- please select ---</option>', "selected");
    $dropDownList .= sprintf(' <option selected value="something_or_nothing" >--- please select ---</option>'); // these both the same
    ...
    

    Awsome--! I still got to figure out where to place this but its should be a cinch from here, otherwise expect lots of private messages. ;)

    Thanks ocpaul20.

    regards

    Tony

     

  12. thanks ocpaul20.

    Im playing with the code now-- but im not getting it right with th code above. Can you please help me get it into the equation above?

     

    also note this is a search string of text values not (int)-- the droplist calls for a column in the table, there is no default "0" or "null" value.

    i used something like this:

                            $searchAll= gettext(_LANGUAGE_SEARCH_ALL..................................)

    $dropDownList ="<select class=\"inputbox\" name=\"ratestitle\">";

    $ratesitles =doSelectSql($query);

      /*i added*/  $ratestitles[]=$searchAll;

     

     

     

    ADDING THIS GIVE ME THE BLANK BUT AT THE BOTTOM OF THE LIST ITS NOT INCLUDED INTO THE ARRAY.

     

    how can i apply your code?

    best regards

    Tony

  13. Hi,

    I need to call to this text to add a all with value "blank/empty" or "0" to the dropdownlist code below..

    it should be inserted int the first position in the dropdownlist and have a value blank and call to this text from the language files:

    $searchAll = gettext('_LANGUAGE_SEARCH_ALL',_LANGUAGE_SEARCH_ALL,false,false);

    example is:

    ratestitle=>0 gettext('_LANGUAGE_SEARCH_ALL',_LANGUAGE_SEARCH_ALL,false,false);

    the words it calls is "ALL" when the user selects or leaves the "ALL" in the list the value

    remains empty this allows the search to search everything..

    basically im stuck how to get it in the dropdown list as the first default position:

    can anyone help?

     

    here is my code://this is a search function which calls to the field rate_title the text from the select box is matched to the database table and the search pages shows the search option is the search is successful.. I have 5 of these types of searches but cant give a broader search option to my users as the values must be selected to search--- i need the option "ALL" to have a "EMPTY" value or no value....

     

     

    if (in_array("ratestitle",$searchOptions)&& $showSearchOptions )

    {

    if (empty($sch->filter['ratestitle']) )

    $selectOption=$output['LANGUAGE_SEARCH_RATESTITLE'];

    else

    $selectOption=$sch->filter['ratestitle'];

    $showButton=true;

    $query = "SELECT DISTINCT rate_title FROM #__rates_table ORDER BY rate_title ASC";

    $dropDownList ="<select class=\"inputbox\" name=\"ratestitle\">";

    $ratesitles =doSelectSql($query);

    foreach ($ratesitles as $ratetitle)

    {

    $selected="";

    $rate_title=$ratetitle->rate_title;

    if ($ratetitle==".$sch->filter['ratestitle'].")

    $selected="selected";

    $dropDownList .= "<option ".$selected." value=\"".$rate_title."\">".$rate_title."</option>";

    }

    $dropDownList.="</select>";

    $output['RATESTITLE']=$dropDownList;

    }

     

  14. You don't show how you are getting the list of values from the database or if there should be a "pre-selected" value. Here is some sample code:

     

    //Run query to get all words from database
    $query = "SELECT word FROM table ORDER BY word";
    $result = mysql_query($query) or die(mysql_error());
    
    //Create options
    $wordOptions = '';
    while($row = mysql_fetch_assoc($result))
    {
        //Preselect value if it matches 'LANGUAGE_SEARCH_RATESTITLE'
        $selected = ($row['word']==$output['LANGUAGE_SEARCH_RATESTITLE']) ? ' selected="selected"' : '';
        $wordOptions .= "<option value=\"{$row['word']}\"{$selected}>{$row['word']}</option>\n";
    }
    $output['RATESTITLE'] = "<select class=\"inputbox\" size=\"24px\" name=\"ratestitle\">{$wordOptions}</select>";

     

    Hey yes! NO! joie de vie //joy of life= no luck with code:(--  Can anyone else take a shot at it

  15. Thanks for the reply--- If there can be a default option then blank is 0 value

     

    here is the way i check the database for matching value to text box:

     

     

    function Search_ratestitle()

    {

    $filter=$this->filter['ratestitle'];

    $this->makeOrs('profile_uid');

    $profile_ors=$this->ors;

    if(!empty($filter) && $profile_ors )

    {

    $keywords= mysql_real_escape_string($filter);

    $titlewords = explode( ' ', $keywords );

    $titles = array();

    foreach ($titlewords as $titleword)

    {

    $titles2[] = "LOWER(rate_title) LIKE '%$titleword%'";

    $titles[] = implode( ' OR ', $titles2 );

    }

    $title = '(' . implode( ($magic == 'all' ? ') AND (' : ') OR ('), $titles ) . ')';

    $query="SELECT profile_uid FROM #__profiles_rates ";

    $query.=" WHERE ( $title ) ";

    $query.=" $profile_ors ";

    $result=doSelectSql($query);

    foreach ($result as $st)

    {

    $resultObj = new stdClass;

    $resultObj->profilees_uid = $st->profile_uid;

    if (!in_array($resultObj,$stit))

    $stit[]=$resultObj;

    }

    $this->resultBucket=$stit;

    }

    $this->sortResult();

    }

     

    //profilees_uid is not a spelling mistake--

     

    The word entered in to the text box (first code set)is searched and matched to  a field as above---

    I want to call the list of names entered into the rate_title field into a droplist which the user uses to populate the text box (first code) if there can be a default option (it should have no value) if nothing is entered it will not be searched...

    one more point of interest-- the search textbox forms an array of searches so it is an optional search value that is added-- but a must!! to have it work ;)

    thanks for the quick responce, will the code you first gave me work?

    regards

    Tony

     

  16. I have a search function in php where the text characters are matched to characters in a tables field--- works perfectly....

    I need to make the input box have a droplist of words from database, this is also easy for me to do. the problem here is there is no definitive value! the options list always outputs a blank in the url---

     

    its supposed to search a matching value and then output the matching value to url...

     

    Here is the droplist code:

     

     

    $output['RATESTITLE']='<input class="inputbox" type="text" size="24px" name="ratestitle" value="'.$sch->filter['ratestitle'].'"  onfocus="if (this.value ==\''.$output['LANGUAGE_SEARCH_RATESTITLE'].'\') {this.value = \'\'}" />';

     

    this outputs a input text box--- i want to have a droplist of options to populate this text box...

    If you must know this is the third day im at it...

  17. Hi, im quite a newbie at .php forms but getting a handle on it..

    I have a script which allows registered users to create a profile.. which later enables them to select information such as services they provide form a dropdown list.. The information from the dropdownlist comes from the table in my phpmyadmin called:

    xxx_xxxx_services_classes

    and the columns under this field are:

    services_classes_uid , service_class_ abbv, services_classes_full_desc, image(can be 0), profile_uid(can be 0), srp_only(can be '0").

     

    I have a working form in my admin section where i can populate this table with no problem, how ever i want the user to be able to add data themselves from the profile creation form.. The data does not have to link to the profile, it just has to populate the table above...

     

    The profile creation form has several columns under the xxx_xxxx_profiles table...

     

    Both forms work perfectly seperately, I would like to add multiple textboxes to the profile creation form so that when the submit button is clicked, both tables will be populated in phpmyadmin so that they will apear in the dropdown box on the redirect page where the user can select their services and add a more information in the new form.

     

    I have an html frontend and a form script component for each form..

    I think i just need to modify the profile creation form to be able to add the data to the Services table?

    can someone help with the code? to enter the text boxes in the html, and the tables into the form..

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.