Guest User

WEB

a guest
Feb 10th, 2016
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 106.73 KB | None | 0 0
  1.  
  2. c:\users\lalikali\desktop\web\txt\addcslash.txt
  3. <---------------------------------------------------------------------->
  4. <!DOCTYPE html>
  5. <html>
  6. <body>
  7.  
  8. <?php
  9. $str = "Welcome to my humble Homepage!";
  10. echo $str."<br>";
  11. echo addcslashes($str,'A..Z')."<br>";
  12. echo addcslashes($str,'a..z')."<br>";
  13. echo addcslashes($str,'a..g');
  14. ?>
  15.  
  16. </body>
  17. </html>
  18.  
  19. Welcome to my humble Homepage!
  20. \Welcome to my humble \Homepage!
  21. W\e\l\c\o\m\e \t\o \m\y \h\u\m\b\l\e H\o\m\e\p\a\g\e!
  22. W\el\com\e to my hum\bl\e Hom\ep\a\g\e!
  23.  
  24.  
  25. c:\users\lalikali\desktop\web\txt\addslash.txt
  26. <---------------------------------------------------------------------->
  27. <!DOCTYPE html>
  28. <html>
  29. <body>
  30.  
  31. <?php
  32. $str = addslashes('What does "yolo" mean?');
  33. echo($str);
  34. ?>  
  35.  
  36. </body>
  37. </html>
  38.  
  39. Rezultati:What does \"yolo\" mean?
  40.  
  41.  
  42. c:\users\lalikali\desktop\web\txt\arsort.txt
  43. <---------------------------------------------------------------------->
  44. <!DOCTYPE html>
  45. <html>
  46. <body>
  47.  
  48. <?php
  49. $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
  50. arsort($age);
  51.  
  52. foreach($age as $x => $x_value) {
  53.      echo "Key=" . $x . ", Value=" . $x_value;
  54.      echo "<br>";
  55. }
  56. ?>
  57.  
  58. </body>
  59. </html>
  60.  
  61. Key=Joe, Value=43
  62. Key=Ben, Value=37
  63. Key=Peter, Value=35
  64.  
  65.  
  66. c:\users\lalikali\desktop\web\txt\asort.txt
  67. <---------------------------------------------------------------------->
  68. <!DOCTYPE html>
  69. <html>
  70. <body>
  71.  
  72. <?php
  73. $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
  74. asort($age);
  75.  
  76. foreach($age as $x => $x_value) {
  77.      echo "Key=" . $x . ", Value=" . $x_value;
  78.      echo "<br>";
  79. }
  80. ?>
  81.  
  82. </body>
  83. </html>
  84.  
  85. Key=Peter, Value=35
  86. Key=Ben, Value=37
  87. Key=Joe, Value=43
  88.  
  89.  
  90. c:\users\lalikali\desktop\web\txt\assignment.txt
  91. <---------------------------------------------------------------------->
  92. <!DOCTYPE html>
  93. <html>
  94. <body>
  95.  
  96. <h1>The += Operator</h1>
  97.  
  98. <p id="demo"></p>
  99.  
  100. <script>
  101. var x = 10;
  102. x += 5;
  103. document.getElementById("demo").innerHTML = x;
  104. </script>
  105.  
  106. </body>
  107. </html>
  108.  
  109.  
  110. c:\users\lalikali\desktop\web\txt\assignment2.txt
  111. <---------------------------------------------------------------------->
  112. <!DOCTYPE html>
  113. <html>
  114. <body>
  115.  
  116. <h1>JavaScript Operators</h1>
  117.  
  118. <p>The assignment operator += can concatenate strings.</p>
  119.  
  120. <p id="demo"></p>
  121.  
  122. <script>
  123. txt1 = "What a very ";
  124. txt1 += "nice day";
  125. document.getElementById("demo").innerHTML = txt1;
  126. </script>
  127.  
  128. </body>
  129. </html>
  130.  
  131.  
  132.  
  133. c:\users\lalikali\desktop\web\txt\assignment3.txt
  134. <---------------------------------------------------------------------->
  135. <!DOCTYPE html>
  136. <html>
  137. <body>
  138.  
  139. <h1>JavaScript Operators</h1>
  140.  
  141. <p>Adding a number and a string, returns a string.</p>
  142.  
  143. <p id="demo"></p>
  144.  
  145. <script>
  146. var x = 5 + 5;
  147. var y = "5" + 5;
  148. var z = "Hello" + 5;
  149. document.getElementById("demo").innerHTML =
  150. x + "<br>" + y + "<br>" + z;
  151. </script>
  152.  
  153. </body>
  154. </html>
  155.  
  156.  
  157. c:\users\lalikali\desktop\web\txt\attachments.txt
  158. <---------------------------------------------------------------------->
  159. <?php
  160.   // kerkojme ndryshoret // e rendesishme
  161.   $from = $_REQUEST["from"];
  162.   $emaila = $_REQUEST["emaila"];
  163.   $filea = $_REQUEST["filea"];
  164.  
  165.   if ($filea) {
  166.      function mail_attachment ($from , $to, $subject, $message, $attachment){
  167.         $fileatt = $attachment; // rruga e file-it
  168.         $fileatt_type = "application/octet-stream"; //lloji i file-it
  169.        
  170.         $start = strrpos($attachment, '/') == -1 ?
  171.            strrpos($attachment, '//') : strrpos($attachment, '/')+1;
  172.                
  173.         $fileatt_name = substr($attachment, $start,
  174.            strlen($attachment)); // emri i file-it qe do perdoret per file-in si attachment
  175.        
  176.         $email_from = $from; // kush e dergon emailin
  177.         $subject = "New Attachment Message";
  178.        
  179.         $email_subject =  $subject; // subjekti
  180.         $email_txt = $message; // mesazhi
  181.         $email_to = $to; // kujt i dergohet
  182.        
  183.         $headers = "From: ".$email_from;
  184.         $file = fopen($fileatt,'rb');
  185.         $data = fread($file,filesize($fileatt));
  186.         fclose($file);
  187.        
  188.         $msg_txt="\n\n You have recieved a new attachment message from $from";
  189.         $semi_rand = md5(time());
  190.         $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
  191.         $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . "
  192.            boundary=\"{$mime_boundary}\"";
  193.        
  194.         $email_txt .= $msg_txt;
  195.            
  196.         $email_message .= "This is a multi-part message in MIME format.\n\n" .
  197.            "--{$mime_boundary}\n" . "Content-Type:text/html;
  198.            charset = \"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" .
  199.            $email_txt . "\n\n";
  200.                
  201.         $data = chunk_split(base64_encode($data));
  202.        
  203.         $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" .
  204.            " name = \"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" .
  205.            //" filename = \"{$fileatt_name}\"\n" . "Content-Transfer-Encoding:
  206.            base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n";
  207.                
  208.         $ok = mail($email_to, $email_subject, $email_message, $headers);
  209.        
  210.         if($ok) {
  211.            echo "File Sent Successfully.";
  212.            unlink($attachment); // delete a file after attachment sent.
  213.         }else {
  214.            die("Sorry but the email could not be sent. Please go back and try again!");
  215.         }
  216.      }
  217.      move_uploaded_file($_FILES["filea"]["tmp_name"],
  218.         'temp/'.basename($_FILES['filea']['name']));
  219.            
  220.      mail_attachment("$from", "youremailaddress@gmail.com",
  221.         "subject", "message", ("temp/".$_FILES["filea"]["name"]));
  222.   }
  223. ?>
  224.  
  225. <html>
  226.    <head>
  227.      
  228.       <script language = "javascript" type = "text/javascript">
  229.          function CheckData45() {
  230.             with(document.filepost) {
  231.                if(filea.value ! = "") {
  232.                   document.getElementById('one').innerText =
  233.                      "Attaching File ... Please Wait";
  234.                }
  235.             }
  236.          }
  237.       </script>
  238.      
  239.    </head>
  240.    <body>
  241.      
  242.       <table width = "100%" height = "100%" border = "0"
  243.         cellpadding = "0" cellspacing = "0">
  244.          <tr>
  245.             <td align = "center">
  246.                <form name = "filepost" method = "post"
  247.                  action = "file.php" enctype = "multipart/form-data" id = "file">
  248.                  
  249.                   <table width = "300" border = "0" cellspacing = "0"
  250.                     cellpadding = "0">
  251.                            
  252.                      <tr valign = "bottom">
  253.                         <td height = "20">Your Name:</td>
  254.                      </tr>
  255.                      
  256.                      <tr>
  257.                         <td><input name = "from" type = "text"
  258.                           id = "from" size = "30"></td>
  259.                      </tr>
  260.                      
  261.                      <tr valign = "bottom">
  262.                         <td height = "20">Your Email Address:</td>
  263.                      </tr>
  264.                      
  265.                      <tr>
  266.                         <td class = "frmtxt2"><input name = "emaila"
  267.                           type = "text" id = "emaila" size = "30"></td>
  268.                      </tr>
  269.                      
  270.                      <tr>
  271.                         <td height = "20" valign = "bottom">Attach File:</td>
  272.                      </tr>
  273.                      
  274.                      <tr valign = "bottom">
  275.                         <td valign = "bottom"><input name = "filea"
  276.                           type = "file" id = "filea" size = "16"></td>
  277.                      </tr>
  278.                      
  279.                      <tr>
  280.                         <td height = "40" valign = "middle"><input
  281.                           name = "Reset2" type = "reset" id = "Reset2" value = "Reset">
  282.                         <input name = "Submit2" type = "submit"
  283.                           value = "Submit" onClick = "return CheckData45()"></td>
  284.                      </tr>
  285.                   </table>
  286.                  
  287.                </form>
  288.                
  289.                <center>
  290.                   <table width = "400">
  291.                      
  292.                      <tr>
  293.                         <td id = "one">
  294.                         </td>
  295.                      </tr>
  296.                      
  297.                   </table>
  298.                </center>
  299.                
  300.             </td>
  301.          </tr>
  302.       </table>
  303.      
  304.    </body>
  305. </html>
  306.  
  307.  
  308. c:\users\lalikali\desktop\web\txt\body.txt
  309. <---------------------------------------------------------------------->
  310. <!DOCTYPE html>
  311. <html>
  312. <body>
  313.  
  314. <h1>JavaScript in Body</h1>
  315.  
  316. <p id="demo">A Paragraph.</p>
  317.  
  318. <button type="button" onclick="myFunction()">Try it</button>
  319.  
  320. <script>
  321. function myFunction() {
  322.     document.getElementById("demo").innerHTML = "Paragraph changed.";
  323. }
  324. </script>
  325.  
  326. </body>
  327. </html>
  328.  
  329.  
  330. c:\users\lalikali\desktop\web\txt\border-spacing.txt
  331. <---------------------------------------------------------------------->
  332. <!DOCTYPE html>
  333. <html>
  334. <head>
  335. <style>
  336. table, th, td {
  337.     border: 1px solid black;
  338.     padding: 5px;
  339. }
  340. table {
  341.     border-spacing: 15px;
  342. }
  343. </style>
  344. </head>
  345. <body>
  346.  
  347. <table style="width:100%">
  348.   <tr>
  349.     <td>Jill</td>
  350.     <td>Smith</td>     
  351.     <td>50</td>
  352.   </tr>
  353.   <tr>
  354.     <td>Eve</td>
  355.     <td>Jackson</td>       
  356.     <td>94</td>
  357.   </tr>
  358.   <tr>
  359.     <td>John</td>
  360.     <td>Doe</td>       
  361.     <td>80</td>
  362.   </tr>
  363. </table>
  364.  
  365. <p>Try to change the border-spacing to 5px.</p>
  366.  
  367. </body>
  368. </html>
  369.  
  370.  
  371.  
  372. c:\users\lalikali\desktop\web\txt\break.txt
  373. <---------------------------------------------------------------------->
  374. <html>
  375.    <body>
  376.    
  377.       <?php
  378.         $i = 0;
  379.        
  380.         while( $i < 10)
  381.         {
  382.            $i++;
  383.            if( $i == 3 )break;
  384.         }
  385.         echo ("Loop stopped at i = $i" );
  386.      ?>
  387.    
  388.    </body>
  389. </html>
  390.  
  391.  
  392. c:\users\lalikali\desktop\web\txt\caption.txt
  393. <---------------------------------------------------------------------->
  394. <!DOCTYPE html>
  395. <html>
  396. <head>
  397. <style>
  398. table, th, td {
  399.     border: 1px solid black;
  400.     border-collapse: collapse;
  401. }
  402. th, td {
  403.     padding: 5px;
  404.     text-align: left;
  405. }
  406. </style>
  407. </head>
  408. <body>
  409.  
  410. <table style="width:100%">
  411.   <caption>Monthly savings</caption>
  412.   <tr>
  413.     <th>Month</th>
  414.     <th>Savings</th>
  415.   </tr>
  416.   <tr>
  417.     <td>January</td>
  418.     <td>$100</td>
  419.   </tr>
  420.   <tr>
  421.     <td>February</td>
  422.     <td>$50</td>
  423.   </tr>
  424. </table>
  425.  
  426. </body>
  427. </html>
  428.  
  429.  
  430. c:\users\lalikali\desktop\web\txt\charAt.txt
  431. <---------------------------------------------------------------------->
  432. <!DOCTYPE html>
  433. <html>
  434. <body>
  435.  
  436. <p>The charAt() method returns the character at a given position in a string:</p>
  437.  
  438. <p id="demo"></p>
  439.  
  440. <script>
  441. var str = "HELLO WORLD";
  442. document.getElementById("demo").innerHTML = str.charAt(0);
  443. </script>
  444. </body>
  445. </html>
  446.  
  447.  
  448.  
  449.  
  450. c:\users\lalikali\desktop\web\txt\chop.txt
  451. <---------------------------------------------------------------------->
  452. <!DOCTYPE html>
  453. <html>
  454. <body>
  455.  
  456. <?php
  457. $str = "Hello World!\n\n";
  458. echo $str;
  459. echo chop($str);
  460. ?>  
  461.  
  462. </body>
  463. </html>
  464.  
  465. Hello World! Hello World!
  466.  
  467.  
  468. c:\users\lalikali\desktop\web\txt\chunk_split.txt
  469. <---------------------------------------------------------------------->
  470. <!DOCTYPE html>
  471. <html>
  472. <body>
  473.  
  474. <?php
  475. $str = "Hello world!";
  476. echo chunk_split($str,1,".");
  477. ?>  
  478.  
  479. </body>
  480. </html>
  481.  
  482. Rez: H.e.l.l.o. .w.o.r.l.d.!.
  483.  
  484.  
  485. c:\users\lalikali\desktop\web\txt\colgroup.txt
  486. <---------------------------------------------------------------------->
  487. <!DOCTYPE html>
  488. <html>
  489. <head>
  490. <style>
  491. table, th, td {
  492.     border: 1px solid black;
  493. }
  494. </style>
  495. </head>
  496. <body>
  497.  
  498. <table>
  499.   <colgroup>
  500.     <col span="2" style="background-color:red">
  501.     <col style="background-color:yellow">
  502.   </colgroup>
  503.   <tr>
  504.     <th>ISBN</th>
  505.     <th>Title</th>
  506.     <th>Price</th>
  507.   </tr>
  508.   <tr>
  509.     <td>3476896</td>
  510.     <td>My first HTML</td>
  511.     <td>$53</td>
  512.   </tr>
  513.   <tr>
  514.     <td>5869207</td>
  515.     <td>My first CSS</td>
  516.     <td>$49</td>
  517.   </tr>
  518. </table>
  519.  
  520. </body>
  521. </html>
  522.  
  523.  
  524.  
  525. c:\users\lalikali\desktop\web\txt\concat.txt
  526. <---------------------------------------------------------------------->
  527. <!DOCTYPE html>
  528. <html>
  529. <body>
  530.  
  531. <p>The concat() method joins two or more strings:</p>
  532.  
  533. <p id="demo"></p>
  534.  
  535. <script>
  536. var text1 = "Hello";
  537. var text2 = "World!";
  538. document.getElementById("demo").innerHTML = text1.concat(" ",text2);
  539. </script>
  540.  
  541. </body>
  542. </html>
  543.  
  544.  
  545.  
  546. c:\users\lalikali\desktop\web\txt\console.txt
  547. <---------------------------------------------------------------------->
  548. <!DOCTYPE html>
  549. <html>
  550. <body>
  551.  
  552. <h1>My First Web Page</h1>
  553. <p>My first paragraph.</p>
  554.  
  555. <p>
  556. Activate debugging in your browser (Chrome, IE, Firefox) with F12, and select "Console" in the debugger menu.
  557. </p>
  558.  
  559. <script>
  560. console.log(5 + 6);
  561. </script>
  562.  
  563. </body>
  564. </html>
  565.  
  566.  
  567. c:\users\lalikali\desktop\web\txt\continue.txt
  568. <---------------------------------------------------------------------->
  569. <html>
  570.    <body>
  571.    
  572.       <?php
  573.         $array = array( 1, 2, 3, 4, 5);
  574.        
  575.         foreach( $array as $value )
  576.         {
  577.            if( $value == 3 )continue;
  578.            echo "Value is $value <br />";
  579.          }
  580.       ?>
  581.    
  582.    </body>
  583. </html>
  584. Value is 1
  585. Value is 2
  586. Value is 4
  587. Value is 5
  588.  
  589.  
  590. c:\users\lalikali\desktop\web\txt\ctype.txt
  591. <---------------------------------------------------------------------->
  592. <?php
  593. $strings = array('1820.20', '10002', 'wsl!12');
  594. foreach ($strings as $testcase) {
  595.    if (ctype_digit($testcase)) {
  596.        echo "The string $testcase consists of all digits.\n";
  597.    } else {
  598.        echo "The string $testcase does not consist of all digits.\n";
  599.    }
  600. }
  601. ?>
  602.  
  603. The string 1820.20 does not consist of all digits.
  604. The string 10002 consists of all digits.
  605. The string wsl!12 does not consist of all digits.
  606.  
  607. <?php
  608. $field = $_POST["field"];
  609. if(!ctype_digit($field)){
  610.  echo "It's not a digit";
  611. }
  612. ?>
  613.  
  614.  
  615. c:\users\lalikali\desktop\web\txt\debug.txt
  616. <---------------------------------------------------------------------->
  617. <!DOCTYPE html>
  618. <html>
  619. <body>
  620.  
  621. <h1>My First Web Page</h1>
  622. <p>My first paragraph.</p>
  623.  
  624. <p>
  625. Activate debugging in your browser (Chrome, IE, Firefox) with F12, and select "Console" in the debugger menu.
  626. </p>
  627.  
  628. <script>
  629. console.log(5 + 6);
  630. </script>
  631.  
  632. </body>
  633. </html>
  634.  
  635.  
  636. c:\users\lalikali\desktop\web\txt\dekrement.txt
  637. <---------------------------------------------------------------------->
  638. <!DOCTYPE html>
  639. <html>
  640. <body>
  641.  
  642. <h1>The -- Operator</h1>
  643.  
  644. <p id="demo"></p>
  645.  
  646. <script>
  647. var x = 5;
  648. x--;
  649. var z = x;
  650. document.getElementById("demo").innerHTML = z;
  651. </script>
  652.  
  653. </body>
  654. </html>
  655.  
  656.  
  657. c:\users\lalikali\desktop\web\txt\do_while.txt
  658. <---------------------------------------------------------------------->
  659. <html>
  660.    <body>
  661.    
  662.       <?php
  663.         $i = 0;
  664.         $num = 0;
  665.        
  666.         do{
  667.            $i++;
  668.         }
  669.        
  670.         while( $i < 10 );
  671.         echo ("Loop stopped at i = $i" );
  672.      ?>
  673.      
  674.    </body>
  675. </html>
  676. Loop stopped at i = 10
  677.  
  678.  
  679. c:\users\lalikali\desktop\web\txt\do+while.txt
  680. <---------------------------------------------------------------------->
  681. <!DOCTYPE html>
  682. <html>
  683. <body>
  684.  
  685. <p>Click the button to loop through a block of code as long as i is less than 10.</p>
  686.  
  687. <button onclick="myFunction()">Try it</button>
  688.  
  689. <p id="demo"></p>
  690.  
  691. <script>
  692. function myFunction() {
  693.     var text = ""
  694.     var i = 0;
  695.     do {
  696.         text += "<br>The number is " + i;
  697.         i++;
  698.     }
  699.     while (i < 10)  
  700.    document.getElementById("demo").innerHTML = text;
  701. }
  702. </script>
  703.  
  704. </body>
  705. </html>
  706.  
  707.  
  708. c:\users\lalikali\desktop\web\txt\else_if.txt
  709. <---------------------------------------------------------------------->
  710. <html>
  711.    <body>
  712.    
  713.       <?php
  714.         $d=date("D");
  715.        
  716.         if ($d=="Fri")
  717.            echo "Have a nice weekend!";
  718.        
  719.         elseif ($d=="Sun")
  720.            echo "Have a nice Sunday!";
  721.        
  722.         else
  723.            echo "Have a nice day!";
  724.      ?>
  725.      
  726.    </body>
  727. </html>
  728.  
  729.  
  730.  
  731.  
  732. c:\users\lalikali\desktop\web\txt\explode.txt
  733. <---------------------------------------------------------------------->
  734. <!DOCTYPE html>
  735. <html>
  736. <body>
  737.  
  738. <?php
  739. $str = "Hello world. It's a beautiful day.";
  740. print_r (explode(" ",$str));
  741. ?>  
  742.  
  743. </body>
  744. </html>
  745.  
  746. Array ( [0] => Hello [1] => world. [2] => Its [3] => a [4] => beautiful [5] => day. )())
  747.  
  748.  
  749.  
  750.  
  751. c:\users\lalikali\desktop\web\txt\external.txt
  752. <---------------------------------------------------------------------->
  753. <!DOCTYPE html>
  754. <html>
  755. <body>
  756.  
  757. <h1>External JavaScript</h1>
  758.  
  759. <p id="demo">A Paragraph.</p>
  760.  
  761. <button type="button" onclick="myFunction()">Try it</button>
  762.  
  763. <p><strong>Note:</strong> myFunction is stored in an external file called "myScript.js".</p>
  764.  
  765. <script src="myScript.js"></script>
  766.  
  767. </body>
  768. </html>
  769.  
  770.  
  771.  
  772. c:\users\lalikali\desktop\web\txt\file_plote_rekursiv.txt
  773. <---------------------------------------------------------------------->
  774. <!doctype html>
  775. <html lang="en">
  776. <head>
  777. <title>Rekursion: leximi i nje grupi skedaresh dhe direktorish</title>
  778. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  779. </head>
  780. <body>
  781.  
  782. <h1>Rekursion</h1>
  783.  
  784. <?php
  785.  
  786. $folderPath = "photos";
  787.  
  788. function readFolder( $path ) {
  789.  
  790.  // hapim direktorine
  791.  if ( !( $dir = opendir( $path ) ) ) die( "Can't open $path" );
  792.  $filenames = array();
  793.  
  794.  // Lexojme permbajtjen e nje direktorie , duke injoruar '.' dhe '..', dhe
  795.  // duke shtuar '/' ne cdo nendirektori. Shtojme te gjithe skedaret dhe nendirektorite ne vektorin $filenames.
  796.  
  797.  while ( $filename = readdir( $dir ) ) {
  798.    if ( $filename != '.' && $filename != '..' ) {
  799.      if ( is_dir( "$path/$filename" ) ) $filename .= '/';
  800.      $filenames[] = $filename;
  801.    }
  802.  }
  803.  
  804.  closedir ( $dir );
  805.  
  806.  // rendisim emrat e skedareve sipas alfabetit
  807.  sort( $filenames );
  808.  
  809.  // shfaqim emrat
  810.  
  811.  echo "<ul>";
  812.  
  813.   foreach ( $filenames as $filename ) {
  814.     echo "<li>$filename";
  815.     if ( substr( $filename, -1 ) == '/' ) readFolder( "$path/" . substr( $filename, 0, -1 ) );
  816.     echo "</li>";
  817.   }
  818.  
  819.   echo "</ul>";
  820. }
  821.  
  822. echo "<h2>Contents of '$folderPath':</h2>";
  823. readFolder( $folderPath );
  824.  
  825. ?>
  826.  
  827. </body>
  828. </html>
  829.  
  830.  
  831. c:\users\lalikali\desktop\web\txt\fontcss.txt
  832. <---------------------------------------------------------------------->
  833. <!DOCTYPE html>
  834. <html>
  835. <head>
  836. <style>
  837. h1 {
  838.     color:blue;
  839.     font-family:verdana;
  840.     font-size:300%;
  841.  
  842. }
  843. p  {
  844.     color:red;
  845.     font-family:courier;
  846.     font-size:160%;
  847. }
  848. </style>
  849. </head>
  850. <body>
  851.  
  852. <h1>This is a heading</h1>
  853. <p>This is a paragraph.</p>
  854.  
  855. </body>
  856. </html>
  857.  
  858.  
  859. c:\users\lalikali\desktop\web\txt\for (2).txt
  860. <---------------------------------------------------------------------->
  861. <html>
  862.    <body>
  863.      
  864.       <?php
  865.         $a = 0;
  866.         $b = 0;
  867.        
  868.         for( $i=0; $i<5; $i++ )
  869.         {
  870.            $a += 10;
  871.            $b += 5;
  872.         }
  873.        
  874.         echo ("At the end of the loop a=$a and b=$b" );
  875.      ?>
  876.    
  877.    </body>
  878. </html>
  879.  
  880.  
  881. c:\users\lalikali\desktop\web\txt\for.txt
  882. <---------------------------------------------------------------------->
  883. <!DOCTYPE html>
  884. <html>
  885. <body>
  886.  
  887. <p id="demo"></p>
  888.  
  889. <script>
  890. var cars = ["BMW", "Volvo", "Saab", "Ford"];
  891. var text = "";
  892. var i;
  893. for (i = 0; i < cars.length; i++) {
  894.    text += cars[i] + "<br>";
  895. }
  896.  
  897. document.getElementById("demo").innerHTML = text;
  898. </script>
  899.  
  900. </body>
  901. </html>
  902.  
  903.  
  904.  
  905. c:\users\lalikali\desktop\web\txt\for1.txt
  906. <---------------------------------------------------------------------->
  907. <!DOCTYPE html>
  908. <html>
  909. <body>
  910.  
  911. <p id="demo"></p>
  912.  
  913. <script>
  914. var cars = ["BMW", "Volvo", "Saab", "Ford"];
  915. var text = "";
  916. var i;
  917. for (i = 0; i < cars.length; i++) {
  918.    text += cars[i] + "<br>";
  919. }
  920.  
  921. document.getElementById("demo").innerHTML = text;
  922. </script>
  923.  
  924. </body>
  925. </html>
  926.  
  927.  
  928. c:\users\lalikali\desktop\web\txt\for2 (2).txt
  929. <---------------------------------------------------------------------->
  930. <!DOCTYPE html>
  931. <html>
  932. <body>
  933.  
  934. <p>Click the button to loop through a block of code five times.</p>
  935.  
  936. <button onclick="myFunction()">Try it</button>
  937.  
  938. <p id="demo"></p>
  939.  
  940. <script>
  941. function myFunction() {
  942.     var text = "";
  943.     var i;
  944.     for (i = 0; i < 5; i++) {
  945.        text += "The number is " + i + "<br>";
  946.     }
  947.     document.getElementById("demo").innerHTML = text;
  948. }
  949. </script>
  950.  
  951. </body>
  952. </html>
  953.  
  954.  
  955. c:\users\lalikali\desktop\web\txt\for2.txt
  956. <---------------------------------------------------------------------->
  957. <!DOCTYPE html>
  958. <html>
  959. <body>
  960.  
  961. <p id="demo"></p>
  962.  
  963. <script>
  964. var cars = ["BMW", "Volvo", "Saab", "Ford"];
  965.  
  966. var i = 0;
  967. var len = cars.length;
  968. var text = "";
  969.  
  970. for (; i < len; ) {
  971.    text += cars[i] + "<br>";
  972.     i++;
  973. }
  974. document.getElementById("demo").innerHTML = text;
  975. </script>
  976.  
  977. </body>
  978. </html>
  979.  
  980.  
  981.  
  982. c:\users\lalikali\desktop\web\txt\for3.txt
  983. <---------------------------------------------------------------------->
  984. <!DOCTYPE html>
  985. <html>
  986. <body>
  987.  
  988. <p id="demo"></p>
  989.  
  990. <script>
  991. var cars = ["BMW", "Volvo", "Saab", "Ford"];
  992. var i, len, text;
  993. for (i = 0, len = cars.length, text = ""; i < len; i++) {
  994.    text += cars[i] + "<br>";
  995. }
  996.  
  997. document.getElementById("demo").innerHTML = text;
  998. </script>
  999.  
  1000. </body>
  1001. </html>
  1002.  
  1003.  
  1004. c:\users\lalikali\desktop\web\txt\foreach.txt
  1005. <---------------------------------------------------------------------->
  1006. <html>
  1007.    <body>
  1008.    
  1009.       <?php
  1010.         $array = array( 1, 2, 3, 4, 5);
  1011.        
  1012.         foreach( $array as $value )
  1013.         {
  1014.            echo "Value is $value <br />";
  1015.          }
  1016.       ?>
  1017.      
  1018.    </body>
  1019. </html>
  1020. Value is 1
  1021. Value is 2
  1022. Value is 3
  1023. Value is 4
  1024. Value is 5
  1025.  
  1026.  
  1027. c:\users\lalikali\desktop\web\txt\form_get.txt
  1028. <---------------------------------------------------------------------->
  1029. <!DOCTYPE HTML>
  1030. <html>
  1031. <body>
  1032.  
  1033. <form action="welcome_get.php" method="get">
  1034. Name: <input type="text" name="name"><br>
  1035. E-mail: <input type="text" name="email"><br>
  1036. <input type="submit">
  1037. </form>
  1038.  
  1039. </body>
  1040. </html>
  1041.  
  1042.  
  1043. c:\users\lalikali\desktop\web\txt\form_post.txt
  1044. <---------------------------------------------------------------------->
  1045. <!DOCTYPE HTML>
  1046. <html>
  1047. <body>
  1048.  
  1049. <form action="welcome.php" method="post">
  1050. Name: <input type="text" name="name"><br>
  1051. E-mail: <input type="text" name="email"><br>
  1052. <input type="submit">
  1053. </form>
  1054.  
  1055. </body>
  1056. </html>
  1057.  
  1058.  
  1059.  
  1060.  
  1061. c:\users\lalikali\desktop\web\txt\form_validation.txt
  1062. <---------------------------------------------------------------------->
  1063. <!DOCTYPE HTML>
  1064. <html>
  1065. <head>
  1066. </head>
  1067. <body>
  1068.  
  1069. <?php
  1070. // define variables and set to empty values
  1071. $name = $email = $gender = $comment = $website = "";
  1072.  
  1073. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  1074.   $name = test_input($_POST["name"]);
  1075.   $email = test_input($_POST["email"]);
  1076.   $website = test_input($_POST["website"]);
  1077.   $comment = test_input($_POST["comment"]);
  1078.   $gender = test_input($_POST["gender"]);
  1079. }
  1080.  
  1081. function test_input($data) {
  1082.   $data = trim($data);
  1083.   $data = stripslashes($data);
  1084.   $data = htmlspecialchars($data);
  1085.   return $data;
  1086. }
  1087. ?>
  1088.  
  1089. <h2>PHP Form Validation Example</h2>
  1090. <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
  1091.    Name: <input type="text" name="name">
  1092.    <br><br>
  1093.    E-mail: <input type="text" name="email">
  1094.    <br><br>
  1095.    Website: <input type="text" name="website">
  1096.    <br><br>
  1097.    Comment: <textarea name="comment" rows="5" cols="40"></textarea>
  1098.    <br><br>
  1099.    Gender:
  1100.    <input type="radio" name="gender" value="female">Female
  1101.    <input type="radio" name="gender" value="male">Male
  1102.    <br><br>
  1103.    <input type="submit" name="submit" value="Submit">
  1104. </form>
  1105.  
  1106. <?php
  1107. echo "<h2>Your Input:</h2>";
  1108. echo $name;
  1109. echo "<br>";
  1110. echo $email;
  1111. echo "<br>";
  1112. echo $website;
  1113. echo "<br>";
  1114. echo $comment;
  1115. echo "<br>";
  1116. echo $gender;
  1117. ?>
  1118.  
  1119. </body>
  1120. </html>
  1121.  
  1122.  
  1123. c:\users\lalikali\desktop\web\txt\form_validation2.txt
  1124. <---------------------------------------------------------------------->
  1125. <!DOCTYPE HTML>
  1126. <html>
  1127. <head>
  1128. <style>
  1129. .error {color: #FF0000;}
  1130. </style>
  1131. </head>
  1132. <body>
  1133.  
  1134. <?php
  1135. // define variables and set to empty values
  1136. $nameErr = $emailErr = $genderErr = $websiteErr = "";
  1137. $name = $email = $gender = $comment = $website = "";
  1138.  
  1139. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  1140.   if (empty($_POST["name"])) {
  1141.     $nameErr = "Name is required";
  1142.   } else {
  1143.     $name = test_input($_POST["name"]);
  1144.   }
  1145.  
  1146.   if (empty($_POST["email"])) {
  1147.     $emailErr = "Email is required";
  1148.   } else {
  1149.     $email = test_input($_POST["email"]);
  1150.   }
  1151.    
  1152.   if (empty($_POST["website"])) {
  1153.     $website = "";
  1154.   } else {
  1155.     $website = test_input($_POST["website"]);
  1156.   }
  1157.  
  1158.   if (empty($_POST["comment"])) {
  1159.     $comment = "";
  1160.   } else {
  1161.     $comment = test_input($_POST["comment"]);
  1162.   }
  1163.  
  1164.   if (empty($_POST["gender"])) {
  1165.     $genderErr = "Gender is required";
  1166.   } else {
  1167.     $gender = test_input($_POST["gender"]);
  1168.   }
  1169. }
  1170.  
  1171. function test_input($data) {
  1172.   $data = trim($data);
  1173.   $data = stripslashes($data);
  1174.   $data = htmlspecialchars($data);
  1175.   return $data;
  1176. }
  1177. ?>
  1178.  
  1179. <h2>PHP Form Validation Example</h2>
  1180. <p><span class="error">* required field.</span></p>
  1181. <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
  1182.    Name: <input type="text" name="name">
  1183.    <span class="error">* <?php echo $nameErr;?></span>
  1184.    <br><br>
  1185.    E-mail: <input type="text" name="email">
  1186.    <span class="error">* <?php echo $emailErr;?></span>
  1187.    <br><br>
  1188.    Website: <input type="text" name="website">
  1189.    <span class="error"><?php echo $websiteErr;?></span>
  1190.    <br><br>
  1191.    Comment: <textarea name="comment" rows="5" cols="40"></textarea>
  1192.    <br><br>
  1193.    Gender:
  1194.    <input type="radio" name="gender" value="female">Female
  1195.    <input type="radio" name="gender" value="male">Male
  1196.    <span class="error">* <?php echo $genderErr;?></span>
  1197.    <br><br>
  1198.    <input type="submit" name="submit" value="Submit">
  1199. </form>
  1200.  
  1201. <?php
  1202. echo "<h2>Your Input:</h2>";
  1203. echo $name;
  1204. echo "<br>";
  1205. echo $email;
  1206. echo "<br>";
  1207. echo $website;
  1208. echo "<br>";
  1209. echo $comment;
  1210. echo "<br>";
  1211. echo $gender;
  1212. ?>
  1213.  
  1214. </body>
  1215. </html>
  1216.  
  1217.  
  1218. c:\users\lalikali\desktop\web\txt\fshirja.txt
  1219. <---------------------------------------------------------------------->
  1220. <html>
  1221.    
  1222.    <head>
  1223.       <title>Delete a Record from MySQL Database</title>
  1224.    </head>
  1225.    
  1226.    <body>
  1227.       <?php
  1228.         if(isset($_POST['delete'])) {
  1229.            $dbhost = 'localhost:3036';
  1230.            $dbuser = 'root';
  1231.            $dbpass = 'rootpassword';
  1232.            $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  1233.            
  1234.            if(! $conn ) {
  1235.               die('Could not connect: ' . mysql_error());
  1236.            }
  1237.                
  1238.            $emp_id = $_POST['emp_id'];
  1239.            
  1240.            $sql = "DELETE employee ". "WHERE emp_id = $emp_id" ;
  1241.            mysql_select_db('test_db');
  1242.            $retval = mysql_query( $sql, $conn );
  1243.            
  1244.            if(! $retval ) {
  1245.               die('Could not delete data: ' . mysql_error());
  1246.            }
  1247.            
  1248.            echo "Deleted data successfully\n";
  1249.            
  1250.            mysql_close($conn);
  1251.         }else {
  1252.            ?>
  1253.                <form method = "post" action = "<?php $_PHP_SELF ?>">
  1254.                   <table width = "400" border = "0" cellspacing = "1"
  1255.                     cellpadding = "2">
  1256.                      
  1257.                      <tr>
  1258.                         <td width = "100">Employee ID</td>
  1259.                         <td><input name = "emp_id" type = "text"
  1260.                           id = "emp_id"></td>
  1261.                      </tr>
  1262.                      
  1263.                      <tr>
  1264.                         <td width = "100"> </td>
  1265.                         <td> </td>
  1266.                      </tr>
  1267.                      
  1268.                      <tr>
  1269.                         <td width = "100"> </td>
  1270.                         <td>
  1271.                            <input name = "delete" type = "submit"
  1272.                              id = "delete" value = "Delete">
  1273.                         </td>
  1274.                      </tr>
  1275.                      
  1276.                   </table>
  1277.                </form>
  1278.             <?php
  1279.         }
  1280.      ?>
  1281.      
  1282.    </body>
  1283. </html>
  1284.  
  1285.  
  1286. c:\users\lalikali\desktop\web\txt\funksion1 (2).txt
  1287. <---------------------------------------------------------------------->
  1288. <!DOCTYPE html>
  1289. <html>
  1290. <body>
  1291.  
  1292. <?php
  1293. function writeMsg() {
  1294.     echo "Hello world!";
  1295. }
  1296.  
  1297. writeMsg();
  1298. ?>
  1299.  
  1300. </body>
  1301. </html>
  1302.  
  1303.  
  1304. c:\users\lalikali\desktop\web\txt\funksion1.txt
  1305. <---------------------------------------------------------------------->
  1306. <!DOCTYPE html>
  1307. <html>
  1308. <body>
  1309.  
  1310. <p>This example calls a function which performs a calculation, and returns the result:</p>
  1311.  
  1312. <p id="demo"></p>
  1313.  
  1314. <script>
  1315. function myFunction(a, b) {
  1316.     return a * b;
  1317. }
  1318. document.getElementById("demo").innerHTML = myFunction(4, 3);
  1319. </script>
  1320.  
  1321. </body>
  1322. </html>
  1323.  
  1324.  
  1325. c:\users\lalikali\desktop\web\txt\funksion2 (2).txt
  1326. <---------------------------------------------------------------------->
  1327. <!DOCTYPE html>
  1328. <html>
  1329. <body>
  1330.  
  1331. <?php
  1332. function familyName($fname) {
  1333.     echo "$fname Refsnes.<br>";
  1334. }
  1335.  
  1336. familyName("Jani");
  1337. familyName("Hege");
  1338. familyName("Stale");
  1339. familyName("Kai Jim");
  1340. familyName("Borge");
  1341. ?>
  1342.  
  1343. </body>
  1344. </html>
  1345.  
  1346. Jani Refsnes.
  1347. Hege Refsnes.
  1348. Stale Refsnes.
  1349. Kai Jim Refsnes.
  1350. Borge Refsnes.
  1351.  
  1352.  
  1353. c:\users\lalikali\desktop\web\txt\funksion2.txt
  1354. <---------------------------------------------------------------------->
  1355. <!DOCTYPE html>
  1356. <html>
  1357. <body>
  1358.  
  1359. <p id="demo"></p>
  1360.  
  1361. <script>
  1362. document.getElementById("demo").innerHTML =
  1363. "The temperature is " + toCelsius(77) + " Celsius";
  1364.  
  1365. function toCelsius(fahrenheit) {
  1366.     return (5/9) * (fahrenheit-32);
  1367. }
  1368. </script>
  1369.  
  1370. </body>
  1371. </html>
  1372.  
  1373.  
  1374. c:\users\lalikali\desktop\web\txt\funksion3.txt
  1375. <---------------------------------------------------------------------->
  1376. <!DOCTYPE html>
  1377. <html>
  1378. <body>
  1379.  
  1380. <?php
  1381. function familyName($fname, $year) {
  1382.     echo "$fname Refsnes. Born in $year <br>";
  1383. }
  1384.  
  1385. familyName("Hege","1975");
  1386. familyName("Stale","1978");
  1387. familyName("Kai Jim","1983");
  1388. ?>
  1389.  
  1390. </body>
  1391. </html>
  1392.  
  1393. Hege Refsnes. Born in 1975
  1394. Stale Refsnes. Born in 1978
  1395. Kai Jim Refsnes. Born in 1983
  1396.  
  1397.  
  1398. c:\users\lalikali\desktop\web\txt\funksion4.txt
  1399. <---------------------------------------------------------------------->
  1400. <!DOCTYPE html>
  1401. <html>
  1402. <body>
  1403.  
  1404. <?php
  1405. function setHeight($minheight = 50) {
  1406.     echo "The height is : $minheight <br>";
  1407. }
  1408.  
  1409. setHeight(350);
  1410. setHeight();
  1411. setHeight(135);
  1412. setHeight(80);
  1413. ?>
  1414.  
  1415. </body>
  1416. </html>
  1417.  
  1418. The height is : 350
  1419. The height is : 50
  1420. The height is : 135
  1421. The height is : 80
  1422.  
  1423.  
  1424. c:\users\lalikali\desktop\web\txt\funksion5.txt
  1425. <---------------------------------------------------------------------->
  1426. <!DOCTYPE html>
  1427. <html>
  1428. <body>
  1429.  
  1430. <?php
  1431. function sum($x, $y) {
  1432.     $z = $x + $y;
  1433.     return $z;
  1434. }
  1435.  
  1436. echo "5 + 10 = " . sum(5,10) . "<br>";
  1437. echo "7 + 13 = " . sum(7,13) . "<br>";
  1438. echo "2 + 4 = " . sum(2,4);
  1439. ?>
  1440.  
  1441. </body>
  1442. </html>
  1443.  
  1444. 5 + 10 = 15
  1445. 7 + 13 = 20
  1446. 2 + 4 = 6
  1447.  
  1448.  
  1449. c:\users\lalikali\desktop\web\txt\globale.txt
  1450. <---------------------------------------------------------------------->
  1451. <?php
  1452.   $somevar = 15;
  1453.  
  1454.   function addit() {
  1455.      GLOBAL $somevar;
  1456.      $somevar++;
  1457.      
  1458.      print "Somevar is $somevar";
  1459.   }
  1460.  
  1461.   addit();
  1462. ?>
  1463.  
  1464. Do afishoje:
  1465. Somevar is 16
  1466.  
  1467.  
  1468. c:\users\lalikali\desktop\web\txt\head.txt.txt
  1469. <---------------------------------------------------------------------->
  1470. <!DOCTYPE html>
  1471. <html>
  1472. <head>
  1473. <script>
  1474. function myFunction() {
  1475.     document.getElementById("demo").innerHTML = "Paragraph changed.";
  1476. }
  1477. </script>
  1478. </head>
  1479.  
  1480. <body>
  1481.  
  1482. <h1>JavaScript in Head</h1>
  1483.  
  1484. <p id="demo">A Paragraph.</p>
  1485.  
  1486. <button type="button" onclick="myFunction()">Try it</button>
  1487.  
  1488. </body>
  1489. </html
  1490.  
  1491.  
  1492. c:\users\lalikali\desktop\web\txt\html-php_mysql.txt
  1493. <---------------------------------------------------------------------->
  1494. <html>
  1495.    
  1496.    <head>
  1497.       <title>Shtojme nje rekord te ri ne databaze</title>
  1498.    </head>
  1499.    
  1500.    <body>
  1501.       <?php
  1502.         if(isset($_POST['add'])) {
  1503.            $dbhost = 'localhost:3036';
  1504.            $dbuser = 'root';
  1505.            $dbpass = 'rootpassword';
  1506.            $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  1507.            
  1508.            if(! $conn ) {
  1509.               die('Could not connect: ' . mysql_error());
  1510.            }
  1511.            
  1512.            if(! get_magic_quotes_gpc() ) {
  1513.               $emp_name = addslashes ($_POST['emp_name']);
  1514.               $emp_address = addslashes ($_POST['emp_address']);
  1515.            }else {
  1516.               $emp_name = $_POST['emp_name'];
  1517.               $emp_address = $_POST['emp_address'];
  1518.            }
  1519.            
  1520.            $emp_salary = $_POST['emp_salary'];
  1521.            
  1522.            $sql = "INSERT INTO employee ". "(emp_name,emp_address, emp_salary,
  1523.               join_date) ". "VALUES('$emp_name','$emp_address',$emp_salary, NOW())";
  1524.              
  1525.            mysql_select_db('test_db');
  1526.            $retval = mysql_query( $sql, $conn );
  1527.            
  1528.            if(! $retval ) {
  1529.               die('Could not enter data: ' . mysql_error());
  1530.            }
  1531.            
  1532.            echo "Entered data successfully\n";
  1533.            
  1534.            mysql_close($conn);
  1535.         }else {
  1536.            ?>
  1537.            
  1538.                <form method = "post" action = "<?php $_PHP_SELF ?>">
  1539.                   <table width = "400" border = "0" cellspacing = "1"
  1540.                     cellpadding = "2">
  1541.                  
  1542.                      <tr>
  1543.                         <td width = "100">Employee Name</td>
  1544.                         <td><input name = "emp_name" type = "text"
  1545.                           id = "emp_name"></td>
  1546.                      </tr>
  1547.                  
  1548.                      <tr>
  1549.                         <td width = "100">Employee Address</td>
  1550.                         <td><input name = "emp_address" type = "text"
  1551.                           id = "emp_address"></td>
  1552.                      </tr>
  1553.                  
  1554.                      <tr>
  1555.                         <td width = "100">Employee Salary</td>
  1556.                         <td><input name = "emp_salary" type = "text"
  1557.                           id = "emp_salary"></td>
  1558.                      </tr>
  1559.                  
  1560.                      <tr>
  1561.                         <td width = "100"> </td>
  1562.                         <td> </td>
  1563.                      </tr>
  1564.                  
  1565.                      <tr>
  1566.                         <td width = "100"> </td>
  1567.                         <td>
  1568.                            <input name = "add" type = "submit" id = "add"
  1569.                              value = "Add Employee">
  1570.                         </td>
  1571.                      </tr>
  1572.                  
  1573.                   </table>
  1574.                </form>
  1575.            
  1576.             <?php
  1577.         }
  1578.      ?>
  1579.    
  1580.    </body>
  1581. </html>
  1582.  
  1583.  
  1584. c:\users\lalikali\desktop\web\txt\HTTP_USER_AGENT.txt
  1585. <---------------------------------------------------------------------->
  1586. <html>
  1587.    <body>
  1588.    
  1589.       <?php
  1590.         function getBrowser()
  1591.         {
  1592.            $u_agent = $_SERVER['HTTP_USER_AGENT'];
  1593.            $bname = 'Unknown';
  1594.            $platform = 'Unknown';
  1595.            $version= "";
  1596.            
  1597.            //gjejme fillimisht sistemin
  1598.            if (preg_match('/linux/i', $u_agent)) {
  1599.               $platform = 'linux';
  1600.            }
  1601.            
  1602.            elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
  1603.               $platform = 'mac';
  1604.            }
  1605.            
  1606.            elseif (preg_match('/windows|win32/i', $u_agent)) {
  1607.               $platform = 'windows';
  1608.            }
  1609.            
  1610.            // gjejme browserin
  1611.            if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))
  1612.            {
  1613.               $bname = 'Internet Explorer';
  1614.               $ub = "MSIE";
  1615.            }
  1616.            
  1617.            elseif(preg_match('/Firefox/i',$u_agent))
  1618.            {
  1619.               $bname = 'Mozilla Firefox';
  1620.               $ub = "Firefox";
  1621.            }
  1622.            
  1623.            elseif(preg_match('/Chrome/i',$u_agent))
  1624.            {
  1625.               $bname = 'Google Chrome';
  1626.               $ub = "Chrome";
  1627.            }
  1628.            
  1629.            elseif(preg_match('/Safari/i',$u_agent))
  1630.            {
  1631.               $bname = 'Apple Safari';
  1632.               $ub = "Safari";
  1633.            }
  1634.            
  1635.            elseif(preg_match('/Opera/i',$u_agent))
  1636.            {
  1637.               $bname = 'Opera';
  1638.               $ub = "Opera";
  1639.            }
  1640.            
  1641.            elseif(preg_match('/Netscape/i',$u_agent))
  1642.            {
  1643.               $bname = 'Netscape';
  1644.               $ub = "Netscape";
  1645.            }
  1646.            
  1647.            // gjejme cili version eshte
  1648.            $known = array('Version', $ub, 'other');
  1649.            $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
  1650.            
  1651.             if (!preg_match_all($pattern, $u_agent, $matches)) {
  1652.                // nqs nuk e kemi gjetur numrin
  1653.             }
  1654.             shikojme sa kemi
  1655.             $i = count($matches['browser']);
  1656.            
  1657.             if ($i != 1) {
  1658.                //kemi 2
  1659.                
  1660.                //shikojme nqs versioni eshte para apo mbrapa emrit
  1661.                if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){
  1662.                  $version= $matches['version'][0];
  1663.               }
  1664.               else {
  1665.                  $version= $matches['version'][1];
  1666.               }
  1667.            }
  1668.            else {
  1669.               $version= $matches['version'][0];
  1670.            }
  1671.            
  1672.            // kontrollojme nqs kemi nje numer
  1673.            if ($version==null || $version=="") {$version="?";}
  1674.            return array(
  1675.               'userAgent' => $u_agent,
  1676.                'name'      => $bname,
  1677.                'version'   => $version,
  1678.                'platform'  => $platform,
  1679.                'pattern'   => $pattern
  1680.             );
  1681.          }
  1682.          
  1683.          // e kontrollojme
  1684.          $ua=getBrowser();
  1685.          $yourbrowser= "Your browser: " . $ua['name'] . " " . $ua['version'] . " on " .$ua['platform'] . " reports: <br >" . $ua['userAgent'];
  1686.          
  1687.          print_r($yourbrowser);
  1688.       ?>
  1689.    
  1690.    </body>
  1691. </html>
  1692.  
  1693.  
  1694. c:\users\lalikali\desktop\web\txt\id.txt
  1695. <---------------------------------------------------------------------->
  1696. <!DOCTYPE html>
  1697. <html>
  1698. <head>
  1699. <style>
  1700. table, th, td {
  1701.     border: 1px solid black;
  1702.     border-collapse: collapse;
  1703. }
  1704. th, td {
  1705.     padding: 5px;
  1706.     text-align: left;
  1707. }
  1708. table#t01 {
  1709.     width: 100%;    
  1710.     background-color: #f1f1c1;
  1711. }
  1712. </style>
  1713. </head>
  1714. <body>
  1715.  
  1716. <table style="width:100%">
  1717.   <tr>
  1718.     <th>First Name</th>
  1719.     <th>Last Name</th>     
  1720.     <th>Points</th>
  1721.   </tr>
  1722.   <tr>
  1723.     <td>Jill</td>
  1724.     <td>Smith</td>     
  1725.     <td>50</td>
  1726.   </tr>
  1727.   <tr>
  1728.     <td>Eve</td>
  1729.     <td>Jackson</td>       
  1730.     <td>94</td>
  1731.   </tr>
  1732.   <tr>
  1733.     <td>John</td>
  1734.     <td>Doe</td>       
  1735.     <td>80</td>
  1736.   </tr>
  1737. </table>
  1738.  
  1739. <br>
  1740.  
  1741. <table id="t01">
  1742.   <tr>
  1743.     <th>First Name</th>
  1744.     <th>Last Name</th>     
  1745.     <th>Points</th>
  1746.   </tr>
  1747.   <tr>
  1748.     <td>Jill</td>
  1749.     <td>Smith</td>     
  1750.     <td>50</td>
  1751.   </tr>
  1752.   <tr>
  1753.     <td>Eve</td>
  1754.     <td>Jackson</td>       
  1755.     <td>94</td>
  1756.   </tr>
  1757.   <tr>
  1758.     <td>John</td>
  1759.     <td>Doe</td>       
  1760.     <td>80</td>
  1761.   </tr>
  1762. </table>
  1763.  
  1764. </body>
  1765. </html>
  1766.  
  1767.  
  1768. c:\users\lalikali\desktop\web\txt\if (2).txt
  1769. <---------------------------------------------------------------------->
  1770. <html>
  1771.    <body>
  1772.    
  1773.       <?php
  1774.         $d=date("D");
  1775.        
  1776.         if ($d=="Fri")
  1777.            echo "Have a nice weekend!";
  1778.        
  1779.         else
  1780.            echo "Have a nice day!";
  1781.      ?>
  1782.    
  1783.    </body>
  1784. </html>
  1785.  
  1786. Rezultati:
  1787. Have a nice day!
  1788.  
  1789.  
  1790. c:\users\lalikali\desktop\web\txt\if.txt
  1791. <---------------------------------------------------------------------->
  1792. <!DOCTYPE html>
  1793. <html>
  1794. <body>
  1795.  
  1796. <p>Click the button to display a time-based greeting:</p>
  1797.  
  1798. <button onclick="myFunction()">Try it</button>
  1799.  
  1800. <p id="demo"></p>
  1801.  
  1802. <script>
  1803. function myFunction() {
  1804.     var hour = new Date().getHours();
  1805.     var greeting;
  1806.     if (hour < 18) {
  1807.        greeting = "Good day";
  1808.    } else {
  1809.        greeting = "Good evening";
  1810.    }
  1811.    document.getElementById("demo").innerHTML = greeting;
  1812. }
  1813. </script>
  1814.  
  1815. </body>
  1816. </html>
  1817.  
  1818.  
  1819.  
  1820. c:\users\lalikali\desktop\web\txt\if2.txt
  1821. <---------------------------------------------------------------------->
  1822. !DOCTYPE html>
  1823. <html>
  1824. <body>
  1825.  
  1826. <p>Click the button to get a time-based greeting:</p>
  1827.  
  1828. <button onclick="myFunction()">Try it</button>
  1829.  
  1830. <p id="demo"></p>
  1831.  
  1832. <script>
  1833. function myFunction() {
  1834.     var greeting;
  1835.     var time = new Date().getHours();
  1836.     if (time < 10) {
  1837.        greeting = "Good morning";
  1838.    } else if (time < 20) {
  1839.        greeting = "Good day";
  1840.    } else {
  1841.        greeting = "Good evening";
  1842.    }
  1843. document.getElementById("demo").innerHTML = greeting;
  1844. }
  1845. </script>
  1846.  
  1847. </body>
  1848. </html>
  1849.  
  1850.  
  1851. c:\users\lalikali\desktop\web\txt\implode.txt
  1852. <---------------------------------------------------------------------->
  1853. <!DOCTYPE html>
  1854. <html>
  1855. <body>
  1856.  
  1857. <?php
  1858. $arr = array('Hello','World!','Beautiful','Day!');
  1859. echo implode(" ",$arr);
  1860. ?>
  1861.  
  1862. </body>
  1863. </html>
  1864.  
  1865. Hello World! Beautiful Day!
  1866.  
  1867.  
  1868. c:\users\lalikali\desktop\web\txt\infinity.txt
  1869. <---------------------------------------------------------------------->
  1870. <!DOCTYPE html>
  1871. <html>
  1872. <body>
  1873.  
  1874. <p>Infinity is returned if you calculate a number outside the largest possible number.</p>
  1875.  
  1876. <button onclick="myFunction()">Try it</button>
  1877.  
  1878. <p id="demo"></p>
  1879.  
  1880. <script>
  1881. function myFunction() {
  1882.     var myNumber = 2;
  1883.     var txt = "";
  1884.     while (myNumber != Infinity) {
  1885.         myNumber = myNumber * myNumber;
  1886.         txt = txt + myNumber + "<br>";
  1887.     }
  1888.     document.getElementById("demo").innerHTML = txt;
  1889. }
  1890. </script>
  1891.  
  1892. </body>
  1893. </html>
  1894.  
  1895.  
  1896. c:\users\lalikali\desktop\web\txt\inkrement.txt
  1897. <---------------------------------------------------------------------->
  1898. <!DOCTYPE html>
  1899. <html>
  1900. <body>
  1901.  
  1902. <h1>The ++ Operator</h1>
  1903.  
  1904. <p id="demo"></p>
  1905.  
  1906. <script>
  1907. var x = 5;
  1908. x++;
  1909. var z = x;
  1910. document.getElementById("demo").innerHTML = z;
  1911. </script>
  1912.  
  1913. </body>
  1914. </html>
  1915.  
  1916.  
  1917.  
  1918. c:\users\lalikali\desktop\web\txt\inner.txt
  1919. <---------------------------------------------------------------------->
  1920. <!DOCTYPE html>
  1921. <html>
  1922. <body>
  1923.  
  1924. <h1>My First Web Page</h1>
  1925. <p>My first paragraph.</p>
  1926.  
  1927. <button type="button" onclick="document.write(5 + 6)">Try it</button>
  1928.  
  1929. </body>
  1930. </html>
  1931.  
  1932.  
  1933. c:\users\lalikali\desktop\web\txt\javascript.body.txt
  1934. <---------------------------------------------------------------------->
  1935. <!DOCTYPE html>
  1936. <html>
  1937. <body>
  1938.  
  1939. <h1>JavaScript in Body</h1>
  1940.  
  1941. <p id="demo">A Paragraph.</p>
  1942.  
  1943. <button type="button" onclick="myFunction()">Try it</button>
  1944.  
  1945. <script>
  1946. function myFunction() {
  1947.     document.getElementById("demo").innerHTML = "Paragraph changed.";
  1948. }
  1949. </script>
  1950.  
  1951. </body>
  1952. </html>
  1953.  
  1954.  
  1955.  
  1956. c:\users\lalikali\desktop\web\txt\javascript.external.txt
  1957. <---------------------------------------------------------------------->
  1958. <!DOCTYPE html>
  1959. <html>
  1960. <body>
  1961.  
  1962. <h1>External JavaScript</h1>
  1963.  
  1964. <p id="demo">A Paragraph.</p>
  1965.  
  1966. <button type="button" onclick="myFunction()">Try it</button>
  1967.  
  1968. <p><strong>Note:</strong> myFunction is stored in an external file called "myScript.js".</p>
  1969.  
  1970. <script src="myScript.js"></script>
  1971.  
  1972. </body>
  1973. </html>
  1974.  
  1975.  
  1976. c:\users\lalikali\desktop\web\txt\javascript.head.txt
  1977. <---------------------------------------------------------------------->
  1978. <!DOCTYPE html>
  1979. <html>
  1980. <head>
  1981. <script>
  1982. function myFunction() {
  1983.     document.getElementById("demo").innerHTML = "Paragraph changed.";
  1984. }
  1985. </script>
  1986. </head>
  1987.  
  1988. <body>
  1989.  
  1990. <h1>JavaScript in Head</h1>
  1991.  
  1992. <p id="demo">A Paragraph.</p>
  1993.  
  1994. <button type="button" onclick="myFunction()">Try it</button>
  1995.  
  1996. </body>
  1997. </html>
  1998.  
  1999.  
  2000.  
  2001. c:\users\lalikali\desktop\web\txt\javascript1.txt
  2002. <---------------------------------------------------------------------->
  2003. <!DOCTYPE html>
  2004. <html>
  2005. <body>
  2006.  
  2007. <h1>My First JavaScript</h1>
  2008.  
  2009. <button type="button"
  2010. onclick="document.getElementById('demo').innerHTML = Date()">
  2011. Click me to display Date and Time.</button>
  2012.  
  2013. <p id="demo"></p>
  2014.  
  2015. </body>
  2016. </html>
  2017.  
  2018.  
  2019. c:\users\lalikali\desktop\web\txt\koment.txt
  2020. <---------------------------------------------------------------------->
  2021. <!DOCTYPE html>
  2022. <html>
  2023. <body>
  2024.  
  2025. <h1>Comments are NOT Executed</h1>
  2026.  
  2027. <p id="demo"></p>
  2028.  
  2029. <script>
  2030. var x = 5;
  2031. // var x = 6; I will not be executed
  2032. document.getElementById("demo").innerHTML = x;
  2033. </script>
  2034.  
  2035. </body>
  2036. </html>
  2037.  
  2038.  
  2039. c:\users\lalikali\desktop\web\txt\konstante.txt
  2040. <---------------------------------------------------------------------->
  2041. // emrat te skate konstantesh
  2042. define("ONE",     "first thing");
  2043. define("TWO2",    "second thing");
  2044. define("THREE_3", "third thing")
  2045.  
  2046. // emra gabim
  2047. define("2TWO",    "second thing");
  2048. define("__THREE__", "third value");
  2049.  
  2050.  
  2051. c:\users\lalikali\desktop\web\txt\konturcss.txt
  2052. <---------------------------------------------------------------------->
  2053. <!DOCTYPE html>
  2054. <html>
  2055. <head>
  2056. <style>
  2057. p {
  2058.     border:1px solid grey;
  2059. }
  2060. </style>
  2061. </head>
  2062. <body>
  2063.  
  2064. <h1>This is a heading</h1>
  2065.  
  2066. <p>This is a paragraph.</p>
  2067. <p>This is a paragraph.</p>
  2068. <p>This is a paragraph.</p>
  2069.  
  2070. </body>
  2071. </html>
  2072.  
  2073.  
  2074.  
  2075. c:\users\lalikali\desktop\web\txt\krsort.txt
  2076. <---------------------------------------------------------------------->
  2077. <!DOCTYPE html>
  2078. <html>
  2079. <body>
  2080.  
  2081. <?php
  2082. $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
  2083. krsort($age);
  2084.  
  2085. foreach($age as $x => $x_value) {
  2086.      echo "Key=" . $x . ", Value=" . $x_value;
  2087.      echo "<br>";
  2088. }
  2089. ?>
  2090.  
  2091. </body>
  2092. </html>
  2093.  
  2094. Key=Peter, Value=35
  2095. Key=Joe, Value=43
  2096. Key=Ben, Value=37
  2097.  
  2098.  
  2099. c:\users\lalikali\desktop\web\txt\ksort.txt
  2100. <---------------------------------------------------------------------->
  2101. <!DOCTYPE html>
  2102. <html>
  2103. <body>
  2104.  
  2105. <?php
  2106. $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
  2107. ksort($age);
  2108.  
  2109. foreach($age as $x => $x_value) {
  2110.      echo "Key=" . $x . ", Value=" . $x_value;
  2111.      echo "<br>";
  2112. }
  2113. ?>
  2114.  
  2115. </body>
  2116. </html>
  2117.  
  2118. Key=Ben, Value=37
  2119. Key=Joe, Value=43
  2120. Key=Peter, Value=35
  2121.  
  2122.  
  2123. c:\users\lalikali\desktop\web\txt\kthimi_ndryshoreve_ne_numra.txt
  2124. <---------------------------------------------------------------------->
  2125. <!DOCTYPE html>
  2126. <html>
  2127. <body>
  2128.  
  2129. <p>The global JavaScript function Number() converts variables to numbers:</p>
  2130.  
  2131. <p id="demo"></p>
  2132.  
  2133. <script>
  2134. document.getElementById("demo").innerHTML =
  2135.     Number(true) + "<br>" +
  2136.     Number(false) + "<br>" +
  2137.     Number(new Date()) + "<br>" +
  2138.     Number("  10") + "<br>" +
  2139.     Number("10  ") + "<br>" +
  2140.     Number("10 6");    
  2141. </script>
  2142.  
  2143. </body>
  2144. </html>
  2145.  
  2146.  
  2147.  
  2148. c:\users\lalikali\desktop\web\txt\kthimi_numrave.txt
  2149. <---------------------------------------------------------------------->
  2150. <!DOCTYPE html>
  2151. <html>
  2152. <body>
  2153.  
  2154. <p>The toString() method can output numbers as base 16 (hex), base 8 (octal), or base 2 (binary).</p>
  2155.  
  2156. <p id="demo"></p>
  2157.  
  2158. <button onclick="myFunction()">Try it</button>
  2159.  
  2160. <script>
  2161. function myFunction() {
  2162.     var myNumber = 128;
  2163.     document.getElementById("demo").innerHTML = "128 = " +
  2164.     myNumber + " Decimal, " +
  2165.     myNumber.toString(16) + " Hexadecimal, " +
  2166.     myNumber.toString(8) + " Octal, " +
  2167.     myNumber.toString(2) + " Binary."
  2168. }
  2169. </script>
  2170.  
  2171. </body>
  2172. </html>
  2173.  
  2174.  
  2175. c:\users\lalikali\desktop\web\txt\kthimi_stringjeve_ne_numra.txt
  2176. <---------------------------------------------------------------------->
  2177. <!DOCTYPE html>
  2178. <html>
  2179. <body>
  2180.  
  2181. <p>The global JavaScript function parseInt() converts strings to numbers:</p>
  2182.  
  2183. <p id="demo"></p>
  2184.  
  2185. <script>
  2186. document.getElementById("demo").innerHTML =
  2187.     parseInt("10") + "<br>" +
  2188.     parseInt("10.33") + "<br>" +
  2189.     parseInt("10 6") + "<br>" +    
  2190.     parseInt("10 years") + "<br>" +    
  2191.     parseInt("years 10");    
  2192. </script>
  2193.  
  2194. </body>
  2195. </html>
  2196.  
  2197.  
  2198.  
  2199. c:\users\lalikali\desktop\web\txt\lastname.txt
  2200. <---------------------------------------------------------------------->
  2201. <!DOCTYPE html>
  2202. <html>
  2203. <body>
  2204.  
  2205. <h1>JavaScript is Case Sensitive</h1>
  2206.  
  2207. <p>Try change lastName to lastname.</p>
  2208.  
  2209. <p id="demo"></p>
  2210.  
  2211. <script>
  2212. var lastName = "Doe";
  2213. var lastname = "Peterson";
  2214. document.getElementById("demo").innerHTML = lastName;
  2215. </script>
  2216.  
  2217. </body>
  2218. </html>
  2219.  
  2220.  
  2221. c:\users\lalikali\desktop\web\txt\linkcss.txt
  2222. <---------------------------------------------------------------------->
  2223. <!DOCTYPE html>
  2224. <html>
  2225. <head>
  2226. <style>
  2227. a:link {
  2228.     color: green;
  2229.     background-color: transparent;
  2230.     text-decoration: none;
  2231. }
  2232. a:visited {
  2233.     color: pink;
  2234.     background-color: transparent;
  2235.     text-decoration: none;
  2236. }
  2237. a:hover {
  2238.     color: red;
  2239.     background-color: transparent;
  2240.     text-decoration: underline;
  2241. }
  2242. a:active {
  2243.     color: yellow;
  2244.     background-color: transparent;
  2245.     text-decoration: underline;
  2246. }
  2247. </style>
  2248. </head>
  2249. <body>
  2250.  
  2251. <p>You can change the default colors of links</p>
  2252.  
  2253. <a href="html_images.asp" target="_blank">HTML Images</a>
  2254.  
  2255. </body>
  2256. </html>
  2257.  
  2258.  
  2259.  
  2260. c:\users\lalikali\desktop\web\txt\literals.txt
  2261. <---------------------------------------------------------------------->
  2262. <!DOCTYPE html>
  2263. <html>
  2264. <body>
  2265.  
  2266. <h1>JavaScript Numbers</h1>
  2267.  
  2268. <p>Number can be written with or without decimals.</p>
  2269.  
  2270. <p id="demo"></p>
  2271.  
  2272. <script>
  2273. document.getElementById("demo").innerHTML = 10.50;
  2274. </script>
  2275.  
  2276. </body>
  2277. </html>
  2278.  
  2279.  
  2280.  
  2281. c:\users\lalikali\desktop\web\txt\literals2.txt
  2282. <---------------------------------------------------------------------->
  2283. <!DOCTYPE html>
  2284. <html>
  2285. <body>
  2286.  
  2287. <h1>JavaScript Strings</h1>
  2288.  
  2289. <p>Strings can be written with double or single quotes.</p>
  2290.  
  2291. <p id="demo"></p>
  2292.  
  2293. <script>
  2294. document.getElementById("demo").innerHTML = 'John Doe';
  2295. </script>
  2296.  
  2297. </body>
  2298. </html>
  2299.  
  2300.  
  2301. c:\users\lalikali\desktop\web\txt\local.txt
  2302. <---------------------------------------------------------------------->
  2303. <?php
  2304.   $x = 4;
  2305.  
  2306.   function assignx () {
  2307.      $x = 0;
  2308.      print "\$x brenda funksionit eshte $x. <br />";
  2309.    }
  2310.    
  2311.    assignx();
  2312.    print "\$x jashte funksionit eshte $x. <br />";
  2313. ?>
  2314. Do afishoje:
  2315. $x brenda funksionit eshte 0.
  2316. $x jashte funksionit eshte 4.
  2317.  
  2318.  
  2319.  
  2320.  
  2321. c:\users\lalikali\desktop\web\txt\lower.txt
  2322. <---------------------------------------------------------------------->
  2323. <!DOCTYPE html>
  2324. <html>
  2325. <body>
  2326.  
  2327. <p>Convert string to lower case:</p>
  2328.  
  2329. <button onclick="myFunction()">Try it</button>
  2330.  
  2331. <p id="demo">Hello World!</p>
  2332.  
  2333. <script>
  2334. function myFunction() {
  2335.     var text = document.getElementById("demo").innerHTML;
  2336.     document.getElementById("demo").innerHTML = text.toLowerCase();
  2337. }
  2338. </script>
  2339.  
  2340. </body>
  2341. </html>
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347. c:\users\lalikali\desktop\web\txt\math_ceil.txt
  2348. <---------------------------------------------------------------------->
  2349. <!DOCTYPE html>
  2350. <html>
  2351. <body>
  2352.  
  2353. <p>Math.ceil() rounds a number <strong>up</strong> to its nearest integer.</p>
  2354.  
  2355. <button onclick="myFunction()">Try it</button>
  2356.  
  2357. <p id="demo"></p>
  2358.  
  2359. <script>
  2360. function myFunction() {
  2361.     document.getElementById("demo").innerHTML = Math.ceil(4.4);
  2362. }
  2363. </script>
  2364.  
  2365. </body>
  2366. </html>
  2367.  
  2368.  
  2369.  
  2370. c:\users\lalikali\desktop\web\txt\math_constants.txt
  2371. <---------------------------------------------------------------------->
  2372. <!DOCTYPE html>
  2373. <html>
  2374. <body>
  2375.  
  2376. <p>Math constants are E, PI, SQR2, SQR1_2, LN2, LN10, LOG2E, LOG10E</p>
  2377.  
  2378. <button onclick="myFunction()">Try it</button>
  2379.  
  2380. <p id="demo"></p>
  2381.  
  2382. <script>
  2383. function myFunction() {
  2384.     document.getElementById("demo").innerHTML =
  2385.     Math.E + "<br>" +
  2386.     Math.PI + "<br>" +
  2387.     Math.SQRT2 + "<br>" +
  2388.     Math.SQRT1_2 + "<br>" +
  2389.     Math.LN2 + "<br>" +
  2390.     Math.LN10 + "<br>" +
  2391.     Math.LOG2E + "<br>" +
  2392.     Math.LOG10E + "<br>";
  2393. }
  2394. </script>
  2395.  
  2396. </body>
  2397. </html>
  2398.  
  2399.  
  2400.  
  2401. c:\users\lalikali\desktop\web\txt\math_floor.txt
  2402. <---------------------------------------------------------------------->
  2403. <!DOCTYPE html>
  2404. <html>
  2405. <body>
  2406.  
  2407. <p>Math.floor() rounds a number <strong>down</strong> to its nearest integer.</p>
  2408.  
  2409. <button onclick="myFunction()">Try it</button>
  2410.  
  2411. <p id="demo"></p>
  2412.  
  2413. <script>
  2414. function myFunction() {
  2415.     document.getElementById("demo").innerHTML = Math.floor(4.7);
  2416. }
  2417. </script>
  2418.  
  2419. </body>
  2420. </html>
  2421.  
  2422.  
  2423.  
  2424. c:\users\lalikali\desktop\web\txt\math_max.txt
  2425. <---------------------------------------------------------------------->
  2426. <!DOCTYPE html>
  2427. <html>
  2428. <body>
  2429.  
  2430. <p>Math.max() returns the highest value.</p>
  2431.  
  2432. <button onclick="myFunction()">Try it</button>
  2433.  
  2434. <p id="demo"></p>
  2435.  
  2436. <script>
  2437. function myFunction() {
  2438.     document.getElementById("demo").innerHTML =
  2439.     Math.max(0, 150, 30, 20, -8, -200);
  2440. }
  2441. </script>
  2442.  
  2443. </body>
  2444. </html>
  2445.  
  2446.  
  2447.  
  2448. c:\users\lalikali\desktop\web\txt\math_min.txt
  2449. <---------------------------------------------------------------------->
  2450. <!DOCTYPE html>
  2451. <html>
  2452. <body>
  2453.  
  2454. <p>Math.min() returns the lowest value.</p>
  2455.  
  2456. <button onclick="myFunction()">Try it</button>
  2457.  
  2458. <p id="demo"></p>
  2459.  
  2460. <script>
  2461. function myFunction() {
  2462.     document.getElementById("demo").innerHTML =
  2463.     Math.min(0, 150, 30, 20, -8, -200);
  2464. }
  2465. </script>
  2466.  
  2467. </body>
  2468. </html>
  2469.  
  2470.  
  2471. c:\users\lalikali\desktop\web\txt\math_random.txt
  2472. <---------------------------------------------------------------------->
  2473. <!DOCTYPE html>
  2474. <html>
  2475. <body>
  2476.  
  2477. <p>Math.random() returns a random number between 0 and 1.</p>
  2478.  
  2479. <button onclick="myFunction()">Try it</button>
  2480.  
  2481. <p id="demo"></p>
  2482.  
  2483. <script>
  2484. function myFunction() {
  2485.     document.getElementById("demo").innerHTML = Math.random();
  2486. }
  2487. </script>
  2488.  
  2489. </body>
  2490. </html>
  2491.  
  2492.  
  2493.  
  2494. c:\users\lalikali\desktop\web\txt\math_round.txt
  2495. <---------------------------------------------------------------------->
  2496. <!DOCTYPE html>
  2497. <html>
  2498. <body>
  2499.  
  2500. <p>Math.round() rounds a number to its nearest integer.</p>
  2501.  
  2502. <button onclick="myFunction()">Try it</button>
  2503.  
  2504. <p id="demo"></p>
  2505.  
  2506. <script>
  2507. function myFunction() {
  2508.     document.getElementById("demo").innerHTML = Math.round(4.4);
  2509. }
  2510. </script>
  2511.  
  2512. </body>
  2513. </html>
  2514.  
  2515.  
  2516. c:\users\lalikali\desktop\web\txt\max_value.txt
  2517. <---------------------------------------------------------------------->
  2518. <!DOCTYPE html>
  2519. <html>
  2520. <body>
  2521.  
  2522. <p id="demo"></p>
  2523.  
  2524. <script>
  2525. document.getElementById("demo").innerHTML = Number.MAX_VALUE;
  2526. </script>
  2527.  
  2528. </body>
  2529. </html>
  2530.  
  2531.  
  2532. c:\users\lalikali\desktop\web\txt\ndarjaStringut.txt
  2533. <---------------------------------------------------------------------->
  2534. <!DOCTYPE html>
  2535. <html>
  2536. <body>
  2537.  
  2538. <p>Click "Try it" to display the first array element, after a string split.</p>
  2539.  
  2540. <button onclick="myFunction()">Try it</button>
  2541.  
  2542. <p id="demo"></p>
  2543.  
  2544. <script>
  2545. function myFunction() {
  2546.     var str = "a,b,c,d,e,f";
  2547.     var arr = str.split(",");
  2548.     document.getElementById("demo").innerHTML = arr[0];
  2549. }
  2550. </script>
  2551.  
  2552. </body>
  2553. </html>
  2554.  
  2555.  
  2556. c:\users\lalikali\desktop\web\txt\ndarjaStringut2.txt
  2557. <---------------------------------------------------------------------->
  2558. <!DOCTYPE html>
  2559. <html>
  2560. <body>
  2561.  
  2562. <p id="demo"></p>
  2563.  
  2564. <script>
  2565. var str = "Hello";
  2566. var arr = str.split("");
  2567. var text = "";
  2568. var i;
  2569. for (i = 0; i < arr.length; i++) {
  2570.    text += arr[i] + "<br>"
  2571. }
  2572. document.getElementById("demo").innerHTML = text;
  2573. </script>
  2574.  
  2575. </body>
  2576. </html>
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582. c:\users\lalikali\desktop\web\txt\ndryshimi.imazhit.txt
  2583. <---------------------------------------------------------------------->
  2584. <!DOCTYPE html>
  2585. <html>
  2586. <body>
  2587.  
  2588. <h1>JavaScript Can Change Images</h1>
  2589.  
  2590. <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180">
  2591.  
  2592. <p>Click the light bulb to turn on/off the light.</p>
  2593.  
  2594. <script>
  2595. function changeImage() {
  2596.     var image = document.getElementById('myImage');
  2597.     if (image.src.match("bulbon")) {
  2598.         image.src = "pic_bulboff.gif";
  2599.     } else {
  2600.         image.src = "pic_bulbon.gif";
  2601.     }
  2602. }
  2603. </script>
  2604.  
  2605. </body>
  2606. </html>
  2607.  
  2608.  
  2609.  
  2610. c:\users\lalikali\desktop\web\txt\ndryshimi.permbajtjesHTML.txt
  2611. <---------------------------------------------------------------------->
  2612. <!DOCTYPE html>
  2613. <html>
  2614. <body>
  2615.  
  2616. <h1>What Can JavaScript Do?</h1>
  2617.  
  2618. <p id="demo">JavaScript can change HTML content.</p>
  2619.  
  2620. <button type="button"
  2621. onclick="document.getElementById('demo').innerHTML = 'Hello JavaScript!'">
  2622. Click Me!</button>
  2623.  
  2624. </body>
  2625. </html>
  2626.  
  2627.  
  2628.  
  2629. c:\users\lalikali\desktop\web\txt\ndryshimi.stilit.txt
  2630. <---------------------------------------------------------------------->
  2631. <!DOCTYPE html>
  2632. <html>
  2633. <body>
  2634.  
  2635. <h1>What Can JavaScript Do?</h1>
  2636.  
  2637. <p id="demo">JavaScript can change the style of an HTML element.</p>
  2638.  
  2639. <script>
  2640. function myFunction() {
  2641.     var x = document.getElementById("demo");
  2642.     x.style.fontSize = "25px";          
  2643.     x.style.color = "red";
  2644. }
  2645. </script>
  2646.  
  2647. <button type="button" onclick="myFunction()">Click Me!</button>
  2648.  
  2649. </body>
  2650. </html>
  2651.  
  2652.  
  2653. c:\users\lalikali\desktop\web\txt\numeric.txt
  2654. <---------------------------------------------------------------------->
  2655. <body>
  2656.  
  2657. <?php
  2658. $temp = "";
  2659. $msg = "";
  2660. $rst = "";
  2661.  
  2662. if (isset($_POST["submit"])) {  
  2663. $number = $_POST["custid"];
  2664.  
  2665. if(empty($number)) {
  2666. $msg = '<span class="error"> Please enter a value</span>';
  2667. } else if(!is_numeric($number)) {
  2668. $msg = '<span class="error"> Data entered was not numeric</span>';
  2669. } else if(strlen($number) != 6) {
  2670. $msg = '<span class="error"> The number entered was not 6 digits long</span>';
  2671. } else {
  2672. echo "valid";
  2673. }
  2674.  
  2675. }
  2676.  
  2677. ?>
  2678.  
  2679. <h1>Customer Information Collection <br /></h1>
  2680.  
  2681. <form method="POST" action="<?php echo $_SERVER["PHP_SELF"];?>" id="custinfo" >
  2682. <table>
  2683. <tr>
  2684.     <td><label for="custid">Customer ID (integer value): </label></td>
  2685.     <td><input type="text" id="custid" name="custid" value="<?php echo   $temp ?>" size=11 /><?php echo $msg; ?></td>
  2686. </tr>
  2687.  
  2688. <tr>
  2689.     <td><label for="customerfname">Customer Frist Name: </label></td>
  2690.     <td><input type="text" id="customerfname" name="fname" size=50/></td>
  2691. </tr>
  2692. <tr>
  2693.     <td><label for="customerlname">Customer Last Name: </label></td>
  2694.     <td><input type="text" id="customerlname" name="lname" size=50/></td>
  2695. </tr>
  2696. <tr>
  2697.     <td><label for="customeraddress">Customer Address: </label></td>
  2698.     <td><input type="text" id="customeraddress" name="custaddress" size=65/></td>
  2699.  
  2700.     <td><label for="suburb"> Suburb: </label></td>
  2701. <td><input type="text" id="suburb" name="suburb"/></td>
  2702. </tr>
  2703. <tr>
  2704. <td>
  2705. State:<select name="state" id="state">
  2706.     <option value="select">--</option>
  2707.     <option value="ACT">ACT</option>
  2708.     <option value="NSW">NSW</option>
  2709.     <option value="NT">NT</option>
  2710.     <option value="QLD">QLD</option>
  2711.     <option value="SA">SA</option>
  2712.     <option value="TAS">TAS</option>
  2713.     <option value="VIC">VIC</option>
  2714.      <option value="WA">WA</option>
  2715.   </select>
  2716. </td>
  2717. <td><label for="postcode"> Post Code: </label><input type="text" id="postcode" name="postcode" size=4/></td>
  2718. </tr>
  2719. </table>
  2720. <p><input type="submit" name="submit" value="Save Data"/>&nbsp;<input type="reset" value="Clear Form" />
  2721. </tr>
  2722.  
  2723. </form>
  2724.  
  2725. </body>
  2726.  
  2727.  
  2728. modifikim
  2729. if(empty($number)) {
  2730.     $msg = '<span class="error"> Please enter a value</span>';
  2731. } else if(!is_numeric($number)) {
  2732.     $msg = '<span class="error"> Data entered was not numeric</span>';
  2733. } else if(strlen($number) != 6) {
  2734.     $msg = '<span class="error"> The number entered was not 6 digits long</span>';
  2735. } else {
  2736.    
  2737. }
  2738.  
  2739.  
  2740. c:\users\lalikali\desktop\web\txt\numri+madh.txt
  2741. <---------------------------------------------------------------------->
  2742. <!DOCTYPE html>
  2743. <html>
  2744. <body>
  2745.  
  2746. <p>Finding the largest number.</p>
  2747. <p id="demo"></p>
  2748.  
  2749. <script>
  2750. function findMax() {
  2751.     var i;
  2752.     var max = -Infinity;
  2753.     for(i = 0; i < arguments.length; i++) {
  2754.        if (arguments[i] > max) {
  2755.             max = arguments[i];
  2756.         }
  2757.     }
  2758.     return max;
  2759. }
  2760. document.getElementById("demo").innerHTML = findMax(4, 5, 6);
  2761. </script>
  2762.  
  2763. </body>
  2764. </html>
  2765.  
  2766.  
  2767. c:\users\lalikali\desktop\web\txt\objekt.txt
  2768. <---------------------------------------------------------------------->
  2769. <!DOCTYPE html>
  2770. <html>
  2771. <body>
  2772. <p id="demo"></p>
  2773.  
  2774. <script>
  2775. var person = {
  2776.     firstName : "John",
  2777.     lastName  : "Doe",
  2778.     age       : 50,
  2779.     eyeColor  : "blue"
  2780. };
  2781.  
  2782. document.getElementById("demo").innerHTML =
  2783. person.firstName + " is " + person.age + " years old.";
  2784. </script>
  2785.  
  2786. </body>
  2787. </html>
  2788.  
  2789.  
  2790.  
  2791. c:\users\lalikali\desktop\web\txt\onkeydown.txt
  2792. <---------------------------------------------------------------------->
  2793. <!DOCTYPE html>
  2794. <html>
  2795. <body>
  2796.  
  2797. <p>Click the button to display the date.</p>
  2798.  
  2799. <button onkeydown="displayDate()">The time is?</button>
  2800.  
  2801. <script>
  2802. function displayDate() {
  2803.     document.getElementById("demo").innerHTML = Date();
  2804. }
  2805. </script>
  2806.  
  2807. <p id="demo"></p>
  2808.  
  2809. </body>
  2810. </html>
  2811.  
  2812.  
  2813.  
  2814. c:\users\lalikali\desktop\web\txt\onmouseout.txt
  2815. <---------------------------------------------------------------------->
  2816. <!DOCTYPE html>
  2817. <html>
  2818. <body>
  2819.  
  2820. <p>Click the button to display the date.</p>
  2821.  
  2822. <button onmouseout="displayDate()">The time is?</button>
  2823.  
  2824. <script>
  2825. function displayDate() {
  2826.     document.getElementById("demo").innerHTML = Date();
  2827. }
  2828. </script>
  2829.  
  2830. <p id="demo"></p>
  2831.  
  2832. </body>
  2833. </html>
  2834.  
  2835.  
  2836.  
  2837. c:\users\lalikali\desktop\web\txt\operator_aritmetike.txt
  2838. <---------------------------------------------------------------------->
  2839. <html>
  2840.    
  2841.    <head>
  2842.       <title>Arithmetical Operators</title>
  2843.    </head>
  2844.    
  2845.    <body>
  2846.    
  2847.       <?php
  2848.         $a = 42;
  2849.         $b = 20;
  2850.        
  2851.         $c = $a + $b;
  2852.         echo "Addtion Operation Result: $c <br/>";
  2853.          
  2854.          $c = $a - $b;
  2855.          echo "Substraction Operation Result: $c <br/>";
  2856.          
  2857.          $c = $a * $b;
  2858.          echo "Multiplication Operation Result: $c <br/>";
  2859.          
  2860.          $c = $a / $b;
  2861.          echo "Division Operation Result: $c <br/>";
  2862.          
  2863.          $c = $a % $b;
  2864.          echo "Modulus Operation Result: $c <br/>";
  2865.          
  2866.          $c = $a++;
  2867.          echo "Increment Operation Result: $c <br/>";
  2868.          
  2869.          $c = $a--;
  2870.          echo "Decrement Operation Result: $c <br/>";
  2871.       ?>
  2872.    
  2873.    </body>
  2874. </html>
  2875.  
  2876. Rezultati:
  2877. Addtion Operation Result: 62
  2878. Substraction Operation Result: 22
  2879. Multiplication Operation Result: 840
  2880. Division Operation Result: 2.1
  2881. Modulus Operation Result: 2
  2882. Increment Operation Result: 42
  2883. Decrement Operation Result: 43
  2884.  
  2885.  
  2886. c:\users\lalikali\desktop\web\txt\operator_dhenie vlere.txt
  2887. <---------------------------------------------------------------------->
  2888. <html>
  2889.    
  2890.    <head>
  2891.       <title>Assignment Operators</title>
  2892.    </head>
  2893.    
  2894.    <body>
  2895.      
  2896.       <?php
  2897.         $a = 42;
  2898.         $b = 20;
  2899.        
  2900.         $c = $a + $b;   /* operator dhenie vlere */
  2901.         echo "Addtion Operation Result: $c <br/>";
  2902.          
  2903.          $c += $a;  /* vlera e c eshte 42 + 20 = 62 */
  2904.          echo "Add AND Assigment Operation Result: $c <br/>";
  2905.          
  2906.          $c -= $a; /* vlera e c eshte 42 + 20 + 42 = 104 */
  2907.          echo "Subtract AND Assignment Operation Result: $c <br/>";
  2908.          
  2909.          $c *= $a; /* vlera e c eshte 104 - 42 = 62 */
  2910.          echo "Multiply AND Assignment Operation Result: $c <br/>";
  2911.          
  2912.          $c /= $a;  /* vlera e c eshte 62 * 42 = 2604 */
  2913.          echo "Division AND Assignment Operation Result: $c <br/>";
  2914.          
  2915.          $c %= $a; /* vlera e c eshte 2604/42 = 62*/
  2916.          echo "Modulus AND Assignment Operation Result: $c <br/>";
  2917.       ?>
  2918.      
  2919.    </body>
  2920. </html>
  2921.  
  2922. Rezultati:
  2923. Addtion Operation Result: 62
  2924. Add AND Assigment Operation Result: 104
  2925. Subtract AND Assignment Operation Result: 62
  2926. Multiply AND Assignment Operation Result: 2604
  2927. Division AND Assignment Operation Result: 62
  2928. Modulus AND Assignment Operation Result: 20
  2929.  
  2930.  
  2931. c:\users\lalikali\desktop\web\txt\operator_krahasues.txt
  2932. <---------------------------------------------------------------------->
  2933. <html>
  2934.    
  2935.    <head>
  2936.       <title>Comparison Operators</title>
  2937.    </head>
  2938.    
  2939.    <body>
  2940.      
  2941.       <?php
  2942.         $a = 42;
  2943.         $b = 20;
  2944.      
  2945.         if( $a == $b ){
  2946.            echo "TEST1 : a is equal to b<br/>";
  2947.          }
  2948.          else{
  2949.             echo "TEST1 : a is not equal to b<br/>";
  2950.          }
  2951.      
  2952.          if( $a > $b ){
  2953.             echo "TEST2 : a is greater than  b<br/>";
  2954.          }
  2955.          else{
  2956.             echo "TEST2 : a is not greater than b<br/>";
  2957.          }
  2958.      
  2959.          if( $a < $b ){
  2960.            echo "TEST3 : a is less than  b<br/>";
  2961.          }
  2962.          else{
  2963.             echo "TEST3 : a is not less than b<br/>";
  2964.          }
  2965.      
  2966.          if( $a != $b ){
  2967.             echo "TEST4 : a is not equal to b<br/>";
  2968.          }
  2969.          else{
  2970.             echo "TEST4 : a is equal to b<br/>";
  2971.          }
  2972.      
  2973.          if( $a >= $b ){
  2974.             echo "TEST5 : a is either greater than or equal to b<br/>";
  2975.          }
  2976.          else{
  2977.             echo "TEST5 : a is neither greater than nor equal to b<br/>";
  2978.          }
  2979.      
  2980.          if( $a <= $b ){
  2981.            echo "TEST6 : a is either less than or equal to b<br/>";
  2982.          }
  2983.          else{
  2984.             echo "TEST6 : a is neither less than nor equal to b<br/>";
  2985.          }
  2986.       ?>
  2987.      
  2988.    </body>
  2989. </html>
  2990.  
  2991. Rezultati:
  2992. TEST1 : a is not equal to b
  2993. TEST2 : a is greater than b
  2994. TEST3 : a is not less than b
  2995. TEST4 : a is not equal to b
  2996. TEST5 : a is either greater than or equal to b
  2997. TEST6 : a is neither less than nor equal to b
  2998.  
  2999.  
  3000. c:\users\lalikali\desktop\web\txt\operator_kushtor.txt
  3001. <---------------------------------------------------------------------->
  3002. <html>
  3003.    
  3004.    <head>
  3005.       <title>Arithmetical Operators</title>
  3006.    </head>
  3007.    
  3008.    <body>
  3009.    
  3010.       <?php
  3011.         $a = 10;
  3012.         $b = 20;
  3013.        
  3014.         /* nqs kushti i vertete kaloja vleren a perndryshe b */
  3015.         $result = ($a > $b ) ? $a :$b;
  3016.          
  3017.          echo "TEST1 : Value of result is $result<br/>";
  3018.          
  3019.          /* nqs kushti i vertete kaloja vleren a perndryshe b */
  3020.          $result = ($a < $b ) ? $a :$b;
  3021.        
  3022.         echo "TEST2 : Value of result is $result<br/>";
  3023.       ?>
  3024.    
  3025.    </body>
  3026. </html>
  3027. rezultati:
  3028. TEST1 : Value of result is 20
  3029. TEST2 : Value of result is 10
  3030.  
  3031.  
  3032. c:\users\lalikali\desktop\web\txt\operator_llogjike.txt
  3033. <---------------------------------------------------------------------->
  3034. <html>
  3035.    
  3036.    <head>
  3037.       <title>Logical Operators</title>
  3038.    </head>
  3039.    
  3040.    <body>
  3041.      
  3042.       <?php
  3043.         $a = 42;
  3044.         $b = 0;
  3045.        
  3046.         if( $a && $b ){
  3047.            echo "TEST1 : Both a and b are true<br/>";
  3048.          }
  3049.          else{
  3050.             echo "TEST1 : Either a or b is false<br/>";
  3051.          }
  3052.          
  3053.          if( $a and $b ){
  3054.             echo "TEST2 : Both a and b are true<br/>";
  3055.          }
  3056.          else{
  3057.             echo "TEST2 : Either a or b is false<br/>";
  3058.          }
  3059.          
  3060.          if( $a || $b ){
  3061.             echo "TEST3 : Either a or b is true<br/>";
  3062.          }
  3063.          else{
  3064.             echo "TEST3 : Both a and b are false<br/>";
  3065.          }
  3066.          
  3067.          if( $a or $b ){
  3068.             echo "TEST4 : Either a or b is true<br/>";
  3069.          }
  3070.          else{
  3071.             echo "TEST4 : Both a and b are false<br/>";
  3072.          }
  3073.          
  3074.          $a = 10;
  3075.          $b = 20;
  3076.          
  3077.          if( $a ){
  3078.             echo "TEST5 : a is true <br/>";
  3079.          }
  3080.          else{
  3081.             echo "TEST5 : a  is false<br/>";
  3082.          }
  3083.          
  3084.          if( $b ){
  3085.             echo "TEST6 : b is true <br/>";
  3086.          }
  3087.          else{
  3088.             echo "TEST6 : b  is false<br/>";
  3089.          }
  3090.          
  3091.          if( !$a ){
  3092.             echo "TEST7 : a is true <br/>";
  3093.          }
  3094.          else{
  3095.             echo "TEST7 : a  is false<br/>";
  3096.          }
  3097.          
  3098.          if( !$b ){
  3099.             echo "TEST8 : b is true <br/>";
  3100.          }
  3101.          else{
  3102.             echo "TEST8 : b  is false<br/>";
  3103.          }
  3104.       ?>
  3105.      
  3106.    </body>
  3107. </html>
  3108.  
  3109.  
  3110. c:\users\lalikali\desktop\web\txt\operator1.txt
  3111. <---------------------------------------------------------------------->
  3112. <!DOCTYPE html>
  3113. <html>
  3114. <body>
  3115.  
  3116. <h1>Assigning Values</h1>
  3117.  
  3118. <p>In JavaScript the = operator is used to assign values to variables.</p>
  3119.  
  3120. <p id="demo"></p>
  3121.  
  3122. <script>
  3123. var x = 5;
  3124. var y = 6;
  3125. document.getElementById("demo").innerHTML = x + y;
  3126. </script>
  3127.  
  3128. </body>
  3129. </html>
  3130.  
  3131.  
  3132. c:\users\lalikali\desktop\web\txt\operator2.txt
  3133. <---------------------------------------------------------------------->
  3134. <!DOCTYPE html>
  3135. <html>
  3136. <body>
  3137.  
  3138. <h1>JavaScript Operators</h1>
  3139.  
  3140. <p>JavaScript uses arithmetic operators to compute values (just like algebra).</p>
  3141.  
  3142. <p id="demo"></p>
  3143.  
  3144. <script>
  3145. document.getElementById("demo").innerHTML = (5 + 6) * 10;
  3146. </script>
  3147.  
  3148. </body>
  3149. </html>
  3150.  
  3151.  
  3152.  
  3153. c:\users\lalikali\desktop\web\txt\parameter.txt
  3154. <---------------------------------------------------------------------->
  3155. <?php
  3156.   // shumezo me 10
  3157.   function multiply ($value) {
  3158.      $value = $value * 10;
  3159.      return $value;
  3160.   }
  3161.  
  3162.   $retval = multiply (10);
  3163.   Print "Return value is $retval\n";
  3164. ?>
  3165.  
  3166. Do afishoje:
  3167. Return value is 100
  3168.  
  3169.  
  3170. c:\users\lalikali\desktop\web\txt\print.txt
  3171. <---------------------------------------------------------------------->
  3172. <!DOCTYPE html>
  3173. <html>
  3174. <body>
  3175.  
  3176. <?php
  3177. $str = "Hello world!";
  3178. print $str;
  3179. print "<br>What a nice day!";
  3180. ?>
  3181.  
  3182. </body>
  3183. </html>
  3184.  
  3185. Rez:
  3186. Hello world!
  3187. What a nice day!
  3188.  
  3189.  
  3190. c:\users\lalikali\desktop\web\txt\printf.txt
  3191. <---------------------------------------------------------------------->
  3192. <!DOCTYPE html>
  3193. <html>
  3194. <body>
  3195.  
  3196. <?php
  3197. $number = 9;
  3198. $str = "Beijing";
  3199. printf("There are %u million bicycles in %s.",$number,$str);
  3200. ?>
  3201.  
  3202. </body>
  3203. </html>
  3204.  
  3205. There are 9 million bicycles in Beijing.
  3206.  
  3207.  
  3208. c:\users\lalikali\desktop\web\txt\program.txt
  3209. <---------------------------------------------------------------------->
  3210. <!DOCTYPE html>
  3211. <html>
  3212. <body>
  3213.  
  3214. <p>JavaScript code (or just JavaScript) is a list of JavaScript statements.</p>
  3215.  
  3216. <p id="demo"></p>
  3217.  
  3218. <script>
  3219. var x = 5;
  3220. var y = 6;
  3221. var z = x + y;
  3222. document.getElementById("demo").innerHTML = z;
  3223. </script>
  3224.  
  3225. </body>
  3226. </html>
  3227.  
  3228.  
  3229.  
  3230. c:\users\lalikali\desktop\web\txt\program2.txt
  3231. <---------------------------------------------------------------------->
  3232. <!DOCTYPE html>
  3233. <html>
  3234. <body>
  3235.  
  3236. <h1>My Web Page</h1>
  3237.  
  3238. <p id="myPar">I am a paragraph.</p>
  3239. <div id="myDiv">I am a div.</div>
  3240.  
  3241. <p>
  3242. <button type="button" onclick="myFunction()">Try it</button>
  3243. </p>
  3244.  
  3245. <script>
  3246. function myFunction() {
  3247.     document.getElementById("myPar").innerHTML = "Hello Dolly.";
  3248.     document.getElementById("myDiv").innerHTML = "How are you?";
  3249. }
  3250. </script>
  3251.  
  3252. <p>When you click on "Try it", the two elements will change.</p>
  3253.  
  3254. </body>
  3255. </html>
  3256.  
  3257.  
  3258. c:\users\lalikali\desktop\web\txt\program3.txt
  3259. <---------------------------------------------------------------------->
  3260. <!DOCTYPE html>
  3261. <html>
  3262. <body>
  3263.  
  3264. <h1>JavaScript Variables</h1>
  3265.  
  3266. <p>Add "5" + 2 + 3. and display the result:</p>
  3267.  
  3268. <p id="demo"></p>
  3269.  
  3270. <script>
  3271. var x = "5" + 2 + 3;
  3272. document.getElementById("demo").innerHTML = x;
  3273. </script>
  3274.  
  3275. </body>
  3276. </html>
  3277.  
  3278.  
  3279.  
  3280. c:\users\lalikali\desktop\web\txt\replace.txt
  3281. <---------------------------------------------------------------------->
  3282. <!DOCTYPE html>
  3283. <html>
  3284. <body>
  3285.  
  3286. <p>Replace "Microsoft" with "W3Schools" in the paragraph below:</p>
  3287.  
  3288. <button onclick="myFunction()">Try it</button>
  3289.  
  3290. <p id="demo">Please visit Microsoft!</p>
  3291.  
  3292. <script>
  3293. function myFunction() {
  3294.     var str = document.getElementById("demo").innerHTML;
  3295.     var txt = str.replace("Microsoft","Windows");
  3296.     document.getElementById("demo").innerHTML = txt;
  3297. }
  3298. </script>
  3299.  
  3300. </body>
  3301. </html>
  3302.  
  3303.  
  3304. c:\users\lalikali\desktop\web\txt\round.txt
  3305. <---------------------------------------------------------------------->
  3306. <!DOCTYPE html>
  3307. <html>
  3308. <body>
  3309.  
  3310. <p>The toFixed() method rounds a number to a given number of digits.</p>
  3311. <p>For working with money, toFixed(2) is perfect.</p>
  3312.  
  3313. <p id="demo"></p>
  3314.  
  3315. <script>
  3316. var x = 9.656;
  3317. document.getElementById("demo").innerHTML =
  3318.     x.toFixed(0) + "<br>" +
  3319.     x.toFixed(2) + "<br>" +
  3320.     x.toFixed(4) + "<br>" +
  3321.     x.toFixed(6);
  3322. </script>
  3323.  
  3324. </body>
  3325. </html>
  3326.  
  3327.  
  3328. c:\users\lalikali\desktop\web\txt\rsort_index.txt
  3329. <---------------------------------------------------------------------->
  3330. <!DOCTYPE html>
  3331. <html>
  3332. <body>
  3333.  
  3334. <?php
  3335. $cars = array("Volvo", "BMW", "Toyota");
  3336. rsort($cars);
  3337.  
  3338. $clength = count($cars);
  3339. for($x = 0; $x <  $clength; $x++) {
  3340.     echo $cars[$x];
  3341.     echo "<br>";
  3342. }
  3343. ?>
  3344.  
  3345. </body>
  3346. </html>
  3347.  
  3348. Volvo
  3349. Toyota
  3350. BMW
  3351.  
  3352.  
  3353. c:\users\lalikali\desktop\web\txt\rsort_index2.txt
  3354. <---------------------------------------------------------------------->
  3355. <!DOCTYPE html>
  3356. <html>
  3357. <body>
  3358.  
  3359. <?php
  3360. $numbers = array(4, 6, 2, 22, 11);
  3361. rsort($numbers);
  3362.  
  3363. $arrlength = count($numbers);
  3364. for($x = 0; $x <  $arrlength; $x++) {
  3365.     echo $numbers[$x];
  3366.     echo "<br>";
  3367. }
  3368. ?>
  3369.  
  3370. </body>
  3371. </html>
  3372.  
  3373. 22
  3374. 11
  3375. 6
  3376. 4
  3377. 2
  3378.  
  3379.  
  3380. c:\users\lalikali\desktop\web\txt\shoqerues.txt
  3381. <---------------------------------------------------------------------->
  3382. <html>
  3383.    <body>
  3384.      
  3385.       <?php
  3386.         /* Menyra e pare */
  3387.         $salaries = array("arben" => 2000, "mira" => 1000, "zara" => 500);
  3388.          
  3389.          echo "Salary of arben is ". $salaries['arben'] . "<br />";
  3390.          echo "Salary of mira is ".  $salaries['mira']. "<br />";
  3391.          echo "Salary of zara is ".  $salaries['zara']. "<br />";
  3392.          
  3393.          /* Menyra e dyte */
  3394.          $salaries['arben'] = "high";
  3395.          $salaries['mira'] = "medium";
  3396.          $salaries['zara'] = "low";
  3397.          
  3398.          echo "Salary of arben is ". $salaries['arben'] . "<br />";
  3399.          echo "Salary of mira is ".  $salaries['mira']. "<br />";
  3400.          echo "Salary of zara is ".  $salaries['zara']. "<br />";
  3401.       ?>
  3402.    
  3403.    </body>
  3404. </html>
  3405.  
  3406. Rezultati:
  3407.  
  3408. Salary of arben is 2000
  3409. Salary of mira is 1000
  3410. Salary of zara is 500
  3411. Salary of arben is high
  3412. Salary of mira is medium
  3413. Salary of zara is low
  3414.  
  3415.  
  3416. c:\users\lalikali\desktop\web\txt\shprehje1.txt
  3417. <---------------------------------------------------------------------->
  3418. <!DOCTYPE html>
  3419. <html>
  3420. <body>
  3421.  
  3422. <h1>JavaScript Expressions</h1>
  3423.  
  3424. <p>Expressions compute to values.</p>
  3425.  
  3426. <p id="demo"></p>
  3427.  
  3428. <script>
  3429. document.getElementById("demo").innerHTML = 5 * 10;
  3430. </script>
  3431.  
  3432. </body>
  3433. </html>
  3434.  
  3435.  
  3436. c:\users\lalikali\desktop\web\txt\shprehje2.txt
  3437. <---------------------------------------------------------------------->
  3438. <!DOCTYPE html>
  3439. <html>
  3440. <body>
  3441.  
  3442. <h1>JavaScript Expressions</h1>
  3443.  
  3444. <p>Expressions compute to values.</p>
  3445.  
  3446. <p id="demo"></p>
  3447.  
  3448. <script>
  3449. var x = 5;
  3450. document.getElementById("demo").innerHTML = x * 10;
  3451. </script>
  3452.  
  3453. </body>
  3454. </html>
  3455.  
  3456.  
  3457. c:\users\lalikali\desktop\web\txt\shprehje3.txt
  3458. <---------------------------------------------------------------------->
  3459. <!DOCTYPE html>
  3460. <html>
  3461. <body>
  3462.  
  3463. <h1>JavaScript Expressions</h1>
  3464.  
  3465. <p>Expressions compute to values.</p>
  3466.  
  3467. <p id="demo"></p>
  3468.  
  3469. <script>
  3470. document.getElementById("demo").innerHTML = "John" + " "  + "Doe";
  3471. </script>
  3472.  
  3473. </body>
  3474. </html>
  3475.  
  3476.  
  3477.  
  3478. c:\users\lalikali\desktop\web\txt\shprehje4.txt
  3479. <---------------------------------------------------------------------->
  3480. <!DOCTYPE html>
  3481. <html>
  3482. <body>
  3483.  
  3484. <h1>The var Keyword Creates a Variable</h1>
  3485.  
  3486. <p id="demo"></p>
  3487.  
  3488. <script>
  3489. var x = 5 + 6;
  3490. var y = x * 10;
  3491. document.getElementById("demo").innerHTML = y;
  3492. </script>
  3493.  
  3494. </body>
  3495. </html>
  3496.  
  3497.  
  3498.  
  3499. c:\users\lalikali\desktop\web\txt\shumedimensional.txt
  3500. <---------------------------------------------------------------------->
  3501. <html>
  3502.    <body>
  3503.      
  3504.       <?php
  3505.         $marks = array( "arben" => array
  3506.             (
  3507.                "physics" => 35,
  3508.                "maths" => 30,  
  3509.                "chemistry" => 39
  3510.             ),
  3511.            
  3512.             "mira" => array
  3513.             (
  3514.                "physics" => 30,
  3515.                "maths" => 32,
  3516.                "chemistry" => 29
  3517.             ),
  3518.            
  3519.             "zara" => array
  3520.             (
  3521.                "physics" => 31,
  3522.                "maths" => 22,
  3523.                "chemistry" => 39
  3524.             )
  3525.          );
  3526.          
  3527.          /* Accessing multi-dimensional array values */
  3528.          echo "Marks for arben in physics : " ;
  3529.          echo $marks['arben']['physics'] . "<br />";
  3530.          
  3531.          echo "Marks for mira in maths : ";
  3532.          echo $marks['mira']['maths'] . "<br />";
  3533.          
  3534.          echo "Marks for zara in chemistry : " ;
  3535.          echo $marks['zara']['chemistry'] . "<br />";
  3536.       ?>
  3537.    
  3538.    </body>
  3539. </html>
  3540.  
  3541. Rezultati:
  3542. Marks for arben in physics : 35
  3543. Marks for mira in maths : 32
  3544. Marks for zara in chemistry : 39
  3545.  
  3546.  
  3547. c:\users\lalikali\desktop\web\txt\sort_index.txt
  3548. <---------------------------------------------------------------------->
  3549. <!DOCTYPE html>
  3550. <html>
  3551. <body>
  3552.  
  3553. <?php
  3554. $cars = array("Volvo", "BMW", "Toyota");
  3555. sort($cars);
  3556.  
  3557. $clength = count($cars);
  3558. for($x = 0; $x <  $clength; $x++) {
  3559.     echo $cars[$x];
  3560.     echo "<br>";
  3561. }
  3562. ?>
  3563.  
  3564. </body>
  3565. </html>
  3566.  
  3567. BMW
  3568. Toyota
  3569. Volvo
  3570.  
  3571.  
  3572. c:\users\lalikali\desktop\web\txt\sort_index2.txt
  3573. <---------------------------------------------------------------------->
  3574. <!DOCTYPE html>
  3575. <html>
  3576. <body>
  3577.  
  3578. <?php
  3579. $numbers = array(4, 6, 2, 22, 11);
  3580. sort($numbers);
  3581.  
  3582. $arrlength = count($numbers);
  3583. for($x = 0; $x <  $arrlength; $x++) {
  3584.     echo $numbers[$x];
  3585.     echo "<br>";
  3586. }
  3587. ?>
  3588.  
  3589. </body>
  3590. </html>
  3591.  
  3592. 2
  3593. 4
  3594. 6
  3595. 11
  3596. 22
  3597.  
  3598.  
  3599. c:\users\lalikali\desktop\web\txt\static.txt
  3600. <---------------------------------------------------------------------->
  3601. <?php
  3602.   function keep_track() {
  3603.      STATIC $count = 0;
  3604.      $count++;
  3605.      print $count;
  3606.      print "<br />";
  3607.    }
  3608.    
  3609.    keep_track();
  3610.    keep_track();
  3611.    keep_track();
  3612. ?>
  3613.  
  3614. Do afishoje:
  3615. 1
  3616. 2
  3617. 3
  3618.  
  3619.  
  3620. c:\users\lalikali\desktop\web\txt\stile.txt
  3621. <---------------------------------------------------------------------->
  3622. <!DOCTYPE html>
  3623. <html>
  3624. <head>
  3625. <style>
  3626. table {
  3627.     width:100%;
  3628. }
  3629. table, th, td {
  3630.     border: 1px solid black;
  3631.     border-collapse: collapse;
  3632. }
  3633. th, td {
  3634.     padding: 5px;
  3635.     text-align: left;
  3636. }
  3637. table#t01 tr:nth-child(even) {
  3638.     background-color: #eee;
  3639. }
  3640. table#t01 tr:nth-child(odd) {
  3641.    background-color:#fff;
  3642. }
  3643. table#t01 th    {
  3644.     background-color: black;
  3645.     color: white;
  3646. }
  3647. </style>
  3648. </head>
  3649. <body>
  3650.  
  3651. <table>
  3652.   <tr>
  3653.     <th>First Name</th>
  3654.     <th>Last Name</th>     
  3655.     <th>Points</th>
  3656.   </tr>
  3657.   <tr>
  3658.     <td>Jill</td>
  3659.     <td>Smith</td>     
  3660.     <td>50</td>
  3661.   </tr>
  3662.   <tr>
  3663.     <td>Eve</td>
  3664.     <td>Jackson</td>       
  3665.     <td>94</td>
  3666.   </tr>
  3667.   <tr>
  3668.     <td>John</td>
  3669.     <td>Doe</td>       
  3670.     <td>80</td>
  3671.   </tr>
  3672. </table>
  3673.  
  3674. <br>
  3675.  
  3676. <table id="t01">
  3677.   <tr>
  3678.     <th>First Name</th>
  3679.     <th>Last Name</th>     
  3680.     <th>Points</th>
  3681.   </tr>
  3682.   <tr>
  3683.     <td>Jill</td>
  3684.     <td>Smith</td>     
  3685.     <td>50</td>
  3686.   </tr>
  3687.   <tr>
  3688.     <td>Eve</td>
  3689.     <td>Jackson</td>       
  3690.     <td>94</td>
  3691.   </tr>
  3692.   <tr>
  3693.     <td>John</td>
  3694.     <td>Doe</td>       
  3695.     <td>80</td>
  3696.   </tr>
  3697. </table>
  3698.  
  3699. </body>
  3700. </html>
  3701.  
  3702.  
  3703.  
  3704. c:\users\lalikali\desktop\web\txt\str_replace.txt
  3705. <---------------------------------------------------------------------->
  3706. <!DOCTYPE html>
  3707. <html>
  3708. <body>
  3709.  
  3710. <?php
  3711. echo str_replace("world","Peter","Hello world!");
  3712. ?>
  3713.  
  3714.  
  3715. </body>
  3716. </html>
  3717.  
  3718. Hello Peter!
  3719.  
  3720.  
  3721. c:\users\lalikali\desktop\web\txt\str_word_count.txt
  3722. <---------------------------------------------------------------------->
  3723. <!DOCTYPE html>
  3724. <html>
  3725. <body>
  3726.  
  3727. <?php
  3728. print_r(str_word_count("Hello world & good morning!",1));
  3729. print "<br>";
  3730. print_r(str_word_count("Hello world & good morning!",1,"&"));
  3731. ?>
  3732.  
  3733. </body>
  3734. </html>
  3735.  
  3736. Array ( [0] => Hello [1] => world [2] => good [3] => morning )
  3737. Array ( [0] => Hello [1] => world [2] => & [3] => good [4] => morning )
  3738.  
  3739. <!DOCTYPE html>
  3740. <html>
  3741. <body>
  3742.  
  3743. <?php
  3744. echo str_word_count("Hello world!");
  3745. ?>
  3746.  
  3747. </body>
  3748. </html>
  3749.  
  3750. Rez:2
  3751.  
  3752.  
  3753. c:\users\lalikali\desktop\web\txt\strcasecmp.txt
  3754. <---------------------------------------------------------------------->
  3755. <!DOCTYPE html>
  3756. <html>
  3757. <body>
  3758.  
  3759. <?php
  3760. echo strcasecmp("Hello world!","HELLO WORLD!")."<br>"; // te barabarte
  3761. echo strcasecmp("Hello world!","HELLO")."<br>"; // String1 me i madh se string2
  3762. echo strcasecmp("Hello world!","HELLO WORLD! HELLO!")."<br>"; // String1 me i vogle se string2
  3763. ?>
  3764.  
  3765. </body>
  3766. </html>
  3767.  
  3768. 0
  3769. 7
  3770. -7
  3771.  
  3772.  
  3773. c:\users\lalikali\desktop\web\txt\strcmp.txt
  3774. <---------------------------------------------------------------------->
  3775. <!DOCTYPE html>
  3776. <html>
  3777. <body>
  3778.  
  3779. <?php
  3780. echo strcmp("Hello world!","Hello world!");
  3781. ?>
  3782.  
  3783. <p>If this function returns 0, the two strings are equal.</p>
  3784.  
  3785. </body>
  3786. </html>
  3787.  
  3788. 0
  3789. If this function returns 0, the two strings are equal.
  3790.  
  3791.  
  3792. c:\users\lalikali\desktop\web\txt\string.txt
  3793. <---------------------------------------------------------------------->
  3794. <!DOCTYPE html>
  3795. <html>
  3796. <body>
  3797.  
  3798. <p id="demo"></p>
  3799.  
  3800. <script>
  3801. var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  3802. document.getElementById("demo").innerHTML = txt.length;
  3803. </script>
  3804.  
  3805. </body>
  3806. </html>
  3807.  
  3808.  
  3809. c:\users\lalikali\desktop\web\txt\string_indexof.txt
  3810. <---------------------------------------------------------------------->
  3811. <!DOCTYPE html>
  3812. <html>
  3813. <body>
  3814.  
  3815. <p id="p1">Please locate where 'locate' occurs!.</p>
  3816.  
  3817. <button onclick="myFunction()">Try it</button>
  3818.  
  3819. <p id="demo"></p>
  3820.  
  3821. <script>
  3822. function myFunction() {
  3823.     var str = document.getElementById("p1").innerHTML;
  3824.     var pos = str.indexOf("locate");
  3825.     document.getElementById("demo").innerHTML = pos;
  3826. }
  3827. </script>
  3828.  
  3829. </body>
  3830. </html>
  3831.  
  3832.  
  3833.  
  3834.  
  3835. c:\users\lalikali\desktop\web\txt\string_lastindexindexof.txt
  3836. <---------------------------------------------------------------------->
  3837. <!DOCTYPE html>
  3838. <html>
  3839. <body>
  3840.  
  3841. <p id="p1">Please locate where 'locate' occurs!.</p>
  3842.  
  3843. <button onclick="myFunction()">Try it</button>
  3844.  
  3845. <p id="demo"></p>
  3846.  
  3847. <script>
  3848. function myFunction() {
  3849.     var str = document.getElementById("p1").innerHTML;
  3850.     var pos = str.lastIndexOf("locate");
  3851.     document.getElementById("demo").innerHTML = pos;
  3852. }
  3853. </script>
  3854.  
  3855. </body>
  3856. </html>
  3857.  
  3858.  
  3859.  
  3860. c:\users\lalikali\desktop\web\txt\string_search.txt
  3861. <---------------------------------------------------------------------->
  3862. <!DOCTYPE html>
  3863. <html>
  3864. <body>
  3865.  
  3866. <p id="p1">Please locate where 'locate' occurs!.</p>
  3867.  
  3868. <button onclick="myFunction()">Try it</button>
  3869.  
  3870. <p id="demo"></p>
  3871.  
  3872. <script>
  3873. function myFunction() {
  3874.     var str = document.getElementById("p1").innerHTML;
  3875.     var pos = str.search("locate");
  3876.     document.getElementById("demo").innerHTML = pos;
  3877. }
  3878. </script>
  3879.  
  3880. </body>
  3881. </html>
  3882.  
  3883.  
  3884.  
  3885. c:\users\lalikali\desktop\web\txt\string_slice.txt
  3886. <---------------------------------------------------------------------->
  3887. <!DOCTYPE html>
  3888. <html>
  3889. <body>
  3890.  
  3891. <p>The slice() method extract a part of a string
  3892. and returns the extracted parts in a new string:</p>
  3893.  
  3894. <p id="demo"></p>
  3895.  
  3896. <script>
  3897. var str = "Apple, Banana, Kiwi";
  3898. document.getElementById("demo").innerHTML = str.slice(7,13);
  3899. </script>
  3900.  
  3901. </body>
  3902. </html>
  3903.  
  3904.  
  3905.  
  3906. c:\users\lalikali\desktop\web\txt\string_slice2.txt
  3907. <---------------------------------------------------------------------->
  3908. <!DOCTYPE html>
  3909. <html>
  3910. <body>
  3911.  
  3912. <p>The slice() method extract a part of a string
  3913. and returns the extracted parts in a new string:</p>
  3914.  
  3915. <p id="demo"></p>
  3916.  
  3917. <script>
  3918. var str = "Apple, Banana, Kiwi";
  3919. document.getElementById("demo").innerHTML = str.slice(7);
  3920. </script>
  3921.  
  3922. </body>
  3923. </html>
  3924.  
  3925.  
  3926. c:\users\lalikali\desktop\web\txt\string_substr.txt
  3927. <---------------------------------------------------------------------->
  3928. <!DOCTYPE html>
  3929. <html>
  3930. <body>
  3931.  
  3932. <p>The substr() method extract a part of a string
  3933. and returns the extracted parts in a new string:</p>
  3934.  
  3935. <p id="demo"></p>
  3936.  
  3937. <script>
  3938. var str = "Apple, Banana, Kiwi";
  3939. document.getElementById("demo").innerHTML = str.substr(7,6);
  3940. </script>
  3941.  
  3942. </body>
  3943. </html>
  3944.  
  3945.  
  3946. c:\users\lalikali\desktop\web\txt\string1.txt
  3947. <---------------------------------------------------------------------->
  3948. <?php
  3949.   $variable = "name";
  3950.   $literally = 'My $variable will not print!\\n';
  3951.  
  3952.   print($literally);
  3953.   print "<br />";
  3954.    
  3955.    $literally = "My $variable will print!\\n";
  3956.    
  3957.    print($literally);
  3958. ?>
  3959.  
  3960. My $variable will not print!\n
  3961. My name will print
  3962.  
  3963.  
  3964. c:\users\lalikali\desktop\web\txt\strtolower.txt
  3965. <---------------------------------------------------------------------->
  3966. <!DOCTYPE html>
  3967. <html>
  3968. <body>
  3969.  
  3970. <?php
  3971. echo strtolower("Hello WORLD.");
  3972. ?>
  3973.    
  3974. </body>
  3975. </html>
  3976.  
  3977. hello world.
  3978.  
  3979.  
  3980. c:\users\lalikali\desktop\web\txt\strtoupper.txt
  3981. <---------------------------------------------------------------------->
  3982. <!DOCTYPE html>
  3983. <html>
  3984. <body>
  3985.  
  3986. <?php
  3987. echo strtoupper("Hello WORLD!");
  3988. ?>  
  3989.  
  3990. </body>
  3991. </html>
  3992.  
  3993. HELLO WORLD!
  3994.  
  3995.  
  3996. c:\users\lalikali\desktop\web\txt\substr_replace.txt
  3997. <---------------------------------------------------------------------->
  3998. <!DOCTYPE html>
  3999. <html>
  4000. <body>
  4001.  
  4002. <?php
  4003. echo substr_replace("Hello","world",0); // 0 will start replacing at the first character in the string
  4004. ?>
  4005.  
  4006. </body>
  4007. </html>
  4008.  
  4009. world
  4010.  
  4011.  
  4012. c:\users\lalikali\desktop\web\txt\switch (2).txt
  4013. <---------------------------------------------------------------------->
  4014. <html>
  4015.    <body>
  4016.      
  4017.       <?php
  4018.         $d=date("D");
  4019.        
  4020.         switch ($d)
  4021.         {
  4022.            case "Mon":
  4023.               echo "Today is Monday";
  4024.               break;
  4025.            
  4026.            case "Tue":
  4027.               echo "Today is Tuesday";
  4028.               break;
  4029.            
  4030.            case "Wed":
  4031.               echo "Today is Wednesday";
  4032.               break;
  4033.            
  4034.            case "Thu":
  4035.               echo "Today is Thursday";
  4036.               break;
  4037.            
  4038.            case "Fri":
  4039.               echo "Today is Friday";
  4040.               break;
  4041.            
  4042.            case "Sat":
  4043.               echo "Today is Saturday";
  4044.               break;
  4045.            
  4046.            case "Sun":
  4047.               echo "Today is Sunday";
  4048.               break;
  4049.            
  4050.            default:
  4051.               echo "Wonder which day is this ?";
  4052.         }
  4053.  
  4054.      ?>
  4055.    </body>
  4056. </html>
  4057.  
  4058.  
  4059. c:\users\lalikali\desktop\web\txt\switch.txt
  4060. <---------------------------------------------------------------------->
  4061. <!DOCTYPE html>
  4062. <html>
  4063. <body>
  4064.  
  4065. <p id="demo"></p>
  4066.  
  4067. <script>
  4068. var day;
  4069. switch (new Date().getDay()) {
  4070.     case 0:
  4071.         day = "Sunday";
  4072.         break;
  4073.     case 1:
  4074.         day = "Monday";
  4075.         break;
  4076.     case 2:
  4077.         day = "Tuesday";
  4078.         break;
  4079.     case 3:
  4080.         day = "Wednesday";
  4081.         break;
  4082.     case 4:
  4083.         day = "Thursday";
  4084.         break;
  4085.     case 5:
  4086.         day = "Friday";
  4087.         break;
  4088.     case  6:
  4089.         day = "Saturday";
  4090.         break;
  4091. }
  4092. document.getElementById("demo").innerHTML = "Today is " + day;
  4093. </script>
  4094.  
  4095. </body>
  4096. </html>
  4097.  
  4098.  
  4099. c:\users\lalikali\desktop\web\txt\thead.txt
  4100. <---------------------------------------------------------------------->
  4101. <!DOCTYPE html>
  4102. <html>
  4103. <head>
  4104. <style>
  4105. thead {color:green;}
  4106. tbody {color:blue;}
  4107. tfoot {color:red;}
  4108.  
  4109. table, th, td {
  4110.     border: 1px solid black;
  4111. }
  4112. </style>
  4113. </head>
  4114.  
  4115. <body>
  4116.  
  4117. <table>
  4118.   <thead>
  4119.     <tr>
  4120.       <th>Month</th>
  4121.       <th>Savings</th>
  4122.     </tr>
  4123.   </thead>
  4124.   <tfoot>
  4125.     <tr>
  4126.       <td>Sum</td>
  4127.       <td>$180</td>
  4128.     </tr>
  4129.   </tfoot>
  4130.   <tbody>
  4131.     <tr>
  4132.       <td>January</td>
  4133.       <td>$100</td>
  4134.     </tr>
  4135.     <tr>
  4136.       <td>February</td>
  4137.       <td>$80</td>
  4138.     </tr>
  4139.   </tbody>
  4140. </table>
  4141.  
  4142. <p><b>Tip:</b> The thead, tbody, and tfoot elements will not affect the layout of the table by default. However, you can use CSS to style these elements.</p>
  4143.  
  4144. </body>
  4145. </html>
  4146.  
  4147.  
  4148.  
  4149. c:\users\lalikali\desktop\web\txt\this.txt
  4150. <---------------------------------------------------------------------->
  4151. <!DOCTYPE html>
  4152. <html>
  4153. <body>
  4154.  
  4155. <button onclick="this.innerHTML=Date()">The time is?</button>
  4156.  
  4157. </body>
  4158. </html>
  4159.  
  4160.  
  4161. c:\users\lalikali\desktop\web\txt\thonjeza.txt
  4162. <---------------------------------------------------------------------->
  4163. <!DOCTYPE html>
  4164. <html>
  4165. <body>
  4166.  
  4167. <p id="demo"></p>
  4168.  
  4169. <script>
  4170. var carName1 = "Volvo XC60";
  4171. var carName2 = 'Volvo XC60';
  4172. var answer1 = "It's alright";
  4173. var answer2 = "He is called 'Johnny'";
  4174. var answer3 = 'He is called 'Johnny'';
  4175.  
  4176. document.getElementById("demo").innerHTML =
  4177. carName1 + "<br>" +
  4178. carName2 + "<br>" +
  4179. answer1 + "<br>" +
  4180. answer2 + "<br>" +
  4181. answer3;
  4182. </script>
  4183.  
  4184. </body>
  4185. </html>
  4186.  
  4187.  
  4188. c:\users\lalikali\desktop\web\txt\trim.txt
  4189. <---------------------------------------------------------------------->
  4190. <!DOCTYPE html>
  4191. <html>
  4192. <body>
  4193.  
  4194. <?php
  4195. $str = "Hello World!";
  4196. echo $str . "<br>";
  4197. echo ltrim($str,"Hello");
  4198. ?>  
  4199.  
  4200. </body>
  4201. </html>
  4202.  
  4203. Hello World!
  4204. World!
  4205.  
  4206. <!DOCTYPE html>
  4207. <html>
  4208. <body>
  4209.  
  4210. <?php
  4211. $str = "Hello World!";
  4212. echo $str . "<br>";
  4213. echo rtrim($str,"World!");
  4214. ?>
  4215.  
  4216. </body>
  4217. </html>
  4218. Hello World!
  4219. Hello
  4220.  
  4221. <!DOCTYPE html>
  4222. <html>
  4223. <body>
  4224.  
  4225. <?php
  4226. $str = "Hello World!";
  4227. echo $str . "<br>";
  4228. echo trim($str,"Hed!");
  4229. ?>
  4230.  
  4231. </body>
  4232. </html>
  4233.  
  4234. Hello World!
  4235. llo Worl
  4236.  
  4237.  
  4238. c:\users\lalikali\desktop\web\txt\typeof.txt
  4239. <---------------------------------------------------------------------->
  4240. !DOCTYPE html>
  4241. <html>
  4242. <body>
  4243.  
  4244. <p>The typeof operator returns the type of a variable or an expression.</p>
  4245.  
  4246. <p id="demo"></p>
  4247.  
  4248. <script>
  4249. document.getElementById("demo").innerHTML =
  4250. typeof "john" + "<br>" +
  4251. typeof 3.14 + "<br>" +
  4252. typeof false + "<br>" +
  4253. typeof [1,2,3,4] + "<br>" +
  4254. typeof {name:'john', age:34};
  4255. </script>
  4256.  
  4257. </body>
  4258. </html>
  4259.  
  4260.  
  4261.  
  4262. c:\users\lalikali\desktop\web\txt\ucfirst.txt
  4263. <---------------------------------------------------------------------->
  4264. <!DOCTYPE html>
  4265. <html>
  4266. <body>
  4267.  
  4268. <?php
  4269. echo ucfirst("hello world!");
  4270. ?>  
  4271.  
  4272. </body>
  4273. </html>
  4274.  
  4275. Hello world!
  4276.  
  4277.  
  4278. c:\users\lalikali\desktop\web\txt\ucwords.txt
  4279. <---------------------------------------------------------------------->
  4280. <!DOCTYPE html>
  4281. <html>
  4282. <body>
  4283.  
  4284. <?php
  4285. echo ucwords("hello world");
  4286. ?>  
  4287.    
  4288. </body>
  4289. </html>
  4290.  
  4291. Hello World
  4292.  
  4293.  
  4294. c:\users\lalikali\desktop\web\txt\updatimi.txt
  4295. <---------------------------------------------------------------------->
  4296. <html>
  4297.    
  4298.    <head>
  4299.       <title>Update a Record in MySQL Database</title>
  4300.    </head>
  4301.    
  4302.    <body>
  4303.       <?php
  4304.         if(isset($_POST['update'])) {
  4305.            $dbhost = 'localhost:3036';
  4306.            $dbuser = 'root';
  4307.            $dbpass = 'rootpassword';
  4308.            
  4309.            $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  4310.            
  4311.            if(! $conn ) {
  4312.               die('Could not connect: ' . mysql_error());
  4313.            }
  4314.            
  4315.            $emp_id = $_POST['emp_id'];
  4316.            $emp_salary = $_POST['emp_salary'];
  4317.            
  4318.            $sql = "UPDATE employee ". "SET emp_salary = $emp_salary ".
  4319.               "WHERE emp_id = $emp_id" ;
  4320.            mysql_select_db('test_db');
  4321.            $retval = mysql_query( $sql, $conn );
  4322.            
  4323.            if(! $retval ) {
  4324.               die('Could not update data: ' . mysql_error());
  4325.            }
  4326.            echo "Updated data successfully\n";
  4327.            
  4328.            mysql_close($conn);
  4329.         }else {
  4330.            ?>
  4331.                <form method = "post" action = "<?php $_PHP_SELF ?>">
  4332.                   <table width = "400" border =" 0" cellspacing = "1"
  4333.                     cellpadding = "2">
  4334.                  
  4335.                      <tr>
  4336.                         <td width = "100">Employee ID</td>
  4337.                         <td><input name = "emp_id" type = "text"
  4338.                           id = "emp_id"></td>
  4339.                      </tr>
  4340.                  
  4341.                      <tr>
  4342.                         <td width = "100">Employee Salary</td>
  4343.                         <td><input name = "emp_salary" type = "text"
  4344.                           id = "emp_salary"></td>
  4345.                      </tr>
  4346.                  
  4347.                      <tr>
  4348.                         <td width = "100"> </td>
  4349.                         <td> </td>
  4350.                      </tr>
  4351.                  
  4352.                      <tr>
  4353.                         <td width = "100"> </td>
  4354.                         <td>
  4355.                            <input name = "update" type = "submit"
  4356.                              id = "update" value = "Update">
  4357.                         </td>
  4358.                      </tr>
  4359.                  
  4360.                   </table>
  4361.                </form>
  4362.             <?php
  4363.         }
  4364.      ?>
  4365.      
  4366.    </body>
  4367. </html>
  4368.  
  4369.  
  4370. c:\users\lalikali\desktop\web\txt\UPPER.txt
  4371. <---------------------------------------------------------------------->
  4372. <!DOCTYPE html>
  4373. <html>
  4374. <body>
  4375.  
  4376. <p>Convert string to upper case:</p>
  4377.  
  4378. <button onclick="myFunction()">Try it</button>
  4379.  
  4380. <p id="demo">Hello World!</p>
  4381.  
  4382. <script>
  4383. function myFunction() {
  4384.     var text = document.getElementById("demo").innerHTML;
  4385.     document.getElementById("demo").innerHTML = text.toUpperCase();
  4386. }
  4387. </script>
  4388.  
  4389. </body>
  4390. </html>
  4391.  
  4392.  
  4393.  
  4394. c:\users\lalikali\desktop\web\txt\uuencode.txt
  4395. <---------------------------------------------------------------------->
  4396. <!DOCTYPE html>
  4397. <html>
  4398. <body>
  4399.  
  4400. <?php
  4401. $str = "Hello world!";
  4402. // shifrojme
  4403. $encodeString = convert_uuencode($str);
  4404. echo $encodeString . "<br>";
  4405.  
  4406. // deshifrojme
  4407. $decodeString = convert_uudecode($encodeString);
  4408. echo $decodeString;
  4409. ?>  
  4410.  
  4411. </body>
  4412. </html>
  4413.  
  4414. Rez:
  4415. ,2&5L;&\@=V]R;&0A `
  4416. Hello world!
  4417.  
  4418.  
  4419. c:\users\lalikali\desktop\web\txt\validation_new.txt
  4420. <---------------------------------------------------------------------->
  4421. <form method="post" action='cake-form-proc.php' id="cakeform" >
  4422. <div>
  4423.    <div class="cont_order">
  4424.       <fieldset>
  4425.        <legend>Make your cake!</legend>
  4426.        <div class='field_container'>
  4427.        <label >Size Of the Cake</label>
  4428.        <label class='radiolabel'><input type="radio"  name="selectedcake" value="Round6"  />Round cake 6" -  serves 8 people</label><br/>
  4429.        <label class='radiolabel'><input type="radio"  name="selectedcake" value="Round8"  />Round cake 8" - serves 12 people</label><br/>
  4430.        <label class='radiolabel'><input type="radio"  name="selectedcake" value="Round10"  />Round cake 10" - serves 16 people</label><br/>
  4431.        <label class='radiolabel'><input type="radio"  name="selectedcake" value="Round12"  />Round cake 12" - serves 30 people</label><br/>
  4432.        </div>
  4433.        
  4434.        <div class='field_container'>
  4435.            <label for="flavor">Select Flavor:</label >
  4436.            <select id="flavor" name='flavor' >
  4437.            <option value="">Select Flavor</option>
  4438.            <option >Yellow</option>
  4439.            <option >White</option>
  4440.            <option >Chocolate</option>
  4441.            <option >Combo</option>
  4442.           </select>
  4443.        </div>
  4444.        <div class='field_container'>
  4445.            <label >Fillings:</label>
  4446.            <label><input type="checkbox" value="Lemon" name='Filling[]'  />Lemon</label>
  4447.            <label><input type="checkbox" value="Custard" name='Filling[]'  />Custard</label>
  4448.            <label><input type="checkbox" value="Fudge" name='Filling[]'  />Fudge</label>
  4449.            <label><input type="checkbox" value="Mocha" name='Filling[]'  />Mocha</label>
  4450.            <label><input type="checkbox" value="Raspberry" name='Filling[]'  />Raspberry</label>
  4451.            <label><input type="checkbox" value="Pineapple" name='Filling[]'  />Pineapple</label>
  4452.       </div>
  4453.       <div class='field_container'>
  4454.           <label class="inlinelabel"><input type="checkbox" id="agree" name='agree' /> I agree to the <a href="javascript:void(0);">terms and conditions</a></label>
  4455.        </div>
  4456.       </fieldset>
  4457.     </div>
  4458.      
  4459.     <div class="cont_details">
  4460.         <fieldset>
  4461.         <legend>Contact Details</legend>
  4462.         <label for='name'>Name</label>
  4463.         <input type="text" id="name" name='name' />
  4464.         <br/>
  4465.         <label for='address'>Address</label>
  4466.         <input type="text" id="address" name='address' />
  4467.         <br/>
  4468.         <label for='phonenumber'>Phone Number</label>
  4469.         <input type="text"  id="phonenumber" name='phonenumber'/>
  4470.         <br/>
  4471.         </fieldset>
  4472.     </div>
  4473.     <input type='submit' id='submit' value='Submit'  />
  4474. </div>  
  4475. </form>
  4476.  
  4477.  
  4478.  
  4479.  
  4480. c:\users\lalikali\desktop\web\txt\validation_new2.txt
  4481. <---------------------------------------------------------------------->
  4482. <body>
  4483.  
  4484. <?php
  4485. $temp = "";
  4486. $msg = "";
  4487. $rst = "";
  4488.  
  4489. if (isset($_POST["submit"])) {  
  4490. $number = $_POST["custid"];
  4491.  
  4492. if(empty($number)) {
  4493. $msg = '<span class="error"> Please enter a value</span>';
  4494. } else if(!is_numeric($number)) {
  4495. $msg = '<span class="error"> Data entered was not numeric</span>';
  4496. } else if(strlen($number) != 6) {
  4497. $msg = '<span class="error"> The number entered was not 6 digits long</span>';
  4498. } else {
  4499. echo "valid";
  4500. }
  4501.  
  4502. }
  4503.  
  4504. ?>
  4505.  
  4506. <h1>Customer Information Collection <br /></h1>
  4507.  
  4508. <form method="POST" action="<?php echo $_SERVER["PHP_SELF"];?>" id="custinfo" >
  4509. <table>
  4510. <tr>
  4511.     <td><label for="custid">Customer ID (integer value): </label></td>
  4512.     <td><input type="text" id="custid" name="custid" value="<?php echo   $temp ?>" size=11 /><?php echo $msg; ?></td>
  4513. </tr>
  4514.  
  4515. <tr>
  4516.     <td><label for="customerfname">Customer Frist Name: </label></td>
  4517.     <td><input type="text" id="customerfname" name="fname" size=50/></td>
  4518. </tr>
  4519. <tr>
  4520.     <td><label for="customerlname">Customer Last Name: </label></td>
  4521.     <td><input type="text" id="customerlname" name="lname" size=50/></td>
  4522. </tr>
  4523. <tr>
  4524.     <td><label for="customeraddress">Customer Address: </label></td>
  4525.     <td><input type="text" id="customeraddress" name="custaddress" size=65/></td>
  4526.  
  4527.     <td><label for="suburb"> Suburb: </label></td>
  4528. <td><input type="text" id="suburb" name="suburb"/></td>
  4529. </tr>
  4530. <tr>
  4531. <td>
  4532. State:<select name="state" id="state">
  4533.     <option value="select">--</option>
  4534.     <option value="ACT">ACT</option>
  4535.     <option value="NSW">NSW</option>
  4536.     <option value="NT">NT</option>
  4537.     <option value="QLD">QLD</option>
  4538.     <option value="SA">SA</option>
  4539.     <option value="TAS">TAS</option>
  4540.     <option value="VIC">VIC</option>
  4541.      <option value="WA">WA</option>
  4542.   </select>
  4543. </td>
  4544. <td><label for="postcode"> Post Code: </label><input type="text" id="postcode" name="postcode" size=4/></td>
  4545. </tr>
  4546. </table>
  4547. <p><input type="submit" name="submit" value="Save Data"/>&nbsp;<input type="reset" value="Clear Form" />
  4548. </tr>
  4549.  
  4550. </form>
  4551.  
  4552. </body>
  4553.  
  4554.  
  4555. modifikim
  4556. if(empty($number)) {
  4557.     $msg = '<span class="error"> Please enter a value</span>';
  4558. } else if(!is_numeric($number)) {
  4559.     $msg = '<span class="error"> Data entered was not numeric</span>';
  4560. } else if(strlen($number) != 6) {
  4561.     $msg = '<span class="error"> The number entered was not 6 digits long</span>';
  4562. } else {
  4563.    
  4564. }
  4565.  
  4566.  
  4567. c:\users\lalikali\desktop\web\txt\validimi.txt
  4568. <---------------------------------------------------------------------->
  4569. <!DOCTYPE html>
  4570. <html>
  4571. <body>
  4572.  
  4573. <h1>JavaScript Can Validate Input</h1>
  4574.  
  4575. <p>Please input a number between 1 and 10:</p>
  4576.  
  4577. <input id="numb" type="number">
  4578.  
  4579. <button type="button" onclick="myFunction()">Submit</button>
  4580.  
  4581. <p id="demo"></p>
  4582.  
  4583. <script>
  4584. function myFunction() {
  4585.     var x, text;
  4586.  
  4587.     // Get the value of the input field with id="numb"
  4588.     x = document.getElementById("numb").value;
  4589.  
  4590.     // If x is Not a Number or less than one or greater than 10
  4591.     if (isNaN(x) || x < 1 || x > 10) {
  4592.         text = "Input not valid";
  4593.     } else {
  4594.         text = "Input OK";
  4595.     }
  4596.     document.getElementById("demo").innerHTML = text;
  4597. }
  4598. </script>
  4599.  
  4600. </body>
  4601. </html>
  4602.  
  4603.  
  4604.  
  4605. c:\users\lalikali\desktop\web\txt\validimi_javascript_forme.txt
  4606. <---------------------------------------------------------------------->
  4607. <!DOCTYPE html>
  4608. <html>
  4609. <head>
  4610. <script>
  4611. function validateForm() {
  4612.     var x = document.forms["myForm"]["fname"].value;
  4613.     if (x == null || x == "") {
  4614.         alert("Name must be filled out");
  4615.         return false;
  4616.     }
  4617. }
  4618. </script>
  4619. </head>
  4620. <body>
  4621.  
  4622. <form name="myForm" action="demo_form.asp"
  4623. onsubmit="return validateForm()" method="post">
  4624. Name: <input type="text" name="fname">
  4625. <input type="submit" value="Submit">
  4626. </form>
  4627.  
  4628. </body>
  4629. </html>
  4630.  
  4631.  
  4632. c:\users\lalikali\desktop\web\txt\valimi_email.txt
  4633. <---------------------------------------------------------------------->
  4634. //validimi i emrit
  4635. $name = test_input($_POST["name"]);
  4636. if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
  4637.   $nameErr = "Only letters and white space allowed";
  4638. }
  4639.  
  4640. //validimi emailit
  4641. $email = test_input($_POST["email"]);
  4642. if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  4643.   $emailErr = "Invalid email format";
  4644. }
  4645.  
  4646. //validimi url
  4647. $website = test_input($_POST["website"]);
  4648. if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {
  4649.  $websiteErr = "Invalid URL";
  4650. }
  4651.  
  4652.  
  4653. c:\users\lalikali\desktop\web\txt\valimi_email2.txt
  4654. <---------------------------------------------------------------------->
  4655. <!DOCTYPE HTML>
  4656. <html>
  4657. <head>
  4658. <style>
  4659. .error {color: #FF0000;}
  4660. </style>
  4661. </head>
  4662. <body>
  4663.  
  4664. <?php
  4665. // define variables and set to empty values
  4666. $nameErr = $emailErr = $genderErr = $websiteErr = "";
  4667. $name = $email = $gender = $comment = $website = "";
  4668.  
  4669. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  4670.   if (empty($_POST["name"])) {
  4671.     $nameErr = "Name is required";
  4672.   } else {
  4673.     $name = test_input($_POST["name"]);
  4674.     // check if name only contains letters and whitespace
  4675.     if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
  4676.       $nameErr = "Only letters and white space allowed";
  4677.     }
  4678.   }
  4679.  
  4680.   if (empty($_POST["email"])) {
  4681.     $emailErr = "Email is required";
  4682.   } else {
  4683.     $email = test_input($_POST["email"]);
  4684.     // check if e-mail address is well-formed
  4685.     if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  4686.       $emailErr = "Invalid email format";
  4687.     }
  4688.   }
  4689.    
  4690.   if (empty($_POST["website"])) {
  4691.     $website = "";
  4692.   } else {
  4693.     $website = test_input($_POST["website"]);
  4694.     // check if URL address syntax is valid
  4695.     if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {
  4696.       $websiteErr = "Invalid URL";
  4697.     }
  4698.   }
  4699.  
  4700.   if (empty($_POST["comment"])) {
  4701.     $comment = "";
  4702.   } else {
  4703.     $comment = test_input($_POST["comment"]);
  4704.   }
  4705.  
  4706.   if (empty($_POST["gender"])) {
  4707.     $genderErr = "Gender is required";
  4708.   } else {
  4709.     $gender = test_input($_POST["gender"]);
  4710.   }
  4711. }
  4712.  
  4713. function test_input($data) {
  4714.   $data = trim($data);
  4715.   $data = stripslashes($data);
  4716.   $data = htmlspecialchars($data);
  4717.   return $data;
  4718. }
  4719. ?>
  4720.  
  4721. <h2>PHP Form Validation Example</h2>
  4722. <p><span class="error">* required field.</span></p>
  4723. <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
  4724.    Name: <input type="text" name="name">
  4725.    <span class="error">* <?php echo $nameErr;?></span>
  4726.    <br><br>
  4727.    E-mail: <input type="text" name="email">
  4728.    <span class="error">* <?php echo $emailErr;?></span>
  4729.    <br><br>
  4730.    Website: <input type="text" name="website">
  4731.    <span class="error"><?php echo $websiteErr;?></span>
  4732.    <br><br>
  4733.    Comment: <textarea name="comment" rows="5" cols="40"></textarea>
  4734.    <br><br>
  4735.    Gender:
  4736.    <input type="radio" name="gender" value="female">Female
  4737.    <input type="radio" name="gender" value="male">Male
  4738.    <span class="error">* <?php echo $genderErr;?></span>
  4739.    <br><br>
  4740.    <input type="submit" name="submit" value="Submit">
  4741. </form>
  4742.  
  4743. <?php
  4744. echo "<h2>Your Input:</h2>";
  4745. echo $name;
  4746. echo "<br>";
  4747. echo $email;
  4748. echo "<br>";
  4749. echo $website;
  4750. echo "<br>";
  4751. echo $comment;
  4752. echo "<br>";
  4753. echo $gender;
  4754. ?>
  4755.  
  4756. </body>
  4757. </html>
  4758.  
  4759.  
  4760. c:\users\lalikali\desktop\web\txt\variables.txt
  4761. <---------------------------------------------------------------------->
  4762. <!DOCTYPE html>
  4763. <html>
  4764. <body>
  4765.  
  4766. <h1>JavaScript Variables</h1>
  4767.  
  4768. <p>In this example, x is defined as a variable.
  4769. Then, x is assigned the value of 6:</p>
  4770.  
  4771. <p id="demo"></p>
  4772.  
  4773. <script>
  4774. var x;
  4775. x = 6;
  4776. document.getElementById("demo").innerHTML = x;
  4777. </script>
  4778.  
  4779. </body>
  4780. </html>
  4781.  
  4782.  
  4783.  
  4784. c:\users\lalikali\desktop\web\txt\vektor.txt
  4785. <---------------------------------------------------------------------->
  4786. <!DOCTYPE html>
  4787. <html>
  4788. <body>
  4789.  
  4790. <p id="demo"></p>
  4791.  
  4792. <script>
  4793. var cars = ["Saab","Volvo","BMW"];
  4794.  
  4795. document.getElementById("demo").innerHTML = cars[0];
  4796. </script>
  4797.  
  4798. </body>
  4799. </html>
  4800.  
  4801.  
  4802.  
  4803.  
  4804. c:\users\lalikali\desktop\web\txt\vektor_loop_index.txt
  4805. <---------------------------------------------------------------------->
  4806. <!DOCTYPE html>
  4807. <html>
  4808. <body>
  4809.  
  4810. <?php
  4811. $cars = array("Volvo", "BMW", "Toyota");
  4812. $arrlength = count($cars);
  4813.  
  4814. for($x = 0; $x <  $arrlength; $x++) {
  4815.     echo $cars[$x];
  4816.     echo "<br>";
  4817. }
  4818. ?>
  4819.  
  4820. </body>
  4821. </html>
  4822.  
  4823. Volvo
  4824. BMW
  4825. Toyota
  4826.  
  4827.  
  4828. c:\users\lalikali\desktop\web\txt\vektor_loop_shoqerues.txt
  4829. <---------------------------------------------------------------------->
  4830. <!DOCTYPE html>
  4831. <html>
  4832. <body>
  4833.  
  4834. <?php
  4835. $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
  4836.  
  4837. foreach($age as $x => $x_value) {
  4838.      echo "Key=" . $x . ", Value=" . $x_value;
  4839.      echo "<br>";
  4840. }
  4841. ?>
  4842.  
  4843. </body>
  4844. </html>
  4845.  
  4846. Key=Peter, Value=35
  4847. Key=Ben, Value=37
  4848. Key=Joe, Value=43
  4849.  
  4850.  
  4851. c:\users\lalikali\desktop\web\txt\vektor1.txt
  4852. <---------------------------------------------------------------------->
  4853. <!DOCTYPE html>
  4854. <html>
  4855. <body>
  4856.  
  4857. <?php
  4858. $cars = array("Volvo", "BMW", "Toyota");
  4859. echo count($cars);
  4860. ?>
  4861.  
  4862. </body>
  4863. </html>
  4864.  
  4865. 3
  4866.  
  4867.  
  4868. c:\users\lalikali\desktop\web\txt\welcome_get_php.txt
  4869. <---------------------------------------------------------------------->
  4870. <html>
  4871. <body>
  4872.  
  4873. Welcome <?php echo $_GET["name"]; ?><br>
  4874. Your email address is: <?php echo $_GET["email"]; ?>
  4875.  
  4876. </body>
  4877. </html>
  4878.  
  4879.  
  4880. c:\users\lalikali\desktop\web\txt\welcome_php.txt
  4881. <---------------------------------------------------------------------->
  4882. <html>
  4883. <body>
  4884.  
  4885. Welcome <?php echo $_POST["name"]; ?><br>
  4886. Your email address is: <?php echo $_POST["email"]; ?>
  4887.  
  4888. </body>
  4889. </html>
  4890.  
  4891.  
  4892.  
  4893.  
  4894. c:\users\lalikali\desktop\web\txt\while (2).txt
  4895. <---------------------------------------------------------------------->
  4896. <html>
  4897.    <body>
  4898.    
  4899.       <?php
  4900.         $i = 0;
  4901.         $num = 50;
  4902.        
  4903.         while( $i < 10)
  4904.         {
  4905.            $num--;
  4906.            $i++;
  4907.         }
  4908.        
  4909.         echo ("Loop stopped at i = $i and num = $num" );
  4910.      ?>
  4911.      
  4912.    </body>
  4913. </html>
  4914.  
  4915. rezultati:
  4916. Loop stopped at i = 10 and num = 40
  4917.  
  4918.  
  4919. c:\users\lalikali\desktop\web\txt\while.txt
  4920. <---------------------------------------------------------------------->
  4921. <!DOCTYPE html>
  4922. <html>
  4923. <body>
  4924.  
  4925. <p>Click the button to loop through a block of code as long as i is less than 10.</p>
  4926.  
  4927. <button onclick="myFunction()">Try it</button>
  4928.  
  4929. <p id="demo"></p>
  4930.  
  4931. <script>
  4932. function myFunction() {
  4933.     var text = "";
  4934.     var i = 0;
  4935.     while (i < 10) {
  4936.        text += "<br>The number is " + i;
  4937.         i++;
  4938.     }
  4939.     document.getElementById("demo").innerHTML = text;
  4940. }
  4941. </script>
  4942.  
  4943. </body>
  4944. </html>
  4945.  
  4946.  
  4947.  
  4948. c:\users\lalikali\desktop\web\txt\window.txt
  4949. <---------------------------------------------------------------------->
  4950. <!DOCTYPE html>
  4951. <html>
  4952. <body>
  4953.  
  4954. <h1>My First Web Page</h1>
  4955. <p>My first paragraph.</p>
  4956.  
  4957. <script>
  4958. window.alert(5 + 6);
  4959. </script>
  4960.  
  4961. </body>
  4962. </html>
  4963.  
  4964.  
  4965.  
  4966. c:\users\lalikali\desktop\web\txt\wordwrap.txt
  4967. <---------------------------------------------------------------------->
  4968. <!DOCTYPE html>
  4969. <html>
  4970. <body>
  4971.  
  4972. <?php
  4973. $str = "An example of a long word is: Supercalifragulistic";
  4974. echo wordwrap($str,15,"<br>\n",TRUE);
  4975. ?>  
  4976.  
  4977. </body>
  4978. </html>
  4979.  
  4980. Rez:
  4981. An example of a
  4982. long word is:
  4983. Supercalifragul
  4984. istic
  4985.  
  4986.  
  4987. c:\users\lalikali\desktop\web\txt\write.txt
  4988. <---------------------------------------------------------------------->
  4989. <!DOCTYPE html>
  4990. <html>
  4991. <body>
  4992.  
  4993. <h1>My First Web Page</h1>
  4994. <p>My first paragraph.</p>
  4995.  
  4996. <script>
  4997. document.write(5 + 6);
  4998. </script>
  4999.  
  5000. </body>
  5001. </html>
  5002.  
  5003.  
  5004.  
  5005. c:\users\lalikali\desktop\web\txt\write2.txt
  5006. <---------------------------------------------------------------------->
  5007. <!DOCTYPE html>
  5008. <html>
  5009. <body>
  5010.  
  5011. <h1>My First Web Page</h1>
  5012. <p>My first paragraph.</p>
  5013.  
  5014. <button type="button" onclick="document.write(5 + 6)">Try it</button>
  5015.  
  5016. </body>
  5017. </html>
Add Comment
Please, Sign In to add comment