Jump to content

Recommended Posts

Hi guys, I have a problem.. I have a table which shows the results, but the table is showing right at the bottom below the button "delete members" although the code is right above it so I don't really understand.. and hope someone can shed the light?

 

Appreciated

 


<?php
include "connect.php";
session_start();
if(!isset($_SESSION['email']))
{
die('You have no access to this page.');
}
else{

//Check if records were submitted for deletion
if(isset($_POST['id']) && count($_POST['id']))
{
    //Ensure values are ints
    $deleteIDs = implode(', ', array_map('intval', $_POST['id']));
    $query = "DELETE FROM member WHERE id IN ({$deleteIDs})";
    //Debug line
    echo "Successfuly deleted member(s)";
    mysql_query($query) or die(mysql_error());
}
?>
  	<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>
<body id="main_body" >

<img id="top" src="top.png" alt="">
<div id="form_container">

<h1>Consult, Modify or Delete a Member</h1>

	<form id="form_362567" class="appnitro"  method="post" action="searchmember.php">
				<div class="form_description">
		<h2> Consult, Search, Modify or Delete a Member</h2>
		<p></p>
	</div>						
		<ul >

				<li class="section_break">


<br>Search members with any keyword or character within the options id/email/firstname/lastname/phone/address1/address2/city/county/postcode - relevant matches will show.<br><br>
<b>Keyword/Character:</b><br>
<input id="search" name="search" class="element text medium" type="text" maxlength="50" value=""/> <br><br>
<b>Search on</b>:<br>
<select name="searchvalue" id="searchvalue">
	<option name="id" id="id">id</option>
<option name="email" id="email">email</option>
    <option name="firstname" id="firstname">firstname</option>
    <option name="lastname" id="lastname">lastname</option>
    	<option name="phone" id="phone">phone</option>
    	   <option name="address1" id="address1">address1</option>
    <option name="address2" id="address2">address2</option>
    	<option name="city" id="city">city</option>
    	   <option name="county" id="county">county</option>
    <option name="postcode" id="postcode">postcode</option>
    	
</select><br><input type='submit' value='Search' name='go' /><INPUT TYPE="button" VALUE="Cancel" onClick="history.go(-1);return true;"><br>
<br>
To consult or modify a profile click on the member's E-mail address.	<li class="section_break">
</form>
<?php

$result = mysql_query("SELECT * FROM member");
?>
<table border='1'>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
<th>Postcode</th>
<th>E-mail</th>
<th>Delete</th>
</tr>
<?php
while($row = mysql_fetch_array($result))
{


echo "<form action='' method='POST'>";  

  echo "<tr>";
  echo "<td>" . $row['firstname'] . "</td>";
  echo "<td>" . $row['lastname'] . "</td>";
    echo "<td>" . $row['phone'] . "</td>";
      echo "<td>" . $row['postcode'] . "</td>";
      
      	echo "<td>";
      	echo '<a href="consultmember.php?email=';
echo $row['email'];
echo '">';
echo $row['email'];
echo "</a></td>";
	echo "<td><input type='checkbox' name='id[]' value='{$row['id']}' /></td>";
  echo "</tr>";
  

}
?>
<br><input type='submit' value='Delete Members' name='delete' /><INPUT TYPE="button" VALUE="Cancel" onClick="history.go(-1);return true;"><br>
</form>
		<div id="footer">

	</div>
</div>
<img id="bottom" src="bottom.png" alt="">
</body>

<?php
}
?>

Link to comment
https://forums.phpfreaks.com/topic/259114-data-displaying-at-bottom-of-code/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.