Snaip3Rs Posted May 17, 2010 Report Share Posted May 17, 2010 Es zinu ka vote skripts nav nemaz tik viegls, bet vai jūs varētu lūdzu man palīdzēt un parādīt kā jaliek kautkāds balsošanas skripts piemēram vote poga un katrs nospiežot nobalso par savu iemīļoto dziesmu un saglabājās ar IP lai nākošs reiz nevarētu balsot un cik nobalsojuši tur skaits rādās piemēram 34 citai tur 4 vēl citai 153. Lūdzu izpalīdziet. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Dziesmu Tops</title> </head> <body> <table border=1> <tr> <th>Nr</th> <th>Albums</th> <th>Izpilditajs</th> <th>Dziesma</th> </tr> <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("top", $con); //Izveido query $query = mysql_query("select * from top"); //dabu visus datus no db while ($row = mysql_fetch_array($query)){ $id = $row['id']; $albums = $row['albums']; $izpilditajs = $row['izpilditajs']; $dziesma = $row['dziesma']; ?> <tr> <th><?php echo $id;?></th> <th><?php echo $albums;?></th> <th><?php echo $izpilditajs;?></th> <th><?php echo $dziesma;?></th> </tr> <?php } //If beigu zime ?> <FORM> <INPUT TYPE="BUTTON" VALUE="Pievienot dziesmu" ONCLICK="window.location.href='http://localhost/Top/pievienot.php'"> </FORM> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
emsy Posted May 17, 2010 Report Share Posted May 17, 2010 (edited) Kas par modi konektēties datubāzei katru reizi pa jaunam :@ Nav vieglāk configā piekonektēties un par to vairs nesatraukties?? Edited May 17, 2010 by emsy Quote Link to comment Share on other sites More sharing options...
bobsters Posted May 17, 2010 Report Share Posted May 17, 2010 Nav jēga pārbaudīt lietotājus pēc IP adresēm! Jo daudziem IP adreses ir dinamiskas un mainās! Labāk ieteiktu pēc MAC adresēm :) Tas mazliet tāds Offtopiks :) Quote Link to comment Share on other sites More sharing options...
ohmygod Posted May 17, 2010 Report Share Posted May 17, 2010 Tad jau tomēr labāk IP :D jo kāds biedrs bobsters nezin kā darbojas webi un tīkli. Quote Link to comment Share on other sites More sharing options...
anonīms Posted May 17, 2010 Report Share Posted May 17, 2010 (edited) yo, wtf? using a MAC address will be impossible unless you're on a LAN. Even on a LAN, you couldn't do this from php without jumping through hoops. drīzak If you are not on a LAN you may not be able to get the MAC since MACs are not part of the TCP/IP. Čakars daudzreiz lielāks EDIT, EDIT, EDIT: function returnMacAddress() { // This code is under the GNU Public Licence // Written by michael_stankiewicz {don't spam} at yahoo {no spam} dot com // Tested only on linux, please report bugs // WARNING: the commands 'which' and 'arp' should be executable // by the apache user; on most linux boxes the default configuration // should work fine // Get the arp executable path $location = `which arp`; // Execute the arp command and store the output in $arpTable $arpTable = `$location`; // Split the output so every line is an entry of the $arpSplitted array $arpSplitted = split("\n",$arpTable); // Get the remote ip address (the ip address of the client, the browser) $remoteIp = $GLOBALS['REMOTE_ADDR']; // Cicle the array to find the match with the remote ip address foreach ($arpSplitted as $value) { // Split every arp line, this is done in case the format of the arp // command output is a bit different than expected $valueSplitted = split(" ",$value); foreach ($valueSplitted as $spLine) { if (preg_match("/$remoteIp/",$spLine)) { $ipFound = true; } // The ip address has been found, now rescan all the string // to get the mac address if ($ipFound) { // Rescan all the string, in case the mac address, in the string // returned by arp, comes before the ip address // (you know, Murphy's laws) reset($valueSplitted); foreach ($valueSplitted as $spLine) { if (preg_match("/[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f][:-]". "[0-9a-f][0-9a-f]/i",$spLine)) { return $spLine; } } } $ipFound = false; } } return false; } Edited May 17, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
bobsters Posted May 17, 2010 Report Share Posted May 17, 2010 (edited) lai ari chakars lielaks toties atkrit iespeja ka lietotaja IP (kurs jau ir nobalsojis) nenonak pie cita kurs grib balsot bet nevar jo ta IP jau ir blacklistee.... Tad jau tomēr labāk IP :D jo kāds biedrs bobsters nezin kā darbojas webi un tīkli. Labi ka tu mums tāds izglītots un visu māki un zini.... Edited May 17, 2010 by bobsters Quote Link to comment Share on other sites More sharing options...
ohmygod Posted May 18, 2010 Report Share Posted May 18, 2010 Akdies... Nu un ko tev dos, ja visi tie jūzeri sēž aiz viena rūtera? Kā tas arī noteikti ka ir, ja ir viena IP adrese? Viena IP, viena MAC. Matemātika ir vienkārša - viens balsojums no vienas IP adreses dienā/vispār. Quote Link to comment Share on other sites More sharing options...
briedis Posted May 18, 2010 Report Share Posted May 18, 2010 Ko jūs te pīpējat? Nevar dabūt MAC adresi. Piemēram, man rūteris ir tā nokonfigurēts, ka tu nemaz nezini, cik datori aiz viņa sēž, viņš simulē vienu datoru ar konkrētu MAC adresi. Nav ko iespringt par šīm lietām, ja gribēs, tāpat nobalsos vairākkārt caur prokšiem... Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted May 18, 2010 Author Report Share Posted May 18, 2010 Es skatos jūs baigi te aizrāvaties! :D BEt lūdzu simple vote skript varat iedot kur nospiežot nobalsojās un nevajag nekādas zvaigznes neko citu! pas pats apmēram kas click counter tikai viens un tas pats IP nevar balsot un saglabājās DB pēc ID Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.