양식이 매우 약하다. 양식이 제출 될 때 mysql 테이블이 채워지지 않고있는 것 같습니다. 웹은 양식을 만드는 방법에 관한 많은 것들이 있습니다. PHP에서는 충분하지만, MySQL에서는 충분합니다. 그러나 세 가지를 동기화시키는 어떤 것도 발견하지 못합니다. 이것은 제가 가지고있는 것입니다 :MySQL, PHP 및 HTML 양식 동기화
폼 (걱정하지 마세요.
<div style="background-color:#424142; width:100%; margin-left:7%; margin-top:20px;">
<form action="templates/tmpl_tmd022/scripts/post_subscription.php" method="post">
<table width="100%" border="0">
<tr>
<td style="padding:5px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#FFF;" colspan="2">Sign up now to recieve our free newsletter. </td>
</tr>
<tr>
<td style="padding:5px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#FFF;" width="30%">First name:</td>
<td style="padding:5px; padding-left:0; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#FFF;" width="70%"><input type="text" name="fname" /></td>
</tr>
<tr>
<td style="padding:5px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#FFF;">Last name:</td>
<td style="padding:5px; padding-left:0; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#FFF;"><input type="text" name="lname" /></td>
</tr>
<tr>
<td style="padding:5px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#FFF;">Email:</td>
<td style="padding:5px; padding-left:0; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#FFF;"><input type="text" name="email" /></td>
</tr>
<tr>
<td style="padding:5px;"> </td>
<td style="padding:3px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:12px; color:#000;"><input type="submit" value="Submit" style="color:000;"/></td>
</tr>
</table>
</form>
</div>
PHP :
스타일 외부 나는 기능 아래)를 얻을 마자포함 된 connect_to_mysql.php 파일은 db 이름, db 사용자 및 db 암호이며 테스트를 거쳐 정상적으로 작동합니다.
누군가 내가 뭘 만들고 있는지 (어리석은) 실수에 대한 생각이 있습니까? 당신은 당신의 쿼리를 실행하여 mysql_query() 부분을 포함하지 않은
$sql = "INSERT INTO subscriptions (lname, fname, email)
VALUES ('$lname','$fname','$email')";
mysql_query($sql);
mysql_query ($ sql)? 누락되었습니다. – Gntem