chmod za pomocą zmiennych
: czw lut 15, 2007 9:32 pm
Witam, siedzę już nad tym pare godzin i nie mogę sobie z tym poradzić.
Chodzi o ustawienie chmod dla pliku za pomocą http.
Formularz:
[php]<?php
<form action='chmod.php' method='POST'>
<table border='1' cellspacing='0' cellpadding='0' style='border-collapse: collapse; font-family: verdana; font-size: 11; text-align: center' bordercolor='#EFEFEF' width='250'>
<tr>
<td width='100'>czytaj</td>
<td width='50'><input type='checkbox' name='w4' value='4'></td>
<td width='50'><input type='checkbox' name='g4' value='4'></td>
<td width='50'><input type='checkbox' name='s4' value='4'></td>
</tr>
<tr>
<td width='100'>zapisz</td>
<td width='50'><input type='checkbox' name='w2' value='2'></td>
<td width='50'><input type='checkbox' name='g2' value='2'></td>
<td width='50'><input type='checkbox' name='s2' value='2'></td>
</tr>
<tr>
<td width='100'>wykonaj</td>
<td width='50'><input type='checkbox' name='w1' value='1'></td>
<td width='50'><input type='checkbox' name='g1' value='1'></td>
<td width='50'><input type='checkbox' name='s1' value='1'></td>
</tr>
</table>
<input type='submit' name='ustaw' value='ustaw chmod' style='font-family: verdana; font-size: 10'></form>";
?>[/php]
a to skrypt, który ma zostać wykonany:
[php]<?php
$w = $_POST["w4"] + $_POST["w2"] + $_POST["w1"];
$g = $_POST["g4"] + $_POST["g2"] + $_POST["g1"];
$s = $_POST["s4"] + $_POST["s2"] + $_POST["s1"];
chmod("$sciezka".$_GET["edit"]."", $w.$g.$s);
?>[/php]
Problem w tym, że chmod pliku zmienia się nieprawidłowo.
Każda kolumna jest dodawana i wyświetlana w postaci zmiennej.
3 zmienne mają tworzyć chmod, ale niestety nie działa. Próbowałem również z zerem na początku, ale to samo.
Chodzi o ustawienie chmod dla pliku za pomocą http.
Formularz:
[php]<?php
<form action='chmod.php' method='POST'>
<table border='1' cellspacing='0' cellpadding='0' style='border-collapse: collapse; font-family: verdana; font-size: 11; text-align: center' bordercolor='#EFEFEF' width='250'>
<tr>
<td width='100'>czytaj</td>
<td width='50'><input type='checkbox' name='w4' value='4'></td>
<td width='50'><input type='checkbox' name='g4' value='4'></td>
<td width='50'><input type='checkbox' name='s4' value='4'></td>
</tr>
<tr>
<td width='100'>zapisz</td>
<td width='50'><input type='checkbox' name='w2' value='2'></td>
<td width='50'><input type='checkbox' name='g2' value='2'></td>
<td width='50'><input type='checkbox' name='s2' value='2'></td>
</tr>
<tr>
<td width='100'>wykonaj</td>
<td width='50'><input type='checkbox' name='w1' value='1'></td>
<td width='50'><input type='checkbox' name='g1' value='1'></td>
<td width='50'><input type='checkbox' name='s1' value='1'></td>
</tr>
</table>
<input type='submit' name='ustaw' value='ustaw chmod' style='font-family: verdana; font-size: 10'></form>";
?>[/php]
a to skrypt, który ma zostać wykonany:
[php]<?php
$w = $_POST["w4"] + $_POST["w2"] + $_POST["w1"];
$g = $_POST["g4"] + $_POST["g2"] + $_POST["g1"];
$s = $_POST["s4"] + $_POST["s2"] + $_POST["s1"];
chmod("$sciezka".$_GET["edit"]."", $w.$g.$s);
?>[/php]
Problem w tym, że chmod pliku zmienia się nieprawidłowo.
Każda kolumna jest dodawana i wyświetlana w postaci zmiennej.
3 zmienne mają tworzyć chmod, ale niestety nie działa. Próbowałem również z zerem na początku, ale to samo.