Guest User

Untitled

a guest
May 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. function addto_form ($new_array, $module, $text, $input_type, $name)
  4. {
  5. global $form_data;
  6.  
  7. $form_data[$new_array] = array(
  8.  
  9. 'new_array' => $new_array,
  10. 'module' => $module,
  11. 'text' => $test,
  12. 'input_type' => $input_type,
  13. 'name' => $name
  14. );
  15. }
  16.  
  17. addto_form('blog', 'blogadd', 'Title:', 'text', 'title');
  18.  
  19. function display_form($new_array)
  20. {
  21. global $form_data;
  22.  
  23. foreach ($form_data[$new_array] as $offset => $val)
  24. {
  25. if (empty($_POST['name']) || !isset($_POST['name']))
  26. {
  27. echo (
  28. "<form action='./nmod={$val['module']}' method='post'>
  29.  
  30. <h2>{$val['text']}</h2>
  31. <input type='{$val['input_type']}' name='{$val['name']}'>
  32. <br><br>
  33.  
  34. </form>"
  35. );
  36. }
  37. else {
  38. echo ($_POST['name']);
  39. }
  40. }
  41. echo ("<input type='submit' value='submit'>");
  42. }
  43.  
  44. ?>
Add Comment
Please, Sign In to add comment