Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. //you can define variables
  4. $variable = "This is a VARIABLE";
  5.  
  6. //You can also echo that variable
  7.  
  8. echo $variable;
  9.  
  10. //or make it more complicated
  11.  
  12. $echo $variable . " " . ". What's Up?";
  13.  
  14. lets do a php form
  15.  
  16. if (!isset($_POST['submit']) { ?>
  17.  
  18. Lets pretend this is a form, but I'm not going to write it.
  19.  
  20. <?php }
  21.  
  22. if (isset($_POST['submit']) {
  23.  
  24. $user = $_POST['user'];
  25. $pass = $_POST['[pass];
  26.  
  27. if ($pass=="kingpin") {
  28. echo "True";
  29. } else {
  30. echo "False;
  31. }
  32. }
  33.  
  34. // this probably wont help you lol. but this is some examples.
  35.  
  36. /*
  37. this is for block comments while the previous was line comments
  38. */
  39.  
  40. //heres a for loop
  41.  
  42. for ($i=1; $i<=5; $i++)
  43. {
  44. echo "The number is " . $i . "<br />";
  45. }
  46.  
  47. //basically outputs 1 -5; says if i = 1 but is < then 5 add a number each loop. Good luck!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement