Jump to content
php.lv forumi

Kāpēc ar include notiek gļuki?


IM24LV

Recommended Posts

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

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

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

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

×
×
  • Create New...