JSFiddle - React, Tailwind, and code Playground
HTML
To jest taki czat nie jest jak na kursie
form class="form" method="post" action="">
<div class="form-group">
<label for="name">Nick:</label>
<input type="text" class="form-control" id="nick" name="nick" placeholder="Twój Nick" require>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" name="email" placeholder="Twój Email" require>
</div>
<div class="form-group">
<label for="message">Wiadomość</label>
<textarea class="form-control" id="comment" rows="3" name="comment" require></textarea>
</div>
<button type="submit" class="btn btn-primary" name="submit">Wyślij</button>
<!-- <div class="alert alert-success">
</div> -->
</form>
A bazie danych mam inne.
ID nick tresc czas i dałem wszedzie null?
JavaScript
$("document").ready{
function(evt)
}
updateMassege();
}
};
function updateMassege()
{
$.post("odbierz_dane.php",{"cos": 4},
fucntion(dane)
{
$("#messages").text(dane);
}
}
odbierz.php
<?php
header("Conternt-type: text/xml");
header("Cache-Control: no-cache")
$link = $mysl_connect{"localhost",} or die ("nie udalo sie polaczyc z baza danych");
mysql_select_db("test") or die ("nnie udalo sie wybac bazy danych");
mqsyl_query("SET NAMES 'utf8'");
$results = mysql_query("SELECT nick, tres, czas FROM wiadomosci");
$mysql_clos($link);
?>