justsomeguy 1,135 Posted April 14, 2009 Report Share Posted April 14, 2009 You have these three variables available in the script:$user=mysql_num_rows($result11);$usermem=mysql_num_rows($result112);$usertot=$usermem+$user;So $user and $usermem each have a number, and $usertot is the sum. Check the queries to see which numbers they have, but I assume you just want to print one or more of those numbers out. Quote Link to post Share on other sites
masrawy 0 Posted April 14, 2009 Author Report Share Posted April 14, 2009 this is the outprintecho "<table width=100%>";echo "<tr><td>";echo "المتواجدون: ";include('online/useronline.php'); echo "$usertot (الأعضاء:$usermem الزوار:$user)";br();echo "الزيارات اليوم :$n_total أمس :$yesterday";echo "</td></tr></table>";//echo "<tr><td><font color=#000000>عدد الزوار الإجمالي</font> ($n_total) *** <font color=#000000>عدد المتواجدين الآن</font> ";include('online/useronline.php'); echo" ***<font color=#000000>عدد الأعضاء</font> ($count_m)</td></tr></ Quote Link to post Share on other sites
masrawy 0 Posted April 14, 2009 Author Report Share Posted April 14, 2009 $userthis is print vistor not login $usermemthis is print the members how loginbut all the tome $usermem=0$user=1 Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 14, 2009 Report Share Posted April 14, 2009 but all the tome $usermem=0$user=1Look at the code, that means that 1 IP address for a user who is not logged in has accessed that particular page within the last 3 seconds. That's not a problem with the code, that's exactly the information that you're asking it for. Quote Link to post Share on other sites
masrawy 0 Posted April 14, 2009 Author Report Share Posted April 14, 2009 so sir what can i do to print the number of member on line who login Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 14, 2009 Report Share Posted April 14, 2009 $usermem contains the number of logged in users who have accessed the current page within the last 3 seconds. Quote Link to post Share on other sites
masrawy 0 Posted April 14, 2009 Author Report Share Posted April 14, 2009 so nothing rong in code only chang this within the last 3 secondsok ? Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 14, 2009 Report Share Posted April 14, 2009 Right, there's a variable that holds the number of seconds to check. Quote Link to post Share on other sites
masrawy 0 Posted April 15, 2009 Author Report Share Posted April 15, 2009 thank you sir donei forget to say nice picture for your profile hhhhhhhhhhhhhhhnow i need only special user can delet his repplay ?how sir Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 15, 2009 Report Share Posted April 15, 2009 Checking permissions is always the same. You need a permission in the database, so your users table needs a field to say if that's a "special" user. In your delete code, look up the user in the database and check the field before doing the delete. Quote Link to post Share on other sites
masrawy 0 Posted April 15, 2009 Author Report Share Posted April 15, 2009 i have field for special user but i need the code sir Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 15, 2009 Report Share Posted April 15, 2009 It's not very difficult, which part of the code don't you understand? I assume you already have delete code somewhere. You need to add code to send a database query and look up the field in the database. You should be able to figure out how to do that. Quote Link to post Share on other sites
masrawy 0 Posted April 15, 2009 Author Report Share Posted April 15, 2009 <? $asmemr1_select = mysql_query ("SELECT * from ssubject where id='$ssub_id' and active='1'"); while ($Row515=mysql_fetch_array($asmemr1_select)) { $memberr_id = $Row515[mem_id]; $asmm_select = mysql_query ("SELECT * from members where id='$member_id' and active='1'"); while ($Row16=mysql_fetch_array($asmm_select)) { $speciall = $Row16 [special]; } }if ($special == "1" AND $mem_id == $memberid){?> <tr> <td colspan="2" bgcolor="<? echo $col1; ?>"> <p align="center"> <a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td> </tr><? } else {}?> Quote Link to post Share on other sites
masrawy 0 Posted April 20, 2009 Author Report Share Posted April 20, 2009 hi sir no help on this ? Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 20, 2009 Report Share Posted April 20, 2009 You didn't ask me for anything. What do you need help with in that code? Quote Link to post Share on other sites
masrawy 0 Posted April 20, 2009 Author Report Share Posted April 20, 2009 <?$asmemr1_select = mysql_query ("SELECT * from ssubject where id='$ssub_id' and active='1'");while ($Row515=mysql_fetch_array($asmemr1_select)){$memberr_id = $Row515[mem_id];$asmm_select = mysql_query ("SELECT * from members where id='$member_id' and active='1'");while ($Row16=mysql_fetch_array($asmm_select)){$speciall = $Row16 [special];}}if ($special == "1" AND $mem_id == $memberid){?><tr><td colspan="2" bgcolor="<? echo $col1; ?>"><p align="center"><a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td></tr><? }else {}?> i need the spicial member can delet his replayand any function do the same of int_set Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 20, 2009 Report Share Posted April 20, 2009 $speciall = $Row16 [special];}}if ($special == "1" AND $mem_id == $memberid){Those need to be spelled the same. Quote Link to post Share on other sites
masrawy 0 Posted April 21, 2009 Author Report Share Posted April 21, 2009 i did sirnow i can see icone say deletif i do it told me the delet of repllay done but i fine it not deleted Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 21, 2009 Report Share Posted April 21, 2009 Well, then check the code that does the delete to figure out why. You should be able to think of that on your own, it doesn't sound like you're trying very hard. If you click delete and it's not deleting, then look at the delete code to figure out why! Quote Link to post Share on other sites
masrawy 0 Posted April 21, 2009 Author Report Share Posted April 21, 2009 itry sir and i find this code <p align="center"><a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td>but it is not get information frome data base Quote Link to post Share on other sites
masrawy 0 Posted April 21, 2009 Author Report Share Posted April 21, 2009 i find this code for delet replay if ($action == "delete_replly") {br(); br();echo "<center><font size=4 face=\"Traditional Arabic\"><b> حزف الرد </b></font></center>";br(); br();echo "<p align=right><font size=2 color=#FF0000><b> </b></font></p>"; $result = mysql_query("SELECT mem_id FROM subject_replays WHERE id='{$sid}'");if ($row = mysql_fetch_assoc($result)){ if ($row['mem_id'] == $memberid) { $delete=mysql_query("DELETE from subject_replays WHERE id='$sid'"); if($delete){echo "تم الحذف بنجاح";} else {echo "ليس لديك صلاحية هذا هذا الاعلان";} } else { echo "ليس لديك صلاحية لحزف الرد"; }}else{ echo "هذا الاعلان غير موجود ";}echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php\">";}but i think ther is arong thing ? Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 21, 2009 Report Share Posted April 21, 2009 This is the link you're printing:<a href="index.php?action=delete_subject&rep_id=...It runs the "delete_subject" code, not the "delete_replly" code. Quote Link to post Share on other sites
masrawy 0 Posted April 21, 2009 Author Report Share Posted April 21, 2009 <a href="index.php?action=delete_subject&rep_id=...i change it to <a href="index.php?action=delete_replly&rep_id=...printed me no repplay found Quote Link to post Share on other sites
justsomeguy 1,135 Posted April 21, 2009 Report Share Posted April 21, 2009 I'm not sure which of those messages you posted above says not found, but print $sid to make sure it's what you expect it to be. Quote Link to post Share on other sites
masrawy 0 Posted April 21, 2009 Author Report Share Posted April 21, 2009 hi sirthis code you write it for delet subject before i put it to delet replayif ($action == "delete_replly") {br(); br();echo "<center><font size=4 face=\"Traditional Arabic\"><b> حزف الرد </b></font></center>";br(); br();echo "<p align=right><font size=2 color=#FF0000><b> </b></font></p>";$result = mysql_query("SELECT mem_id FROM subject_replays WHERE id='{$sid}'");if ($row = mysql_fetch_assoc($result)){if ($row['mem_id'] == $memberid){$delete=mysql_query("DELETE from subject_replays WHERE id='$sid'");if($delete){echo "تم الحذف بنجاح";} else {echo "ليس لديك صلاحية هذا هذا الاعلان";}}else{echo "ليس لديك صلاحية لحزف الرد";}}else{echo "هذا الاعلان غير موجود ";}echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php\">";} Quote Link to post Share on other sites
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.