Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. Array (
  2. [events] => Array
  3. [fromdate] => February 12, 2014 3:10 PM
  4. [todate] => February 19, 2014 3:10 PM
  5. [description] => hfhhhhhhhhhhhhhhhhhh
  6. [subject] => fhhhhhhhhhhhhhhhhhh
  7. [fromname] => gjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
  8. [replyto] => gjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
  9. [senddatetime] => February 12, 2014 3:10 PM
  10. [timezone] => America/Los_Angeles
  11. [message] =>
  12.  
  13. dhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  14. [submit_skip] => Continue
  15. )
  16.  
  17. $select = sprintf ("SELECT event_id,event_name
  18. FROM `events`
  19. WHERE (`user_id` = '%s') order by event_name",
  20. $GLOBALS ['mysqli']->real_escape_string ($_SESSION['user_id']));
  21.  
  22. $res = $GLOBALS ['mysqli']->query ($select) or die ($GLOBALS ['mysqli']->error . __LINE__);
  23. if ($res->num_rows > 0)
  24. {
  25. while($row = $res->fetch_assoc ())
  26. {
  27. foreach( $_POST['events'] as $val ){ ?>
  28.  
  29. <option value="<?= $row['event_id'];
  30. if($row['event_id'] == $val) echo "selected";
  31. ?>">
  32. <?=$row['event_name']?>
  33. </option>
  34.  
  35. <?
  36. }
  37. }
  38. }
  39. ?>
  40. </select>
  41.  
  42. Warning: Invalid argument supplied for foreach() in C:wampwwwticket_inspector_newforms_hd87wblfo084wgdtryform_email_compose
  43.  
  44. <?php
  45. $x = array (
  46. 'events' => array(),
  47. 'fromdate' => 'February 12, 2014 3:10 PM',
  48. 'todate' => 'February 19, 2014 3:10 PM',
  49. // So on .....
  50. );
  51.  
  52. $check = $x['events'];
  53.  
  54. var_dump($check);
  55.  
  56. ?>
  57.  
  58. <option value="<?php echo $row['event_id']; ?>"<?php if(in_array($row['event_id'],$check)) { ?> selected="selected" <?php } ?> ><?php echo $row['event_name']?></option>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement