Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP-Datenbankabfrage an Javascript

Empfohlene Antworten

Hallo Leute,

folgende Problemstellung: Ich habe eine PHP-Datei, in der ich eine Datenbankabfrage mache. Das Ergebnis dieser Abfrage soll an meine Javascript-Datei gesendet werden und in einem bestimmten Bereich angezeigt werden.

Mein Problem ist nun, die Übergabe der Abfrage von PHP-Script an das Javascript.

Kann mir da jemand weiterhelfen?

Gruß

Scherzkeks

Mein Problem ist nun, die Übergabe der Abfrage von PHP-Script an das Javascript.

Stichwort Ajax. Oder wenn du die Seite generell erst aufbaust, dann einfach die Ausgabe als Javascript-Code in dein Dokument.

Könntest du das mit Ajax etvl. näher erläutern? Ich versuche es z.Zt. auch mit Ajax. Ich schicke damit Daten an ein PHP-Script, das diese dann in eine DB einträgt. Folgendermaßen gehe ich vor:

Javacsript:


  with(new Ajax()) {

    url = "php/dbConnect.php";

    method = "POST";

    params = "content_first="+content_first+"&content_second="+content_second+"&content_third="+content_third;

    onError = function() { alert("Fehler aufgetreten"); }

    onSuccess = function() { alert("test"); }

    doRequest();

  }

um die daten dann in PHP engegenzunehmen gehe ich so vor:


$content_first = stripslashes($_POST["content_first"]);
$content_second = stripslashes($_POST["content_second"]);
$content_third = stripslashes($_POST["content_third"]);
[/PHP]

Mein Problem ist es das ich es nicht andersrum schaffe.

Kann mir da jemend hilfreiche, sinnvolle Tipps geben?

Gruß

Scherzkeks

Könntest du das mit Ajax etvl. näher erläutern?

Da ist ein Link hintendran ;)

Was ist es?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.