Jump to content
php.lv forumi

login pogas maiņa


Snaip3Rs

Recommended Posts

Man ir šāds skripts bet galīgi neiebraucu kā nomainīt submit pogas izskatu!

<?
mysql_connect("localhost", "root", "gribetu_zinats_:D")or die('<pre>OMG, mana oo.lv datubaze atkal nospraga</p>');
mysql_select_db("db")or die('<pre>OMG, mana oo.lv datubaze atkal nospraga</p>');
function draw_login(){
   echo '
   <form method="post" action="http://vacklan.wos.lv/f/index.php?act=Login&CODE=01">
       <p>
           <b>Lietotajvards:</b><br />
           <input name="UserName" type="text" /><br />
           <b>Parole:</b><br />
           <input name="PassWord" type="password" /><br />
           <input name="CookieDate" value="1" type="checkbox" /> <b>acereties mani?</b><br />
           <input type="submit" /> <a href="http://vacklan.wos.lv/f/index.php?act=Reg&CODE=00"><img border="0" src="images/registreties.jpg"></a>
       </p>
   </form>
   ';
}
if(!empty($_COOKIE['member_id']) && is_numeric($_COOKIE['member_id']) && !empty($_COOKIE['pass_hash'])){
   $sql = sprintf("SELECT m.id, m.members_display_name, m.email, m.member_login_key, m.joined, e.avatar_location FROM `ibf_members` m, `ibf_member_extra` e WHERE m.id=%d AND m.member_login_key='%s' AND e.id=m.id LIMIT 1", (int)$_COOKIE['member_id'], mysql_real_escape_string($_COOKIE['pass_hash']));
   $res = mysql_query($sql);
   if(mysql_num_rows($res)>0){
       $row = mysql_fetch_object($res);
       printf('
       <p style="text-align:center;">
           Sveiks %s%s
       </p>
       <ul>
<img src="images/repair.png" />
<a href="http://vacklan.wos.lv/f/index.php?act=UserCP&CODE=00">Labot Profilu</a><br>
<img src="images/mail1.png" />
<a href="http://vacklan.wos.lv/f/index.php?act=Msg&CODE=01">Vestules</a><br>
<img src="images/users.png" />
<a href="http://vacklan.wos.lv/f/index.php?act=Members">Lietotaji</a><br>
<img src="images/serch.png" />
           <a href="http://vacklan.wos.lv/f/index.php?act=Search&f=0">Meklet foruma</a><br>
<img src="images/key.png" />
           <a href="http://vacklan.wos.lv/f/index.php?act=Login&CODE=03&k=%s">Iziet</a><br>
       </ul>
       ', $row->members_display_name, !empty($row->avatar_location) ? '<br /><img src="'.$row->avatar_location.'" alt="" />' : '', md5($row->email.'&'.$row->member_login_key.'&'.$row->joined));
   }else{
       draw_login();
   }
}else{
   draw_login();
}
?>

l7urmov284p6hxunddpd.jpg

register pogu uztaisīju jo tas bija liks bet kā utaisīt submit pogu?

Edited by Snaip3Rs
Link to comment
Share on other sites

Paldies aleksej un tu vel teici ka nemaki pa vēstuli bet tikai viena ķibelīte sanāca šādi!

spnfbmv6ejmp6qipsur9.jpg

Un velvienu lietu gribu pajautāt kā varēja uzlikt piemēram tu nesi ielogojies un ej iekšā www.mansklan.lv tevi pārmet uz www.mansklan.lvlogin.php bet ja esi saglabājis cepumi;nus tevi parmet uz sakumlapu!

Link to comment
Share on other sites

function is_logged_in() {
 if(...te raksti kam vajag izpildīties, lai skaitītos, ka lietotājs ir ielogojies...) {
   return true;
 }
 return false;
}

...

//šitais jāraksta pirms jebkāda output`a.

if(!is_logged_in()) {
header("Location: http://mans_krutais_cs_mu_wow_nfs_pacman_mario_legendOfZelda_klans.lv/login.php");
}

Link to comment
Share on other sites

Liels paldies briedi man tikai tagad jasataisa tas login page pec si skripta kautka!

uo5wj230jfdhtcwjc2i.jpg

Un ar to login skriptu izdarīju šādi bet nekāda kustība neparmet ne ko!

<php
function is_logged_in() {
 if(!empty($_COOKIE['member_id']) && is_numeric($_COOKIE['member_id']) && !empty($_COOKIE['pass_hash'])){
   $sql = sprintf("SELECT m.id, m.members_display_name, m.email, m.member_login_key, m.joined, e.avatar_location FROM `ibf_members` m, `ibf_member_extra` e WHERE m.id=%d AND m.member_login_key='%s' AND e.id=m.id LIMIT 1", (int)$_COOKIE['member_id'], mysql_real_escape_string($_COOKIE['pass_hash']));
    {
   return true;
 }
 return false;
}

...

//šitais jāraksta pirms jebkāda output`a.

if(!is_logged_in()) {
header("Location: http://vacklan.wos.lv/login.php");
}
/>

Varu derēt ka nepareizi bet varbūt kāds pateiks kā! :(

 

Man liekās ka viņš saglabā cepumiņus un cepumiņi ir burti ar cipariem kopā noslēpta parole! piemēram tāpat kā ja tu nēsi ielogojies tev rādās ielogojies un kad esi ielogojies tev rāda profilu savu un es vēlos uz tādu pašu principu login lapu restrick kas nav ielogojušies!

Edited by Snaip3Rs
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...