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...
dfowler Posted November 14, 2007 Share Posted November 14, 2007 typically a completely blank page results from an error int he coding. You either left out something (like a ' or $) or you have something there that shouldn't be. I notice you have a quote after the </form> at the bottom. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 14, 2007 Share Posted November 14, 2007 Are you sure $_GET['cust_id'] is set? If it isn't, the form isn't going to show. Quote Link to comment Share on other sites More sharing options...
atticus Posted November 14, 2007 Author Share Posted November 14, 2007 I think it is, this is the link from the other page: echo "<div><b>Username:</b> ".$row['cust_id']." | <a href=\"cust_edit.php?id=$row[cust_id]\">Edit User</a><br />"; The cust_id is also showing in URL Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 14, 2007 Share Posted November 14, 2007 Nope, you don't have it set. Change your link to this echo "<div><b>Username:</b> ".$row['cust_id']." | <a href=\"cust_edit.php?cust_id=$row[cust_id]\">Edit User</a><br />"; Quote Link to comment Share on other sites More sharing options...
atticus Posted November 14, 2007 Author Share Posted November 14, 2007 thank you...you guys rock! 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.