Jump to content

Recommended Posts

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: frank@test.com )</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

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; ?>" >

 

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.

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.