Mesran

Hanya ingin berbagi kebaikan dan mendapatkan kebaikan yang lain.

Menggunakan Combo di PHP

Sebelumnya anda sudah menggunakan Input. Sekarang kita menggunakan combo untuk melakukan pemilihan data.

Lihat dan ketikkan program di bawah ini :

<form name="form1" method="post" action="<? echo $_SERVER['PHP_SELF']; ?>">
  Nama 
  <select name="kode">
    <option value="001">001</option>
    <option value="002">002</option>
  </select>

  <input type="submit" name="Submit" value="Submit">
</form>
<?
	$kd = $_POST['kode']  ;
    if(!empty($kd) ){	    
		if($kd=='001'){
		    $nama="televisi" ;
			$harga = 1200000 ;
		}elseif($kd=='002'){
			$nama="dvd player" ;
			$harga = 600000 ;
		}else{
			$nama="" ;
			$harga = 0;
		}
					  
		echo "  Nama <input type='text' name='kd' value='$kd' ><br>
				Nama <input type='text' name='nama' value='$nama' ><br>
				Harga <input type='text' name='harga' value='$harga' >
				" ;
	}

?>

Simpan dengan nama input.php
Jalankan program php tersebut pada localhost atau 127.0.0.1
bagaimana hasilnya lumayan kan.🙂

Filed under: PHP,

One Response

  1. Theron Ya says:

    Hello Webmaster, I noticed that https://mesran.wordpress.com/2011/12/15/menggunakan-combo-di-php/ is ranking pretty low on Google and has a low Google PageRank. Now the Google PageRank is how Google is able to see how relevant your webpage is compared to all the other webpages online, if you cannot rank high at the top of Google, then you will NOT get the traffic you need. Now usually trying to get to the top of Google costs hundreds if not thousands of dollars and very highly optimized targeted marketing campaigns that takes a team of experts months to achieve. However, we can show you how to get to the top of Google with no out of pocket expenses (free traffic), no stupid ninja tricks, no silly mind control techniques, and this will be all white hat with no blackhat software or tactics that could possibly land you on bad terms with Google and put you in the dreaded “Google Sandbox”. We’ll show you how to easily capture all the targeted traffic you need, for free, multiple ways to land fast (not months) first-page rankings in Google and other major search engines (Bing, Yahoo, Ask, etc), even show you strategies on how to earn daily commissions just try Ranking Top of Google, please check out our 5 minute video.

Terima kasih telah memberikan komentar anda.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives Per Tahun

Sponsored

C&C Online Shop

Blog Stats

  • 356,504 sejak 12 Jan 2011

User’s Online


My Music

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 223 other followers

December 2011
M T W T F S S
« Nov   Jan »
 1234
567891011
12131415161718
19202122232425
262728293031  
%d bloggers like this: