Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. wrong... how come you were *thinking* about this properly when it was my code, but not with yours?
  2. don't type the path, type the code needed!
  3. id_dir() expects a path. what you're 'feeding' it is not a valid path, so the if statement will always fail.
  4. yes, what is wrong with this? if(is_dir($dir.'/films'.$file)) {
  5. a-ha! So you see how it is wrong in your code?
  6. ok, so now that's beginning to look like the path you need right?.. so what would this output? $dir = './films'; $file = 'SomeFile.avi'; echo $dir.'/films'.$file;
  7. all databases are different. The person who creates them chooses the database name, table names, field names, how the tables will link with each other, etc... without knowing those names you cannot do the script. post the code that stores files.
  8. [assume the same values as defined before]
  9. post the code you have so far, and whatever errors you're getting please.
  10. sorry, was a typo. removed one of them. and $dir doesn't exist in my code. (ignore your original code for goodness sake)
  11. ok, cool. (it was a trick question) now this: echo $mainDirectory . '/' .$folder . '/' .$filename; ??
  12. YES! so how would you fix this line of code: echo $mainDirectory . $folder . $filename; so that the result is: ./filmsFilm1GoneWithTheWind.avi ??
  13. YES! ok, what about this? (still ignore YOUR code, just look at the example) $mainDirectory= './films'; $folder = 'Film1'; $filename = 'GoneWithTheWind.avi'; echo $mainDirectory . $folder . $filename;
  14. no. forget about your code for now, and just look at this: $var = "whatever"; echo $var . ' xxx ' . $var . ' xxx'; what would be the result printed on the screen?
  15. no man, believe me, you NEED to understand this... ok, same example as I gave before... when I do this: $var = "whatever"; echo $var . ' xxx ' . $var . ' xxx'; if I tell you that echo just prints whatever comes after it on the screen, and $var gets replaced with the value that was assigned to it, what would be the result?
  16. if(is_dir($dir.'/films'.$file)) { Better, but still wrong. you need: directory/folder/filename.ext each variable ($dir and $file) get replaced by their content, so in your code above, if $file holds the filename (plus extension), what would be the result of what you typed ($dir.'/films'.$file) ?
  17. yeah man, I know what you need, but the purpose of this forum is to help programmers understand and solve problems. You don't seem to know any programming, and you don't even want to understand it, you basically just want someone to write the code for you (which has already been done, and still you couldn't get it to work)... so we're in a difficult spot right now... I don't mind explaining everything 20 times if necessary until you understand it, but you need to WANT to learn this stuff.
  18. and don't you thing that learning the very basics is a good idea before starting to code a project ?
  19. ok, back to basics... what would be the result of this? $var = "whatever"; echo $var . ' xxx ' . $var . ' xxx';
  20. please think about what's happening when you do this: if(is_dir($dir.'/scream4/scream4.avi'.$file)) { you seem very confused. Do you understand that a variable holds a piece of information, in this case a string (sequence of characters) ? so $file holds the file's name.... and... is_dir tests to see if the input path is a directory (folder) now look at the code above again, and tell me what's wrong with it.
  21. you're trying to build a simple path to some files... you have been told that the base directory MUST be './films' or 'films'... if you want a path like films/moviename/movie.avi and you store './films' in a variable called $dir.. then the path will be: $dir.'/moviename/movie.avi'
  22. oh man.... Do you have ANY understanding of variables at all ?
  23. yes. there's always a way!
×
×
  • 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.