Nasıl php bir dizi için bir html formundan (çoklu) girişleri tasarruf edebilirsiniz?

0 Cevap

Ben üç alan, adı soyadı ve orta ile bir HTML formuu var. isim ve ben bir php sayfasında bu bilgileri kaydetmek istiyorum. Sorun veritabanı bağlantısı olmadan dizide birden girişleri kaydetmek için nasıl bilmiyorum.

HTML formu

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Εργασία 11 - Βασίλης Τρίγκας</title>
    </head>
    <body>
        <h4>Καταχώριση βιβλίου</h4>
        <form action="form_action.php" method="get">
            Συγγραφέας <br/><input type="text" name="fnwriter" /><br/>
            Τίτλος <br/><input type="text" name="title" /><br/>
            Εκδότης<br/> <input type="text" name="editor" /><br />
            <input type="submit" value="Submit" />
        </form>

    </body>
</html>

PHP Dosya

    <?php 

function display_welcome(){
    print("Σωστή εισαγωγή,  ");
    print($_GET['fnwriter','title','editor'])
}

function display_empty_form(){
    print <<<_HTML_
    <FORM method="post" action="$SERVER['PHP_SELF']">
    <BR/>
    <INPUT type="submit" value="SUBMIT NAME">
    </FORM>
    _HTML_;
}

if ($_GET['fnwriter','title']) {
    display_welcome();
}
else {
    display_empty_form();
}

$Book=array("fnwriter","title","editor");

$fwriter=$_GET['$fnwriter']
$title=$_GET['$title']
$editor=$_GET['$editor']

echo $fnwriter;
echo $title;
echo $editor;

for ($i = 0; $i < count($fnwriter,$title,$editor); ++$i) {
        echo "Book $i= $fnwriter[$i],$title[$i],$editor[$i]<br />";
    }

//echo $Book[$_GET];
//print_r($);
?>

0 Cevap