Jump to content
php.lv forumi

raada kaa .txt


zirgs

Recommended Posts

taatad man nesen radaas taada probleema ar apaci , jau kadu laiku jau maacos php tad nu domaaju jaataisa augshaaa web lapa nu uztaisiju uzliku uz janhost.com servera tur tas scripts straadaa visss ok (tas ir zem linuxa)

a tagad uztaisiiju home serveri (uz windos xp)

un itkaa pirmaa .php scripta dalja straadaa bet otru vnk raada kaaa tx failu .. kas vareetu buut par peobleemu?

te tas ko raada kaa .txt

<html>
<head>
<title>Voting Results</title>
<style type="text/css">
body {background-color: #000000; color: #273b0d; font-family: Verdana, sans-serif; font-size: 11px; text-align: center;}
</style>
</head>
<body>
<?php
$file='1.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result1=fread($fh,filesize($file));
fclose($fh);

$file='2.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result2=fread($fh,filesize($file));
fclose($fh);

	$file='3.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result3=fread($fh,filesize($file));
fclose($fh);

$file='4.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result4=fread($fh,filesize($file));
fclose($fh);

	$file='5.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result5=fread($fh,filesize($file));
fclose($fh);

$file='6.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result6=fread($fh,filesize($file));
fclose($fh);

	$file='7.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result7=fread($fh,filesize($file));
fclose($fh);

$file='8.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result8=fread($fh,filesize($file));
fclose($fh);

	$file='9.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result9=fread($fh,filesize($file));
fclose($fh);

$file='10.txt';
$fh=fopen($file,'r') or die ('Failed to read file');
$result10=fread($fh,filesize($file));
fclose($fh);

?>
<br/>
Place a mark for this web layout 1-10?
<br/>
<br/>
1 = <?php echo "$result1"; ?> votes.<br/>
2 = <?php echo "$result2"; ?> votes.<br/>
3 = <?php echo "$result3"; ?> votes.<br/>
4 = <?php echo "$result4"; ?> votes.<br/>
5 = <?php echo "$result5"; ?> votes.<br/>
6 = <?php echo "$result6"; ?> votes.<br/>
7 = <?php echo "$result7"; ?> votes.<br/>
8 = <?php echo "$result8"; ?> votes.<br/>
9 = <?php echo "$result9"; ?> votes.<br/>
10 = <?php echo "$result10"; ?> votes.<br/>
Total votes: <?php $total= $result1 + $result2 + $result3+ $result4+ $result5+ $result6+ $result7+ $result8+ $result9+ $result10; echo "$total"; ?>
</body>
</html>

Link to comment
Share on other sites

shii buutu straadaajoshaa dalja

<html>
<head>
<meta http-equiv="Refresh"
content="1; URL=results.php">
<title> Place a mark for this web layout 1-10?</title>
<style type="text/css">
body {background-color: #000000; color: #273b0d; }
a:link, a:visited, a:active { color: #273b0d; text-decoration: underline; }
a:hover { color: #273b0d; text-decoration: none; }

</style>
</head>
<body>
<script language="javascript" type="text/javascript">

window.resizeTo(600,400);

</script>
<?php
$vote=$_POST["rate"];
$file="$vote" . ".txt";
$fh=fopen($file,'r') or die ('Failed to read file');
$count=fread($fh,filesize($file)) or $count=1;
fclose($fh);
$count++;

$fh=fopen($file,'w') or die('could not open file');
fwrite($fh,$count) or die ('could not write');
fclose($fh);
?>
<br/>
Thank you for your vote.<br/>
Redirecting to results...
</body>
</html>

un par to... man beigaas ir .conf failam sitaada rinda

ScriptAlias /php/ "c:/web_p/php/"
		 Action application/x-httpd-php "/php/php-cgi.exe"
	   AddType application/x-httpd-php .php

tad kas vareetu buut...?

un ko tu teici kaa bija tad jaaielaadee tas modulis...?

bet ja jau viena dalja straadaa bet otra ne tad jau php itkaa straadaa(daljeeji)

... :(

Link to comment
Share on other sites

'elementarna Vatson' faila paplasinaajums nav PHP un tas arii viss

uzliec *.php un viss iess vai noraadi kaadus paplasinaajumus vel(bez *.php) vajag apstraadaat ar PHP...

P.S. AddType application/x-httpd-php .php

noraada ka njemt kaa PHP prograamu vaijag tikai failus ar doto paplasinaajumu

ja pieliksi:

AddType application/x-httpd-php .bla

tad arii failus *.bla apstraadaas kaa PHP scriptus...

Link to comment
Share on other sites

nu bet vinsh ir ar paplashinaajumu .php ... :(

bet piem jociigi tas ka palaizhot vinju taapat to lapu vnk kompii uz taa scripta visss straadaa bet caur apache un rakstot adresi nekas nestraadaaa..? kaa tas var buut?znachit kaut kas apacim nepatiik...

Link to comment
Share on other sites

×
×
  • Create New...