PDA

View Full Version : مبتدی: مشکل ارسال value به دیتابیس



mosavi7
شنبه 07 بهمن 1391, 21:04 عصر
سلام و عرض ادب
بنده یه فرومی با جاوا اسکریپت , پی اچ پی درست کردم , که اطلاعات رو به دیتابیس ارسال کنه .
الان تمامی اطلاعات رو صحیح ارسال میکنه به جز اون قسمتی که دسته بندی ها رو از دیتابیس میخونه ...





<style type="text/css">
@import url('style.css');
</style>
<script type="text/javascript">
$(document).ready(function(){
// jQuery comments
});
</script>


<script type="text/javascript">
$(document).ready(function(){
$("button#send").click(
function() {
var gname = $("input#name").val();
var gemail = $("input#email").val();
var gphone = $("input#phone").val();
var gghesmat = $("select#ghesmat").val();
var gcountry = $("select#country").val();
var gmessage = $("textarea#message").val();
var gnorobot = $("input#norobot").val();

$("div#result").html("<img src='images/ajax-loader.gif'/>");
$("div#result").load('send.php',
{name: gname,
email:gemail,
phone:gphone,
ghesmat:gghesmat,
country:gcountry,
message:gmessage,
norobot:gnorobot
}
);
}
);
});
</script>
</head>
<body>
<div id="contact">
<div id="contact_form">
<div id="form">

<table width="450" style="margin-right: 200px;">
<tr>
<td width="130"></td>
<td style="text-align:center; font:bold 15px arial; color:#47c12f;"><div id="result"></div></td>
</tr>

<tr>
<td ><p> نام کامل </p></td>
<td><input type="text" id="name" name="name" /></td>
</tr>

<tr>
<td><p> ایمیل </p></td>
<td><input type="email" id="email" name="email"/></td>
</tr>

<tr>
<td><p> موبایل </p></td>
<td><input type="text" id="phone" name="phone" />
</td>
</tr>

<tr>
<td><p> قسمت </p></td>
<td>
<select id="ghesmat" name="ghesmat">
<?php

include('__admin/functions.php');
$tabCat = getAllTable('categories');
while($allCat = mysql_fetch_row($tabCat))
{
$catId = $allCat[0];
$catAddress = $allCat[1];
$catName = $allCat[2];

echo "
<option value='$catName'>$catName</option>
"; } ?>
</select>
</td>
</tr>

<tr>
<td><p> کشور </p></td>
<td>
<span class="input">
<select id="country" name="country">
<option value="ایران">ایران </option>
<option value="آلمان">آلمان</option>
</select>
</span>
</td>


<tr>
<td><p> پیام </p></td>
<td><textarea id="message" name="message">سلام ,</textarea></td>
</tr>

<tr>
<td><img src="captcha.php" /></td>
<td><input id="norobot" name="norobot" /></td>
</tr>

<tr>
<td></td>
<td><button id="send">ارسال</button></td>
</tr>

</table>

mosavi7
یک شنبه 08 بهمن 1391, 18:27 عصر
:( دوستان عزیز کسی میتونه تو این زمینه بنده رو یاری کنه ... ؟

siavashsay
یک شنبه 08 بهمن 1391, 18:46 عصر
دوست عزیز !
نیازی نیست کد کل صفحتون رو بذارید !
فقط اون قسمتی که الان مشکل داری ! الان لیست کردن کدوم قسمت این کد میشه ؟!