'Programming'에 해당되는 글 1721건

  1. 2017.01.25 php $_REQUEST
  2. 2017.01.23 php global
  3. 2017.01.18 html+php login form
  4. 2017.01.16 xdebug - php debug / profiler
  5. 2017.01.16 php 암호 해싱
  6. 2017.01.15 php sprintf
  7. 2017.01.14 div slide 애니메이션
  8. 2017.01.14 php array to table
  9. 2017.01.09 php <?=$var>
  10. 2017.01.09 PHP 최적화 관련
Programming/php2017. 1. 25. 18:14

An associative array that by default contains the contents of $_GET, $_POST and $_COOKIE.

[링크 : http://php.net/manual/en/reserved.variables.request.php]


간단하게 post와 get으로 받은거 구분없이 사용하는 변수

[링크 : http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=251801]

[링크 : http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=forum&wr_id=115415]



+

get / post / cookie에 대해서 적용되고

[링크 : http://php.net/manual/en/reserved.variables.request.php]


Sets the order of the EGPCS (Environment, Get, Post, Cookie, and Server) variable parsing. 

[링크 : http://php.net/manual/en/ini.core.php#ini.variables-order]


변수 우선순위에 의해서 Get이 우선권을 가질 듯?

request_order GP 인데..

이경우에는 Get와 Post만 파싱하는건가?


$ vi /etc/php5/apache2/php.ini

; This directive determines which super global data (G,P & C) should be

; registered into the super global array REQUEST. If so, it also determines

; the order in which that data is registered. The values for this directive

; are specified in the same manner as the variables_order directive,

; EXCEPT one. Leaving this value empty will cause PHP to use the value set

; in the variables_order directive. It does not mean it will leave the super

; globals array REQUEST empty.

; Default Value: None

; Development Value: "GP"

; Production Value: "GP"

; http://php.net/request-order

request_order = "GP" 


'Programming > php' 카테고리의 다른 글

php zend guard ?  (2) 2017.03.14
php -> exe (윈도우)  (0) 2017.03.14
php global  (0) 2017.01.23
html+php login form  (0) 2017.01.18
xdebug - php debug / profiler  (0) 2017.01.16
Posted by 구차니
Programming/php2017. 1. 23. 16:36

접근제어 키워드 라고 해야하나.

함수 내에서 전역변수를 '간편하게' 이용하려면

global $gbal;

이런식으로 선언해주면 $GLOBALS['gbal'] 이런 수고수러움을 해주지 않아도 되는 듯?


[링크 : http://devist.tistory.com/65]


<?php
$a 1;
$b 2;

function 
Sum()
{
    global 
$a$b;

    
$b $a $b;


Sum();
echo 
$b;

?> 


[링크 : http://php.net/manual/en/language.variables.scope.php]



+

그래서.. mantis 소스에서 환경변수로 끌어온 다른 파일의 변수를 그냥 쓴건가...


+

mediawiki는 곳곳에 global 키워드가 보이네... mantis는 머지?

'Programming > php' 카테고리의 다른 글

php -> exe (윈도우)  (0) 2017.03.14
php $_REQUEST  (0) 2017.01.25
html+php login form  (0) 2017.01.18
xdebug - php debug / profiler  (0) 2017.01.16
php 암호 해싱  (0) 2017.01.16
Posted by 구차니
Programming/php2017. 1. 18. 19:11

직접 타이핑 해서 만든건 처음이군..

일단 post와 get 방식으로 테스트를 하게 되었는데..


<form> 은 method를 지정해주지 않으면 기본값이 get 이기 때문에

method="post"를 넣어 주어야 POST 부분에 출력이 되어 나온다.


php에서 echo . 으로 잇는것도 첨 써보는군 ㅋㅋ

 <?php

        include('./conf.php');


        echo "<pre>";

        echo "POST<br>";

        echo $_POST['id'].":".$_POST['pw'];


        echo "<br>GET<br>";

        echo $_GET['id'].":".$_GET['pw'];

        echo "<pre>";

?>


<html>

<head>

<script src="./jquery-3.1.1.min.js"></script>

</head>

<body>

        <form method="post" action="login.php">

                <input type="text" name="id" />

                <input type="password" name="pw" />

                <button type="submit">login</button>

        </form>


</body>

</html>


[링크 : http://www.w3schools.com/howto/howto_css_login_form.asp]

[링크 : https://www.howtoforge.com/community/threads/simple-html-login-form.2895/]

'Programming > php' 카테고리의 다른 글

php $_REQUEST  (0) 2017.01.25
php global  (0) 2017.01.23
xdebug - php debug / profiler  (0) 2017.01.16
php 암호 해싱  (0) 2017.01.16
php sprintf  (0) 2017.01.15
Posted by 구차니
Programming/php2017. 1. 16. 18:23

문득 mediawiki 어디가 이렇게 버벅대나 한번 보려는데 검색을 해보니 xdebug라는 녀석이 있네

$ sudo apt-cache search xdebug

php5-xdebug - Xdebug Module for PHP 5 

[링크 : http://stackoverflow.com/questions/21133/simplest-way-to-profile-a-php-script]


우분투에서 설치하고(라즈베리) phpinfo로 보니 일단 비활성화

xdebug.profiler_aggregate Off Off

xdebug.profiler_append Off Off

xdebug.profiler_enable Off Off

xdebug.profiler_enable_trigger Off Off

xdebug.profiler_output_dir /tmp /tmp

xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p


kcachegrind를 깔기에는 KDE다 끌려올 기세라..

$ apt-cache search KCachegrind

kcachegrind - visualisation tool for the Valgrind profiler

kcachegrind-converters - format converters for KCachegrind profiler visualisation tool 


$ sudo vi /etc/php5/apache2/php.ini

[xdebug]

xdebug.profiler_enable = 1

xdebug.profiler_output_name = xdebug.out.%t

xdebug.profiler_output_dir = /tmp

xdebug.profiler_enable_trigger = 1

[링크 : https://www.sitepoint.com/debugging-and-profiling-php-with-xdebug/]


[링크 : https://code.google.com/archive/p/webgrind/]

[링크 : https://github.com/jokkedk/webgrind]


webgrind를 깔고 하는데 라즈베리 성능의 문제인지 한 5분은 거의 먹통...

아무튼 total inclusive cost 로 정렬을 해보니

라즈베리에서 mysql이 꽤나 느리긴 한지, database-query에서 꽤나 많은 시간을 잡아 먹는다.


+

2017.01.18

어라..? var_dump()를 했는데.. <pre> 태그에 xdebug 관련 내용이 추가되면서

밋밋하던 녀석이 갑자기 컬러풀해졌다?

<pre><pre class='xdebug-var-dump' dir='ltr'>
<b>array</b> <i>(size=4)</i>
0 <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=1)</i>
'Tables_in_archlog' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'article'</font> <i>(length=7)</i>
1 <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=1)</i>
'Tables_in_archlog' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'blobs'</font> <i>(length=5)</i>
2 <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=1)</i>
'Tables_in_archlog' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'reply'</font> <i>(length=5)</i>
3 <font color='#888a85'>=&gt;</font>
<b>array</b> <i>(size=1)</i>
'Tables_in_archlog' <font color='#888a85'>=&gt;</font> <small>string</small> <font color='#cc0000'>'user'</font> <i>(length=4)</i>
</pre></pre>


+

2017.01.19

xdebug가 var_dump를 교체해버린다고 한다.

[링크 : http://stackoverflow.com/questions/15666916/weird-var-dump-behavior]

'Programming > php' 카테고리의 다른 글

php global  (0) 2017.01.23
html+php login form  (0) 2017.01.18
php 암호 해싱  (0) 2017.01.16
php sprintf  (0) 2017.01.15
php array to table  (0) 2017.01.14
Posted by 구차니
Programming/php2017. 1. 16. 11:19

brcypt니 mcrypt니 왜 phpmyadmin에서 안뜨나 했더니

얘는 생각을 해보니 mysql에서 제공하는 암화화 방식...

그냥 php 에서 코드 짜서 암호화 하는거라 당연히.. phpmyadmin에서 뜰리가...

ㅠㅠ


[링크 : http://php.net/manual/kr/function.password-hash.php]

'Programming > php' 카테고리의 다른 글

html+php login form  (0) 2017.01.18
xdebug - php debug / profiler  (0) 2017.01.16
php sprintf  (0) 2017.01.15
php array to table  (0) 2017.01.14
php <?=$var>  (0) 2017.01.09
Posted by 구차니
Programming/php2017. 1. 15. 23:09

음.. 보다 보니 예전에 찾았던

posix sprintf의 %1$s가 떠오르네


[링크 : http://php.net/manual/en/function.sprintf.php]

2014/12/09 - [Programming/C / Win32 / MFC] - printf POSIX 확장 %1$d


'Programming > php' 카테고리의 다른 글

xdebug - php debug / profiler  (0) 2017.01.16
php 암호 해싱  (0) 2017.01.16
php array to table  (0) 2017.01.14
php <?=$var>  (0) 2017.01.09
PHP 최적화 관련  (0) 2017.01.09
Posted by 구차니
Posted by 구차니
Programming/php2017. 1. 14. 08:40

table은 별루니 div를 쓰라고 하지만..

그래도 table이 편할수도 있으니 php의 array로 변수를 넘겨받고

디자인 쪽에서는 간편하게 쓰려면 table 만한게 없을거 같긴한데...


[링크 : http://stackoverflow.com/questions/4746079/how-to-create-a-html-table-from-a-php-array]

[링크 : http://stackoverflow.com/questions/13284073/creating-a-table-with-mysql-php-and-ajax-with-jquery]


explode / implode

[링크 : http://sexy.pe.kr/tc/55]

'Programming > php' 카테고리의 다른 글

php 암호 해싱  (0) 2017.01.16
php sprintf  (0) 2017.01.15
php <?=$var>  (0) 2017.01.09
PHP 최적화 관련  (0) 2017.01.09
php 로그인 관련 - 세션  (0) 2017.01.06
Posted by 구차니
Programming/php2017. 1. 9. 11:28


PHP 5.6.29 / 라즈베리 

echo의 short form인데.. 

short_open_tag 가 off되어도 작동이 되네.. 신기해라...


<?=$var?>

<?php echo$var?>

[링크 : http://php.net/manual/en/function.echo.php]

'Programming > php' 카테고리의 다른 글

php sprintf  (0) 2017.01.15
php array to table  (0) 2017.01.14
PHP 최적화 관련  (0) 2017.01.09
php 로그인 관련 - 세션  (0) 2017.01.06
php pack / unpack  (0) 2017.01.04
Posted by 구차니
Programming/php2017. 1. 9. 11:10

echo랑 print의 차이점 찾다가 여기까지 흘러옴 .. ㄷㄷㄷ

[링크 : http://php.net/manual/kr/function.print.php]

[링크 : http://php.net/manual/kr/function.echo.php]


[링크 : http://blog.bloodcat.com/186]

'Programming > php' 카테고리의 다른 글

php array to table  (0) 2017.01.14
php <?=$var>  (0) 2017.01.09
php 로그인 관련 - 세션  (0) 2017.01.06
php pack / unpack  (0) 2017.01.04
php foreach / array  (0) 2017.01.03
Posted by 구차니