無料スクリプト配布のPHP.TO   PHPの実用的なtips PHPマニュアル MySQLマニュアル Apacheマニュアル PostgreSQLマニュアル マニュアル検索    
無料スクリプト配布のPHP.TO   PHPの実用的なtips PHPマニュアル MySQLマニュアル Apacheマニュアル PostgreSQLマニュアル マニュアル検索    

PHP HTML

PHP HTML ????PHP HTML HTML ? PHP ????? ? FAQ ??? ????????? ??????????? register_globals ??? ???

??? URL ????? ?/??????

???????? string $data ? ?????????????

  • HTML ??? ??????????? ?? htmlspecialchars ? ?????????

  • URL ??: URL ??? ??????? urlencode() ?? ???

1 HTML hidden

<?php
    
echo '<input type="hidden" value="' htmlspecialchars($data) . '" />'."\n";
?>

: $data urlencode() ?? ????????????? ????????? ??(GET POST)??? ??????? GET ???????? POST ??????????

2 ???

<?php
    
echo "<textarea name='mydata'>\n";
    echo 
htmlspecialchars($data)."\n";
    echo 
"</textarea>";
?>

: ????????data ????? ????GET POST ? data ??? URL ???PHP ? URL ??? ??URL ?/????????? ????????

3 URL

<?php
    
echo '<a href="' htmlspecialchars("/nextpage.php?stage=23&data=" .
        
urlencode($data)) . '">'."\n";
?>

: ?? GET ?????data ? urlencode() ???

: ? URL htmlspecialchars() ??? ?? URL HTML value ???? ????? htmlspecialchars() ? ???? URL ??URL urlencode() ??PHP ? ????? URL & &amp; ?????????? ???????????? ??URL ????? URL htmlspecialchars() ? ?

<input type="image"> ????? $foo.x $foo.y ???????

??????? ??????

<input type="image" src="image.gif" name="foo" />
?????? foo.x foo.y ? 2 ?????

PHP ? $foo.x $foo.y ??????? ? $foo_x $foo_y ????????? ?????? ???? ?? ??????? ??? $_GET['foo_x'] ???

:

???????

HTML ???????

?? PHP ??????? <input><select> ? <textarea> ?? name ????

<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyArray[]" />
?????????? ?????????? ????????
<input name="MyArray[]" />
<input name="MyArray[]" />
<input name="MyOtherArray[]" />
<input name="MyOtherArray[]" />
HTML ?MyArray MyOtherArray ? 2 ? PHP ?????? ???
<input name="AnotherArray[]" />
<input name="AnotherArray[]" />
<input name="AnotherArray[email]" />
<input name="AnotherArray[phone]" />
? AnotherArray 01email phone ???

:

HTML ???????? ????????? 0123 ???

? ?? ??

"select multiple" ????? ????

"select multiple" ??????? ???????????? action ????????? ????????

<select name="var" multiple="yes">
???? action ?????
var=option1
var=option2
var=option3
      
??? $var ?? ????PHP "???" ????????
<select name="var[]" multiple="yes">
PHP $var ?? ????? value ??? var[] ???? $var[0] ??? ? $var[1]... ???? count() ?????? ???????? sort() ? ???????

JavaScript ???????( document.myform.myelement.value ?)?? ???? [] ???? ????? ID ?????????? ????????

variable = document.forms[0].elements['var[]'];
      

Javascript PHP ????

Javascript ?????????? PHP ??? ???? HTTP "???"??? ??????????

????????? ? PHP ? Javascript ? ????????????? ?????PHP ?????? ??????????

4 PHP ? Javascript

<?php
if (isset($_GET['width']) AND isset($_GET['height'])) {
  
// ???
  
echo "?: "$_GET['width'] ."<br />\n";
  echo 
"??: "$_GET['height'] ."<br />\n";
} else {
  
// ???
  // (??
  //   -- POST ??????)

  
echo "<script language='javascript'>\n";
  echo 
"  location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"
            
"&width=\" + screen.width + \"&height=\" + screen.height;\n";
  echo 
"</script>\n";
  exit();
}
?>



powered by SEO.CUG.NET


powered by SEO.CUG.NET