Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] [Formularze] Otwieranie, zapisywanie, zmienne...
Tilosag
post
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 10.04.2007

Ostrzeżenie: (0%)
-----


  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
  6. <meta name="Description" content="Tu wpisz opis zawartości strony" />
  7. <meta name="Keywords" content="Tu wpisz wyrazy kluczowe rozdzielone przecinkami" />
  8. <title>Tu wpisz tytuł strony</title>
  9. </head>
  10.  
  11. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" METHOD="POST">
  12. </form>
  13. <table border="1" >
  14. <caption align="left"></caption>
  15. <tr align="center" valign="middle">
  16. <td>
  17. Co tu ma być?
  18. </td>
  19.  
  20. <td>
  21. Wielkość
  22. </td>
  23. </tr>
  24. <tr>
  25. <td align="center" valign="middle">
  26. Link do pliku:
  27. </td>
  28. <td align="center" valign="middle" width="100" height="100%">
  29. <input type="file" name="$plik" value="<?php echo $_POST['$plik'] ?>" />
  30. </td>
  31. </tr>
  32. <tr>
  33. <td align="center" valign="middle">
  34. Różnica x:
  35. </td>
  36. <td align="center" valign="middle" width="100" height="100%">
  37. <input type="text" name="x"/>
  38. </td>
  39. </tr>
  40. <tr align="center" valign="middle">
  41. <td align="center" valign="middle">
  42. Różnica y:
  43. </td>
  44. <td align="center" valign="middle" width="100" height="100%">
  45. <input type="text" name="y"/>
  46. </td>
  47. </tr>
  48. <tr align="center" valign="middle">
  49. <td align="center" valign="middle" width="100" height="100%">
  50. Różnica z:
  51. </td>
  52. <td align="center" valign="middle" width="100" height="100%">
  53. <input type="text" name="z"/>
  54. </td>
  55. </tr>
  56.  
  57.  
  58. <table width="100$" height="100%"><tr><td align="center" valign="middle" width="300px"><input type="submit" name="submit" value="Wykonaj" /></td></tr></table>


Jestem newbie i mam problem.

Jak pobiera się dane z forumlarza, bo tego do końca nie rozumiem.

Piszę:
  1. <?php
  2. if (IsSet(submit))
  3. print (x+12);
  4. else
  5. print(:///);
  6.  
  7. ?>

A chcę żeby mi policzyło X+12 jak się wpisze... ;//
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Tilosag
post
Post #2





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 10.04.2007

Ostrzeżenie: (0%)
-----


Nom przestudiowałem i:

  1. <?php
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  6. <meta http-equiv="Creation-date" content="2007-04-10T11:08:47Z">
  7. <meta name="Authoring-tool" content="Pajaczek NxG PRO v5.6.1">
  8. </head>
  9.  
  10. <body>
  11.  
  12. <form action="code.php" method="post">
  13.  
  14. <table border="1">
  15. <tr>
  16. <td>
  17.  
  18. <form enctype="multipart/form-data" action="code.php" method="POST">
  19. <!-- MAX_FILE_SIZE must precede the file input field -->
  20. <input type="hidden" name="MAX_FILE_SIZE" value="3000" />
  21. <!-- Name of input element determines name in $_FILES array -->
  22. Plik:
  23. <input name="userfile" type="file" />
  24. </form>
  25.  
  26. </td>
  27. </tr>
  28. <tr>
  29. <td>Potworek był na pozycji:</td>
  30. <td>Potworek jest na pozycji:</td>
  31. </tr>
  32. <tr>
  33. <td>X
  34. <input type="text" name="x1" value="" /></td>
  35. <td>X
  36. <input type="text" name="x2" value="" /></td>
  37. </tr>
  38. <tr>
  39. <td>Y
  40. <input type="text" name="y1" value="" /></td>
  41. <td>Y
  42. <input type="text" name="y2" value="" /></td>
  43. </tr>
  44. <tr>
  45. <td>Z
  46. <input type="text" name="z1" value="" /></td>
  47. <td>Z
  48. <input type="text" name="z2" value="" /></td>
  49. </tr>
  50. </table>
  51.  
  52. <table width="100$" height="100%">
  53. <tr>
  54. <td align="center" valign="middle" width="300px">
  55. <input type="submit" name="submit" value="Wykonaj" /></td>
  56. </tr>
  57. </table>
  58.  
  59. </form>
  60.  
  61. </body>
  62. </html>
  63. ?>




  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  5. <meta http-equiv="Creation-date" content="2007-04-10T11:26:00Z">
  6. <meta name="Authoring-tool" content="Pajaczek NxG PRO v5.6.1">
  7. </head>
  8. <body>
  9.  
  10.  
  11.  
  12. <?php
  13. $roznicax=$_POST['x2']-$_POST['x1'];
  14. $roznicay=$_POST['y2']-$_POST['y1'];
  15. $roznicaz=$_POST['z2']-$_POST['z1'];
  16.  
  17. print("Różnica X: $roznicax");
  18. print('<br />');
  19. print("Różnica Y: $roznicay");
  20. print('<br />');
  21. print("Różnica Z: $roznicaz");
  22.  
  23.  
  24. ?>
  25.  
  26. </body>
  27. </html>


Gdzie on zapisał ten plik?(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 10.10.2025 - 22:18