انجمن سایت کلیدستان


رتبه موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
روش post

روش post

#1
به نام خدا
سلام،من فرمی به شکل زیر دارم
کد پی‌اچ‌پی:
<div class="form-content">

    <
div class="input-wrapper">
        <
input type="text" data-copy-to=".register-name-input" autocomplete="off" data-placeholder="(english) نام ونام خانوادگی " placeholder="(english) نام ونام خانوادگی " value="(english) نام ونام خانوادگی "></input>

    <
input class="register-name-input" type="hidden" name="name"></input>

</
div>
<
div class="input-wrapper">

    <
input type="text" data-copy-to=".register-username-input" autocomplete="off" onkeyup="SK_checkUsername(this.value,0,'.check-username-result',false);" data-placeholder="(english) نام کاربری" placeholder="(english) نام کاربری" value="(english) نام کاربری"></input>

    <
input class="register-username-input" type="hidden" name="username"></input>
    <
div class="check-username-result"></div>

</
div>
<
div class="input-wrapper">

    <
input type="password" autocomplete="off" placeholder="رمز عبور -هشت رقمی" name="password"></input>

</
div>
<
div class="input-wrapper">

    <
input type="text" data-copy-to=".register-email-input" autocomplete="off" data-placeholder="ایمیل" placeholder="ایمیل" value="ایمیل"></input>

    <
input class="register-email-input" type="hidden" name="email"></input>

</
div>
<
div class="input-wrapper">

    <
select name="gender">
        <
option value="">

            
جنسیت

        
</option>
        <
option value="male">

            
مرد

        
</option>
        <
option value="female">

            
زن

        
</option>
    </
select>

</
div>
<
div class="input-wrapper">

    <
table width="100%" cellspacing="0" cellpadding="0" border="0">
        <
tbody>
            <
tr>
                <
td width="85px" valign="middle" align="left">
                    <
img class="captcha" src="http://rayej.ir/photos/captcha_1435089991_5393.png"></img>
                </
td>
                <
td valign="middle" align="left">
                    <
input type="text" data-copy-to=".register-captcha-input" autocomplete="off" data-placeholder="حروف امنیتی" placeholder="حروف امنیتی" value="حروف امنیتی"></input>

                            <
input class="register-captcha-input" type="hidden" name="captcha"></input>
                        </
td>
                    </
tr>
                </
tbody>
            </
table>
        </
div>
        <
button class="submit-btn active">
            <
class="icon-angle-right progress-icon">
                ::
before
            
</i>

             
ثبت نام

        
</button>
    </
div>

</
form
ولی نمیدانم چطور میتوانم اطلاعات را به این فرم وارد کنم. اگه میشه بگین که دربخش (کلید 313 )
کد پی‌اچ‌پی:
params.add(new BasicNameValuePair("country""iran"));
 
params.add(new BasicNameValuePair("age""27")); 
به جای "country", "iran" و "age", "27" چی قرار بدم
راست نگین کلید 313
پاسخ

روش post

#2
به بخشید کد فرمم رو  تصحیح میکنم
کد پی‌اچ‌پی:
if ($t == "login") {
    $data['error_message'] = $lang['error_empty_login'];
    
    
if (!empty($_POST['login_id']) && !empty($_POST['login_password'])) {
        
        $login_id 
SK_secureEncode($_POST['login_id']);
        $login_password trim($_POST['login_password']);
        $login_password_md5 md5($login_password);
        
        
if (preg_match('/@/'$login_id)) {
            $db_query_part "email='$login_id'";
        } elseif (preg_match('/^[0-9]+$/'$login_id)) {
            $db_query_part "id=$login_id";
        } else {
            $db_query_part "username='$login_id'";
        }
        
        $query_one 
"SELECT id FROM " DB_ACCOUNTS " WHERE $db_query_part AND password='$login_password_md5' AND type='user' AND active=1";
        $sql_query_one mysqli_query($dbConnect$query_one);
        $data['error_message'] = $lang['error_bad_login'];
        
        
if (($sql_numrows_one mysqli_num_rows($sql_query_one)) == 1) {
            $sql_fetch_one mysqli_fetch_assoc($sql_query_one);
            
            $query_two 
"SELECT username,email_verified FROM " DB_ACCOUNTS " WHERE id=" $sql_fetch_one['id'] . " AND password='$login_password_md5' AND type='user' AND active=1";
            $sql_query_two mysqli_query($dbConnect$query_two);
            
            
if (($sql_numrows_two mysqli_num_rows($sql_query_two)) == 1) {
                $sql_fetch_two mysqli_fetch_assoc($sql_query_two);
                $continue true;
                
                
if ($config['email_verification'] == && $sql_fetch_two['email_verified'] == 0) {
                    $continue false;
                    $data['error_message'] = $lang['error_verify_email'];
                }
                
                
if ($continue == true) {
                    $_SESSION['user_id'] = $sql_fetch_one['id'];
                    $_SESSION['user_pass'] = $login_password_md5;
                    
                    
if (!empty($_POST['keep_logged_in']) && $_POST['keep_logged_in'] == 1) {
                        setcookie('sk_u_i'$_SESSION['user_id'], time() + (60 60 24 7));
                        setcookie('sk_u_p'$_SESSION['user_pass'], time() + (60 60 24 7));
                    }
                    
                    $data
['status'] = 200;
                    $data['redirect_url'] = SK_smoothLink('index.php?tab1=home');
                }
            }
        
کد پی‌اچ‌پی:
    
 

 

پاسخ
 سپاس شده توسط شماره مجازی امارات


پرش به انجمن:


کاربران در حال بازدید این موضوع: 1 مهمان