Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- function ask () {
- return confirm( "Are you sure?" ); // RETURNS TRUE OR FALSE.
- }
- </script>
- </head>
- <body>
- <?php
- require_once('usersAPI.php');
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- /*
- function tinyf_users_get($extra ='')
- {
- global $tf_handle;
- $query = sprintf("SELECT * FROM `users` %s",$extra );
- $qresult = mysqli_query($tf_handle, $query);
- if (!$qresult)
- return NULL;
- $recount = mysqli_num_rows($qresult);
- if ($recount == 0)
- return NULL ;
- $users = array();
- for($i = 0 ; $i < $recount ; $i++)
- $users[count($users)] = mysqli_fetch_object($qresult); returns the current row of a result set
- //mysql_free_result($qresult);
- return $users;
- }
- */
- $users = tinyf_users_get();
- if($users == NULL)
- {
- die('problem');
- }
- $ucount = count($users);
- if($ucount == 0)
- {
- die('No users');
- }
- ?>
- <ul type = "square">
- <?php
- for($i = 0 ; $i < $ucount ; $i++)
- {
- $user = $users[$i];
- //echo "<li><a href = \"userProfile.php?id=$user->id\">$user->name <a/> -- $user->email -- <a href = \"deleteUser.php?id=$user->id\"> Delete <a/> | <a href = \"modifyUser.php?id=$user->id\"> edit <a/> </li>"; //$array ->
- echo '<form method="post" action="deleteUser.php" onsubmit="return ask()">' ;
- $user->name ;
- ' <input type="text" name="uid" value="$user->id" hidden />' ;
- ' <input type="submit" value="Delete" />' ;
- '</form>';
- }
- ?>
- </ul>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement