PDA

View Full Version : سوال: اشکال در عملکرد فرم ها



ahmadbadpey
یک شنبه 28 مهر 1387, 16:04 عصر
با سلام
بچه ها ، هیچ کدوم از فرم هایی که توی صفحات طراحی شده ام هستند کار نمی کنند . البته روی کامپیوتر خودم خوب کار می کنند ولی تا روی سرور آپلودشون می کنم دیگه کار نمی کنند . التبه باید بگم که بیشتر این فرم ها همون صفحه ای رو که توشون هستند فراخوانی می کنند یعنی خصوصیت action اونها رو یا خالی گذاشتم یا اصلا نذاشتم . روی سرور تا یک دکمه (submit ) می زنم همون صفحه ها باز می شن اما هیچ تغییری نکرده اند
به هر حال نمی دونم مشکل چیه . اگه کسی تا حالا از این مشکلا داشته راهنمایی کنه . بازم می گم این مشکل فقط روی هاست پیش می آد.

cybercoder
یک شنبه 28 مهر 1387, 16:48 عصر
چطور Submit رو کنترل می کنی قسمتی از کدت رو بذار

ahmadbadpey
یک شنبه 28 مهر 1387, 16:59 عصر
این هم قسمتی از کد . در صورت submit شدن فرم اول فرم دوم فراخوانی می شود

<?php if (!$username && !$btn){ ?>
<form name="login_form" method="post" >
<input name="username" type="text" size="20" maxlength="15" id="edit" />
<br>
<input name="password" type="password" size="20" maxlength="15" id="edit" />
<br>
<input type="submit" name="btn" value="login" id="button" />
</form>
<?php
}else{
if ($btn){
if ($username=="a" ){
if ($password=="0"){
?>
<form method="post" >
<table width="900" border="0">
<tr>
<th width="72" scope="col" align="right" style="color:#000000" >عنوان :</th>
<th width="818" scope="col" align="right" ><input name="post_title" type="text" id="post_title" style="font-
family:Tahoma;font-size:11px;" dir="rtl" size="81" maxlength="255" /></th>
</tr>
<tr>
<th width="72" scope="col" align="right" style="color:#000000" >توضیحات :</th>
<th width="818" scope="col" align="right" ><input name="description" type="text" id="post_title" style="font-
family:Tahoma;font-size:11px;" dir="rtl" size="81" maxlength="255" /></th>
</tr>
<tr>
<td valign="top" align="right" style="color:#000000">متن مطلب :</td>
<td valign="top" align="right">
<?php
$oFCKeditor = new FCKeditor('post_text') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Value = '' ;
$oFCKeditor->Create() ;
?></td>
</tr>
<tr>
<td valign="top" align="right" style="color:#000000">ادامه مطلب :</td>
<td valign="top" align="right">
<?php
$oFCKeditor = new FCKeditor('post_textfull') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Value = '' ;
$oFCKeditor->Create() ;
?></td>
</tr>
<tr>
<td align="right" style="color:#000000"> موضوع: </td>
<td align="right"><select name="category" dir="rtl" style="font-family:Tahoma;font-size:11px;">
<?php
require_once("config.php");
$query=mysql_db_query(root_pd_db,"select * from cat_list",$conn);
for($i=0;$i!=mysql_num_rows($query);$i++){
print("<option dir=\"rtl\">".@mysql_result($query,$i,1)."");
}
mysql_close($conn);
?>

</select>
</td>
</tr>
<tr>
<td align="right" style="color:#000000">نویسنده :</td>
<td align="right"><input name="author" type="text" id="author" size="40" dir="rtl" style="font-family:Tahoma;font-
size:11px;"/></td>
</tr>

<tr>
<td ></td>
<td align="right"><input name="btn1" type="submit" value="ارسال" id="button" />
<input name="btn2" type="reset" id="button" value="پاک کردن "/></td>
</tr>
</table>
</form>
<?php }
else {$msg="<b dir=\"ltr\">THE PASSWORD IS WRONG !!!</b> ";}}
else { $msg="<b dir=\"ltr\">THE ID IS WRONG !!! </b>";} }}?>
<?php print( "$msg"); ?>

cybercoder
یک شنبه 28 مهر 1387, 17:09 عصر
به جای $btn و $username بنویس


$_POST['btn']
و $_GET['btn']

ahmadbadpey
یک شنبه 28 مهر 1387, 17:21 عصر
آقا دستت درد نکنه انشا الله بری کربلا مشکل همونی بود که گفتی