아놔...............

왜 아무리 찾아도 한글로는 자료가 없는거냐....

내가 진짜. 뽝쳐서...

지금은 제대로 이해를 못했지만 셤 끝나면 찾아서 뷰로 발행하고 만다. 진짜....

아놔!


아놔... 길을 길게 그리고 잘~ 쓰고 싶지만 그러면 시간이 너무 소요되므로 그냥 쓴다. 

나도 종종 블로그를 통해서 도움을 받기에 혹여나 한명이라도 도움을 받는다면 그걸로 오케이

php랑 html이랑 연결이라....

여튼 php가 html안에서 돌아갈 수 있다는건 알았다 

근데 이걸 한 페이지에서 정보를 넣으면 어떻게 다음 페이지로 넘어가는건지 되지가 않는거다. 

하아 진짜. 하루 날렸다. 그래서 빡친김에 그냥 글이나 쓰고 있다. 뭐래 여튼...'

아래는 html 파일이다. 파란색이 핵심인거다. ,<body>부분부터 보면된다.




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>무제 문서</title>

</head>

<body>


야 방갑다. 왔냐? ㅋㅋㅋㅋ<br />

아래다가 니 이름을 써라 ㅋㅋ <br />

<form method="post" action="http://localhost/PlayDB/practice.php">


<input type = "text"  name="idx2"  >

<input type = "submit" value = "check" >

<input type = "reset" value = "reset" >


</form>

</body>

</html>





한글로 쓴거는 그냥 알림이다. 이건 html로 된거다.


파란색이 form 부분인데 어떤 "틀"을 만들어 주는거다. 여기서 이 "틀"은 POST라는 방식을 사용한다.(뭔지는 아래가서 보자) 또 action을 행동인데, 이게 "틀"에 뭔가 채워 넣은후에 행동하는거다. 여기서 행동은 여기 이상하고 긴 주소에 있는 곳으로 가라는거다. http://localhost/                                           PlayDB/practice.php

앞부분은 웹서버(아파치)의 기본 폴더,                 여기부분은 그 폴더안에서 우리가 실행하고자 하는 파일의 위치를 자세히 알려준다. 

결론 - PlayDB 폴더에 가서 practice.php를 실행하라고 이자식아!!


input type은 여러가지가 있는데 그중에 text는 그냥 글 한줄 넣겠다는 의미다. 별거 아니다. 

그리고 name이 idx2 인데 그냥 보통 id 대신에 idx라고 많이 쓴단다. 2는 왜 있을까? 1이 실패했으니까 2겠지 ㅠㅠ ㅅㅂ...

여튼 근데 이게 중요한듯 하다. 왜냐면 니가 입력한 그 글한줄 의 이름이 바로 idx2가 된다. 썅따옴표 기억해라. 두번해라... (ㅠㅠ 난 그냥 운다.)

여튼 그 아래 submit은 버튼 만들어준다. value는 그 버튼 표면에 적히는 이름이다. (포장지 같은거지 머. 키보드자판에 한글이 인쇄된거랑 비슷하다)

음 그리고 reset은 그 한줄을 지워버리는거다. 별거아님 value는 같은 의미고,


 여기서 잠깐.

아까 미룬 POST한번 보자. 이건 그냥 어떤 정보를 전달하는 방식이다. GET과 POST두개가 있다. get이 빠른데 보안이 약하다. 그니까 그냥 post 써라. 초보면 이것만 알자. 나도 이것만 안다. 쉽지? ㅋㅋㅋㅋ

그래서 post는 내가 아래서 입력받은 그 한줄을 idx2라는 이름에 넣는다. 그리고 그걸 가지고 php파일에 넘겨주는 역할을 한다. 

다시 말하면 임시저장창고 같은거다. 파일과 파일 사이를 연결해주는 거. 이사갈때 잠깐 이삿짐 자동차에다가 짐 싣자나? 비슷한거다. 포장 방식이 post냐 get이냐 차이일뿐.

자 이제 php 보자. 노란색이 핵심이다. </head> 윗 부분은 드림위버 cs6에서 자동으로 만들어준거다. 별거 아니다. 모르면 걍 쌩까자.


<practice.php> 파일


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>무제 문서</title>

</head>


<body>

<?php


echo "hellooooooooooooooooo<br>";

$idx = $_POST["idx2"];


echo "니 이름이... $idx 이냐?<br>";

?>

</body>

</html>


이것이 바로 php파일의 모습이다. 이거 실행하려면 웹서버 켜라. 그게 모징? 먹는거임? 이러면 amp에 대해서 찾아보고 다운 받아라. amp에 아파치가 있는게 이게 니 컴퓨터가 웹서버도 될수 있게 해준단다. 여튼 각설하고


<?php  요 아래가 php 내용 부분이데 신기한거는 이거다.

$idx = $_POST["idx2"];

아놔 진짜 개빡쳐서.......

이거 그냥 하면 된다. ..... 요즘에는 포스트로 넘어오는 값들은 저렇게 넘겨준단다 그냥 외우면 됨.


$_POST["어쩌구"] ==> 이게 정보를 담는 그릇이다.

"idx2" ==> 쌍타옴표 잊지마라 두번 확인해라 내가 바보된 이유다...

$idx   ==> 이거는 정보(그 한줄)를 담는 새 이름이다. 그래서 받아온 정보는 여기다가 저장한다. 


그러면 아래에서 $idx를 변수로 사용할 수 있다. 


뭔말인지 모르겠나? 그러면 방명록에 남기든 메일을 보내든 해라 아는데까지 도와준다.

근데 알다시피 나도 모른다. ㅋㅋㅋㅋ

도움이 되셨나요?^^

내가 이대로 했는데 됐음!! ㅋㅋㅋㅋ 오 신기방기 ㅋㅋㅋ

찾은 내가 신기 ㅋㅋㅋㅋ


제어판, 장치관리자 - 거기보면 usb 연결 나와 있음 노란색으로 경고표시 뜰꺼임 ㅋㅋ

우클릭 - 드라이버 업데이트 선택

새로운 팝업이 뜨면 Browse My Computer for driver software ( 대충 내장치에서 찾기 ) 뭐 이정도 ㅋㅋ

다음 클릭, 그담에 아래쪽에 (내가 찾기??) 뭐 이딴거 찾음 ㅋㅋ

장치타입을 고르라고 하는데

아래로 내려가서 Network Adapters. 이거 고름

그담에 제조사 고르라고 하는데 Microsoft 생까고  Microsoft Corporation. 를 고르라고함(이건 윈7 버전이고 8은 Microsoft 밖에 없으므로 걍 이거 고름)

거기서 옆칸을 보면 Remote NDIS based Internet Sharing Device.를 찾아서 선택

다음 클릭!! 안전하지 않다고 ㅈㄹㅈㄹ 하는데 무시하고 걍 설치 끝!!


아근데 핸드폰에는 연결표시랑 디버그 표시 뜨는데 컴터에서는 인식이 안됨 ㅠㅠㅠㅠ 왠지 아시면 좀 도움좀 ㅠㅠ




이것은 원문 ㅋㅋ

Dude, go to your device manager.
Find the Device with the little ? and then maybe a yellow !.
Right click that device and select Update Driver. 
When the window pops up (on Windows 7 32bit), select, Browse My Computer for driver software, then on the next screen, click on the bottom that says, LET ME PICK. 
Then it will ask you the device type. 
Here you go down to Network Adapters. 
Then when it asks you to select manufacturer, skip Microsoft and select Microsoft Corporation. 
Then, select Remote NDIS based Internet Sharing Device.
Hit next, it will say it's not safe, etc etc, proceed to install it. 




This is the text of the Commencement address by Steve Jobs, CEO of Apple Computer and of Pixar Animation Studios, delivered on June 12, 2005.


I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I've ever gotten to a college graduation. Today I want to tell you three stories from my life. That's it. No big deal. Just three stories.


The first story is about connecting the dots.


I dropped out of Reed College after the first 6 months, but then stayed around as a drop-in for another 18 months or so before I really quit. So why did I drop out?


It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting list, got a call in the middle of the night asking: "We have an unexpected baby boy; do you want him?" They said: "Of course." My biological mother later found out that my mother had never graduated from college and that my father had never graduated from high school. She refused to sign the final adoption papers. She only relented a few months later when my parents promised that I would someday go to college.


And 17 years later I did go to college. But I naively chose a college that was almost as expensive as Stanford, and all of my working-class parents' savings were being spent on my college tuition. After six months, I couldn't see the value in it. I had no idea what I wanted to do with my life and no idea how college was going to help me figure it out. And here I was spending all of the money my parents had saved their entire life. So I decided to drop out and trust that it would all work out OK. It was pretty scary at the time, but looking back it was one of the best decisions I ever made. The minute I dropped out I could stop taking the required classes that didn't interest me, and begin dropping in on the ones that looked interesting.


It wasn't all romantic. I didn't have a dorm room, so I slept on the floor in friends' rooms, I returned coke bottles for the 5¢ deposits to buy food with, and I would walk the 7 miles across town every Sunday night to get one good meal a week at the Hare Krishna temple. I loved it. And much of what I stumbled into by following my curiosity and intuition turned out to be priceless later on. Let me give you one example:


Reed College at that time offered perhaps the best calligraphy instruction in the country. Throughout the campus every poster, every label on every drawer, was beautifully hand calligraphed. Because I had dropped out and didn't have to take the normal classes, I decided to take a calligraphy class to learn how to do this. I learned about serif and san serif typefaces, about varying the amount of space between different letter combinations, about what makes great typography great. It was beautiful, historical, artistically subtle in a way that science can't capture, and I found it fascinating.


None of this had even a hope of any practical application in my life. But ten years later, when we were designing the first Macintosh computer, it all came back to me. And we designed it all into the Mac. It was the first computer with beautiful typography. If I had never dropped in on that single course in college, the Mac would have never had multiple typefaces or proportionally spaced fonts. And since Windows just copied the Mac, its likely that no personal computer would have them. If I had never dropped out, I would have never dropped in on this calligraphy class, and personal computers might not have the wonderful typography that they do. Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later.


Again, you can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something — your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.


My second story is about love and loss.


I was lucky — I found what I loved to do early in life. Woz and I started Apple in my parents garage when I was 20. We worked hard, and in 10 years Apple had grown from just the two of us in a garage into a $2 billion company with over 4000 employees. We had just released our finest creation — the Macintosh — a year earlier, and I had just turned 30. And then I got fired. How can you get fired from a company you started? Well, as Apple grew we hired someone who I thought was very talented to run the company with me, and for the first year or so things went well. But then our visions of the future began to diverge and eventually we had a falling out. When we did, our Board of Directors sided with him. So at 30 I was out. And very publicly out. What had been the focus of my entire adult life was gone, and it was devastating.


I really didn't know what to do for a few months. I felt that I had let the previous generation of entrepreneurs down - that I had dropped the baton as it was being passed to me. I met with David Packard and Bob Noyce and tried to apologize for screwing up so badly. I was a very public failure, and I even thought about running away from the valley. But something slowly began to dawn on me — I still loved what I did. The turn of events at Apple had not changed that one bit. I had been rejected, but I was still in love. And so I decided to start over.


I didn't see it then, but it turned out that getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life.


During the next five years, I started a company named NeXT, another company named Pixar, and fell in love with an amazing woman who would become my wife. Pixar went on to create the worlds first computer animated feature film, Toy Story, and is now the most successful animation studio in the world. In a remarkable turn of events, Apple bought NeXT, I returned to Apple, and the technology we developed at NeXT is at the heart of Apple's current renaissance. And Laurene and I have a wonderful family together.


I'm pretty sure none of this would have happened if I hadn't been fired from Apple. It was awful tasting medicine, but I guess the patient needed it. Sometimes life hits you in the head with a brick. Don't lose faith. I'm convinced that the only thing that kept me going was that I loved what I did. You've got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.


My third story is about death.


When I was 17, I read a quote that went something like: "If you live each day as if it was your last, someday you'll most certainly be right." It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: "If today were the last day of my life, would I want to do what I am about to do today?" And whenever the answer has been "No" for too many days in a row, I know I need to change something.


Remembering that I'll be dead soon is the most important tool I've ever encountered to help me make the big choices in life. Because almost everything — all external expectations, all pride, all fear of embarrassment or failure - these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.


About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the morning, and it clearly showed a tumor on my pancreas. I didn't even know what a pancreas was. The doctors told me this was almost certainly a type of cancer that is incurable, and that I should expect to live no longer than three to six months. My doctor advised me to go home and get my affairs in order, which is doctor's code for prepare to die. It means to try to tell your kids everything you thought you'd have the next 10 years to tell them in just a few months. It means to make sure everything is buttoned up so that it will be as easy as possible for your family. It means to say your goodbyes.


I lived with that diagnosis all day. Later that evening I had a biopsy, where they stuck an endoscope down my throat, through my stomach and into my intestines, put a needle into my pancreas and got a few cells from the tumor. I was sedated, but my wife, who was there, told me that when they viewed the cells under a microscope the doctors started crying because it turned out to be a very rare form of pancreatic cancer that is curable with surgery. I had the surgery and I'm fine now.


This was the closest I've been to facing death, and I hope its the closest I get for a few more decades. Having lived through it, I can now say this to you with a bit more certainty than when death was a useful but purely intellectual concept:


No one wants to die. Even people who want to go to heaven don't want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life's change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.


Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma — which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.


When I was young, there was an amazing publication called The Whole Earth Catalog, which was one of the bibles of my generation. It was created by a fellow named Stewart Brand not far from here in Menlo Park, and he brought it to life with his poetic touch. This was in the late 1960's, before personal computers and desktop publishing, so it was all made with typewriters, scissors, and polaroid cameras. It was sort of like Google in paperback form, 35 years before Google came along: it was idealistic, and overflowing with neat tools and great notions.


Stewart and his team put out several issues of The Whole Earth Catalog, and then when it had run its course, they put out a final issue. It was the mid-1970s, and I was your age. On the back cover of their final issue was a photograph of an early morning country road, the kind you might find yourself hitchhiking on if you were so adventurous. Beneath it were the words: "Stay Hungry. Stay Foolish." It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.


Stay Hungry. Stay Foolish.


Thank you all very much.

무언가를 동적할당을 받을때...

할당을 free로 하기전까진 동적할당 받은 메모리가 잡혀 있으니까..

그 할당받은 내용을 함수 내외부에서 모두 사용가능한 건가?

주소만 함수에 잘 넘겨주면?


그렇다면... 함수에서 동적할당한 것들은?

굳이 외부에서 다시 불러오지 않아도 main 함수나 다른 함수에서 재사용이 가능한건가??


음냐....... 나중에 찾아봐야지


----------------------------------

다시 생각해보니

주소값만 잘 주고 받을수 있으면 아무곳에서나 접근 가능한듯.. 

서로 주소를 주고 받을 수 있어야 하므로 함수의 안인지 밖인지는 중요치 않을듯..


주소만 잘주면 됨!!!

+ Recent posts