rezajalalii
Member
سلام من جستجو زدم ندیدم چیزی
من یک فرم ورود میخوام بسازم تو صفحه اصلی وردپرس که کاربران رو از طریق دیتابیس اسکریپت تیکفا لاگین کنه و به صفحه داشبورد تیکفا کاربر هدایت بشه
این کد صفحه ایندکس تیکفا هست:
این هم فایل های setlan.php و config.php که ممکنه نیاز بشه :
مشاهده پیوست tikfa.zip
ممنون میشم اگه راهنمایی کنید
من یک فرم ورود میخوام بسازم تو صفحه اصلی وردپرس که کاربران رو از طریق دیتابیس اسکریپت تیکفا لاگین کنه و به صفحه داشبورد تیکفا کاربر هدایت بشه
این کد صفحه ایندکس تیکفا هست:
PHP:
<?phpsession_start();######################################################################/*************************************************************************** * Tickfa : Online Customer Support System * =========================== * COPYRIGHT * * Copyright (c) 2008 by Aftabgardan Cultural Center >>> http://aftab.cc * * Online Support: http://tickfa.aftab.cc ***************************************************************************/######################################################################include("setlan.php"); $db_link = mysql_connect($dbhost, $dbuname, $dbpass); mysql_select_db($dbname,$db_link); mysql_query("set names 'utf8'"); $query = "select count(*) from ".$dbprefix."admins"; $default = mysql_query($query); if (!$default) { echo "<script type='text/javascript'> function redirector() { window.location = 'install/index.php'; } setTimeout('redirector()',0); </script>"; die(); }
if($_POST["send"]){ $username = $_POST["username"]; $password = $_POST["password"]; $username = stripslashes(mysql_real_escape_string($username)); $username = htmlentities($username ,ENT_QUOTES, "utf-8" ); $password = stripslashes(mysql_real_escape_string($password)); $password = htmlentities($password ,ENT_QUOTES, "utf-8" ); $login_query = "select * from ".$dbprefix."users where uname='$username' and pass='$password'"; $login_result = mysql_query($login_query); if(mysql_num_rows($login_result)>0) { $row = mysql_fetch_assoc($login_result); $_SESSION['user'] = $row['uname'] ; $_SESSION['pass'] = $row['pass'] ; $_SESSION['userid'] = $row['uid'] ; echo "<script type='text/javascript'> function redirector() { window.location = 'ticket.php?action=show'; } setTimeout('redirector()',0); </script>"; } else $use_or_pass_not_valid = 1;}if($_SESSION['userid']){ if($_POST['sendchange']) { $fname = $_POST['fname']; $lname = $_POST['lname']; $tel = $_POST['tel']; $mob = $_POST['mob']; $email = $_POST['email']; $address = $_POST['address']; $fname = stripslashes(mysql_real_escape_string($fname)); $fname = htmlentities($fname ,ENT_QUOTES, "utf-8" ); $lname = stripslashes(mysql_real_escape_string($lname)); $lname = htmlentities($lname ,ENT_QUOTES, "utf-8" ); $tel = stripslashes(mysql_real_escape_string($tel)); $tel = htmlentities($tel ,ENT_QUOTES, "utf-8" ); $mob = stripslashes(mysql_real_escape_string($mob)); $mob = htmlentities($mob ,ENT_QUOTES, "utf-8" ); $email = stripslashes(mysql_real_escape_string($email)); $email = htmlentities($email ,ENT_QUOTES, "utf-8" ); $address = stripslashes(mysql_real_escape_string($address)); $address = htmlentities($address ,ENT_QUOTES, "utf-8" ); $result = mysql_query("update ".$dbprefix."users set ufname='$fname' ,ulname='$lname' ,tel='$tel' ,mobile='$mob' ,email='$email' ,address='$address' where uid=$_SESSION[userid]"); $change_succes = 1; }}include("header.php");?> <!-- START mainsection --> <div class="mainsection"><?phpif(isset($_SESSION['userid'])){ $user_details = mysql_query("SELECT * FROM ".$dbprefix."users WHERE uid='".$_SESSION['userid']."'"); $rec = mysql_fetch_array($user_details); echo '<br /><br /> <div class="titrfont">'._ADMIN_USER_PROFIL.'</div> <br/><br /><br /> <div class="guidance">'._USER_INFO_CHANGE_INFO.'</div> <br /><br />'; if($change_succes==1) { echo "<center><label class='succ_msg'>"._USER_INFO_CHANGES_SUCCESSFUL."</label></center>"; } echo '<br /><br /> <form action="" method="post" id="myform" class="editform"> <table> <tr> <td class="login_table_td1">'._USER_NAME.' :</td> <td class="login_table_td2"> <input type="text" name="fname" id="fname" dir="rtl" size="20" value="'. $rec[ufname].'" > </td> </tr> <tr> <td class="login_table_td1">'._USER_LAST_NAME.' :</td> <td class="login_table_td2"> <input type="text" name="lname" id="lname" value="'.$rec[ulname].'" dir="rtl" size="20" > </td> </tr> <tr> <td class="login_table_td1">'._USER_TELEPHONE.' :</td> <td class="login_table_td2"> <input type="text" name="tel" id="tel" value="'.$rec[tel].'" dir="ltr" size="20" maxlength="12" ><br /> </td> </tr> <tr> <td class="login_table_td1">'._USER_MOBILE.' :</td> <td class="login_table_td2"> <input type="text" name="mob" id="mob" value="'.$rec[mobile].'" dir="ltr" size="20" maxlength="12" ><br /> </td> </tr> <tr> <td class="login_table_td1">'._USER_EMAIL.' :</td> <td class="login_table_td2"> <input type="text" name="email" id="email" value="'.$rec[email].'" dir="ltr" size="30" > </td> </tr> <tr> <td class="login_table_td1" style="vertical-align:top">'._USER_ADDRESS.' :</td> <td class="login_table_td2"> <textarea name="address" id="address" dir="rtl" rows="8" cols="30" >'. $rec[address].'</textarea><br /> </td> </tr> </table> <div class="submit_btn"><input type="submit" name="sendchange" value="'._USER_INFO_CONFIRMATION.'" /></div> </form> <br /><br />';}else{ echo '<script language="JavaScript" type="text/javascript"> <!-- function Check(formID) { if (formID.username.value == "") { alert("<?php echo _USER_ENTER_USERNAME_REQUIRED ?>"); formID.username.focus(); return false; } if (formID.password.value == "") { alert("<?php echo_USER_ENTER_PASSWORD_REQUIRED ?>"); formID.password.focus(); return false; } return true; } //--> </script> ';
echo' <form name="signin" action="" method="post" onSubmit="return Check(this);"> <br /><br /> <div class="wellcom_index">'._USER_WELCOME.'</div><br /><br /> <div align="center"> <img src="img/loginup.jpg" alt="image" /> <div class="logincenter"> '; if($use_or_pass_not_valid == 1) echo "<br /><span class='errorsign'>» </span>"._USER_INFO_USERNAME_PASS_INCORRECT."!<br /><br />"; echo' <table cellpadding="5"> <tr> <td class="login_table_td1">'._USER_USERNAME .':</td> </tr> <tr> <td class="login_table_td2"><input name="username" type="text" dir="ltr" size="25" /></td> </tr> <tr> <td class="login_table_td1">'._USER_PASSWORD .':</td> </tr> <tr> <td class="login_table_td2"><input name="password" type="password" dir="ltr" size="25" /></td> </tr> <tr> <td class="login_table_td1" style="text-align:center"><input name="send" type="submit" value="' ._USER_LOGIN. '" style="width:50px" /></td> <td></td> </tr> </table> </div> <div><img src="img/logindown2.jpg" alt="image" /></div> </div> </form> <div style="margin-left:15px; direction:ltr"><a href="register.php" style="color:#000;font-size:9pt;font-weight:bold">'._USER_REGISTER.'</a></div> ';}?> </div> <!-- END mainsection --><?php include("footer.php"); ?>
این هم فایل های setlan.php و config.php که ممکنه نیاز بشه :
مشاهده پیوست tikfa.zip
ممنون میشم اگه راهنمایی کنید