justsomeguy Posted April 14, 2009 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. Link to comment Share on other sites More sharing options...
masrawy Posted April 14, 2009 Author 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></ Link to comment Share on other sites More sharing options...
masrawy Posted April 14, 2009 Author 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted April 14, 2009 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. Link to comment Share on other sites More sharing options...
masrawy Posted April 14, 2009 Author Share Posted April 14, 2009 so sir what can i do to print the number of member on line who login Link to comment Share on other sites More sharing options...
justsomeguy Posted April 14, 2009 Share Posted April 14, 2009 $usermem contains the number of logged in users who have accessed the current page within the last 3 seconds. Link to comment Share on other sites More sharing options...
masrawy Posted April 14, 2009 Author Share Posted April 14, 2009 so nothing rong in code only chang this within the last 3 secondsok ? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 14, 2009 Share Posted April 14, 2009 Right, there's a variable that holds the number of seconds to check. Link to comment Share on other sites More sharing options...
masrawy Posted April 15, 2009 Author 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted April 15, 2009 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. Link to comment Share on other sites More sharing options...
masrawy Posted April 15, 2009 Author Share Posted April 15, 2009 i have field for special user but i need the code sir Link to comment Share on other sites More sharing options...
justsomeguy Posted April 15, 2009 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. Link to comment Share on other sites More sharing options...
masrawy Posted April 15, 2009 Author 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 {}?> Link to comment Share on other sites More sharing options...
masrawy Posted April 20, 2009 Author Share Posted April 20, 2009 hi sir no help on this ? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 20, 2009 Share Posted April 20, 2009 You didn't ask me for anything. What do you need help with in that code? Link to comment Share on other sites More sharing options...
masrawy Posted April 20, 2009 Author 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted April 20, 2009 Share Posted April 20, 2009 $speciall = $Row16 [special];}}if ($special == "1" AND $mem_id == $memberid){Those need to be spelled the same. Link to comment Share on other sites More sharing options...
masrawy Posted April 21, 2009 Author 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted April 21, 2009 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! Link to comment Share on other sites More sharing options...
masrawy Posted April 21, 2009 Author 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 Link to comment Share on other sites More sharing options...
masrawy Posted April 21, 2009 Author 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 ? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 21, 2009 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. Link to comment Share on other sites More sharing options...
masrawy Posted April 21, 2009 Author 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted April 21, 2009 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. Link to comment Share on other sites More sharing options...
masrawy Posted April 21, 2009 Author 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\">";} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.