PHP Navigations


SUBMITTED BY: Milazzo11

DATE: Nov. 27, 2020, 11:13 a.m.

FORMAT: Text only

SIZE: 1.4 kB

HITS: 376

  1. <?php
  2. if($_SERVER['QUERY_STRING'] == "SoD")
  3. print "owns you!";
  4. else
  5. print "don't front!";
  6. ?>
  7. Description: Instead of calling files like ( index.php?str=blah ) , you could do ( index.php?SoD ) and it would print out "owns you!". You can add more strings in there, this is just an example.
  8. $vars = explode(",", urldecode(getenv('QUERY_STRING')));
  9. $v1 = array_shift($vars);
  10. $v2 = array_shift($vars);
  11. $v3 = array_shift($vars);
  12. switch ($v1) {
  13. case 'first.1': {
  14. print("This is v1, first string case 'file.php?first.1'.");
  15. break;
  16. }
  17. case 'first.2': {
  18. switch ($v2) {
  19. case 'second': {
  20. switch($v3) {
  21. case 'third': {
  22. print("This is v3, the last case 'file.php?first.2,second,third'.");
  23. break;
  24. }
  25. }
  26. }
  27. }
  28. }
  29. }
  30. Description: This basically does what the 1st one does but with more strings and a different seperator rather than '&'. I don't really want to go into too much detail on the thread so if people are confused or need explaining, reply or PM me.
  31. That's it for the navigation as I am not going to do the other due to they're everywhere else and I wanted to be different and show everyone this method.

comments powered by Disqus