Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. well... if you think about it... they got a 10/1500 chance of getting one of them... thats 1/150, so if you load 150 times, so if you load the page every few seconds... you could very easily find one in 10 minutes...
  2. now... this could work... however switch, is SOOO much faster for stuff like this :-) [code] $randevent=rand(0,1500); $event=""; switch($randevent){ case "0":   $rare1=1;   $event="Your villagers have uncovered the eye of evil stone..."; break; case "250":   $rare2=1;   $event="Your villagers have uncovered the jewel of death stone..."; break; case "350":   $rare3=1;   $event="Your villagers have uncovered the stone of fear..."; break; case "450":   $rare4=1;   $event="Your villagers have uncovered the dragons eye stone..."; break; case "550":   $rare5=1;   $event="Your villagers have uncovered the statue of eden..."; break; case "650":   $rare6=1;   $event="Your villagers have uncovered the priest of lier stone..."; break; case "750":   $rare7=1;   $event="Your villagers have uncovered the sphere of sin stone..."; break; case "850":   $rare8=1;   $event="Your villagers have uncovered the knights of satan stone..."; break; case "950":   $rare9=1;   $event="Your villagers have uncovered the weather witch stone..."; break; case "1500":   $rare10=1;   $event="Your villagers have uncovered the gods of war stone..."; break; } [/code]
  3. the date(z) is from 0-365 (including loop years) just name your images one of them numbers, and on that day, i'll show... then you just [code] <? $comic=$_GET['comicnum']; if(empty($comic)) $comic = date(z); echo '<img alt="alt text" src="'.$comic.'.jpg">'; $pd=$comic -1; $nd=$comic +1; echo '<a href="?comic='.$pd.'">Previous</a> <a href="?comic='.$nd.'">Next</a>'; ?> [/code]
  4. sweet deal :-) thanks... and you had an extra ";" [code] <?php function filter_censor($censor,$badwords=array()){ foreach($badwords as $badword){   $censor = str_ireplace($badword, str_pad("",strlen($badword),"*"), $censor); } return $censor; } $badword[]="hello"; echo filter_censor("Hello hello",$badword); ?> [/code]
  5. how about something like this? [code] <? include("protect.php"); $cid = $_GET["cid"]; echo $cid; mysql_connect("localhost", $dbname, $dbpasswd ) or die ("Unable to connect to server."); mysql_select_db($database) or die ("Unable to select database."); $result1 = mysql_query("SELECT * FROM `Customers` WHERE `CID`= $cid "); $myrow1 = mysql_fetch_array($result1); $company = $myrow1["Company"]; ?> <form enctype='multipart/form-data' action='add_custadd2.php?cid=<?=$cid?>&userid=<?=$userid?>' method='post'> <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#000066" width="95%" cellpadding="5">   <tr><font face="Verdana" size="2">COMPANY     <td><input type=hidden name="company"  value="<?=$company?>"><input type=text name="company"  value="<?=$company?>" disabled="true">&nbsp;</td>     <tr>Country</td><select size="1" onchange="document.location.href=this.value"><option value="">[Select One]</option> <? $result = mysql_query("SELECT * FROM `Countries`  ORDER BY `Country` asc "); while($myrow = mysql_fetch_array($result)){ if($row[country]==$_GET[country]) echo '<option selected value="?country='.$myrow[country].'">'.$myrow[country].'</option>'; else echo '<option value="?country='.$myrow[country].'">'.$myrow[country].'</option>'; } echo '</select>'; ?>   </td> </tr> <?if(!empty($_GET[country])){?> <tr>   <td>Towns<br>   <select name="tid"><option value="">[Select One]         <? $resulta = mysql_query("SELECT * FROM `Towns`  WHERE `ctid` = $ctid ORDER BY `ctid` asc "); while($myrowa = mysql_fetch_array($resulta)){ echo '<option value=%d>%s, %s".', '.$myrowa["TID"].', '.$myrowa["Town"].','. $myrowa["State"]; } echo "</select>\n"; ?>   </td> </tr> <?}?> </table> [/code]
  6. another option would be to have a javascript/dhtml window that just shows once you click submit... or something to that effect...
  7. i think you're looking for something like this... [code] $result = mysql_query("select * from XXXXX "); if(mysql_num_rows($result)==0){ echo "No Records Found !"; }else{ while($row = mysql_fetch_array($result)){   echo $row['name']. " - ". $row['age']; } } [/code]
  8. date(z) is the number of days since jan 1 , somewhere between 1-365. date(z) also compensates for leap years... just put a row into your mysql for "date", and have it fill in date(z) coming to think of it... if you go this way... you'd also want [code] $date=date(z)+1; mysql_query("DELETE FROM example WHERE date>'$date1'"); [/code] so it'd go around newyears...
  9. [code] $date=date(z)-3; mysql_query("DELETE FROM example WHERE date<'$date1'"); [/code] how bout this?
  10. no problem... i try ;-) for any specific questions... feel free to pm me :-)
  11. anything that is dynamic without reloading the page, is probably done in javascript
  12. since .php is only loaded once, you'd have to reload the page inbetween each selection... you'd probly want a to intermingle javascript and .php together to get something like this [code] <select size="1" onchange="document.location.href=this.value"> <option value="'.$PHP_SELF.'.?country='.$countryname.'">'.$countryname.'</option> </select> <? switch($_GET[country]){ case "countryname":  echo '<select size="1" onchange="document.location.href=this.value">';  echo  '<option value="'.$PHP_SELF.'.?country='.$countryname.'">'.$countryname.'</option>';  echo '</select>'; break; } ?> [/code] or something to that effect...
  13. [code] $_POST['upass'] = md5($_POST['upass']); [/code] that cant happen... put [code] $pass= md5($_POST['upass']);. [/code] then [code] $query="select * from user where uname='".$_POST['uname']."'  and pw='".$pass."' "; [/code]
  14. no... not really any other way of doing it... other then typing it over, or changing the other pages...
  15. true... however this one is much easier to connect with a mysql database... :-)
  16. ok :-) basically speaking... [code] $head = " <html> <head> <LINK href='../lib/style.css' rel='stylesheet' type='text/css'> <title>TITLE</title> </head> <body> <center> <div id='wrapper'> <div id='topnav'>   <div class='nav'>"; include('../lib/userlogin.php'); $head .= "</div> </div> <div id='header'>   <a href='../index.php'><img src='../images/logo.png' border='0' alt='aaa' title='aaa'>[/url] </div> <div id='mainnav'>   <a href='../index.php'><img src='../images/01home.jpg' alt='Home' border='0' height='49' width='191' />[/url]<a href='../plans.php'><img src='../images/02plans.jpg' alt='Plans' border='0' height='49' width='197' />[/url]<a href='#'><img src='../images/03forums.jpg' alt='Forums' border='0' height='49' width='201' />[/url]<a href='#'><img src='../images/04support.jpg' alt='Support' border='0' height='49' width='211' />[/url] </div> <div id='menu'>"; include('../admin/lib/nav.php'); $head .= "</div> <div id='content'>   <div class='ads'>   <p><center><? include('../lib/ads.php'); ?></center></p>   </div>"; [/code] then in the nav.php etc. have that info also encompased by the "$head .= "
  17. no, its not possible... the only ip address that .php has access to, is the one sent along with the headers, no access to their internal ip's :-(
  18. [code] $variable = '<span class="price">$'.$PrintPrice.'</span>'; [/code]
  19. unfortunatly, this cannot be in side of a variable... [code] <? include('../admin/lib/nav.php'); ?> [/code] what you'd want to do is end the variable, and in that file, have that information there appended to the $head...
  20. taith

    Logout help

    on some systems i've found... that session_destroy(); has no effect, try putting this... or perhaps just unset(); all of your main session variables... [code] <? @session_destroy(); @session_end(); header("location:back.php") ?> [/code]
  21. easiest way i've found is to drop this to the top of your file [code] if(isset($_COOKIE[lang])) require_once('lang/'.$_COOKIE[lang].'.php'); else require_once('lang/english.php'); [/code] then in your english.php [code] define("HOME","Home"); [/code] or dutch.php [code] define("HOME","Huiswaarts"); [/code] etc. then in your code, you simply just [code] <a href="home.php"><?=HOME?></a> [/code] or whatnot... then all you have to do is set the cookie to change languages...
  22. the only other way of doing it, is by cookies, very effective i've found...
  23. okie :-D is fixed and works perfectly :-D anyone that wants to use it... feel free :-P [code] <? function filter_censor($censor,$badwords=array()){ foreach($badwords as $badword){   for($i=0;$i<strlen($badword);$i++) $x .= "*";   $censor = str_ireplace($badword, $x, $censor);   unset($x); } return $censor; } $badword[]="hello"; echo filter_censor("Hello hello",$badword); ?> [/code]
  24. ok... got that fixed... however it is still only blocking 1 word [code]<? function filter_censor($censor,$badwords=array()){ foreach($badwords as $badword){   if(strpos($censor, $badword)){   for($i=0;$i<strlen($badword);$i++) $x .= "*";   $censor = str_replace($badword, $x, $censor);   } } return $censor; } $badword[]="hello"; echo filter_censor("Hello hello",$badword); ?>[/code]
×
×
  • 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.