Jump to content

C)zy

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About C)zy

  • Rank
    User Nou
  1. hello..for that problem with the session destroy: first you should use: require_once or include_once for including function and class definition files.

    initiate a session (or pick up an existing one) by using session_start() (which takes no arguments), do not change the structure of session_register(), in your case session_register('email').

  2. Deci..am un script de login ...merge perfect , scriptul este : <?php require ('functions.php'); require ('config.php'); if(!isset($_SESSION['logat_utilizator'])) $_SESSION['logat_utilizator'] = 'Nu'; if(!session_is_registered(email)) { $conexiune = mysql_connect($_mysql_host,$_mysql_user,$_mysql_password) or die("a.Nu ma pot conecta la MySQL!"); mysql_select_db($_mysql_db, $conexiune) or die("Nu gasesc baza de date"); if(!isset($_GET['actiune'])) $_GET['actiune'] = ''; switch($_GET['actiune']) { case '': ?> <br><br> <form name="form" method="post" action="login.php?actiune=validare"> <center> <table width="230" border="0"> <tr> <td><font size="1" face="Verdana" color="#00000">» <strong>E-mail</strong></font></td> <td width="119"> <input name="email" type="text" class="box"> </td> </tr> <tr> <td><font size="1" face="Verdana" color="#00000">» <strong>Parola</strong></font></td> <td width="119"> <input name="parola" type="password" class="box"> </td> </tr> <tr> <td> <input name="Login" type="submit" class="box" value="Login"> </td> <td> <font size="1" face="Verdana"><strong><a href="inregistrare.php">» Inregistreaza-te</a></strong></font></a></td> </table> </center> </form> <BR><BR> <? break; case 'validare': $_SESSION['email'] = $_POST['email']; if(($_POST['email'] == '') || ($_POST['parola'] == '')) { echo '<center> <b><font size="1" face="Verdana" color="#ff0000"><BR><BR>Completeaza user-ul si parola<br> Apasati <a href="login.php">aici</a> pentru a va intoarce la pagina de logare</font></b> <META HTTP-EQUIV=Refresh CONTENT="1; URL=login.php"></center>'; } else { $cerereSQL = "SELECT * FROM `utilizatori` WHERE email='".htmlentities($_POST['email'])."' AND parola='".md5($_POST['parola'])."'"; $rezultat = mysql_query($cerereSQL); if(mysql_num_rows($rezultat) == 1) { while($rand = mysql_fetch_array($rezultat)) { session_register("email"); session_register("parola"); $data = date('Y-m-d H:i:s'); $IP = $_SERVER['REMOTE_ADDR']; $cerereSQL = 'UPDATE `utilizatori` SET Data="'.$data.'", IP="'.$IP.'" WHERE email="'.$_SESSION['email'].'"'; mysql_query($cerereSQL); echo '<center> <b><font size="1" face="Verdana" color="#ffc00"><BR><BR><BR>Va rugam asteptati ....</font></b><br><br> Vei fi redirectionat. <META HTTP-EQUIV=Refresh CONTENT="1; URL=utilizator.php"></center>'; } } else { echo '<center> <b><font size="1" face="Verdana" color="#ff0000">Datele introduse sunt incorecte<br> Apasati <a href="login.php">aici</a> pentru a va intoarce la pagina precedenta</font></b></center>'; } } break; } } else { echo '<center> <b><font size="1" face="Verdana" color="#00000">Va rugam asteptati ....</font></b> <META HTTP-EQUIV=Refresh CONTENT="0; URL=utilizator.php"></center>'; } ?> Deci...am un panou lateral care imi arata cand ma loghez "bun venit "emailul " de la $_session . Problema este urmatoarea , dupa ce ramane pagina deschisa si incerc sa deschid alta pagina din site ( toate paginile contin session_start() } sesiunea se distruge si nu te mai arata logat...deci din moment ce sesiunea mea este pornita la inceput...si imi arata corect..si functioneaza...si daca as alege orice link de pe site sam erg pe el tot logat imi arata..asta la inceput , dar daca il las 1 minut..si dau pe orice link sesiunea se distruge...care poate fi problema?
  3. Buna ziua am si eu o rugaminte....vreau un cod in .htaccess astfel incat lumea cand acceseaza (hackeri) un anumit fisier spre exemplu ( www.csmaniack.com/admin) ei sa fie redirectionati catre www.csmaniack.com/404.html. Se poate ? multumesc anticipat
  4. C)zy

    Problema Rate Script

    Am si eu o problema...am un script AJAX rate...v 1.7 (ultima) si am o problema..... Am un script unde pot adauga server de cs si fiecarui server ii corespunde un "id" (numar) . Scriptul de implementare a scriptului rate intr-un alt script este : <? echo pullRating(ID,true,false,true); ?> Unde ID este un numar...numarul pe care se inregistreaza votul...spre exemplu daca id-ul serverul si "id" din acest script sunt asemenea , cand votez , votul se inregistreaza pentru acel server . Eu am scriptul urmator : <?php include("include/rating_functions.php"); require ('include/statistici.php'); // If current page number, use it // if not, set one! if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } // Define the number of results per page /////////// afisare randuri $ordine = "desc"; $max_results = 15; /////////// // Figure out the limit for the query based // on the current page number. $from = (($page * $max_results) - $max_results); // Perform MySQL query on only the current page number's results ?> <center>Lista HLDS</center><br><br> <center><table border=0 class=margins cellspacing=1 width=90%> <tr> <td align=center><b>[ Live Stats]</b></td> <td align=center><b>[ Adress ]</b></td> <td align=center><b>[ Port ]</b></td> <td align=center><b>[ Slots ]</b></td> <td align=center><b>[ Anticheat ]</b></td> <td align=center><b>[ ISP ]</b></td> <td align=center><b>[ Mod ]</b></td> <td align=center><b>[ Country ]</b></td> <td align=center><b>[ Rate ]</b></td> </tr> <?PHP $sql = mysql_query("SELECT * FROM server order by id $ordine LIMIT $from, $max_results "); $num=1; while($rand = mysql_fetch_array($sql)){ // Build your formatted results here. $num++; if(($num%2)!=0){ $bg=""; }else{ $bg=""; } $post = substr($rand[5],0,40); ?> <td class=margins><center><a target='_blank' title='CsManiack.COm' onClick=window.open('stats/index.php?ip=<?=$ip?>&port=<?=$port?>','mywindow','width=520,height=680')>Verifica</a></center></td> <td class=margins><center> <?=$rand['ip']?> </center></td> <td class=margins><center> <?=$rand['port']?> </center></td> <td class=margins><center> <?=$rand['player']?> </center></td> <td class=margins><center> <?=$rand['cod']?> </center></td> <td class=margins><center> <?=$rand['net']?> </center></td> <td class=margins><center> <?=$rand['modul']?> </center></td> <td class=margins><center> <?=$rand['tara']?> </center></td> <td class=margins><center> <? echo pullRating($rand['id'],false,false,true); ?> </center></td> </tr> <?PHP } echo "</table>"; // Figure out the total number of results in DB: $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM server"),0); // Figure out the total number of pages. Always round up using ceil() $total_pages = ceil($total_results / $max_results); echo "<br><br>"; echo "<center>Sunt $srv_number servere in baza de date<center>"; echo "<br><br>"; // Build Previous Link if($page > 1){ $prev = ($page - 1); echo "<a class=\"menu_link\" href=\"".$_SERVER['PHP_SELF']."?page=$prev\" ><< Inapoi</a> "; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i "; } else { echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\" class=\"menu_link\">$i</a> "; } } // Build Next Link if($page < $total_pages){ $next = ($page + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\" class=\"menu_link\">Urmatoarele >></a>"; } echo "</center>"; ?> Mie imi arata ip , port , player etc cum trebuie ...de la linia $rand[ip] spre exemplu ( aceasta linie fiind pentru ip ) . Si normal ar trebui sa imi puna in script...id-ul servarului in linia $rand['id'] ... dar nu o face....in timp ce , celalte (ip , nume , player etc..) le arata.. Nu stiu daca intelegeti ce vreau sa zic . Va rog sa ma avutati ...sau daca nu ..as vrea daca se poate in rate script simplu ca pe serverele de pe freakz.ro ... sau play.celife.ro ..... un plus care adauga vot intr-o baza de date..
  5. C)zy

    Cs Dc Script Problem

    Bun am facut modificari <?PHP include("include/rating_functions.php"); ?> <h2>Cauta Server in baza de date</h2> <form name="search" method="post" action="<?=$PHP_SELF?>"> Cauta : <input type="text" name="find" /> dupa <Select NAME="field"> <Option VALUE="ip">Adresa</option> <Option VALUE="modul">Mod</option> <Option VALUE="cod">Anticheat</option> </Select> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" class="box" value="Search" /> </form> <? $modul = $_POST['modul']; $cod = $_POST['cod']; $ip = $_POST['ip']; $searching = $_POST['searching']; $find = $_POST['find']; //This is only displayed if they have submitted the form if ($searching =="yes") { echo "<h2>Rezultatele cautarii</h2><p>"; //If they did not enter a search term we give them an error if ($find == "") { echo "<p>You forgot to enter a search term"; exit; } // We preform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); //Now we search for our search term, in the field the user specified $data = mysql_query("SELECT * FROM server WHERE upper($field) LIKE'($find)'"); ?> <center><table border=0 class=margins cellspacing=1 width=99%> <tr><td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Status ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Live ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Adress ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Port ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Slots ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Anticheat ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ ISP ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Mod ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Country ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Rate ]</b></td> </tr> <?PHP //And we display the results while($result = mysql_fetch_array( $data )) { ?> <tr><td class=margins><center> <?php if ($fp=@fsockopen(htmlentities($ip, ENT_QUOTES),$port,$ERROR_NO,$ERROR_STR,(float)0.5)) { fclose($fp); echo '<img src="imagini/up.png" alt="Online"/>'; } else { echo '<img src="imagini/down.png" alt="Offline"/>'; } ?> </center></td> <td class=margins><center><a target='_blank' title='http://servers.cs-dc.ro/info.php?server=<?=$result['ip']?>:<?=$result['port']?>.html' onClick=window.open('stats/stats.php?ip=<?=$result['ip']?>&port=<?=$result['port']?>','mywindow','width= 520,height=680')>Verifica</a></center></td> <td class=margins><center> <?=$result['ip']?> </center></td> <td class=margins><center> <?=$result['port']?> </center></td> <td class=margins><center> <?=$result['player']?> </center></td> <td class=margins><center> <?=$result['cod']?> </center></td> <td class=margins><center> <?=$result['net']?> </center></td> <td class=margins><center> <?=$result['modul']?> </center></td> <td class=margins><center> <?=$result['tara']?> </center></td> <td class=margins><center> Unavailable </center></td> </tr> <?PHP } print "</table></center>"; //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Cuvantul introdus nu se potriveste cu nimic din baza de date.<br><br>"; } } ?> Totul e bine . problema e la $data = mysql_query("SELECT * FROM server WHERE upper($field) LIKE'($find)'"); cred Edit : mai mult ca sigur problema e la while($result = mysql_fetch_array( $data ))
  6. C)zy

    Cs Dc Script Problem

    Server error The website encountered an error while retrieving http://www.csmaniack.com/cautare_svr.php. It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. nu am modificat nimica in htaccess..
  7. C)zy

    Cs Dc Script Problem

    Super , acu imi da internal server error ....
  8. Buna ziua , am si eu un site facut din putinele mele cunostinte Php . Dorest ca munca mea sa fie in siguranta , si as vrea sa stiu cam ce ar trebui sa adaug in .htaccess sau intr-un fisier php ( fiecare pagina de pe site are inclusa un php extern ( ex : nume.php) in care pot adauga scripturi de protectie . Cam ce scripturi trebuie sa adaug ( Php / htaccess ) pentru a ma proteja de Sql Injection si flood . De flood cred ca am reusit printr-un cod prin care nu permite nimaniu sa se conecteze pe site de mai mult de 3 ori in 3 secunde . Multumesc anticipat .
  9. C)zy

    Cs Dc Script Problem

    $find = $_POST['find']; Am adaugat linia...acum e aceiasi problema ..isi da refresh si atat...totusi cred ca e problema la formural...si linia "if ($searching =="yes") "... cred ca ar trebui alta optiune de trimitere a acestuia edit : bun am observat ca nu am declarat "$searching = $_POST['searching'];" ...si acum nu isi da refresh ...apare doar Rezultatele cautarii [ Status ] [ Live ] [ Adress ] [ Port ] [ Slots ] [ Anticheat ] [ ISP ] [ Mod ] [ Country ] [ Rate ] Cuvantul introdus nu se potriveste cu nimic din baza de date. Orice as scrie aia apare .. daca las spatiu gol zice "You forgot to enter a search term" cum ar trebui Deci problema e ca nu le afiseaza..
  10. C)zy

    Cs Dc Script Problem

    Cauta : <input type="text" name="find" /> dupa if ($find == "") $Find reprezinta cuvantul cheie pe care se realizeaza cautarea
  11. C)zy

    Cs Dc Script Problem

    Buna ziua am si eu o problema , am incercat sa realizez un site pe baza scriptului CS-DC.ro si merge destul de bine , problema este ca nu merge optiunea "cautare server" cand dau sa cauta un server dupa nume / mod sau orice altceva ...si dau trimite ...pur si simplu pagina isi da refresh ( desii sunt 7 servare in baza de date ) si apare formularul necompletat . Scriptul pe care ruelaza optiunea de cautare este : <?PHP include("include/rating_functions.php"); ?> <h2>Cauta Server in baza de date</h2> <form name="search" method="post" action="<?=$PHP_SELF?>"> Cauta : <input type="text" name="find" /> dupa <Select NAME="field"> <Option VALUE="ip">Adresa</option> <Option VALUE="modul">Mod</option> <Option VALUE="cod">Anticheat</option> </Select> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" class="box" value="Search" /> </form> <? //This is only displayed if they have submitted the form if ($searching =="yes") { echo "<h2>Rezultatele cautarii</h2><p>"; //If they did not enter a search term we give them an error if ($find == "") { echo "<p>You forgot to enter a search term"; exit; } // We preform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); //Now we search for our search term, in the field the user specified $data = mysql_query("SELECT * FROM server WHERE upper($field) LIKE'%$find%'"); ?> <center><table border=0 class=margins cellspacing=1 width=99%> <tr><td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Status ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Live ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Adress ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Port ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Slots ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Anticheat ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ ISP ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Mod ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Country ]</b></td> <td height=28 style=background-image:url(imagini/categoriix.png) align=center><b>[ Rate ]</b></td> </tr> <?PHP //And we display the results while($result = mysql_fetch_array( $data )) { ?> <tr><td class=margins><center> <?php if ($fp=@fsockopen(htmlentities($ip, ENT_QUOTES),$port,$ERROR_NO,$ERROR_STR,(float)0.5)) { fclose($fp); echo '<img src="imagini/up.png" alt="Online"/>'; } else { echo '<img src="imagini/down.png" alt="Offline"/>'; } ?> </center></td> <td class=margins><center><a target='_blank' title='http://servers.cs-dc.ro/info.php?server=<?=$result['ip']?>:<?=$result['port']?>.html' onClick=window.open('stats/stats.php?ip=<?=$result['ip']?>&port=<?=$result['port']?>','mywindow','width=520,height=680')>Verifica</a></center></td> <td class=margins><center> <?=$result['ip']?> </center></td> <td class=margins><center> <?=$result['port']?> </center></td> <td class=margins><center> <?=$result['player']?> </center></td> <td class=margins><center> <?=$result['cod']?> </center></td> <td class=margins><center> <?=$result['net']?> </center></td> <td class=margins><center> <?=$result['modul']?> </center></td> <td class=margins><center> <?=$result['tara']?> </center></td> <td class=margins><center> Unavailable </center></td> </tr> <?PHP } print "</table></center>"; //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Cuvantul introdus nu se potriveste cu nimic din baza de date.<br><br>"; } } ?> Cand dau trimite , nu imi apare nici macar "Rezultatele cautarii" ci doar formularul . Din cate vad eu in script in codu : echo "<h2>Rezultatele cautarii</h2><p>"; ar trebui sa imi arate imediat dupa ce dau cauta / trimite . Asta ma duce cu gandul ca este de la formularul de contact , dar care este problema , ma puteti ajuta ? multumesc anticipat
×
×
  • Create New...