To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Coding

Coding Help with PHP coding

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 07-24-2010, 08:34 AM   #1
ace_friends22
Junior Member
 
Join Date: Jul 2010
Posts: 1
Drop Down item with php include()

Hi Team,

Below is my php code.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> Items </TITLE>
  
 </HEAD>

 <BODY>
  <form method="post">
  <select name="item">
  <option> Select... </option>
  <option> Flower Item</option>
  <option> Choclate Item</option>
  <option> Gift Item</option>
</form>

<?php
	$item=$_POST['item'];

	if ($item == "Flower")
	{
		include('Flower.php');
	}
	elseif ($place == "Choclate")
	{
		include('Choclate.php');
	}
	elseif ($place == "Gift")
	{
		include('Gift.php');
	}
	
?>
 </BODY>
</HTML>
What i want to do is, if user select choclate, then php should open choclate.php file and place all codes after form. So that, whenever user select either of choclate, flower of gift, he should able to see the table coded in respective file.

The choclate.php contains a table code, with images in each colum like below.

Code:
<BR><BR><BR>
<table id="customers" width="200" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<th>Flower</th>
	</tr>
</table >
<table id="customers" align="center" >
	<tr >
		<td align="center"><img src="images/1.jpg" name="home_0" border="0" width="100" height="120" hspace="0" vspace="0" ><br><b>Price=20</b></td>
		<td align="center"><img src="images/2.jpg" name="home_0" border="0" width="100" height="120" hspace="0" vspace="0" ><br><b>Price=50</b></td>
		<td align="center"><img src="images/3.jpg" name="home_0" border="0" width="100" height="120" hspace="0" vspace="0" ><br><b>Price=60</b></td>
		<td align="center"><img src="images/4.jpg" name="home_0" border="0" width="100" height="120" hspace="0" vspace="0" ><br><b>Price=80</b></td>
		<td align="center"><img src="images/5.jpg" name="home_0" border="0" width="100" height="120" hspace="0" vspace="0" ><br><b>Price=100</b></td>
	</tr>
</table>
But above code is not working. Could you please tell me how to do it?
ace_friends22 is offline   Reply With Quote
Old 07-24-2010, 10:16 AM   #2
NogDog
High Energy Magic Dept.
 
NogDog's Avatar
 
Join Date: Aug 2006
Location: Ankh-Morpork
Posts: 12,638
http://www.webdeveloper.com/forum/sh...67#post1104167
__________________
"That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett

Email me
NogDog is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:47 AM.








Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.