Jump to content


This topic is now archived and is closed to further replies.


#SOLVED# dynamic self call

Recommended Posts

[img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
First of all: I am Austrian and my English is bad for sure. I apologize, but I try.
Second: on behalf of PHP I am a newbie. Do not have probs with databases (normally).

What I am trying to do:
I would like to generate a filter for database sql script (which is no prob for me); this filter is a dynamic dropdown (I THINK, this is no problem for me), which should react on user action. Oh - You guess right - now my problem begins.

It would be good, to get rid of all javascript-parts, as some guys do have javascript off (as I do, for instance [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] ).

In a later version I will make this page available for a choice of database-lists.

    session_start(); #normal php start
#here I guess a possible creation or passing of the subquery-Part
    if (isset($_SESSION['subquery'])) {
        $_SESSION['subquery'] = $_SESSION['subquery'].' testet';
        echo "<a href='option_select.php?filter='".$supquery.">filtertest</a>";
<title>Dynamic Choice</title>
# here I would like to give You an idea, how I would create the filters;
# the main part of the query is of the sort "SELECT * FROM xtable"
<script language="javascript" type="text/javascript">
    function process(Filter)
        if (Filter=="FN") {
        subquery=" ORDER BY Name";        
        if (Filter=="FP") {
        subquery=" ORDER BY PLZ";
        //und so weiter
        Filter = subquery;

# here i tried to find out, if the $Filtertext got some value; will be cleaned off
      if (!empty($_SESSION['$Filtertext'])) {
      echo $Filtertext; ?>
# Filter- or orderby part
    $filterarten = array(
        "FI"=>"Mitglieder Inland",
        "FA"=>"Mitglieder Ausland",
    <form name="filterform" action=<?php echo $_SERVER['PHP_SELF']; ?> method="post" >      
    <select name="Filter[]" size="1" onChange="process(<?php echo $element ?>)">

        foreach ($filterarten as $key=>$element) {
        echo "<option value=$key>$element</option>";
        <input type="submit" name="Submit" value="Submit">

# again - I try to find out, is there anything, anyone - hallo????
    if ($filter) {
        echo "following filter was choiced:<br>";
        foreach($filter as $element) {
            echo "$element<br>";
    echo "$Filter<br>";
#here always the last element is shown. But is clear to me. Just for test if ANYTHING is writte by this program.
    echo "$element<br>";

I am thankfull for every hint.

I want to get rid of the submit-knob - as I mentioned before.
Thanks for reading, thanks for hopefully helping.


Share this post

Link to post
Share on other sites


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.