mam następujący formularz zrobiony na localhoscie (posiadam apache server 2.2, php 5.0, mysql server 5.0):
// kod formularza składa się z 3 pól: imię, nazwisko, adres e-email; po uzupełnieniu pół dane powinny się dodać do bazy.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zrób ze mnie Elvisa - Dodawanie adresów</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<img src="blankface.jpg" width="161" height="350" alt="" style="float:right" />
<img name="elvislogo" src="elvislogo.gif" width="229" height="32" border="0" alt="Zrób ze mnie Elvisa" />
<p>Wpisz imię, nazwisko i adres e-mail, aby dołączyć do listy mailingowej
<strong>Zrób ze mnie Elvisa</strong>.</p>
<form method="post" action="addemail.php">
<label for="firstname">Imię:</label>
<input type="text" id="firstname" name="firstname" /><br />
<label for="lastname">Nazwisko:</label>
<input type="text" id="lastname" name="lastname" /><br />
<label for="email">Adres e-mail:</label>
<input type="text" id="email" name="email" /><br />
<input type="submit" name="Submit" value="Wyślij" />
</form>
</body>
</html>
// po wciśnięciu przycisku wyślij, zamiast jakiegokolwiek komunikatu pojawia się na stronie czysty kod skryptu:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zrob ze mnie Elvisa - Dodawanie adresow</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php
$dbc = mysqli_connect('localhost', '' , 'haslo, 'nazwa bazy')
// localhost jest, nazwy uzytk nie ma, haslo tez jest, nazwa bazy tez jest
or die('Brak polaczenia z serwerem MySQL.');
$first_name = $_POST['firstname'];
$last_name = $_POST['lastname'];
$email = $_POST['email'];
$query = "INSERT INTO email_list (first_name, last_name, email) VALUES ('$first_name', '$last_name', '$email')";
mysqli_query($dbc, $query)
or die('Blad w zapytaniu do bazy danych.');
echo 'Dodano dane klienta.';
mysqli_close($dbc);
?>
</body>
</html>
jak myślicie co to może być
