Posts

Showing posts from September, 2021

php sql

<?php $con  =  mysqli_connect ( "localhost" ,  "root" ,  "" ,  "employee" ) or  die ( "not connect" ); // if (isset($con)) { //     echo "this is connected"; // } insert: <?php include   "sql_connect.php" ; $name  =  $_GET [ "nm" ]; $pass  =  $_GET [ "pwd" ]; //$name = "tskr"; //$pass = "123"; //echo $name . "" . $pass; if  ( isset ( $name ) &&  isset ( $pass )) {      $sql_query  =  " INSERT   INTO  student_record ( NAME ,  PASSWORD )   VALUES  ('{ $name }','{ $pass }') " ;      //echo $sql_query;      //return $sql_query;      $query  =  mysqli_query ( $con ,  $sql_query ) or  die ( "not executing" );      /...

download in php

 https://www.php.net/manual/en/function.readfile.php https://www.phptutorial.net/php-tutorial/php-download-file/ <?php if ( isset ( $_REQUEST [ "q" ])){      // Get parameters      $filepath  =  urldecode ( $_REQUEST [ "q" ]);  // Decode URL-encoded string //echo $filepath; /* Check if the file name includes illegal characters     like "../" using the regular expression */      // if(preg_match('/^[^.][-a-z0-9_.]+[a-z]$/i', $file)){      //     $filepath = "images/" . $file;          // Process download         echo   basename ( $filepath );     }         /* if(file_...

PHP_important_method

 echo strripos("abc.txt_19909","_"); last index of _ will given.... substr("abc.txt_19909",0,strripos("abc.txt_19909","_"));         $Path = substr ( $data [ 'image_path' ], 0 , strripos ( $data [ 'image_path' ], '_' ));

React_props

  export   class   props   extends   Component  {           render ( props ) {      const { name , lastname }= this . props ;          return  (              < div >              gud morning everyone { name }   { lastname }                  { this . props . children }              </ div >         )     } } import   GS   from   './components/st.js' ; function   App () {    return  (      < div   className = "App" >     ...

media Queries

CSS3 Media Types Value Description all Used for all media type devices print Used for printers screen Used for computer screens, tablets, smart-phones etc. speech Used for screenreaders that "reads" the page out loud If the browser window is 600px or smaller, the background color will be lightblue: @media only screen and (max-width: 600px)  {   body  {     background-color :  lightblue ;    } }   if the viewport is 480 pixels wide or wider  @media screen and (min-width: 480px)  {   body  {     background-color :  lightgreen ;    } } Try it Yourself » /* Extra small devices (phones, 600px and down) */ @media only screen and (max-width: 600px)  { ... } /* Small devices (portrait tablets and large phones, 600px and up) */ @media only screen and (min-width: 600px)  { ... } /* Medium devices (landscape tablets, 768px and up) */ @media only screen and (min-width: 768px)  { ....

phpm _excel_generation(next_target)

Image
header ( 'Content-Type: application/xls' ); header ( 'Content-Disposition: attachment; filename="file.xls"' );   F:\last cmc batch\abc https://www.w3schools.com/css/css_rwd_mediaqueries.asp @media only screen and (orientation: landscape) https://www.youtube.com/watch?v=JqyCORVFvXo F:\last cmc batch\pdf_generation https://code-boxx.com/create-excel-spreadsheet-php/ https://www.youtube.com/watch?v=SCi-BNgRIhY <?php $a=opendir("upload"); while($info=readdir($a)) { if($info!='.' and $info!="..") { echo "<img src='upload/$info' height='100' width=100>"."<a href='download1.php?q=$info'>download</a>"."<br/>"; } } ?> F:\last cmc batch\19marchcmc\upload-download <?php $a=$_REQUEST['q']; $target='upload/'.$a; $bn=basename($target); $ft=filetype($target); header("Content-Type: application/$ft"); header("Content-Disposit...

Css_animation

 Animation:------ @keyframes Keyframes hold what styles the element will have at certain times. animation-name animation-duration animation-delay animation-iteration-count animation-direction animation-timing-function animation-fill-mode animation @keyframes example  {   from  { background-color :  red ; }   to  { background-color :  yellow ; } } @keyframes example  {   from  { cssproperties }   to  { cssproperties } } @keyframes example  {   0%  {css properties }   100%  { css propereties } }

ReactBasic2

 component:-- part of UI like head,sidenav,maincomponent component can contain other component. >component are re-usable and can be nested  inside other components. stateless function component.hooks statefull class component. component are building block of React application. For emmet:----   "emmet.includeLanguages" : {          "javascript" : "javascriptreact"     } props:-- it is the optional property which your component can accept. and it allows component to be dynamic.. ..props are immutable... we spacify them as attribute.. App.js <HeadFun name='gaurav' lastname='pandey'> <p> i am from uk.</p> head.js:-- hello this is the functional components{props.name} {props.lastname} {props.children} in the case of class: {this.props.address} inline css react js: < h1 style = { { color : "red" } } > Hello Style! </ h1 > state:-internal private sta...

React

 React js(facebook)  what is react:-- open source javascript library for building User interface its not framework  focused on doing one thing... not other expect like routing or http request there are libraries for everything we can download and use as an dependency.. component based architecure:-- breaks  down small encapsulated parts which we can use after for creating more complex Ui. header slider  main footer for reusing.Reusable code.. Dom updates are handles gracefull in react. npx create_react_app application npx:--- npm :-package runner which gets installed when u install node. cd application npm start >Npm is a tool that use to install packages. Npx is a tool that use to execute packages. folder structure:---- 1.package.json:--- this file contain the dependency and the scripts require for the project. 2.package-lock.json:- insure consistent installation of your depencies 3.folder:--node modules when we run npx create react node modules created wher...

Facebook_login_php_api

 https://developers.facebook.com/docs/facebook-login/web https://www.youtube.com/watch?v=U_S8GELhhiY https://developers.facebook.com/apps/create/ https://www.youtube.com/watch?v=qMuWbw4rPlU 000webhost.com:--- 1.create an account in 000webhost.com file mangage area:--public_html for managing the file DatabaseName:GauravDatabase username:Gaurav password:J@%m^(8d^I_B[FO_ gauravducat.000webhostapp.com https://www.w3schools.com/howto howto_css_table_zebra.asp

Add_Remove_button_jquery

  < body >      < div   id = "block" >      < input   type = text   name = 'text'   id = 'text'   > <!-- <button id="btnRemove">Remove</button> -->      <!-- <input type="text" name="text1" id="text1"> --> </ div >      < button   id = 'bt' > Add </ button >      < script >          $ ( document ). ready ( function (){              count = 0 ;              $ ( "#bt" ). click ( function (){                  id = $ ( 'input' ). first (). attr ( 'id' );          ...

transitioncss

     div {              height :  200px ;              width :  200px ;              background-color :  burlywood ;               transition : width,background-color  2s , 4s ;                transition-delay :  3s ;              /* transition-property: width,background-color; */              /* transition-duration: 2s,4s; */         }          div:hover {         ...

css Transform

  div {              /*matrix(scaleX(),SkewXX(),scaleY(),translateX(),translateY())*/              margin : 250px ;              /* transform: rotate(210deg); */              /* transform: skew(20deg); */              /* transform:translate(0px ,150px); */ /* transform: skew(10deg,20deg); */ /* transform: rotate(30deg); */   /* transform-origin: left top;   */ transform :  scale ( 2 , 2 );            height :  200px ;              width : 200px ;  ...

typescript

  export {} function   f1 ( a ,... b ){ let   sum = 0 ; let   c ;      // console.log(a);      // console.log(b);      // console.log(b.length);      b . forEach ( element   =>  {     sum = element + sum ;          });      sum = sum + a ;      console . log ( sum );      } f1 ( 3 , 5 , 6 , 7 , 8 , 9 , 10 ); //function   f1 ( a : number ,... b : number []) export {} function   f1 ( a : number , b ?: number ){ let   sum = 0 ; sum = b ? a + b : a ;      console . log ( sum );      } f1 ( 3 ); export {} class   A {      name ;      constructor ( name ){ this . name = name ;     }       getdata (){ return...