jeudi 1 avril 2021

Do I need a Linux machine for back-end web development in PHP?

That is the question: do I need a Linux machine for back-end web development in PHP?

I do not understand fully how might the operating system have anything to do with something deployed on the web if you are not hosting the site locally.

Also, if I do not have a Linux machine, can I replace it by running WSL on my Windows PC? Or are there some fatal drawbacks that might point to not doing that?

Thanks




How can I add Multiple Language options to my website

I want to add a choose language mechanism to my website and I cannot figure out the way to do that. I tried browsing for the solution, still have no idea. Any suggestions?




Is there any method to pass live data from one Browser tab another Browser tab by using Javascript

I am Created one Increment and Decrement Program but in that, I want to pass data from 1st Browser to 2nd Browser(one tab to another tab). In Index.html there are two button for increament and decreament operation. in 2nd page only there data will show but my code is working on only same tab. as well as How I can store data after page refresh??

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <script src="/index.js"></script>
    <link href="/index.css" rel="stylesheet" type="text/css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Live Users in Mall</title>
</head>
<body>
    <div class="container">
        <h1>Live Users in Mall</h1>
    <div class = "card">
        <button onclick = "decreament()">-</button>
        <h2 id = "root">0</h2>
        <button onclick = "increament()">+</button>
    </div>
    </div>
</body>
</html>

index.css

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body{
    background-color: rgb(255, 255, 255);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
}
.card{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 100px;
}

h2{
    margin: 0 50px;
    font-size: 50px;
}
button{
    background-color: #ff9100;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 25px;
}
button:hover{
    background-color: rgb(206, 206, 206);
    color: #ff9100;
    border-color: #000 ;
}

index.js

var data = 0;
        document.getElementById("root").innerText=data;
        function decreament(){
            data = data-1;
            if(data<=0)
            {data = 0;}
            document.getElementById("root").innerText=data;
            localStorage.setItem("key",data);
        }
        function increament(){
            data = data + 1;
            document.getElementById("root").innerText=data;
            localStorage.setItem("key",data);
        }

2nd Page Name as Showdata Showdata.html

<!DOCTYPE html>
<html lang="en">
<head>
    <link href="/index.css" rel="stylesheet" type="text/css">
    <script src="/showdata.js"></script>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Show Live Data</title>
</head>
<body>
  
  <h3>Users Present in Mall</h3>
    <h2 id="root">0
</h2>  
</body>
</html>

showdata.js

var data = localStorage.getItem("key");
        document.write(data);       
       //output.innerHTML = data;
       //document.getElementById("root").innerText=data;

Can Anyone Please Give me Solution Of My Problem???




Sum of heights of nested blocks

There is a block of code

<div class="FilterDropdown__body FilterDropdown__body_opened" style="height: 246px;">
  <div class="FilterGroupNewDesign">
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821acer"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">ACER</span><sup class="FilterLabelNewDesign__counter">82</sup></div>
        </div>
      </div>
    </div>
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821apple"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">APPLE</span><sup class="FilterLabelNewDesign__counter">34</sup></div>
        </div>
      </div>
    </div>
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821asus"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">ASUS</span><sup class="FilterLabelNewDesign__counter">75</sup></div>
        </div>
      </div>
    </div>
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821dell"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">DELL</span><sup class="FilterLabelNewDesign__counter">47</sup></div>
        </div>
      </div>
    </div>
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821hp"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">HP</span><sup class="FilterLabelNewDesign__counter">82</sup></div>
        </div>
      </div>
    </div>
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821iru"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">IRU</span><sup class="FilterLabelNewDesign__counter">32</sup></div>
        </div>
      </div>
    </div>
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821lenovo"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">LENOVO</span><sup class="FilterLabelNewDesign__counter">78</sup></div>
        </div>
      </div>
    </div>
    <div class="FilterGroupNewDesign__filter-item FilterLabelNewDesign">
      <div class="checkboxStyleDecoratorNewDesign checkboxStyleDecoratorNewDesign_size_m checkboxStyleDecoratorNewDesign_hoverable">
        <div class="FilterCheckbox FilterCheckbox_hoverable"><input type="checkbox" class="FilterCheckbox__input" name="8714_821msi"><span class="checkboxStyleDecoratorNewDesign__checkmark FilterCheckbox__checkmark"></span></div>
        <div class="checkboxStyleDecoratorNewDesign__title">
          <div class="FilterLabelNewDesign"><span class="FilterLabelNewDesign__name">MSI</span><sup class="FilterLabelNewDesign__counter">16</sup></div>
        </div>
      </div>
    </div>
  </div><button class="FilterGroupNewDesign__filter_show-all linkStyleDecorator linkStyleDecorator_size_s linkStyleDecorator_colored linkStyleDecorator_theme_blue Button" name="" type="submit" value="" tabindex="0"><span class="linkStyleDecorator__text linkStyleDecorator__text_border_none">Показать все</span></button></div>

Inside the FilterDropdown__body FilterDropdown__body_opened block there is a FilterGroupNewDesign block and a <button class =" FilterGroupNewDesign__filter_show-all linkStyleDecorator linkStyleDecorator_size_s linkStyleDecorator_collerator_collerator "name= "linkStyleDecorator__text linkStyleDecorator__text_border_none"> Show All </span> </button> . Using the command

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    $("div.FilterGroupNewDesign").each(function() {
                let $div=$(this);
                $div.parent().css("height", /*сумма высот блока FilterGroupNewDesign и кнопки button*/);
    });

I want to make the height of the FilterDropdown__body FilterDropdown__body_opened block equal to the height of the FilterGroupNewDesign block plus the height of the button button. How do I add (how to refer to the button) the height of the button?




Best option for getting input on the website

For a discussion forum i want user comments, which is best approch?

Either

1-Using Textbox.

Or

2-Using Input type=text.

what are their pros and cons?




python, How to recognize that a web page is pdf document, if have no pdf extension?

I have a web scraper written in python, that extracts some data from web pages. It is filtering out unwanted type of documents, such as .pdf, by looking into extension. Such web pages are skipped during scraping process. However, there are some web sites that have big pdf documents embedded but are not indicated to be a pdf by extension. For example, this one is problematic: https://tel.archives-ouvertes.fr/tel-01801803/document I need to skip such web sites. Is there a way to recognize that a web page is pdf document, even if there is no .pdf extension?




mercredi 31 mars 2021

How to Display Api Data in HTML?

<script>
     function fetchdata() {
     $.get("http://10.10.35.138:5000/data", function (data) { //The link of this line is my api link
                $("#visitor").html('Visitor Count : ' + data.people);
                $("#time").html('Time : ' + data.time);
            });
        }
</script>

****HTML PART****
<div class="details">
<p id="visitor">Person Count:</p>
<p id="time">Time:</p>`enter code here`
</div>

My Api data is consist of 2 things count and time. I have mentioned two paragraphs above: I want to display count in first paragraph tag. And I want to display Time is another paragraph. I try more time but API data will not appear paragraph tags. Plz help me