IM24LV Posted September 27, 2006 Report Share Posted September 27, 2006 Tātad ir balsošana, un balsošana atrodas mapītē poll/poll.php kad ar include tā tiek ielikta vietā kur gribu to redzēt <?php include "./poll/poll.php"; ?> parādās daudz dažādi errori, bet kad ieeju pašā poll.php viss ir kārtībā! kāpēc tā? Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2006 Report Share Posted September 27, 2006 Varbūt sāc ar to, ka parādi visus errorus ? Link to comment Share on other sites More sharing options...
IM24LV Posted September 27, 2006 Author Report Share Posted September 27, 2006 nu lab bet ko tas liidzees? Warning: fseek(): supplied argument is not a valid stream resource in C:\wamp\www\poll\poll.php on line 31 Warning: fclose(): supplied argument is not a valid stream resource in C:\wamp\www\poll\poll.php on line 33 Warning: fseek(): supplied argument is not a valid stream resource in C:\wamp\www\poll\poll.php on line 38 Warning: fclose(): supplied argument is not a valid stream resource in C:\wamp\www\poll\poll.php on line 40 Warning: fseek(): supplied argument is not a valid stream resource in C:\wamp\www\poll\poll.php on line 45 Warning: fclose(): supplied argument is not a valid stream resource in C:\wamp\www\poll\poll.php on line 47 Warning: Division by zero in C:\wamp\www\poll\poll.php on line 50 0% Warning: Division by zero in C:\wamp\www\poll\poll.php on line 59 Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2006 Report Share Posted September 27, 2006 Tagad paņem un iztulko ko šie errori nozīmē. (nopietni) Link to comment Share on other sites More sharing options...
IM24LV Posted September 27, 2006 Author Report Share Posted September 27, 2006 Brīdinājums: fseek(): apgādātais arguments ir ne īstenu straumes resursu C:\wamp\www\poll\poll.php on line 31 iztulkoju kaut vai to, skaidraaks nepalika! jo tas pool ja iet taapat straadaa. nestraadaa tad ja to ieliek ar include! Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2006 Report Share Posted September 27, 2006 Un kurš ir tas apgādātais arguments? Tas ir "handleris" uz faila atveršanu. droši vien, ka $f = fopen('file.txt', 'a+'); Funkcijai fseek() netiek padots šis $f; Link to comment Share on other sites More sharing options...
IM24LV Posted September 27, 2006 Author Report Share Posted September 27, 2006 nu es tev varu iedot visu pools.php tas njemts no citurienes. <?php //made by Ovidiu Nita (ovidiuweb@binarythunder.com) //http://www.binarythunder.com -> best source of scripts if (isset($HTTP_POST_VARS['vote'])) { require("votes.php"); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Poll by BinaryThunder.Com</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="115" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="right"> <font color="#FFFFFF" size="2" face="Comic Sans MS"><a href="http://www.binarythunder.com"><img src="menu.gif" alt="http://www.binarythunder.com" width="115" height="19" border="0"></a></font></div></td> </tr> <tr> <td align="center" valign="bottom" bgcolor="#EFF4F8" style="border-right: #336699 1px solid; border-left: #336699 1px solid; border-top: #336699 1px solid; border-bottom: #336699 1px solid"><div align="left"> <table width="113" height="30" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="35" height="100" align="center" valign="bottom" style="FONT-SIZE: 7pt; FONT-FAMILY: Verdana"> <div align="center"> <?php $file="great" . ".txt"; $fh=@fopen("$file", "r+"); @flock($fh, LOCK_EX); fseek($fh, 6, SEEK_SET); $s1=@fgets($fh,10); fclose($fh); $file="nice" . ".txt"; $fh=@fopen("$file", "r+"); @flock($fh, LOCK_EX); fseek($fh, 6, SEEK_SET); $s2=@fgets($fh,10); fclose($fh); $file="bad" . ".txt"; $fh=@fopen("$file", "r+"); @flock($fh, LOCK_EX); fseek($fh, 6, SEEK_SET); $s3=@fgets($fh,10); fclose($fh); $total=$s1 + $s2 + $s3; $procent=100 * (int)$s1 / $total; $procent1=ceil($procent); echo "$procent1" . "%"; echo "<table width=\"15\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><img src=\"vote.jpg\" width=\"15\" height=\"$procent1\" align=\"absmiddle\"></td></tr></table>"; ?> </div></td> <td width="41" height="100" align="center" valign="bottom" style="FONT-SIZE: 7pt; FONT-FAMILY: Verdana"> <div align="center"> <?php $procent=100 * (int)$s2 / $total; $procent2=ceil($procent); echo "$procent2" . "%"; echo "<table width=\"15\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><img src=\"vote.jpg\" width=\"15\" height=\"$procent2\" align=\"absmiddle\"></td></tr></table>"; ?> </div></td> <td width="37" height="100" align="center" valign="bottom" style="FONT-SIZE: 7pt; FONT-FAMILY: Verdana"> <div align="center"> <?php $procent3=100-$procent1-$procent2; //valoarea rotunjita a procentului banal in functie de celelalte doua reusit si interesant echo "$procent3" . "%"; echo "<table width=\"15\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><img src=\"vote.jpg\" width=\"15\" height=\"$procent3\" align=\"absmiddle\"></td></tr></table>"; ?> </div></td> </tr> <tr valign="top"> <td height="12"><div align="center"><strong><font size="1">Great</font></strong></div></td> <td><div align="center"><strong><font size="1">Nice</font></strong></div></td> <td><div align="center"><strong><font size="1">Bad</font></strong></div></td> </tr> </table> </div> <div align="center"> <form name="form2" method="post" action=""> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"> <input name="vot" type="radio" value="great" checked> </div></td> <td><div align="center"> <input name="vot" type="radio" value="nice"> </div></td> <td><div align="center"> <input name="vot" type="radio" value="bad"> </div></td> </tr> </table> <input name="vote" type="submit" id="vote" onmouseover=this.filters.alpha.opacity=100 onmouseout=this.filters.alpha.opacity=80 value="Vote"> </form> </div></td> </tr> </table> <p align="center"><a href="http://www.binarythunder.com/show_showsingle-157.html">Download</a></p> <p align="center"><a href="http://www.binarythunder.com" target="_blank">© http://www.binarythunder.com - free scripts collection</a></p> </body> </html> Bet es vēlreiz saku ka ja ieiet pašā pool.php viss iet! bet ja pool.php ievieto ar include tad neiet Link to comment Share on other sites More sharing options...
Vebers Posted September 27, 2006 Report Share Posted September 27, 2006 Tāpēc, ka nav iespējams inklūdot visus tavus failus, jo adreses uz viņiem nav pareizas. Vienkāršākais veids kā to atrisināt ir neliec to skriptu iekš pool mapes, bet vienkārši tajā mapē kurā ir skripts kas viņu inklūdos Link to comment Share on other sites More sharing options...
IM24LV Posted September 27, 2006 Author Report Share Posted September 27, 2006 paldies :) izvēlējos sarežģītāko veidu un sāku labot vienkārši nosaukumus, kur viss atrodas. lai nepiemēslo galveno mapi Link to comment Share on other sites More sharing options...
Recommended Posts