Vo1The Posted July 2, 2010 Report Share Posted July 2, 2010 esu iesacesj uz visiem shiem php utt , un nevaru tikt gala ar shadam problemam 1. login skripts itka vis iet ,bet kad ielogoajs ieksha pats login panelis nepazud un neparadas panelis <?php require('config.inc.php'); $link = mysql_connect($host, $dbuser, $dbpass) or die("Could not connect: " . mysql_error()); mysql_select_db($dbname) or die("Cannot connect to database!"); echo "<center> <form action='/includes/index.php?act=Login&CODE=01&' method='post'> <table> <tr><td><input type='text' size='25' name='UserName' value='Username' /></td></tr> <tr><td><input type='password' size='25' name='PassWord' value='Password' /></td></tr> <tr><td><input type='submit' name='submit' value='Enter' /> <a href='/includes/index.php?act=Reg&CODE=00'>Registration</a></td></tr> </table> </form> </center>"; 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); $logout = md5($row->email.'&'.$row->member_login_key.'&'.$row->joined); printf("Sveiks, <strong><a href='{$forummap}includes/index.php?showuser=%s' />%s</a></strong>!<br />", $row->id, $row->members_display_name, $row->avatar_location, md5($row->email.'&'.$row->member_login_key.'&'.$row->joined)); echo "» <a href='includes/index.php?act=Search&CODE=getnew' />SkatÄ«t jaunos postus</a><br />» <a href='includes/index.php?act=UserCP&CODE=00' />Mani uzstÄdijumi</a><br />» <a href='includes/index.php?act=Msg&CODE=01' />VÄ“stules</a><br />» <a href='includes/index.php?act=Login&CODE=03&k={$logout}' />Iziet</a><br />"; }else{ echo $login; } }else{ echo $login; } ?> Un toppost vnk rada eroru uz 15 linajas <?php $result = mysql_query("SELECT name,posts FROM ibf_members ORDER BY posts DESC LIMIT 10"); ?> <table id='admintop'> <tr> <th style="text-align:center">LietotÄjs</th> <th style="text-align:center">Posti</th> </tr> <?while($row = mysql_fetch_array($result)){$useris = $row['name'];$skaits = $row['posts'];?> <tr> <td style="text-align:center"><?=$useris?></td> <td style="text-align:center"><?=$skaits?></td> </tr> </table> nezinu ko nepareizi daru Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 2, 2010 Report Share Posted July 2, 2010 Un kāds būtu šī errora teksts? Quote Link to comment Share on other sites More sharing options...
Vo1The Posted July 2, 2010 Author Report Share Posted July 2, 2010 Un kāds būtu šī errora teksts? Parse error: parse error in C:\xampp\htdocs\includes\topposters.php on line 15 bet nezini kas ar to login ? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 2, 2010 Report Share Posted July 2, 2010 Saliec atstarpes un semikolus: <? while($row = mysql_fetch_array($result)){$useris = $row['name'];$skaits = $row['posts']; ?> <td style="text-align:center"><?= $useris; ?></td> <td style="text-align:center"><?= $skaits; ?></td> Panelis parādās... tādēļ, ka tas neatrodas if sadaļā - līdz ar to tas tiek parādīt neatkarīgi no tā vai ir ielogojies vai nav... Quote Link to comment Share on other sites More sharing options...
Vo1The Posted July 2, 2010 Author Report Share Posted July 2, 2010 (edited) Saliec atstarpes un semikolus: <? while($row = mysql_fetch_array($result)){$useris = $row['name'];$skaits = $row['posts']; ?> <td style="text-align:center"><?= $useris; ?></td> <td style="text-align:center"><?= $skaits; ?></td> Panelis parādās... tādēļ, ka tas neatrodas if sadaļā - līdz ar to tas tiek parādīt neatkarīgi no tā vai ir ielogojies vai nav... ne tu nesaprati . vinsh vsp neparadas kad ielogojas foruma vinsh iejiet bet kad uziet uz galvanas lapas , tad vinsh neradas un atkal var logoties ieksha , bet es gribu lai vinsh pazud un paradas tads ka panelis ar izveli edit : tikunta radas ka kluda 15 linija Edited July 2, 2010 by Vo1The Quote Link to comment Share on other sites More sharing options...
codez Posted July 2, 2010 Report Share Posted July 2, 2010 (edited) Tiec sākumā galā ar sevi: pats login panelis nepazud vinsh vsp neparadas kad ielogojas Tad viņš nepazūd vai neparādās? Vai tas ir kvantu panelis, kurš vienlaikus gan ir gan nav, gan ir pazudis, gan nav parādījies? P.S. Kad būsi ticis galā ar to, ka tu runā par diviem paneļiem un kad tev piemin paneli, tu kā par spīti izvēlies saprast to otro nekā domāts, tad man tev ieteikums, ja esi iesācējs, tad taču izvēlies kaut ko vienkāršāku un īsāku. Un, ja kaut kas neiet, debugo - izvadi starpvērtības, skaties, kas neatbilst tam kā jābūt. Bet, ja galīgi nevar palaist kodu, jo parsēšanas kļūda, tad mēģini iekomentēt koda blokus, līdz atrodi, kura ir tā vieta, kura nepārsējas. Edited July 2, 2010 by codez Quote Link to comment Share on other sites More sharing options...
Kemito Posted July 3, 2010 Report Share Posted July 3, 2010 Nu tu ielogojies, pamēģini uztaisīt lapai refresh, ja tad pazūd LOGIN FORMA un parādas TAVS LAUKS, tad attiecīgi vaig uztaisīt kautkādu JavaScript pārlādīti - tobish aiziet uz sākumu! Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 3, 2010 Report Share Posted July 3, 2010 Nu viņa varu derēt ka nav ne mazākās sajēgas par elementāru PHP sintaksi... =/ Quote Link to comment Share on other sites More sharing options...
PIPARIns :* Posted July 4, 2010 Report Share Posted July 4, 2010 Es pievienoju gatavus `sos scriptus, ej un panem :) Quote Link to comment Share on other sites More sharing options...
werd Posted July 4, 2010 Report Share Posted July 4, 2010 Es pievienoju gatavus `sos scriptus, ej un panem :) Nav kauns izlikties, ka tie ir tevis rakstīti? Quote Link to comment Share on other sites More sharing options...
Swear Posted July 19, 2010 Report Share Posted July 19, 2010 Vispār, šie ir paveci manis rakstītie skripti. Pirmajā skriptā vaina noteikti ir tavos cookijos, kuri neredz ka esi ielogojies, bet otrajā vaina ir tur ka esi beigās nodzēsis } kas aizver mysql_fetch_array </tr> <?}?> </table> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.