ďťż

[PHP][MySQL] Sonda Szukam skryptu.

       

Podstrony


telcocafe

Szukam jakiegoś prostego skryptu sondy korzystającego z baz danych MySQL.



http://www.hotscripts.pl
http://skrypty.e9.pl
Tam poszukaj...

Jeśli bez SQL też są dobre, to F3Sonda.

http://pliki.webhelp...y&roz=php&id=17

Ok dzięki za pomoc znalazłem dość prosty skrypt tylko mam jeden problem z tym skryptem nie działa dodawanie nowych głosów.
<?php $mysqlserver = "localhost"; $mysqldb = "*****"; $mysqluser = "*****"; $mysqlpass = "*****"; $mysqltable = "*****"; if($vote && !$already_voted) SetCookie("already_voted","1"); ?> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" /> <title>Vote for Stuff...</title> </head> <body bgcolor="#ffffff" text="#032F5B" link="#537492" vlink="#000000"> <?php echo "<form action=\"$PHP_SELF\" method=\"POST\">"; mysql_pconnect($mysqlserver,$mysqluser,$mysqlpass); if($new_name) { if(!mysql_db_query($mysqldb,"insert into $mysqltable values ('$new_name',0)")) { print mysql_errno().": ".mysql_error()."<br />"; } } if($vote && $already_voted) { print "<font color=#ff0000>Hey, you voted already!  Vote ignored.</font><p>\n"; } else if($vote) { if(!mysql_db_query($mysqldb,"update $mysqltable set votes=votes+1 where name='$vote'")) { print mysql_errno().": ".mysql_error()."<br />"; } } $result=mysql_db_query($mysqldb,"select sum(votes) as sum from $mysqltable"); if($result) { $sum = (int) mysql_result($result,0,"sum"); mysql_free_result($result); } $result=mysql_db_query($mysqldb,"select * from $mysqltable order by votes DESC"); print "<table border=0><tr><th>Vote</th><th>Suggestion</th><th colspan=2>Votes</th></tr>\n"; while($row=mysql_fetch_row($result)) { print "<tr><td align=center><input type=radio name=vote value=\"$row[0]\" /></td><td>"; print $row[0]."</td><td align=right>".$row[1]."</td><td>"; if($sum && (int)$row[1]) { $per = (int)(100 * $row[1]/$sum); print "<img src=\"bline.gif\" height=12 width=$per /> $per %</td>"; } print "</tr>\n"; } print "</table>\n"; mysql_free_result($result); ?> <input type=submit value="Vote"> </form> </body> </html>

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • nvm.keep.pl

  • Sitedesign by AltusUmbrae.