opps I forgot the submit button on the form there. This code is the same with the submit button
PHP Code:
<?php
if (isset($_POST['access']) && $_POST['access'] = "password") {
//this assumes the users password is password for access. You can also hash this with md5 if you want or some other method of your choosing
if (isset($_POST['new_price']) && $_POST['new_price'] !="") {
$price = $_POST['new_price'];
$current_price = "price.txt";
file_put_contents($current_price, $price);
}
}
if (isset($_GET['price']) && $_GET['price'] !="") {
?>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
Input the New Price to be displayed:<input type="text" name="new_price" /><br />
Input your Password:<input type="password" name="access" /><br />
<input type="submit" />
</form>
<?php
} else {
$current_price = "price.txt";
$price_is = file_get_contents($current_price);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
#price {
/*style price however you want here*/
}
</style>
<title>Contact The Gold Buying Girl For A Gold Party or To Sell Gold</title>
<meta name="ROBOTS" content="INDEX,FOLLOW">
<meta name="description" content="Gold Buying Girl, Host a gold party in Houston, gold buyer, mailing gold, gold parties in Houston, TX">
<meta name="keywords" content="Gold Buying Girl, gold buyer in houston, host a gold party, mailing gold, gold parties in Houston, TX">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>
<body background="images/background60.jpg" topmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#000000">
<div align="center">
<table border="0" width="1053" cellspacing="0" cellpadding="0" id="table2">
<tr>
<td width="211" rowspan="2">
<img border="0" src="images/gold-buying-girl-home.png" width="221" height="255" alt="Gold Buyer in Houston"></td>
<td width="832">
<img border="0" src="images/gold-party-purse.jpg" width="594" height="204" align="right" alt="Gold Buyer and Gold Parties"></td>
</tr>
<tr>
<td align="right" width="832">
<p align="center">
<a href="index.html"><img border="0" src="/images/button-home.png" width="185" height="51" alt="Houston Gold Parties"></a>
<a href="about_gold_buying_girl.html"><img border="0" src="images/button-host-a-gold-party.png" width="192" height="51" alt="Host A Gold Party"></a>
<a href="faq.html"><img border="0" src="images/button-faq.png" width="181" height="51"></a>
<a href="contact_gold_buying_girl.html"><img border="0" src="images/button-contact.png" width="192" height="51"></a>
<a href="gold-party-testimonials.html"><img border="0" src="images/button-testimonials.png" width="192" height="51"></a>
<a href="contact_gold_buying_girl.html"><img border="0" src="images/button-appointment.png" width="240" height="51">
</a>
<a href="welcome.htm"> </a><a href="contact_gold_buying_girl.html"><img border="0" src="images/charity.png" width="192" height="51"></a>
<a href="become_a_gold_buyer.html"><img border="0" src="images/button-gbg.png" width="192" height="51"></a>
</td>
</tr>
</table>
</div>
<div align="center">
<table border="0" width="1050" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td valign="top" rowspan="3" width="246">
</td>
<td valign="top" rowspan="3" width="30">
</td>
</tr>
<tr>
<td align="left" width="768">
<p>
</td>
</tr>
<tr>
<td align="center" width="768" valign="middle" >
<b>
<font color="#FFFFFF" size="3" face="Georgia"><a href="http://www.cabida.com/gbgcal/cks.php" target="_blank"><i>View
the Calendar</i></a></font>
<i><font color="#FFFFFF" face="Georgia" size="2"> (opens
in a new tab or window)</font></i></b><br><br>
<p><i><b><a href="calendarupdateform.htm"><font face="Georgia" color="#FFFFFF" size="3">Send a Calendar
Update to the Gold Buying Girl</font></a></b></i></p>
<p><b><font color="#FFFFFF" size="3" face="Georgia"><a href="http://www.cabida.com/gbgcal/calen.php"><br>
<i>Maintain the Calendar</i></a><i> </i></font>
<i><font color="#FFFFFF" face="Georgia" size="2">(requires
a password)</font></i></b>
</td>
</tr>
<tr>
<td valign="top" width="246">
I have not idea where you want the price to show up but ummmm here? <div id="price"><?php echo $price_is; ?></div>
</td>
<td valign="top" width="30">
</td>
<td align="center" width="768">
</td>
</tr>
</table>
</div>
<p align="center">
</p>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>
<?php
}
?>
Bookmarks