perezf Posted August 3, 2007 Share Posted August 3, 2007 I assume it may be because of how im calling the items from the db, can someone help me figure out why i have just a blank screen, i cant see any of the fields <html> <head><title>Update Clients</title></head> <body> <?php include "dbconnect.inc.php"; $clientid = $_POST['updateclient']; if(isset($_POST['updateuser'])) { $clientid = $POST['clientid']; $domain = $_POST['domain']; $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $fax = $_POST['fax']; $address = $_POST['address']; $company = $_POST['company']; $hostingplan = $_POST['hostingplan']; $maintenanceplan = $_POST['maintenanceplan']; $ftpuser = $_POST['ftpuser']; $ftppass = $_POST['ftppass']; $clientinfo_update = "UPDATE `clientinfo` SET `domain` = '$domain', `name` = '$name', `email` = '$email', `phone` = '$phone', `fax` = '$fax', `address` = '$address', `company` = '$company' WHERE `id` = '$clientid' LIMIT 1"; $clientsupport_update = "UPDATE `clientsupport` SET `domain` = '$domain', `hostingtype` = '$hostingplan', `maintenancetype` = '$maintenanceplan' WHERE `id` = '$clientid' LIMIT 1"; $clientftp_update = "UPDATE `clientftp` SET `domain` = '$domain', `ftpuser` = '$ftpuser', `ftppass` = '$ftppass' WHERE `id` = '$clientid' LIMIT 1"; mysql_query($clientinfo_update) or die("Cannot Update from clientinfo"); mysql_query($clientsupport_update) or die("Cannot Update clientsupport"); mysql_query($clientftp_update) or die("Cannot Update clientftp"); echo "Update Complete"; } else { $clientinfo_update = "SELECT * FROM clientinfo WHERE id = '$clientid'"; $clientsupport_update = "SELECT * FROM clientsupport WHERE id = '$clientid'"; $clientftp_update = "SELECT * FROM clientftp WHERE id = '$clientid'"; $result1 = mysql_query($clientinfo_update); $result2 = mysql_query($clientsupport_update); $result3 = mysql_query($clientftp_update); $row1 = mysql_fetch_array($result1, MYSQL_ASSOC); $row2 = mysql_fetch_array($result2, MYSQL_ASSOC); $row3 = mysql_fetch_array($result3, MYSQL_ASSOC); ?> <p>*** <i>means the field is requried</i></p> <form action="" method="post"> <input type="hidden" name="clientid" value="<?php ehco $clientid; ?>" > <p>Domain Name: *** <i> (example: test.com )</i><br> <input type="text" name="domain" value="<?php echo $row1['domain']; ?>"></p> <p>Client Name: *** <i> (example: Frank Perez )</i><br> <input type="text" name="name" value="<?php echo $row1['name']; ?>"></p> <p>Email Address: *** <i>(example: [email protected] )</i><br> <input type="text" name="email" value="<?php echo $row1['email']; ?>"></p> <p>Phone Number: <i>(example: 954-560-8165 )</i><br> <input type="text" name="phone" value="<?php echo $row1['phone']; ?>"></p> <p>Fax Number: <i>(example: 954-252-6025 )</i><br> <input type="text" name="fax" value="<?php echo $row1['fax']; ?>"></p> <p>Client Address: <i>(example: 17040 SW 48th Street SW Ranches FL 33331 )</i><br> <textarea name="address" rows="5" cols="50"><?php echo $row1['address']; ?></textarea> <p>Company Name: <i>(example: Company Name )</i><br> <input type="text" name="company" value="<?php echo $row1['company']; ?>"></p> <p>On Hosting Plan:<br> <select name="hostingplan"> <option selected><?php echo $row2['hostingtype']; ?></option> <option>None</option> <option>Beginners Plan</option> <option>Standard Plan</option> <option>Professional Plan</option> </select></p> <p>Maintenance Plan:<br> <select name="maintenanceplan"> <option selected><?php echo $row2['maintenancetype']; ?></option> <option>None</option> <option>Starters Program</option> <option>Standard Program</option> <option>Professional Program</option> </select></p> <p>FTP Username:<br> <input type="text" name="ftpuser" value="<?php echo $row3['ftpuser']; ?>"></p> <p>Ftp Password:<br> <input type="text" name="ftppass" value="<?php echo $row3['ftppass']; ?>"></p> <p><input type="submit" name="updateuser" value="Update Client"></p> </form> <?php } ?> </body> </html> ??? Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/ Share on other sites More sharing options...
jitesh Posted August 3, 2007 Share Posted August 3, 2007 solve an error before <form action="" method="post"> <input type="hidden" name="clientid" value="<?php ehco $clientid; ?>" > ------------------------------------ <form action="" method="post"> <input type="hidden" name="clientid" value="<?php echo $clientid; ?>" > Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314715 Share on other sites More sharing options...
perezf Posted August 3, 2007 Author Share Posted August 3, 2007 thanks for the help the page is fixed, now i only have a problem it gives me an error on update Cannot Update from clientinfo what am i doing wrong ??? Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314717 Share on other sites More sharing options...
jitesh Posted August 3, 2007 Share Posted August 3, 2007 echo $clientinfo_update ; post query with data here. Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314719 Share on other sites More sharing options...
perezf Posted August 3, 2007 Author Share Posted August 3, 2007 the mysql_query is already there, is that what you mean check above the echo statement Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314722 Share on other sites More sharing options...
jitesh Posted August 3, 2007 Share Posted August 3, 2007 echo query and check in mysql. Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314724 Share on other sites More sharing options...
perezf Posted August 3, 2007 Author Share Posted August 3, 2007 it is not updating the mysql ??? Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314725 Share on other sites More sharing options...
jitesh Posted August 3, 2007 Share Posted August 3, 2007 check what error is giving mysql_query($clientinfo_update) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314726 Share on other sites More sharing options...
perezf Posted August 3, 2007 Author Share Posted August 3, 2007 Query was empty Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314730 Share on other sites More sharing options...
perezf Posted August 3, 2007 Author Share Posted August 3, 2007 why do i recieve that error Query was empty Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314732 Share on other sites More sharing options...
simcoweb Posted August 3, 2007 Share Posted August 3, 2007 How is this variable being given a value? <input type="hidden" name="clientid" value="<?php echo $clientid; ?>" > The $clientid is a hidden field which means no entry. In your update query you have WHERE id = $clientid but I don't see how that's populated with a value. If there's no info in the query it may be because it can't match the id with anything. Link to comment https://forums.phpfreaks.com/topic/63148-solved-php-script-page-displays-white/#findComment-314740 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.