Jump to content

Huijari

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Huijari's Achievements

Member

Member (2/5)

0

Reputation

  1. Sorry if this is wrong place, I did not see anything else. So I have this on the .htaccess: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?sub\.site\.net RewriteCond $1 !^sub/ RewriteRule ^(.*)$ sub/$1 [L] It works very well, except when you type in url eg. sub.site.net/folder Then it will change the url to sub.site.net/sub/folder But it works fine if you type sub.site.net/folder/ You can see the trailing slash on end. Is there any solutions for this?
  2. It works but, well if you test the url I showed, you see it won't get those variables. I think its because there should be &var1=something but there isnt.
  3. So I have code: foreach($_REQUEST as $var => $value) { echo '&' . $var . '=' . $value . "&"; } I would need to to do urldecode() to all REQUEST (posted variables) How would I do it? Because my url is: http://www.finsite.net/testi/example1/example2/get_level.php?levelcode2=%26var1%3D403%26var2%3D254%26varname%3Dvariable And I need to get those vars in php. Have to put somekind of code urldecode(_REQUEST) all requests...
  4. nevermind, go it fixed with using instead of this $array[$plays] = $level; this $array[$level] = $plays;
  5. That code is supposed to sort all the levels by number of $plays thats why cant use that
  6. So I have a code: //Example there are 2 levels with same number of plays (3 plays) $array[$plays] = $level; // at the end of code krsort($array,SORT_NUMERIC); If it now takes level with 3 plays, it adds it to array but when next level with same plays comes, it comes in array as it. My code is to sort these levels so that level with most plays is first. Here's what I mean: $array[3] = level1; // next time $array[3] = level2; I tried this: if ($array[$plays]=="") { $array[$plays] = $level; } else { $array[$plays+1] = $level; } But it won't work because if you have 3 levels with plays 3,3 and 4, and level with 4 plays comes first to array Then when comes 3, its ok But then the next 3, it adds 1 to it, so its 4, but there is already array[4] so it won't work
  7. thanks, works like a dream. This really helps me with my project
  8. If I have array with keys [1] [12] and [25] So when I use ksort($array) it will set first 1, then 12 and last 25. I want it to act like it sets first 25, then 12 then 1 So when 1 its at the end, when big its first in array. How to do this?
  9. So here's my code: I want it to do so if there is variable &number=5& in textfile1.txt and &number=8& in textfile2.txt then it should sort it textfile2 first in array and textfile1 next... $array = array(); // Open the local directory $Directory = opendir("."); // Read each file name while ($filename = readdir($Directory)) { // Deconstruct the file name to get the file suffix in lowercase $temp = explode(".", $filename); $fileSuffix = strtolower(end($temp)); // Only add to list if it ends in 'txt' if ($fileSuffix == "txt") { $file = file_get_contents($filename); // SOME CODE TO HERE THAT SEARCH VARIABLES FROM TXT FILES AND SORT BY ITS SIZE // like there is variable &number=5& in textfile1.txt and &number=7& in textfile2.txt // then it should sort it so textfile2.txt is first then textfile1.txt and so on.. // here below it just adds it in array for the last $addfile = pathinfo($filename, PATHINFO_FILENAME); array_push($array, "$addfile"); } } // Close directory closedir($Directory);
  10. Thank you so much Monkeh. I am not so good with PHP, I thought it would automatically loop. Thanks a lot
  11. Ok, so I previously posted a problem and got fix on it. Unfortunately I found that my script doesn't work like I want it to do. Here's the code: if(!file_exists($file)){ $fh=fopen($file, 'w'); if ($iii>0) { fwrite($fh,"&s" .$iii. "x=$x_coord2,&s" .$iii. "y=$y_coord'w'\n"); $iii -1; } else { fclose($fh); echo "<br/>"; echo "ok<br/><br/>"; } Ok, so now $iii is number 3 for example. And if its greater than 0, it will write to file. But it should do fwrite 3 times, always when $iii -1; It should do this 3 times: fwrite($fh,"&s" .$iii. "x=$x_coord2,&s" .$iii. "y=$y_coord'w'\n"); And all 3 would be same but $iii in then would be 3,2,1 So how to do it so, it always return to do fwrite if $iii is greater than 0?
  12. Thank you so much jl5501! This really helps me with my project.
  13. Hello, so this is my code: $iii=$_REQUEST['iii']; $x_coord=$_REQUEST['word'$iii]; echo "$iii"; echo "$x_coord"; So example: I type url: mysite.com/pathtomyphpfile.php?iii=3&word3=27 Then it should echo: 3 (iii) and 27 (x_coord) Because it should request word+iii so, word3 that is 27 Tell me what I am doing wrong. I hope this is possible because its important for my project.
  14. Hello, so this is my code: if ($act=="changeattrib") { echo"<center><form method=post action=?act=permission&te=$te&path=$dir><FONT SIZE=2 COLOR=#00000>Change $te perms</FONT><BR><input type=hidden name=u value=\"$te\"><input type=radio name=no value=0555>Chmod 555<BR><input type=radio name=no value=0666>Chmod 666<BR><input type=radio name=no value=0777>Chmod 777<BR><input type=submit value=Change> <a href='?dir=$dir'>Cancel</a></form></center>"; } if ($act=="permission") { $v=chmod("$root$path/$u",$no); echo "<center>$te has been CHMOD $v<BR><A HREF=?&dir=$path>Return</A></center>"; } The thing that is not working, is the $no. When I run that script it will change the file's permission to 1411. And it will echo: index.html has been CHMOD 1. So would be nice if someone would see the bug in radio button's script's.
  15. ... the problem is that it doesn't do anything. There is no error but it is not working. And the problem is in that code...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.