atticus Posted November 14, 2007 Share Posted November 14, 2007 The page is blank. It is called to edit info in database. The form is not showing up at all. When I enter text before the first IF statement it does show up. When I echo in the elseiff section, I still get a blank page. When I echo "(" .$result.")"; I get a blank, not even any paranthesis <?php session_start(); // is the one accessing this page logged in or not? if (!isset($_SESSION['db_is_logged_in']) || $_SESSION['db_is_logged_in'] !== true) { // not logged in, move to login page header('Location: login.php'); exit; } ?> <html> <body> <?php include("config.php"); if(isset($_POST['submit'])) { $name = mysql_escape_string($_POST['name']); $password = mysql_escape_string($_POST['password']); $result = mysql_query("UPDATE cust SET cust_id='$name', cust_password='$password' WHERE cust_id ") or die('Error, query failed : ' . mysql_error()); echo "<b>Thank you! User UPDATED Successfully!<br />You will be redirected in 4 seconds"; echo "<meta http-equiv=Refresh content=4;url=index.php>"; } elseif(isset($_GET['cust_id'])) { $result = mysql_query("SELECT * FROM cust WHERE cust_id='$_GET[cust_id]' ") or die('Error, query failed : ' . mysql_error()); while($myrow = mysql_fetch_assoc($result)) { $name = $myrow['cust_id']; $password = $myrow['cust_password']; ?> <br> <h3>::Edit User</h3> <form method="post" action="<?php echo $PHP_SELF ?>"> Name: <input name="title" size="40" id="title" maxlength="255" value="<? echo $name; ?>"> <br> Password: <textarea name="description" id="description" rows="7" cols="30"><? echo $password; ?></textarea> <br> <input type="submit" name="submit" value="Update"> </form>" <?php }//end of while loop }//end else ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.