|
Tutorials
|
|
Â
Skrypt księgi gości
-pliki ksiegi znajduja sie w w katalogu``KsiegaGosci``,ktory znajduje sie w katalogu gÅ‚ownym. -urzywam ``switch``do Å‚adownia stronek w srodku tabelki(tak jak jest to opisane w FAQ) -ksiega skÅ‚ada sie z :ksiega.php(formularz i zapis),baza.txt,wpisy.php(odczyt) -plik ksiega.php ma chmod 777,plik baza.txt ma chmod 666,plik wpisy.php ma chmod 664 -skrypt ksiegi.php wyglÄ…da tak: php: <?php $ip=$_SERVER["REMOTE_ADDR"]; $data = date("Y-m -- H:i:s"); if ($stage == '1') {  $ciag = $data.'|'.$imie.'|'.$miasto.'|'.$email.'|'.$stronka.'|'.$wpis.'|'.$skad.'|'.$ip."\n";  $plik = fopen('baza.txt', 'a'); fputs($plik, $ciag);  fclose($plik);  echo '<font size=3 color=#333311>WPIS DODANO DZIEKUJE</font>' , "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=http://www.vline.pl/~rz-swamp/index.php?id=wpisy\">"; } else { echo '  <script language="JavaScript" type="text/javascript">  <!--  function sprawdz() {  errors = false; Â
if(document.qbook.imie.value.length < 1) { Â errors = "Wpisz Imie lub Nick!"; Â } Â
if(errors) { Â alert(errors); Â return false; Â } else { Â return true; Â } Â } Â //--> Â </script> <script language="JavaScript" type="text/javascript"> Â <!-- Â function sprawdz() { Â errors = false; Â
if(document.qbook.wpis.value.length < 1) { Â errors = "Powinienes wpisac jakis text!"; Â } Â
if(errors) {  alert(errors);  return false;  } else {  return true;  }  }  //-->  </script>  <form name="qbook" method="post" action="ksiega.php" onsubmit="return sprawdz(this)">  <div align="center"> <font size="1" face="Arial Black"> </font>  <table width="39%" height="138" border="0"> <tr>  <td width="43%" height="66"><div align="center">  <div align="center">  <table width="100%" height="23" border="1"> <tr>  <td height="17" bordercolor="#CCCCCC" bgcolor="#333333"><div align="center"><font color="#CCCCCC" size="1" face="Arial Black">IMIE,NICK</font></div></td> </tr> </table> </div> </div> <p align="center"> <font size="1" face="Arial Black">  <input name=imie type=text size="26"> </font></p></td> <td width="6%"> </td> <td width="43%"><div align="center">  <table width="100%" height="23" border="1"> <tr>  <td height="17" bordercolor="#CCCCCC" bgcolor="#333333"><div align="center"><font color="#CCCCCC" size="1" face="Arial Black">MIASTO</font></div></td> </tr> </table> </div> <p align="center"> <font size="1" face="Arial Black">  <input name=miasto type=text size="26"> </font></p></td> </tr> <tr>  <td width="43%" height="66"><div align="center">  <div align="center">  <table width="100%" height="23" border="1"> <tr>  <td height="17" bordercolor="#CCCCCC" bgcolor="#333333"><div align="center"><font color="#CCCCCC" size="1" face="Arial Black">EMAIL</font></div></td> </tr> </table> </div> </div> <p align="center"> <font size="1" face="Arial Black">  <input name=email type=text size="26"> </font></p></td> <td> </td> <td width="43%"><div align="center">  <table width="100%" border="1"> <tr>  <td height="17" bordercolor="#CCCCCC" bgcolor="#333333"><div align="center"><font color="#CCCCCC" size="1" face="Arial Black">STRONA  WWW </font></div></td> </tr> </table> </div> <p align="center"> <font size="1" face="Arial Black">  <input name=stronka type=text value="http://" size="26"> </font></p></td> </tr> </table> <table width="39%" border="0"> <tr>  <td height="104"><div align="center">  <table width="41%" border="1"> <tr>  <td height="6" bordercolor="#CCCCCC" bgcolor="#333333"><div align="center"><font color="#CCCCCC" size="1" face="Arial Black">WPIS</font></div></td> </tr> </table> <p><font size="1" face="Arial Black">  <textarea name="wpis" cols="42" rows="5"></textarea> </font></p> </div></td> </tr> <tr>  <td height="68"><div align="center">  <div align="center">  <table width="91%" border="1"> <tr>  <td height="6" bordercolor="#CCCCCC" bgcolor="#333333"><div align="center"><font color="#CCCCCC" size="1" face="Arial Black">SKAD  WIESZ O TEJ STRONIE ?</font></div></td> </tr> </table> </div> <p> <font size="1" face="Arial Black">  <select name="skad" id="skad"> <option value="Trafilem tu przypadkiem"><font color="#CCCCCC">Trafilem  tu przypadkiem</font></option> <option value="Poprzez wyszukiwarke"><font color="#CCCCCC">Poprzez  wyszukiwarke</font></option> <option value="Znajomy/a mi powiedzial/a"><font color="#CCCCCC">Znajomy/a  mi powiedzial/a</font></option> <option value="Swamp mnie zaprosil"><font color="#CCCCCC">Swamp  mnie zaprosil</font></option> <option value="Poprzez link na zaprzyjaznionej stronie"><font color="#CCCCCC">Poprzez  link na zaprzyjaznionej stronie</font></option> <option value="Niewiem jak sie tu znalazlem/lam"><font color="#CCCCCC">Niewiem  jak tu sie znalazlem/lam</font></option> </select> </font></p> </div></td> </tr> <tr>  <td height="29"><div align="center"><font size="1" face="Arial Black">  </font>  <div align="center"> <font size="1" face="Arial Black">  <input type=hidden name=stage value=1> <input name="submit" type=submit value=WYSLIJ wpis> <input type="reset" name="Submit2" value="WYCZYSC"> '; } ?>
|
|
|
|