Benutzer-Werkzeuge

Webseiten-Werkzeuge


networking

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
networking [2014/10/31 21:14] karlnetworking [2018/03/26 00:44] (aktuell) – [php.ini] karl
Zeile 10: Zeile 10:
 {{:sockettest:screenshot-udp.png?direct&200|}} {{:sockettest:screenshot-udp.png?direct&200|}}
  
-==== Fiddler Web Debugger ====+===== Fiddler Web Debugger ====
 +31.10.2014\\
 http://www.telerik.com/fiddler \\ http://www.telerik.com/fiddler \\
 Seems to be a quite useful tool for having a look on the web traffic.  Seems to be a quite useful tool for having a look on the web traffic. 
 +
 +===== HTTP GET vs. POST =====
 +1.11.2014\\
 +Let's have a look at this simple HTML code:
 +  <html><body>
 +  <h3>Leave a comment:</h3>
 +  <form name="formExample1" action="http://localhost:8080/process.php" method="post">
 +  Name: <br> <input type="text" name="name" value="Jon Doe"> <br>
 +  Rating: <br>
 +  <input type="radio" name="rating" value="1" > 1
 +  <input type="radio" name="rating" value="2" checked="true"> 2
 +  <input type="radio" name="rating" value="3"> 3 <br>
 +  Comment: <br> <textarea name="comment">enter comments here ...</textarea> <br><br>
 +  <input type="submit" value="Submit Comment">
 +  </form>
 +  </body></html>
 +
 +It looks like this in the browser: \\
 +{{networking:form-screenshot.png?direct&200|}}
 +
 +I set up a local TCP-server with [[#SocketTest]] on port 8080. I open the html-file above in my browser, and click submit. What the server receives is:
 +  POST /process.php HTTP/1.1
 +  Host: localhost:8080
 +  User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
 +  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 +  Accept-Language: en-US,en;q=0.5
 +  Accept-Encoding: gzip, deflate
 +  Connection: keep-alive
 +  Content-Type: application/x-www-form-urlencoded
 +  Content-Length: 53
 +  
 +  name=Jon+Doe&rating=2&comment=enter+comments+here+...
 +
 +As we see, we get all the input-fields (name-value-pairs), which are defined in the form. The data is transmitted in the HTTP-message-body. This is, because we used the **method="post"**.\\
 +When we use **method="get"**, the server receives folloing message:
 +  GET /process.php?name=Jon+Doe&rating=2&comment=enter+comments+here+... HTTP/1.1
 +  Host: localhost:8080
 +  User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
 +  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 +  Accept-Language: en-US,en;q=0.5
 +  Accept-Encoding: gzip, deflate
 +  Connection: keep-alive
 +  
 +
 +As we can see now, all the name-value-pairs are transmitted in the HTTP-message-header, and the message has no body. 
 +
 +A HTTP request header ends with an empty line. The new line characters are <CR><LF>, as used in the Windows-world. 
 +
 +===== nmap =====
 +check accessible ports on a computer in the network or on the internet:
 +  nmap -A zeilhofer.co.at
 +
 +===== Learning HTML =====
 +http://www.simplehtmlguide.com\\
 +[[https://www.youtube.com/watch?v=bWPMSSsVdPk|Youtube: Learn HTML in 12 Minutes]]\\
 +[[https://www.youtube.com/watch?v=KJ13lX20FqU|Youtube: Learn more HTML in 12 Minuts]]
 +[[http://library.albany.edu/imc/pdf/HTML-XHTML_Tag_Sheet.pdf|HTML, XHTML and HTML5 Cheat Sheet as a PDF]]
 +
 +===== Learning PHP =====
 +I have created a printable version of "PHP Programming" on wikibooks.org\\
 +https://en.wikibooks.org/wiki/Wikibooks:Collections/PHP_Programming
 +
 +Here are links to my first PHP files:\\
 +http://www.zeilhofer.co.at/php_learning/helloworld.php \\
 +<file php helloworld.php>
 +<?php
 +
 +echo "Hello World!<br>";
 +
 +?>
 +</file>
 +
 +http://www.zeilhofer.co.at/php_learning/myfirstphpfile.php?relay1=5&relay2=7
 +<file php myfirstphpfile.php>
 +<?php
 +
 +echo "Hello World!<br>";
 +
 +// print unix time stamp (in seconds)
 +// append strings with dot
 +echo "unix time = ".time()."s<br>"; 
 +
 +// receive arguments form the url (webrequest):
 +
 +// declare variables:
 +$relay1 = $_REQUEST['relay1'];
 +$relay2 = $_REQUEST['relay2'];
 +
 +echo "relay1 = $relay1 and relay2 = $relay2";
 +?>
 +</file>
 +
 +
 +===== php.ini =====
 +
 +  diff /etc/php5/apache2/php.ini /usr/share/doc/php5-common/examples/php.ini-development
 +
 +If this command returns nothing, then your PHP uses dev configuration.
 +
 +  diff /etc/php5/apache2/php.ini /usr/share/php5/php.ini-production
 +
 +If this command returns nothing your PHP uses production configuration.
 +
 +If you want to use dev configuration,
 +
 +  sudo cp /usr/share/doc/php5-common/examples/php.ini-development /etc/php5/apache2/php.ini
 +
 +If you want to use production configuration,
 +
 +  sudo cp /usr/share/php5/php.ini-production /etc/php5/apache2/php.ini
 +  
 +  
 +{{tag>software english web programming}}
 +
networking.1414786485.txt.gz · Zuletzt geändert: 2014/10/31 21:14 von karl