Jump to content

hphimmel

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About hphimmel

  • Birthday 10/03/1956

Contact Methods

  • Website URL
    http://

Profile Information

  • Gender
    Not Telling
  • Location
    Austria, Oslip

hphimmel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=383950:date=Jun 14 2006, 09:00 PM:name=lead2gold)--][div class=\'quotetop\']QUOTE(lead2gold @ Jun 14 2006, 09:00 PM) [snapback]383950[/snapback][/div][div class=\'quotemain\'][!--quotec--] I don't think AJAX is required... i'm doing what you want with PHP mixed with a FORM and a bit of Javascript. I only use Javascript for the auto-reload of the page once the item is selected. See what you want in action at: [a href=\"http://hitech.lead2gold.org/view_teams.php\" target=\"_blank\"]http://hitech.lead2gold.org/view_teams.php[/a] [/quote] Thank You, @lead2gold! You really leaded to gold and saved my day! I accomplished the task with my DB and my filters, but it works. One more thing: I guess, in Your SELF_PHP code (form... action= ... ) You have one equal-sign too much. That was exactly what I needed. As I am still learning PHP adding AJAX would be a little bit too challenging; it is not dead for me, but it is not the right time. A nice day from Austria Henry
  2. [!--quoteo(post=383652:date=Jun 14 2006, 08:44 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 14 2006, 08:44 AM) [snapback]383652[/snapback][/div][div class=\'quotemain\'][!--quotec--] no he really does mean AJAX. it is a javascript method of updating content "live" without having to submit and refresh the whole page. Go to www.ajaxfreaks.com for more details. [/quote] Well, thanks to both of you. I took a look on their page and it looks strange and broken. So I believe, that AJAX does not look the same on every computer, so I let the fingers from that (knowing the different sort of browser of my comrades...). Maybe the ajaxfriends do have other stylish probs...? One more thing: I took my time now and looked over the tutorials more intensly. There is a lot of stuff and very good as I can say now. Congratulation. I love to learn but sometimes time is a pressure and ideas and technique do not match as easy as I want to. But ok.
  3. [!--quoteo(post=383211:date=Jun 13 2006, 01:46 PM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 13 2006, 01:46 PM) [snapback]383211[/snapback][/div][div class=\'quotemain\'][!--quotec--] YOU NEED AJAX! MATE [/quote] AJAX is the name of a cleaning material in plastic bottles (in Austria) - I think, You mean something else [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] . My provider has no AJAX, so my intention is good, but that is all. Thanks for suggestion Henry
  4. Hello! Desperate programmer here. I would like to show Filter in a Dropdown list. If user changes it, the page should refresh by itself. If nothing is choosen, a standard query is set. This works (ok, is on the first run). I do not have problems with Database. I can connect, I am able to set queries and they work. What I tried, is this: [code] <?php     session_start(); #hier Sessionauthorisierung mitsenden     # Berechtigungsmapping abholen/get Permissionmapping from database (rwx)     #include("../berechtigungskopf.inc.php");     # ---------------------------------------------------- #     # Ab hier Daten gemäß der Aufgabe abfragen/get server,user,password     include("../dbdata.inc.php");     @mysql_connect($server, $username, $password);     # Datenbankverbindung aufnehmen/get connection     @mysql_select_db($database) or die("Kann nicht mit Berechtigungsdatenbank verknüpfen");     # Abfrage absetzen ----------------------------------- #     if (!empty($_SESSION['subquery'])) {         if ($_SESSION['subquery']=='FilterFamilienname') {             $_SESSION['subquery'] =' ORDER BY Name'; } # standard     $query="SELECT * FROM vw_Facharzt".$_SESSION['subquery']; }     else {     $query="SELECT * FROM vw_Facharzt"; }     # ---------------------------------------------------- #     # and so on # now would come the grid and the many fields... again: NO prob.     ?> <html> <head> <title>dynamic filter test</title> </head> <body> <script language="javascript" type="text/javascript">     function hprocess(Filter)     {             subquery=Filter;         if (Filter=="FN") {         subquery=" ORDER BY 'NAME'";         }         if (Filter=="FP") {         subquery=" ORDER BY 'PLZ'"; }         // etc         alert(subquery); // just for testing and it works!    } </script> [/code] The filtering part looks like this: [code] <?php     $filterarten = array(         "FL"=>"",         "FN"=>"Familienname",         "FP"=>"Postleitzahl",         "FR"=>"Fachrichtung",         "FM"=>"Mitglieder",         "FI"=>"Mitglieder Inland",         "FA"=>"Mitglieder Ausland",         "FE"=>"Ehrenmitglieder",         "FD"=>"Diplomierte"         ); ?> <p>     <form name="Filterform" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">           <select name="Filter" size="1" onChange="hprocess(this.form.Filter.options[this.form.Filter.selectedIndex].value)">         <?php             foreach ($filterarten as $key=>$element) {             echo "<option value=$key>$element</option>";             }         ?>     </select> </p> </form> </body> </html> [/code] Is there any hint, how I could manage it, that the filter (=subquery) is done on the same page - or it calls itself again with the right query.subquery combination? Any suggestion? Anyone out there? Hello? Thanks a lot for Your patience ... Henry
  5. [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. [code] <?php     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>";     }     ?> <html> <head> <title>Dynamic Choice</title> </head> <body> # 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;         //location.reload();     } </script>   <?php # here i tried to find out, if the $Filtertext got some value; will be cleaned off       if (!empty($_SESSION['$Filtertext'])) {         $_SESSION['$Filtertext']="neu";     }       echo $Filtertext; ?>       <p> # Filter- or orderby part     <?php     $filterarten = array(         "FL"=>"",            "FN"=>"Familienname",         "FP"=>"Postleitzahl",         "FR"=>"Fachrichtung",         "FM"=>"Mitglieder",         "FI"=>"Mitglieder Inland",         "FA"=>"Mitglieder Ausland",         "FE"=>"Ehrenmitglieder",         "FD"=>"Diplomierte"         );       ?>     <form name="filterform" action=<?php echo $_SERVER['PHP_SELF']; ?> method="post" >           <select name="Filter[]" size="1" onChange="process(<?php echo $element ?>)">     <?php         foreach ($filterarten as $key=>$element) {         echo "<option value=$key>$element</option>";         }       ?>     </select>       </p>     <p>         <input type="submit" name="Submit" value="Submit">       </p>     </form> # again - I try to find out, is there anything, anyone - hallo???? <?php     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>"; ?> </body> </html> [/code] 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. Henry
  6. Hello, over ther! Please bear with me. My English seems not to be good enough to find the right topic. My problem is as follows: I try to show a list ov events, the user could choose and then it should change to the detail mask with the choosen event. I got the list, it shows the right primary id in the title (was just for test, so I knew, I should be right) but than - bang! On the next page it always shows the id from the last event. I surely have a logical error. Could You please help me? Thanks a lot. Now the codesnippets: start: include("../dbdata.inc.php"); @mysql_connect($server, $username, $password); # Database connection @mysql_select_db($database) or die("Kann nicht mit Berechtigungsdatenbank verknüpfen"); # query //$query="SELECT s.Bezeichnung AS Kurs, s.Datum_von, s.Datum_bis, s.Ort, s.Leiter, s.Preis FROM oenrdb_bu.seminar s ORDER BY s.Datum_von"; $query="SELECT v.Seminar_ID, v.Kursbezeichnung, v.Jahr, v.Datum_von, v.Datum_bis, v.SemOrt_ID, v.Leiter, v.Lehrer, v.Min, v.Max, v.Preis_M, v.Preis, v.Status, v.Abgesagt, v.WListe, v.S_1, v.S_2, v.S_3, v.S_4, v.S_5, v.S_6, v.S_7, v.S_P, v.S_Z, v.S_D, v.V_1, v.V_2, v.V_3, v.V_4, v.V_5, v.V_6, v.V_7, v.V_P, v.V_Z, v.Kommentar, v.SeminarOrtPLZ, v.SeminarOrt, v.SeminarOrtBezeichnung, v.LeiterTitel, v.LeiterVorname, v.LeiterName FROM vw_seminar v"; $result=mysql_query($query); # check, how much answers do we have $num= mysql_num_rows($result); mysql_close(); ... and so on (HTML Stuff) NOW: [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] <?php # reading from buffer $i=0; while ($i<$num) { $_SESSION['datenID'] = mysql_result($result, $i, "Seminar_ID"); $Kursnummer = mysql_result($result, $i, "Seminar_ID"); $Kursbezeichnung = mysql_result($result, $i, "Kursbezeichnung"); $DatumVon = mysql_result($result, $i, "Datum_von"); $VDatumStr = date("d.m.Y",getdate(mysql_result($result, $i, "Datum_von"))); $DatumBis = mysql_result($result, $i, "Datum_bis"); $SeminarOrtBezeichnung = mysql_result($result, $i, "SeminarOrtBezeichnung"); $SeminarOrtPLZ = mysql_result($result, $i, "SeminarOrtPLZ"); $SeminarOrtName = mysql_result($result, $i, "SeminarOrt"); $SeminarOrt = $SeminarOrtBezeichnung.', '.$SeminarOrtPLZ.' '.$SeminarOrtName; $SeminarLeiterTitel = mysql_result($result, $i, "LeiterTitel"); $SeminarLeiterVorname = mysql_result($result, $i, "LeiterVorname"); $SeminarLeiterFamName = mysql_result($result, $i, "LeiterName"); if (strlen($SeminarLeiterTitel)>0){ $SeminarLeiter = $SeminarLeiterTitel.' '.$SeminarLeiterVorname.' '.$SeminarLeiterFamName; } else { $SeminarLeiter = $SeminarLeiterVorname.' '.$SeminarLeiterFamName; } $Preis = mysql_result($result, $i, "Preis"); # output-task ?> <td class="bodyText" valign="top"> <?php $_SESSION['datenID'] = $Kursnummer; /* THERE IS THE BAD THING * It shows the right number of the event, but gives the last to the next page * no Synchronisation */?> [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /] [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<p><strong><a href="./seminardetail.php" <?php sessionschreiber($Kursnummer); ?> title=<?php echo $_SESSION['datenID']; ?> > [!--colorc--][/span][!--/colorc--] [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?php echo $Kursbezeichnung.' '.$Kursnummer; ?></a></strong> <br class="quote" />[!--colorc--][/span][!--/colorc--] <?php echo $DatumVon; ?> bis <?php echo $DatumBis; ?> <br /> <?php # echo $VDatumStr; ?> Seminarleiter: <?php echo $SeminarLeiter; ?> <br /> Veranstaltungsort: <?php echo $SeminarOrt; ?> </p> </td> </tr> <?php ++$i; } ?> sessionschreiber($Kursnummer) does only one of two things: either (preferred) assigning the variable $_SESSION['datenID'] = $Kursnummer or writing the primary key to a database. It is always the last number of events Thanks in advance Henry
×
×
  • 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.