Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze skryptem
Hectic
post
Post #1





Grupa: Zarejestrowani
Postów: 256
Pomógł: 7
Dołączył: 1.01.2005

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


Witam, mam mały problemik ze skryptem. Mam taki kodzik:
  1. <?php
  2. if( $_SERVER['REQUEST_METHOD'] == 'POST' )
  3.  
  4. {
  5.  
  6. $b=$_POST['miejsce'];
  7. $b=$_POST['transfer'];
  8. $c=$_POST['ftp'];
  9. $d=$_POST['email'];
  10. $e=$_POST['mysql'];
  11. $f=$_POST['subdomeny'];
  12. $g=$_POST['cena'];
  13.  
  14.  
  15. }
  16. elseif( $_SERVER['REQUEST_METHOD'] == 'GET' )
  17. {
  18. $g = $a * 1 + $b * 2 + $c * 3 + $d * 4 + $e * 5 + $f * 6 ;
  19.  
  20. }
  21. ?>


I nie wiem jak zrobić aby te zmienne był widoczne po za klamrami (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) . Może mi ktoś powie jak zrobić je globalnymi, szukałem w kursach i niemoge znaleźć.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Hectic
post
Post #2





Grupa: Zarejestrowani
Postów: 256
Pomógł: 7
Dołączył: 1.01.2005

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


No wieć tak oto kod (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

  1. <html>
  2. <HEAD>
  3. <link rel="stylesheet" href="style.css" type="text/css">
  4. </HEAD
  5. <body LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0">
  6. <table align="left" width="556" valign="top" border="0" cellspacing="0" cellpadding="0"> 
  7. <tr valign="top">
  8. <td valign="top" background="gfx/pod_g.gif" valign="top" height="27" width="556">
  9. <table class="szablon" border="0" cellspacing="0" cellpadding="0">
  10. <tr>
  11. <td> 
  12.  
  13. <?php
  14. if( $_SERVER['REQUEST_METHOD'] == 'POST' )
  15.  
  16. {
  17.  
  18. $b=$_POST['miejsce'];
  19. $b=$_POST['transfer'];
  20. $c=$_POST['ftp'];
  21. $d=$_POST['email'];
  22. $e=$_POST['mysql'];
  23. $f=$_POST['subdomeny'];
  24. $g=$_POST['cena'];
  25.  
  26.  
  27. }
  28. elseif( $_SERVER['REQUEST_METHOD'] == 'GET' )
  29. {
  30. // Tu będzie formularz;)
  31.  
  32.  
  33. $g = $a * 2 + $b * 4 + $c * 7 + $d * 1 + $e * 7 + $f * 10 ; // Funkcja licząca cene
  34.  
  35. echo ' Cena Twojego konta to '.$g.' Zł ';
  36. }
  37. ?>
  38.  
  39. </td>
  40. </tr>
  41. </table>
  42. </td>
  43. </TR>
  44. <td valign="top" background="gfx/pod_s.gif" valign="top"width="556"></td>
  45. </TR>
  46. <td valign="top" background="gfx/pod_d.gif" valign="top" height="90" width="556"></td>
  47. </tr>
  48. </table>
  49.  
  50. </body>
  51. </html>


Chodzi o to że skrypt ma liczyć ile kosztował by serwer z podanym parametrami wpiszujes w formularz 500 MB, 10 GB transferu itd. Daje ok i liczy (IMG:http://forum.php.pl/style_emoticons/default/tongue.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: 15.10.2025 - 04:08