0
this code is giving me a blank page

<?php 
session_start();

include("header.php"); 
include("conection.php");
include("modal.php");
$abc = 100;
if($_GET["view"] == "delete")
{
mysql_query("DELETE FROM administrator WHERE adminname ='$_GET[slid]'");
}
if(isset($_SESSION["userid"]))
{
    if(isset($_GET[first])) 
    {
    }
    else
    {
        $_GET[first] =0;
    $_GET[last] = 10;
    }
$result = mysql_query("SELECT * FROM administrator LIMIT $_GET[first] , $_GET[last]");

?>
<section id="page">
<header id="pageheader" class="normalheader">
<h2 class="sitedescription">
Admin Details.  </h2>
</header>

<section id="contents">

<article class="post">
  <header class="postheader">
  <h2>Admin Details</h2>
  </header>
  <section class="entry">
  <font color="#330000">
    <table width="458" border="1">
  <tr>
    <th width="62" scope="col">Admin ID</th>
    <th width="73" scope="col">Admin Name</th>
    <th width="73" scope="col">Address</th>
    <th width="84" scope="col">Contact No</th>
    <th width="132" scope="col">Action</th>
  </tr>

  <?php
    $i =$_GET[first]+1;
  while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td align=center> " . $i . "</td>";
  echo "<td> " . $row['adminname'] . "</td>";
   echo "<td> " . $row['address'] . "</td>";
   echo "<td> " . $row['contactno'] . "</td>";
   echo "<td>  <a href='viewrecords.php?slid=$row[adminid]&view=administrator'><img src='images/view.png' width='32' height='32' /></a>
 <a href='addadmin.php?slid=$row[adminid]&view=administrator'>  <img src='images/edit.png' width='32' height='32' /></a>";
 ?>
 <a href='adminview.php?slid=$row[adminid]&view=delete'><img src='images/delete.png' width='32' height='32' onclick="return confirm('Are you sure??')" /></a> </td>
<?php
echo "</tr> ";
    $i++;
  }
  $first=$_GET[first]-10;
$last= $_GET[last]- 10;
  ?>
  <tr>
    <th scope="col"><?php 
    if($first <0)
    { 
    } 
    else 
    { ?>
    <a href="adminview.php?first=<?php echo $first; ?>&last=<?php echo $last; ?>">

    <?php 
    }
    ?><img src="images/previous.png" width="32" height="32" /></th>
    <th scope="col">
<a href="#" onClick="openadmin(); return false"><img src="images/add.png" width="32" height="32" /></a> <span id="youremail" style="color: red"></span>
</a></th> <?php 
$first=$_GET[first]+10;
$last = $_GET[last]+ 10;
?>
    <th scope="col"> </th>
      <th scope="col"> </th>
    <th scope="col"><?php 
    if($first > mysql_num_rows($result))
    { 
    } 
    else 
    { ?>
    <a href="adminview.php?first=<?php echo $first; ?>&last=<?php echo $last; ?>">
    <?php
    }
    ?><img src="images/next.png" width="32" height="32" /></th>
  </tr>
  </table>
  </section>
</article>


</section>

<?php 
}
else
{
        header("Location: admin.php");
}

include("adminmenu.php");
include("footer.php"); 

?>
3
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by simplypixie
0

maybe there's an error to you php code
check out line 14

if(isset($_SESSION["userid"]))
{

i guest this needs a closing =)

0

if its not,...
check on your code maybe there is a wrong syntax,wrong spelling, unclosed statements
check also the included files

1

Turn on error reporting as if you are getting a completely blank page then something is going wrong in either the code at the top of the page, or one of your include files.

<?php
session_start();

ini_set('display_errors',1); 
 error_reporting(E_ALL);

// rest of code here
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.