ไม่ทราบว่า ผมเขียนถูกหรือปล่าวครับหรือต้องแก้ไข ในส่วนไหนแนะนำทีครับ
............................................
<meta http-equiv="Content-Type" content="charset=utf-8" />
<center>
<?php
function Triangle ()
{
$b = $_GET[base];
$h = $_GET[height];
if ($b == '')
{
?>
<form id="form1" name="form1" method="get" action="">
base :
<input type="text" name="base" id="base" />
<p>
height :
<input type="text" name="height" id="height" />
</p>
<p>
<input type="submit" name="button" id="button" value="Submit" />
<input type="reset" name="button2" id="button2" value="Reset" />
</p>
</form>
<? }
else {
echo "Triangle = ".(0.5*$b*$h); }
}
Triangle ();
?>
..........................................................
<meta http-equiv="Content-Type" content="charset=utf-16" />
<center>
<?php
function Rectangle ()
{
$w = $_GET[width];
$h = $_GET[height];
if ($w == '')
{
?>
<form id="form1" name="form1" method="get" action="">
width :
<input type="text" name="width" id="width" />
<p>
height :
<input type="text" name="height" id="height" />
</p>
<p>
<input type="submit" name="button" id="button" value="Submit" />
<input type="reset" name="button2" id="button2" value="Reset" />
</p>
</form>
<? }
else {
echo "Rectangle = ".($h*$w);}
}
Rectangle ();
?>
.................................................
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<center>
<?php
function Circle ()
{
$pi = 3.14;
$c = 2;
$r = $_GET[r];
if ($r == '')
{
?>
<form id="form1" name="form1" method="get" action="">
Radius :
<input type="text" name="r" id="r" />
<p>
<input type="submit" name="button" id="button" value="Submit" />
<input type="reset" name="button2" id="button2" value="Reset" />
</p>
</form>
<? }
else {
echo "Circle = ".($pi*$c*$r); }
}
Circle ();
?>
..................................................
ไม่ทราบว่า ผมเขียนถูกหรือปล่าวครับหรือต้องแก้ไข ในส่วนไหนแนะนำทีครับ
พี่ครับช่วยตรวจสอบ code php ให้ทีครับ (มือใหม่หัดเขียน)
Moderators: mindphp, ผู้ดูแลกระดาน
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 27133
- Joined: 22/09/2008 6:18 pm
- Contact:
Re: พี่ครับช่วยตรวจสอบ code php ให้ทีครับ (มือใหม่หัดเขียน)
ต้องการทำอะไร
มีปัญหาอะไร หรือครับ
อธิบายที่มาที่ไปหน่อยครับ
มีปัญหาอะไร หรือครับ
อธิบายที่มาที่ไปหน่อยครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- Similar Topics
- Replies
- Views
- Last post
-
-
ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no
by Dwight » 09/12/2011 9:57 am » in Programming - PHP - 6 Replies
- 5319 Views
-
Last post by Dwight
12/12/2011 10:07 pm
-
-
-
ดูโค้ดให้หน่อยค่ะ มันเข้าแต่ else ไม่เข้า if เลย มือใหม่หัดเขียน ชี้แนะด้วยค่ะ
by memooApple » 12/10/2012 3:54 pm » in Programming - PHP - 3 Replies
- 2264 Views
-
Last post by HurricaneCyber
15/10/2012 10:33 am
-
-
-
การทำ Android เพื่อใช้สแกน QR Code และ Bar Code Reader
by rangsan » 28/05/2018 11:19 am » in Mobile Application Developing- Android, iOS - 0 Replies
- 5428 Views
-
Last post by rangsan
28/05/2018 11:19 am
-
-
-
เเนะนำ code editor online สำหรับใครที่ไม่ติดตั้ง Code Editor บนเครื่อง
by thatsawan » 08/05/2015 1:03 am » in PHP Knowledge - 0 Replies
- 1002 Views
-
Last post by thatsawan
08/05/2015 1:03 am
-
-
- 0 Replies
- 1513 Views
-
Last post by Kritsana Leesakul
11/11/2018 10:16 am
Who is online
Users browsing this forum: No registered users and 15 guests