Form for Update Customization.

In this example you will learn about form for update customization.


Share on Google+Share on Google+

Form for Update Customization.


In this example you will learn about form for update customization.

Form for Update Customization

In this example, you will learn to make a update customization form in PHP. The code for customization update will be called on HTML form. 

In the following program, we have made a program for updating logo, theme, contact us, support, home page text, and RSS feed. 

#include common.php for connection

HTML action form

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<title>List Customization</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<center><h1> Update Customization </h1></center>

<form action="" method="post" name="" id="">
<table style="border:1px solid #CCCCCC; background-color:#F0F0F0; font-family:verdana; font-size:12px" cellpadding="5" cellspacing="2" width="400px"> 

$resellermail= $_SESSION["reseller_id"];
$link= mysql_connect($cmn_host,$cmn_user,$cmn_password) or die("Could not connect: ".mysql_error());
mysql_select_db($cmn_database,$link) or die("Error in selecting the database:".mysql_error());

$sql1="select * from company where email='$resellermail'";
$compresult = mysql_query($sql1) or exit('$sql failed: '.mysql_error()); 

$sql="select id,company_id,logo,theme_id,contactus,support,homepagetext,rss_feed from customization where company_id ='$compid' order by id";
$result=mysql_query($sql,$link) or die(mysql_error());

while($row=mysql_fetch_array($result)) {
$comid = $row['company_id'];
$theme_id = $row["theme_id"];
$imagename = $row['logo'];

$comprow=mysql_fetch_array(mysql_query("select name from company where company_id='$comid';",$link));
$compname = $comprow["name"];

<td style="border:1px solid #999999" bgcolor="#ABC2E9"><strong>Logo</strong></td>
<td><input type="image" src='images/<?=$imagename?>' size="20" height='100' width='150'></td>
else if($theme_id==2)
else if($theme_id==3)
else if($theme_id==4)
else if($theme_id==5)

<td style="border:1px solid #999999" bgcolor="#ABC2E9"><strong>Theme</strong></td>
<td><?php echo $color; ?></td>
<td style="border:1px solid #999999" bgcolor="#ABC2E9"><strong>Contact Us</strong></td>
<td><?php echo $row['contactus']; ?></td>
<td style="border:1px solid #999999" bgcolor="#ABC2E9"><strong>Support</strong></td>
<td><?php echo $row['support']; ?></td>
<td style="border:1px solid #999999" bgcolor="#ABC2E9"><strong>Home Page Text</strong></td>
<td><?php echo $row['homepagetext']; ?></td>
<td style="border:1px solid #999999" bgcolor="#ABC2E9"><strong>Rss Feed </strong></td>
<td><?php echo $row['rss_feed']; ?></td>
<td ></td><td><a href="<?php echo "addcustomization.php?id=".$row['id']."&mode=edit"?>">Update</a></td>
<?php } ?>


Posted on: July 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles