<?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.webserviceX.NET/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.webserviceX.NET/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET/"> <s:element name="ConvertTemp"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="Temperature" type="s:double" /> <s:element minOccurs="1" maxOccurs="1" name="FromUnit" type="tns:TemperatureUnit" /> <s:element minOccurs="1" maxOccurs="1" name="ToUnit" type="tns:TemperatureUnit" /> </s:sequence> </s:complexType> </s:element> <s:simpleType name="TemperatureUnit"> <s:restriction base="s:string"> <s:enumeration value="degreeCelsius" /> <s:enumeration value="degreeFahrenheit" /> <s:enumeration value="degreeRankine" /> <s:enumeration value="degreeReaumur" /> <s:enumeration value="kelvin" /> </s:restriction> </s:simpleType> <s:element name="ConvertTempResponse"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="ConvertTempResult" type="s:double" /> </s:sequence> </s:complexType> </s:element> <s:element name="double" type="s:double" /> </s:schema> </wsdl:types> <wsdl:message name="ConvertTempSoapIn"> <wsdl:part name="parameters" element="tns:ConvertTemp" /> </wsdl:message> <wsdl:message name="ConvertTempSoapOut"> <wsdl:part name="parameters" element="tns:ConvertTempResponse" /> </wsdl:message> <wsdl:message name="ConvertTempHttpGetIn"> <wsdl:part name="Temperature" type="s:string" /> <wsdl:part name="FromUnit" type="s:string" /> <wsdl:part name="ToUnit" type="s:string" /> </wsdl:message> <wsdl:message name="ConvertTempHttpGetOut"> <wsdl:part name="Body" element="tns:double" /> </wsdl:message> <wsdl:message name="ConvertTempHttpPostIn"> <wsdl:part name="Temperature" type="s:string" /> <wsdl:part name="FromUnit" type="s:string" /> <wsdl:part name="ToUnit" type="s:string" /> </wsdl:message> <wsdl:message name="ConvertTempHttpPostOut"> <wsdl:part name="Body" element="tns:double" /> </wsdl:message> <wsdl:portType name="ConvertTemperatureSoap"> <wsdl:operation name="ConvertTemp"> <wsdl:input message="tns:ConvertTempSoapIn" /> <wsdl:output message="tns:ConvertTempSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:portType name="ConvertTemperatureHttpGet"> <wsdl:operation name="ConvertTemp"> <wsdl:input message="tns:ConvertTempHttpGetIn" /> <wsdl:output message="tns:ConvertTempHttpGetOut" /> </wsdl:operation> </wsdl:portType> <wsdl:portType name="ConvertTemperatureHttpPost"> <wsdl:operation name="ConvertTemp"> <wsdl:input message="tns:ConvertTempHttpPostIn" /> <wsdl:output message="tns:ConvertTempHttpPostOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ConvertTemperatureSoap" type="tns:ConvertTemperatureSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="ConvertTemp"> <soap:operation soapAction="http://www.webserviceX.NET/ConvertTemp" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="ConvertTemperatureSoap12" type="tns:ConvertTemperatureSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="ConvertTemp"> <soap12:operation soapAction="http://www.webserviceX.NET/ConvertTemp" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="ConvertTemperatureHttpGet" type="tns:ConvertTemperatureHttpGet"> <http:binding verb="GET" /> <wsdl:operation name="ConvertTemp"> <http:operation location="/ConvertTemp" /> <wsdl:input> <http:urlEncoded /> </wsdl:input> <wsdl:output> <mime:mimeXml part="Body" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="ConvertTemperatureHttpPost" type="tns:ConvertTemperatureHttpPost"> <http:binding verb="POST" /> <wsdl:operation name="ConvertTemp"> <http:operation location="/ConvertTemp" /> <wsdl:input> <mime:content type="application/x-www-form-urlencoded" /> </wsdl:input> <wsdl:output> <mime:mimeXml part="Body" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="ConvertTemperature"> <wsdl:port name="ConvertTemperatureSoap" binding="tns:ConvertTemperatureSoap"> <soap:address location="http://www.webservicex.net/ConvertTemperature.asmx" /> </wsdl:port> <wsdl:port name="ConvertTemperatureSoap12" binding="tns:ConvertTemperatureSoap12"> <soap12:address location="http://www.webservicex.net/ConvertTemperature.asmx" /> </wsdl:port> <wsdl:port name="ConvertTemperatureHttpGet" binding="tns:ConvertTemperatureHttpGet"> <http:address location="http://www.webservicex.net/ConvertTemperature.asmx" /> </wsdl:port> <wsdl:port name="ConvertTemperatureHttpPost" binding="tns:ConvertTemperatureHttpPost"> <http:address location="http://www.webservicex.net/ConvertTemperature.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
<head> <title>Convert Temperature</title> </head> <body> <h2>Temperature Conversion</h2> <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "GET"> Degrees: <input type = "text" name = "degree" size=4> <select name="scale"> <option value="celcius">Celsius</option> <option value="fahrenheit">Fahrenheit</option> <option value="kelvin">Kelvin</option> <option value="rankine">Rankine</option> </select> <br/> <input type = "submit" name = "Convert Temperature"/> </form> <?php //check for input if (array_key_exists('degree',$_GET)){ $scale = $_GET['scale']; $degree = $_GET['degree']; $firstLength = strlen($_GET['degree']); //check that input is not NULL or NaN if(($firstLength > 0) && (is_numeric($_GET['degree']))) { if ($scale == "celcius") { print "<table><tr><th> Conversion Results</th></tr><tr><td>$degree</td><td>celsius</td></tr>"; $c_2_f = $degree*9/5+32; print "<tr><td>$c_2_f</td><td>fahrenheit</td></tr>"; $c_2_k = $degree+273.15; print "<tr><td>$c_2_k </td><td>kelvin</td></tr>"; $c_2_r = $c_2_f+459.6; print "<tr><td>$c_2_r</td><td>rankine</td></tr></table>";} if ($scale == "fahrenheit") { print "<table border><tr><th colspan=2> Conversion Results</th></tr><tr><td>$degree</td><td>farhenheit</td></tr>"; $f_2_c = ($degree -32)*5/9; print "<tr><td>$f_2_c</td><td>celsius</td></tr>"; $f_2_k = $f_2_c+273.15; print "<tr><td>$f_2_k </td><td>kelvin</td></tr>"; $f_2_r = $degree+459.6; print "<tr><td>$f_2_r</td><td>rankine</td></tr></table>"; } if ($scale == "kelvin") { print "<table border><tr><th colspan=2> Conversion Results</th></tr><tr><td> $degree</td><td>kelvin</td></tr>"; $k_2_f = ($degree - 273.15) * 9 / 5 + 32; print "<tr><td>$k_2_f</td><td>fahrenheit</td></tr>"; $k_2_c = $degree-273.15; print "<tr><td>$k_2_c </td><td>celsius</td></tr>"; $k_2_r = $k_2_f+459.6; print "<tr><td>$k_2_r</td><td>rankine</td></tr></table>"; } if ($scale == "rankine") { print "<table border><tr><th colspan=2> Conversion Results</th></tr><tr><td>$degree</td><td>rankine</td></tr>"; $r_2_f = $degree-459.6; print "<tr><td>$r_2_f</td><td>fahrenheit</td></tr>"; $r_2_c = ($r_2_f - 32)*5/9; print "<tr><td>$r_2_c </td><td>celsius</td></tr>"; $r_2_k = $r_2_c + 273.15; print "<tr><td>$r_2_k</td><td>kelvin</td></tr></table>"; } } else //print an error message if input is NULL or NaN echo "<span style = \"color:red\">*Please Enter a Valid Temperature.</span>"; } ?> <p> <a href="http://www.goatella.com">Goatella's Home Page</a><p> <a href="https://github.com/Goatella/PHPTemperatureConversion">This Project on GitHub</a>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง