Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: ad task
- */
- global $wpdb;
- ?>
- <?php
- if (isset($_POST['submit']))
- {
- $table_name = $wpdb->prefix . "tasks";
- $user_ID = get_current_user_id();
- $values = $_POST['taskName'];
- $array = split("\r\n", $values);
- foreach($array as $line){
- $wpdb->insert( $table_name, array( 'task_name' => $line, 'user_id' => $user_ID ) );
- echo'<script> window.location="/demos/Anthony/my-tasks/"; </script> ';
- }
- }
- else
- {
- echo "no data posted";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement