bddotnet
9-2-07, 01:17 AM
I have a page on a site that I am designing - http://www.bluebeancoffee.com/?pg=shop
The links for the kinds of coffee are there. The object is for the kinds of coffees for each type to appear in the box that says "Choose from the menu at the left."
My links say = a href="?section=flavoredcoffee12ozswdecaf". The page is http://www.bluebeancoffee.com/?pg=shop. How do I get my links to work where the information is displayed when the user clicks on the kind of coffee they want?
My source is:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
last_tab = 'tab1';
function show(layerName) {
document.getElementById(layerName).style.display = '';
}
function hide(layerName) {
document.getElementById(layerName).style.display = 'none';
}
function show_next(tab_name) {
document.getElementById(last_tab).className = 'tab';
var curr = document.getElementById(tab_name);
curr.className='tab_hover';
hide(last_tab+'_data');
show(tab_name+'_data');
last_tab=tab_name;
}
</script>
</head>
<body>
<h1>Shop...</h1>
<a href="?pg=search">Search the database</a>
<form action="shoponline.php" method="post">
<h1></h1>
<?php $section = ($_GET['section']);
if (substr_count($section,"/") != "0" OR substr_count($section,".") != "0") $section = ""; // overkill protect against injection
$section = $section . ".php";
if (file_exists($section)) {
$display = file_get_contents($section);
} else {
$display = file_get_contents('blank.php');
}
?>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="224"><a href="?section=flavored">Flavored Coffee 12 oz. Regular</a></td>
<td width="276" rowspan="8" valign="top"><?=$display?></td>
</tr>
<tr>
<td><a href="?section=flavoredcoffee12ozswdecaf">Flavored Coffee 12 oz.
SW Decaf</a></td>
</tr>
<tr>
<td><a href="?section=lightroast12ozregular">Light Roast 12 oz. Regular</a></td>
</tr>
<tr>
<td><a href="?section=lightroast12ozswdecaf">Light Roast 12 oz. SW
Decaf</a></td>
</tr>
<tr>
<td><a href="?section=mediumroast12ozregular">Medium Roast 12 oz.
Regular</a></td>
</tr>
<tr>
<td><a href="?section=mediumroast12ozswdecaf">Medium Roast 12 oz.
SW Decaf</a></td>
</tr>
<tr>
<td><a href="?section=darkroast12ozregular">Dark Roast 12 oz. Regular</a></td>
</tr>
<tr>
<td><a href="?section=darkroast12ozswdecaf">Dark Roast 12 oz. SW Decaf</a></td>
</tr>
</table>
<p> </p><table width="500" border="0" align="center" cellpadding="0" cellspacing="0" class="nav">
<tr>
<td colspan="2" id="titlebar">Additional Items...</td>
</tr>
<tr>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0110.JPG"><img src="images/newest/IMG_0110_small.jpg" alt="The Blue Bean T-Shirt" width="100" height="75" border="0"></a><a href="images/newest/IMG_0111.JPG"><img src="images/newest/IMG_0111_small.jpg" alt="The Blue Bean T-Shirt" width="100" height="75" border="0"></a></p>
<p align="center">Blue Bean T-Shirt</p></td>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0106.JPG"><img src="images/newest/IMG_0106_small.jpg" alt="The Blue Bean Tote Bag" width="100" height="75" border="0"></a></p>
<p align="center">Blue Bean Tote</p></td>
</tr>
<tr>
<td id="cell2"> <div align="center">$16.95
<input type="checkbox" name="shirt" value="checkbox">
</div></td>
<td id="cell2"><div align="center">$18.95
<input type="checkbox" name="tote" value="checkbox">
</div></td>
</tr>
<tr>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0144.JPG"><img src="images/newest/IMG_0144_small.jpg" alt="The Blue Bean Coffee Pot Shot" width="100" height="75" border="0"></a>
</p>
<p align="center">Blue Bean Coffee</p></td>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0155.JPG"><img src="images/newest/IMG_0155_small.jpg" alt="The Blue Bean Mug" width="100" height="133" border="0"></a></p>
<p align="center">Blue Bean Mug</p></td>
</tr>
<tr>
<td id="cell2"><div align="center">$2.25
<input type="checkbox" name="coffee" value="checkbox">
</div></td>
<td id="cell2"><div align="center">$10.50
<input type="checkbox" name="mug" value="checkbox">
</div></td>
</tr>
</table>
<h1>Customer Information...</h1>
<p>Name:
<input name="text" type="text">
(First and Last)</p>
<p>Email:
<input name="text" type="text">
</p>
<p>Phone:
<input name="text" type="text" id="name3">
(include area code)</p>
<p>About:
<input name="text" type="text" id="name4">
(Mailing Address if you want your order mailed to you)</p>
<p>Credit Card Information:
<input name="text" type="text" id="name5">
(Type of Card, Name, Expiration Date, CVV Code)</p>
<center>
<p align="center">
<input type="submit" name="Submit3" value="Submit Order">
<input type="reset" name="Submit22" value="Reset">
<br>
<a href="?pg=shop">Top</a></p>
<p>
<?php
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;
$mailto = 'bobbyduncandotnet@yahoo.com' ;
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;
$subject = "The Blue Bean Coffee Company - Shop Order" ;
// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://www.domain.net/contact.html" ;
$errorurl = "http://www.domain.net/err.html" ;
$thankyouurl = "http://www.domain.net/ty.html" ;
$uself = 0;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$phone = $_POST['phone'] ;
$about = $_POST['about'] ;
$comments = $_POST['comments'] ;
$return_ip=$_POST["return_ip"];
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$IP = $_SERVER['REMOTE_ADDR']; //added for IP address
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name: $name\n" .
"Email: $email\n" .
"Phone: $phone\n" .
"about: $about\n" .
"IP: $IP\n" . //added for IP address
"------------------------- Message -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;
?>
</p>
</center>
</form>
</body>
</html>
The links for the kinds of coffee are there. The object is for the kinds of coffees for each type to appear in the box that says "Choose from the menu at the left."
My links say = a href="?section=flavoredcoffee12ozswdecaf". The page is http://www.bluebeancoffee.com/?pg=shop. How do I get my links to work where the information is displayed when the user clicks on the kind of coffee they want?
My source is:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
last_tab = 'tab1';
function show(layerName) {
document.getElementById(layerName).style.display = '';
}
function hide(layerName) {
document.getElementById(layerName).style.display = 'none';
}
function show_next(tab_name) {
document.getElementById(last_tab).className = 'tab';
var curr = document.getElementById(tab_name);
curr.className='tab_hover';
hide(last_tab+'_data');
show(tab_name+'_data');
last_tab=tab_name;
}
</script>
</head>
<body>
<h1>Shop...</h1>
<a href="?pg=search">Search the database</a>
<form action="shoponline.php" method="post">
<h1></h1>
<?php $section = ($_GET['section']);
if (substr_count($section,"/") != "0" OR substr_count($section,".") != "0") $section = ""; // overkill protect against injection
$section = $section . ".php";
if (file_exists($section)) {
$display = file_get_contents($section);
} else {
$display = file_get_contents('blank.php');
}
?>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="224"><a href="?section=flavored">Flavored Coffee 12 oz. Regular</a></td>
<td width="276" rowspan="8" valign="top"><?=$display?></td>
</tr>
<tr>
<td><a href="?section=flavoredcoffee12ozswdecaf">Flavored Coffee 12 oz.
SW Decaf</a></td>
</tr>
<tr>
<td><a href="?section=lightroast12ozregular">Light Roast 12 oz. Regular</a></td>
</tr>
<tr>
<td><a href="?section=lightroast12ozswdecaf">Light Roast 12 oz. SW
Decaf</a></td>
</tr>
<tr>
<td><a href="?section=mediumroast12ozregular">Medium Roast 12 oz.
Regular</a></td>
</tr>
<tr>
<td><a href="?section=mediumroast12ozswdecaf">Medium Roast 12 oz.
SW Decaf</a></td>
</tr>
<tr>
<td><a href="?section=darkroast12ozregular">Dark Roast 12 oz. Regular</a></td>
</tr>
<tr>
<td><a href="?section=darkroast12ozswdecaf">Dark Roast 12 oz. SW Decaf</a></td>
</tr>
</table>
<p> </p><table width="500" border="0" align="center" cellpadding="0" cellspacing="0" class="nav">
<tr>
<td colspan="2" id="titlebar">Additional Items...</td>
</tr>
<tr>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0110.JPG"><img src="images/newest/IMG_0110_small.jpg" alt="The Blue Bean T-Shirt" width="100" height="75" border="0"></a><a href="images/newest/IMG_0111.JPG"><img src="images/newest/IMG_0111_small.jpg" alt="The Blue Bean T-Shirt" width="100" height="75" border="0"></a></p>
<p align="center">Blue Bean T-Shirt</p></td>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0106.JPG"><img src="images/newest/IMG_0106_small.jpg" alt="The Blue Bean Tote Bag" width="100" height="75" border="0"></a></p>
<p align="center">Blue Bean Tote</p></td>
</tr>
<tr>
<td id="cell2"> <div align="center">$16.95
<input type="checkbox" name="shirt" value="checkbox">
</div></td>
<td id="cell2"><div align="center">$18.95
<input type="checkbox" name="tote" value="checkbox">
</div></td>
</tr>
<tr>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0144.JPG"><img src="images/newest/IMG_0144_small.jpg" alt="The Blue Bean Coffee Pot Shot" width="100" height="75" border="0"></a>
</p>
<p align="center">Blue Bean Coffee</p></td>
<td id="cell2"> <p align="center"><a href="images/newest/IMG_0155.JPG"><img src="images/newest/IMG_0155_small.jpg" alt="The Blue Bean Mug" width="100" height="133" border="0"></a></p>
<p align="center">Blue Bean Mug</p></td>
</tr>
<tr>
<td id="cell2"><div align="center">$2.25
<input type="checkbox" name="coffee" value="checkbox">
</div></td>
<td id="cell2"><div align="center">$10.50
<input type="checkbox" name="mug" value="checkbox">
</div></td>
</tr>
</table>
<h1>Customer Information...</h1>
<p>Name:
<input name="text" type="text">
(First and Last)</p>
<p>Email:
<input name="text" type="text">
</p>
<p>Phone:
<input name="text" type="text" id="name3">
(include area code)</p>
<p>About:
<input name="text" type="text" id="name4">
(Mailing Address if you want your order mailed to you)</p>
<p>Credit Card Information:
<input name="text" type="text" id="name5">
(Type of Card, Name, Expiration Date, CVV Code)</p>
<center>
<p align="center">
<input type="submit" name="Submit3" value="Submit Order">
<input type="reset" name="Submit22" value="Reset">
<br>
<a href="?pg=shop">Top</a></p>
<p>
<?php
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;
$mailto = 'bobbyduncandotnet@yahoo.com' ;
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;
$subject = "The Blue Bean Coffee Company - Shop Order" ;
// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://www.domain.net/contact.html" ;
$errorurl = "http://www.domain.net/err.html" ;
$thankyouurl = "http://www.domain.net/ty.html" ;
$uself = 0;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$phone = $_POST['phone'] ;
$about = $_POST['about'] ;
$comments = $_POST['comments'] ;
$return_ip=$_POST["return_ip"];
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$IP = $_SERVER['REMOTE_ADDR']; //added for IP address
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name: $name\n" .
"Email: $email\n" .
"Phone: $phone\n" .
"about: $about\n" .
"IP: $IP\n" . //added for IP address
"------------------------- Message -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;
?>
</p>
</center>
</form>
</body>
</html>