Jump to content

lalu

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lalu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. this is my real problem: i have website http://ex.axample.com (subdomain from example.com) now i dont want all my local network or internet to view it but only my local network with 192.168.10.* ip. and i use the following script to do that but the result is FAIL [code] <? $ipne = $_SERVER['REMOTE_ADDR']; require("includes/konpik.php"); $result = mysql_query("SELECT ipku FROM ip WHERE ipku = '$ipne'"); $num = mysql_numrows($result); if ($num != "0") { end_if; ?> <html> <head> <title></title> </head> <body> my index content here </body> </html> <? exit; } else { ?> <html><body bgcolor=000000 text=red> <center><b> <? echo "Auth code : $num<br>"; echo "Access from $ipne denied<br><h1> Forbidden Area</h1>"; } ?> [/code] and of course i try using htacces but also fail. you can see the capture here: http://www.webdeveloper.com/forum/attachment.php?attachmentid=7817 Any other Solution? it will apreciate. Thanks Best Regards,
  2. [quote author=emehrkay link=topic=107079.msg429651#msg429651 date=1157591938] it might depend on the version of php you're running if mysql_fetch_assoc would work try mysql_fetch_array($your_Query, MYSQL_ASSOC); what kind of field is idAgenda? you may need to close the sting out with a double quote. echo $sql_update and see if it is giving you what you expect $sql_update="Select counter from tbagenda where idAgenda=".$idagenda; [/quote] i have tried your help emehrkey but it doesn't work.
  3. [code]<?                   $sqlview = "SELECT * from tbagenda where idAgenda=".$idagenda;                           $resagenda1 = mysql_query($sqlview) or die (mysql_error());                   while ($rowagenda1 = mysql_fetch_array($resagenda1))                   { [/code] now i got error like this: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  4. [quote author=Barand link=topic=107079.msg429067#msg429067 date=1157536777] change line 14 to $res_update=mysql_query($sql_update) or die (mysql_error()); That should help to locate the error. Do similar with other query. BTW: you could accomplish this [code] $sql_update="Select counter from tbagenda where idAgenda=".$idagenda; $res_update=mysql_query($sql_update); $row_update=mysql_fetch_assoc($res_update); $counter_x=$row_update[counter]+1; $sql_update2="Update tbagenda set counter=$counter_x where idAgenda=".$idagenda; $res_update2=mysql_query($sql_update2); [/code] with [code] mysql_query ("UPDATE tbagenda SET counter=counter+1 WHERE idAgenda = '$idagenda' ");[/code] [/quote] Thank you very much Mr Moderator, but now I got an error like this [code]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mmugmac/public_html/agenda2.php on line 65[/code]
  5. I got error like this: ============================ Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/web/public_html/agenda2.php on line 15 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/web/public_html/agenda2.php on line 64 =================== this my code: ================== [code]<?php include("inc/header_dalam.php"); if(!isset($asu)) { $asu=array(); session_register("asu"); } if(!in_array($idagenda,$asu)) { //echo count($asu)."--"; array_push($asu,$idagenda); $sql_update="Select counter from tbagenda where idAgenda=".$idagenda; $res_update=mysql_query($sql_update); $row_update=mysql_fetch_assoc($res_update); $counter_x=$row_update[counter]+1; $sql_update2="Update tbagenda set counter=$counter_x where idAgenda=".$idagenda; $res_update2=mysql_query($sql_update2); } ?>           <table width="100%" border="0" cellspacing="0" cellpadding="0">               <tr>                 <td width="9">&nbsp;</td>                 <td><img src="images/spacer.gif" width="1" height="10"> <table width="100%" border="0" cellspacing="0" cellpadding="0">                     <tr>                       <td>                       <table width="100%" border="0" cellspacing="0" cellpadding="0">                           <tr>                             <td width="317">                             <table border="0" cellpadding="0" cellspacing="0">                                 <tr>                                   <td width="9">&nbsp;</td>                                   <td>                                   <?                                   echo '&nbsp;&nbsp;<span class="judul">';                                   echo $judul_agenda;                                   echo '</span>';                             ?>                                   </td>                                   <td width="12">&nbsp;</td>                                 </tr>                               </table>                             </td>                             <td width="99" height="31">&nbsp;</td>                           </tr>                         </table></td>                     </tr>                     <tr>                       <td class="contentdalam" valign="top" height="350">                       <br>                       <table border=0 cellspacing=0 cellpadding=0 width=100%> <tr> <td><a href="agenda.php?ver=<?=$ver?>" class="iber">INDEX &nbsp;<?=$judul_agenda?></a></td> </tr> </table> <br> <!-- startprint -->   <table border=0 cellspacing=0 cellpadding=2 width=100%>                       <?                   $sqlview = "SELECT * from tbagenda where idAgenda=".$idagenda;                   $resagenda1 = mysql_query($sqlview);                   while ($rowagenda1 = mysql_fetch_array($resagenda1))                   {                   echo '<center><strong>'.$rowagenda1[namaAgenda.$bahasa].'</strong><br>';                   if($rowagenda1[mulaiAgenda]==$rowagenda1[selesaiAgenda]) { if($bahasa=="_e") { echo date("d M Y", $rowagenda1[mulaiAgenda]).'<br>'; } else { echo TglIndo($rowagenda1[mulaiAgenda],"s"); } } else { if($bahasa=="_e") { echo date("d M Y", $rowagenda1[mulaiAgenda])." - ". date("d M Y", $rowagenda1[selesaiAgenda]).'<br>'; } else { echo TglIndo($rowagenda1[mulaiAgenda],"s")." - ". TglIndo($rowagenda1[selesaiAgenda],"s"); } } echo '<br><br></center>';                   echo $rowagenda1[isiAgenda.$bahasa];                                                                               }                   echo '</table>'; ?> <!-- stopprint --> <p align="right"> <? echo '<b>Viewed: '.$viewx.'</b><br>'; echo '<A HREF="#" onClick="window.open(\'send_agenda.php?idagenda='.$idagenda.'&ver='.$ver.'\',\'Send\',\'width=500,height=350,resizable=yes\')">send to friend</a><br>';     ?>     <a href="phprint.php">Print Version&nbsp;&nbsp;<img src="images/print.gif" border="0" align="absmiddle"></a> </p>                       </td>                     </tr>                                      </table></td>                 <td width="20">&nbsp;<td>               </tr>                          </table></td>   </tr>       </table> <?php include("inc/footer_dalam.php"); ?>[/code] ================= any help will appreciate:) thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.