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
Custom php sql request
Old 10-04-2010, 03:15 AM Custom php sql request
Average Talker

Posts: 22
Trades: 0
Hallo i have this script bellow and a db with 3 columns i want to create one 4rd and add numbers there and when i choose a value from call from select box , will show me .. e.g at right of select box the number that i will have put for the selected value


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<style>
body {

background-image:url('bg1.png');
background-repeat:no-repeat;
font-family:"Verdana", Arial, serif;
font-weight: bold; 
}
p {
font-family:"Verdana", Arial, serif;
} 


.loading {  
    background:url(ajax-loader.gif) no-repeat 1px;   
    height:28px;   
   width:28px;   
    display:none; 
    position: absolute;
left:10px;
top:117px;
} 

 
label.error { width: 250px; display: inline; color: black;
position: absolute;
left:46px;
top:113px;}

#pricefrom {
  filter:alpha(opacity=90);
opacity: 0.9;
-moz-opacity:0.9;
position:absolute;
left:97px;
}

#priceto {
  filter:alpha(opacity=90);
opacity: 0.9;
-moz-opacity:0.9;
position:absolute;
left:97px;

}
 
 #submit {
 color: #fff;
 font-size: 0;
 width: 45px;
 height: 19px;
 border: none;
 margin: 0;
 padding: 0;
 background: url(b1.png) 0 0 no-repeat;
position:absolute;
left:97px;
top:91px;
}

#results
{
position: absolute;
left:53px;
top:113px;
}
 
</style>
</head><body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>

    <script type="text/javascript">
    $(document).ready(function(){
        $("#myform").validate({
        
            debug: false,
            rules: {
                pricefrom: "required",
                priceto: "required"

            },
            messages: {
                pricefrom: "Choose country.",
                priceto: "Choose country"
            },
            submitHandler: function(form) {
            $('.results').hide();
            $('.loading').show();  
                // do other stuff for a valid form
                $.post('process.php', $("#myform").serialize(), function(data) {
                    $('#results').html(data);
                });
                 $('.loading').fadeOut('slow'); 
            }
        });
    });
    </script>
<?
$dbhost = "localhost";
$dbuser = "**";
$dbpass = "****";
$dbname = "**";
$conn = mysql_connect($dbhost,$dbuser,$dbpass) or die('wrong');
$db = mysql_select_db($dbname,$conn);


?>

<form name="myform" id="myform" action="" method="POST">  
<!-- The Name form field -->
    <label for="pricefrom" id="pricefrom">Call from: </label>  <Br>
    <select size="1" id="pricefrom" name="pricefrom">    
<?
$onm = "SELECT country FROM prices ORDER BY country ASC";
$onm1 = mysql_query($onm) or die(mysql_error());

    echo '<option value="" >Choose</option>';
    while($onfix = mysql_fetch_array($onm1))
    {

echo '<option value="'.$onfix[country].'" >'.$onfix[country].'</option>';


}




?>             
</select>          
    <br>
<!-- The Email form field -->
    <label for="priceto" id="priceto">Call to: </label>  
    <br><select size="1" id="priceto" name="priceto">    
<?
$onmb = "SELECT country FROM prices ORDER BY country ASC";
$onm1b = mysql_query($onm) or die(mysql_error());

while($onfixb = mysql_fetch_array($onm1b))
    {
if($onfixb[country] == "Greece") { $ch = 'selected';} else { $ch = '';}
echo '<option value="'.$onfixb[country].'" '.$ch.'>'.$onfixb[country].'</option>';



}




?>             
</select>          
    <br>
<!-- The Submit button -->
    <input type="submit" name="submit" value="Go" id="submit"> 
</form>
<!-- We will output the results from process.php here -->
<div class="loading"></div>  
<div id="results"><div>


</body>
</html>
nackgr is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Custom php sql request
 

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.07908 seconds with 12 queries