Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHPµ÷ÓÃϵͳÃüÁîÐÞ¸ÄIP,netmask,gateway,mac,dns

ip_contrl.php:
<?php
 //include('header.php');
 
 $ipaddr = $_POST['ipaddr'];
 $netmask = $_POST['netmask'];
 $gateway = $_POST['gateway'];
 $mac = $_POST['mac'];
 $dns1 = $_POST['dns1'];
 $dns2 = $_POST['dns2'];
 //echo "ipaddr=$ipaddr;netmask=$netmask<br>";
 
 if( $ipaddr && $netmask && $gateway && $mac && $dns1 && $dns2 )
 {
  system("./ip/changeip 1 $ipaddr $netmask $gateway $mac $dns1 $dns2");
  
  echo "<script type='text/javascript'>
    alert( 'ÍøÂçÅäÖóɹ¦£¡' );
    window.location.href = 'service_manage.php?id=2';
     </script>";
 }
 else
 {
  exec("ifconfig eth0", $res);
  
  $str = explode( "HWaddr ",$res[0] );
  $macaddr = $str[1];    //macµØÖ·
  //echo "str[1]=".$str[1]."<br>";  
  
  $s = explode( "addr:",$res[1] );  
  $s1 = explode( "  Bcast:",$s[1] );
  $ipaddr = $s1[0];  //ipµØÖ·
  //echo "s1[0]=".$s1[0]."<br>";
  $s2 = explode( "Mask:",$s1[1] );
  $netmask = $s2[1];  //×ÓÍøÑÚÂë
  //echo "s2[1]=".$s2[1]."<br>";
 }
?>
<script language="javascript">
function checkFormData()
{
   if ( form1.ipaddr.value == "")
 {
  alert ( "IPµØÖ·²»ÄÜΪ¿Õ£¡" );
  form1.ipaddr.focus();
  return false;
 } 
 if ( form1.ipaddr.value.search (".*?((25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d).*?") != 0 )
 {
  alert ( "IP¸ñʽ²»ÕýÈ·£¡" );  
  form1.ipaddr.focus();
  return false; 
   }
 
 if ( form1.netmask.value


Ïà¹ØÎĵµ£º

PHP½Ì³Ì ³õѧÕ߱ؿ´µÄPHP´úÂë


¾­µäÑ­»·Àý×Ó
<HTML>
<HEAD>
<TITLE>¾­µäÑ­»·Àý×Ó</TITLE>
</HEAD>
<BODY>
<?
    for($counter = 1; $counter <= 6; $counter++) 
      //Ñ­»·6´Î
    {
        print("<B& ......

PHP ¸ßЧÂÊд·¨ PHP³õѧÕ߱ؿ´

1¡¢Èç¹ûÄܽ«ÀàµÄ·½·¨¶¨Òå³Éstatic£¬¾Í¾¡Á¿¶¨Òå³Éstatic£¬ËüµÄËٶȻáÌáÉý½«½ü4±¶¡£
2¡¢$row['id'] µÄËÙ¶ÈÊÇ$row[id]µÄ7±¶¡£
3¡¢echo ±È print ¿ì£¬²¢ÇÒʹÓÃechoµÄ¶àÖزÎÊý(Òë×¢£ºÖ¸ÓöººÅ¶ø²»ÊǾäµã)´úÌæ×Ö·û´®Á¬½Ó£¬±ÈÈçecho $str1,$str2¡£
4¡¢×îºÃʹÓÃForeachÖ´ÐÐÑ­»·£¬ÔÚÖ´ÐÐforÑ­»·Ö®Ç°È·¶¨×î´óÑ­»·Êý£¬²»ÒªÃ¿Ñ­»·Ò»´ ......

PHP ·µ»ØÖµ

Àý×Ó. return() º¯ÊýµÄÓ÷¨
<?php
function square ($num)
{
    return $num * $num;
}
echo square (4);   // outputs '16'.
?>
º¯Êý²»ÄÜ·µ»Ø¶à¸öÖµ£¬µ«ÎªÁË»ñµÃ¼òµ¥µÄ½á¹û£¬¿ÉÒÔ·µ»ØÒ»¸öÁÐ±í¡£
Àý×Ó. ·µ»ØÒ»¸öÊý×éÒԵõ½¶à¸ö·µ»ØÖµ
<?php
function small_numbe ......

PHP·Ö¸îtextareaת»ØµÄÊý¾Ý

¼ÙÈçÒ»¸ötextareaÖÐÓÐN¶àÐеÄÊý¾Ý,Òª½«ËüתΪPHPµÄһάÊý×é,
 <form id="textarea_test" action="textarea.php" method="post">
<textarea cols="50" rows="5" name="aa" id="abc" >

<?php
$str = $_POST['aa'];
//var_dump($str);
//$str = "chenjinle le";
$array = explode("\n", trim($ ......

»ñµÃphpËù¶ÔÓ¦µÄÅäÖÃÎļþ(php.ini)ÐÅÏ¢

[root@BIND9-master /usr/local/bin]# php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File:         /usr/local/Zend/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:  &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ