Jump to content
php.lv forumi

Simple WEB+IPB User panel


ashais13

Recommended Posts

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Kā jau teicu, ar $_COOKIE no IPB dabūn cepumu member_id un uzraksti kveriju. Ja member_id = 0, tad parāda login formu, ja cits, tad login forma pazūd, bet parādās logged in saturs.

To kaut kā ar if else dabū gatavu vai kā??

Edited by ashais13
Link to comment
Share on other sites

Nesen te vienam taisīju galveno lapu ipb forumam, tāka varu padalīties ar jūzeru autorizācijas kodu:

<?php
if(isset($_COOKIE['member_id'])){
$get=mysql_query("SELECT * FROM `ibf_members` WHERE id='".intval($_COOKIE['member_id'])."'") or die(mysql_error());
$udata=mysql_fetch_object($get);
if($udata->member_login_key==$_COOKIE['pass_hash']) {
//izvadam kko shaadu: echo "Cau ".$udata->members_display_name."";
}else{
echo "tu neesi autorizeets";
//izvadam logina paneli
}
}else{
echo "tu neesi autorizeets1";
//izvadam logina paneli
}
?>

Link to comment
Share on other sites

<form action='http://tava_ip/index.php?act=Login&CODE=01' method='post' name='theform'>
<div align="left"><font size="1" face="Arial, Helvetica, sans-serif">Username
<input type='text' class='text' name='username'>
<br>
Password</font>
<input type='password' class='text' name='parole'>
<br>
<input name="submit" type='submit' class='submit' value='Login'>
</div>
</form>

Rekur login panelītis!

Edited by waplet
Link to comment
Share on other sites

<?php

if(isset($_COOKIE['member_id'])){

$get=mysql_query("SELECT * FROM `ibf_members` WHERE id='".intval($_COOKIE['member_id'])."'") or die(mysql_error());

$udata=mysql_fetch_object($get);

if($udata->member_login_key==$_COOKIE['pass_hash']) {

//izvadam kko shaadu: echo "Cau ".$udata->members_display_name."";

}else{

echo "tu neesi autorizeets";

//izvadam logina paneli

}

}else{

echo "tu neesi autorizeets1";

//izvadam logina paneli

<form action='http://tava_ip/index.php?act=Login&CODE=01' method='post' name='theform'>

<div align="left"><font size="1" face="Arial, Helvetica, sans-serif">Username

<input type='text' class='text' name='username'>

<br>

Password</font>

<input type='password' class='text' name='parole'>

<br>

<input name="submit" type='submit' class='submit' value='Login'>

</div>

</form>

}

?>

 

es ieliku shadi un man rada balto lapu

Link to comment
Share on other sites


×
×
  • Create New...