Advertisement
Guest User

Untitled

a guest
Jun 15th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?PHP
  2. $db_host="localhost";
  3. $db_user="root";
  4. $db_password="";
  5. $db_name="versandhandel";
  6.  
  7. $db=new PDO("mysql:host=$db_host; dbname=$db_name; charset=utf8", $db_user, "");
  8. $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  9. ?>
  10.  
  11. <!DOCTYPE html>
  12. <html>
  13. <head>
  14. <meta charset="utf-8" />
  15. <title> </title>
  16. </head>
  17. <body>
  18. <?PHP
  19. if (!file_exists("C:/Users/3406/xampp/htdocs/goe/sequ_files")) {
  20. echo mkdir("C:/Users/3406/xampp/htdocs/goe/sequ_files");
  21. echo mkdir("C:/Users/3406/xampp/htdocs/goe/sequ_files/Verz1");
  22. echo mkdir("C:/Users/3406/xampp/htdocs/goe/sequ_files/Verz2");
  23. echo mkdir("C:/Users/3406/xampp/htdocs/goe/sequ_files/Verz1/Unterverz1");
  24. }
  25. //a.txt
  26. $a=fopen("a.txt","w");
  27.  
  28. for($i=1;$i<=50;$i++){
  29. fwrite($a,"$i abcdef\n");
  30. }
  31.  
  32. //b.txt
  33. //$b=fopen("b.txt","w");
  34.  
  35. //for($j=1;$j<=50;$j=$j+2){
  36. // fwrite($b,"$j abcdef\n");
  37. //}
  38.  
  39. $zeilen=file("a.txt");
  40. $b=fopen("b.txt","w");
  41. for($j=1;$j <= count($zeilen); $j=$j+2){
  42. fwrite($b,"$zeilen[$j]");
  43. }
  44.  
  45. //c.txt
  46. ?>
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement