Jump to content

p5y

New Members
  • Posts

    6
  • Joined

  • Last visited

p5y's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. so im trying this $file is not a .txt file if ($file != "." && $file != ".." && !is_dir("uploads/$fuser/$file") && (pathinfo("uploads/$fuser/$file", PATHINFO_FILENAME)!= "txt") i tried this but doesnt work
  2. So please think before you write code. If you want fname and create to be simple alphernumerical strings, you need to actually validate that. the fuser bit is controlled from my android app that sends the request. What is this validation thing , or point me to some tutorial. bear in mind ive just started learning php 3 days ago to go with my gamemaker app
  3. this doesnt work and ive spent ages trying to figure it out its the bit with else <?php //CORS header header("Access-Control-Allow-Origin: *"); //Capture parameter $create = $_POST['create']; $fuser = $_POST['fuser']; if (!file_exists("uploads/$fuser/$create")); { if ($f = fopen("uploads/$fuser/$create", 'w')) { fwrite($f, 1); fclose($f); echo 'OK'; } } else { $f = fopen("uploads/$fuser/$create", 'w') fwrite($f, 5); fclose($f); echo 'FAIL' ; } ?> this bit does work below, its until i try to do else if , or else <?php //CORS header header("Access-Control-Allow-Origin: *"); //Capture parameter $create = $_POST['create']; $fuser = $_POST['fuser']; if (!file_exists("uploads/$fuser/$create")); { if ($f = fopen("uploads/$fuser/$create", 'w')) { fwrite($f, 1); fclose($f); echo 'OK'; } } help
  4. ah got it if ($file != "." && $file != ".." && !is_dir("uploads/$file") ) thanks
  5. if ($d = opendir("uploads")) { while ($file = readdir($d)) { if ($file != "." && $file != ".." ) // if( is_file($file) ) { $files[] = $file; } } closedir($d); } if ($file != "." && $file != ".." $file != ???????? ) just a bit stuck here
×
×
  • 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.