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.

Form mail --> ins html umsetzen pls

Empfohlene Antworten

Veröffentlicht

Hi Leute.

Ich habe ein folgendes problem, ich würde mal gerne auf meine Seite folgenden Script setzen, welcher in PHP geschrieben ist.

Dieser Script dient dazu, damit ein Benutzer eine Informazion abschickt, welche dann später in einem TXT fail auf dem Server gespeichert wird.

Meine Frage bzw. bitte an euch.

Kann mir bitte diesen Code jemand ins html umsetzen ???

Bzw also html und JavaScript oda so???

Ich habe den Script etwas umgeschriben, jetzt funtz er so wie ich es haben wollte, aber in mein Portal kann ich ihn nicht einsetzen als PHP Block, daswegen habe ich mich entschlossen, diesen Code ins HTML bzw Javascript umzuschreiben, aber leider fehlen mir paar kenntnisse in Javascript.

Hier ist der folgende Code:

Datei Nr1, welcher aufgerufen wird --> form.php


<?


echo"

<form method=\"post\" action=\"result.php\">

<input type=\"hidden\" name=\"action\" value=\"add\">

<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

  <tr>

    <td><font class=\"normal\">Nick:</font></td>

    <td><input class=\"box\" type=\"text\" name=\"nick\" size=\"15\"></td>

  </tr>

  <tr>

    <td><font class=\"normal\">Comments:</font></td>

    <td><input class=\"box\" type=\"text\" name=\"comments\" size=\"15\"></td>

  </tr>

  <tr><td><br></td></tr>

  <tr>

    <td colspan=\"2\"><center><input class=\"box\" type=\"submit\" name=\"submit\" value=\"Send message\"></center></td>

  </tr>

</table>

</form>

";


?>

Datei Nr2. --> result.php

<?


include ("functions.php");

//if the form is submitted corectly we process addcomment()

if (($action == "add") && (($nick != "") && ($comments != ""))) addcomment();


header('Location: http://www.weiterleitungseite.de');

exit();


?>

Datei Nr3 --> functions.php

<?


$file = "comments.txt";


function addcomment() {

global $nick, $comments, $file;


//opening the file comments.txt and preparing it for appending

       $f_write = fopen($file, "a");

//we format the line we want to be added into the file

       $array = "    <tr><td><font face=\"arial\" size=\"2\" color=\"#000000\"><u>" . $nick . "</u>: </font><font face=\"arial\" size=\"2\" color=\"#000000\">" . $comments . "</font></td></tr>" . "\r\n";

//adding the line into the file

       fputs($f_write, $array);

//closing the file comments.txt

       fclose($f_write);

}


?>

Und anschließen schreibt sich die ganze Information von angegebenem Benutzer in die letzte Datei Nr4. comments.txt

P.S. danke allen im vorraus für Ihre Hilfe und Antworten.

Mfg SyMteX

Dieser Script dient dazu, damit ein Benutzer eine Informazion abschickt, welche dann später in einem TXT fail auf dem Server gespeichert wird.

HTML und Javascript laufen im Browser ab, also auf dem Client. Du kannst damit also keine Textdatei auf dem Server schreiben oder lesen.

Alternativen wären .z.B. Perl, Java (Servlets) oder ASP, aber mit HTML und Javascript ist das unmöglich.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.