Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 10-01-2010, 08:58 AM Error on page
Junior Talker

Posts: 1
Name: Alexia Net
Trades: 0
Hi. I have created a small form with a radio button, textbox and a list on it. When I click on the radio button I want the list to be populated with some records from a database. I do not know what is the problem with my code and I hope someone can help me. I AM VERY NEW WITH PHP.

HTML Code:
<!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">
<head>
<meta  http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled  Document</title>
</head>

<body>

<?php 
require_once($_SERVER["DOCUMENT_ROOT"].'/ITA/DB/OpenDB.php');

function LoadBuildings(){
$strSQL  = "SELECT internalCodeBuilding FROM building";
$result=mysql_query($strSQL) or die("Unable to select the  information!");
echo'<select  name="lstBuilding"><option value=""></option>';

while($rand=mysql_fetch_array($result)){
echo '<option  value='.$rand['internalCodeBuilding'].'</option>';
}
echo'</select>';
}

echo '
<table width="80%"  border="1">
<tr>
<td><p>
<label>
<input  type="radio" name="RadioGroup1" value="building" id="RadioGroup1_0"  onclick="LoadBuildings()";/>
Building</label>


</p></td>
<td>Building name: 
<label>
<input  type="text" name="txtBuildingName" id="txtBuildingName" />
</label></td>
<td>Select building: 
<label>
<select  name="lstBuilding" id="lstBuilding">
</select>
</label></td>
</tr>
</table>
';
?>

</body>
</html>


Thank you.
alexia_net is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-01-2010, 07:01 PM Re: Error on page
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
option tag not closed and labeled

PHP Code:
echo '<option  value='.$rand['internalCodeBuilding'].'</option>'
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 10-06-2010, 07:21 AM Re: Error on page
Junior Talker

Posts: 1
Name: nirmal
Trades: 0
Nice code is being posted here it really helps me alot thanx for such a nice post ....
neeru84 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Error on page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51677 seconds with 12 queries