samedi 31 octobre 2020

what steps have for create website builder using PHP? [closed]

I want to create website builder using PHP. but I want know about which requirements need for that? Any option have find details? which steps need to follow?




Como seleccionar un elemento dentro de una lista dinamica, y cada uno tiene un porcentaje unico de seleccion en base a 100% [closed]

me encuentro con esta duda, tengo un arreglo con muchos objetos en JavaScript y cada uno tiene como atributo un porcentaje, y una url, este porcentaje define que tan frecuente será seleccionada la url, sin embargo la lista puede ser de mas de 100 elementos, y todo esta a base a 100, a si que hay algunos porcentajes de 0,0345 , etc . la cuestión es selecciono estos elementos en base a su porcentaje de aparición?? muchas gracias




move_uploaded_file() isn't working as expected

This php function move_uploaded_file(file, destination) isn't working. The file isn't there after execution. It keeps on returning false. As it's using HTTP POST, it isn't actually getting the uploaded file to the destination folder/server in this case. After checking the errors, it says that it's error 1. But fixing it still displayed

UPLOAD_ERR_INI_SIZE Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

Although other methods of file upload are described, none seems to work with the input file.




405 error on hitting a URL that calls a Python flask api

The URL https://cliosuite-292503.ue.r.appspot.com/appointment?email=jaryya@gmail.com&email1=cliosight@gmail.com&contactName=Jigisha_Aryya&yourName=Jigisha_Aryya&start=11/05/2020_12:29_AM&end=11/05/2020_1:29_AM&callTitle=Titlesssss&callDesc=skdskcjhdsbchsb&file1=&file2=

is used to send an email invite for a 1-1 Video conference. But I am getting 405 error when the button is clicked to send the emails in the HTML. The application is collab.cliosight.com Please try and check the browser logs. It is a part of my project Cliosuite - suite.cliosight.com

The js function has:

$.post("https://cliosuite-292503.ue.r.appspot.com/appointment?email="+contactEmail+"&email1="+yourEmail+"&contactName="+contactName+
                                "&yourName="+yourName+"&start="+start_cs+"&end="+end_cs+"&callTitle="+
                                callTitle+"&callDesc="+callDesc+"&file1="+file1+"&file2="+file2, function(data, status){
                if(status.indexOf('200')>0){
                        alert('Meeting details are sent. Please check your email after some time.');}
 else {
                    alert("There was some issue in sending the conference details. " +
                                "Please try again later or contact support@cliosight.com");
                }
            });
        }



How to use FastApi with ready-made front-end?

I've already have ready-made front-end with HTML, JavaScript and CSS files, and I can't change them because they generates by Webpack. And I also need a backend on Python for POST requests.

I can't use FastApi to get files like HTML, JavaScript, etc., because as written in documentation the path to these file must be similar to this:

<link href="" rel="stylesheet">

And as I said, files generates by Webpack, it can't write links in this way.

I also could use FastApi as separate server, for example at http://localhost:8000, but this way all my request are blocking by Google Chrome. Even if I use FastApi's middleware:

app = FastAPI()

app.add_middleware(
    CORSMiddleware,
    allow_origins=[
        "http://localhost",
        "http://localhost:8000",
    ],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

So how can I integrate FastApi and front-end?




How can I store data with Vercel?

I have a website hosted by Vercel and I just don't know where to ask this question: How can I store large files like videos? Because I want to develop a social media platform and I don't know what to use to store data. I don't want to use something like Google Drive or something like that because of the privacy of my website. I have already looked for different solutions, but I have not found anything.
Thank you very much in advance.




Need Help To Build A Navbar

How to build A Navbar Like This website (codewithharry) by Using flexbox enter image description here

Pls Provide the source link Or explain me pls or share the link of any tutorial MAKE SURE TO USE FLEXBOX mostly




What is the difference in how you would have to access these two PHP arrays?

I have two PHP arrays in a section of a website I'm building for a class. One contains data that I created with a simple foobar array bit, and the other is created from a fetchAll() PDO call. I can't access the PDO array's element for some reason, so I created a sample array and called var_export() on both arrays to see if there were any differences. Here is the code:

if ($dao->userExistsLogin($_POST["email"], $_POST["password"]))
{
    $useremail = $_POST["email"];
    $_SESSION["authenticated"] = "true";
    $logger->LogDebug("email from post array in login handler: " . $_POST["email"]);
    $user_results = $dao->getIDFromEmail($useremail);
    $logger->LogDebug(print_r($user_results, true));
    $array = [
        "foo" => "bar",
        "bar" => "foo",
    ];
    $logger->LogDebug(var_export($array, true));
    $logger->LogDebug(var_export($user_results, true));
    $logger->LogDebug(gettype($user_results));
    $_SESSION['user_id'] = $user_results['id'];
    header("Location: http://localhost/WIWO/user_account.php");
} 

The GetIDFromEmail function is here:

    public function getIDFromEmail($email)
    {
        $conn = $this->getConnection();
        $getIDFromEmailQuery = "SELECT * FROM user WHERE email=:email";
        $query = $conn->prepare($getIDFromEmailQuery);
        $query->bindParam(":email", $email);
        $query->execute();
        $result = $query->fetchAll(PDO::FETCH_ASSOC);
        $this->logger->LogDebug(print_r($result, true));
        return $result;
    }

And here's what's in my logger from the var_export() commands:

2020-10-31 17:57:10 - DEBUG --> array (
  'foo' => 'bar',
  'bar' => 'foo',
) 
2020-10-31 17:57:10 - DEBUG --> array (
  0 => 
  array (
    'id' => '251',
    'email' => 'heck',
    'institution' => 'heck',
    'access' => '1',
  ),
) 

Why can I not access the second array at $_SESSION['user_id'] = $user_results['id'];? For some reason that line totally fails to do anything. I know the session is started and correct because other variables stored in the SESSION superglobal are showing up correctly, but the user_id never gets set. Does it have something to do with "0 =>" showing up in the var_export() of the second array? I notice that doesn't show up in the first array - is the second array malformed or something?




Making dropdown selection to fill element without gaps

I use menu that was created by other developer in our company. I add to the first item of the menu dropdown selection, but the problem that the dropdown box not fully fill the all the item and I can't make it fill.

here is HTML:

<div class="top-menu-item-container">
  <div class="inactive-border-bottom">
      <p class="control has-icons-left is-expanded">
      <span class="select is-fullwidth ">
        <select class="full-height">
          <option>dropdown</option>
          <option>options 1</option>
        </select>                  
      </span>
      <span class="icon is-small is-left"><i class="far fa-building"></i></span>
    </p> 
    
    
  </div>
</div>

 <div class="top-menu-item-container" >
    <div>
      <div class="top-menu-item">2. Lot and Model</div>
    </div>
</div>   

<div class="top-menu-item-container" >
  <div [className]="ishpExpanded?'active-border-bottom':'inactive-border-bottom'">
    <div class="top-menu-item">3. Home Plan</div>
  </div>
</div>

<div class="top-menu-item-container">
  <div [className]="isupgExpanded?'active-border-bottom':'inactive-border-bottom'">
    <div class="top-menu-item">4. Upgrades</div>
  </div>
</div>

<div class="top-menu-item-container">
  <div [className]="isnextExpanded?'active-border-bottom':'inactive-border-bottom'">
    <div class="top-menu-item">5. Next Steps</div>
  </div>
</div>
<div class="top-menu-icon-container">
  <i class="fas fa-print top-menu-icon"></i>
  <i class="fas fa-share-alt top-menu-icon"></i>
</div>

And her is CSS:

.scroll1::-webkit-scrollbar {
    width: 0px;
    height: 3px;
  }
  
  .scroll1::-webkit-scrollbar-track {
    background: #eff0f0;
  }
  
  .scroll1::-webkit-scrollbar-thumb {
    background: #666;
  }
  .main-container-top-menu {
    scrollbar-width: auto;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
 
  }
  
  .top-menu-item-container-empty {
    border-bottom: 2px solid #eff0f0;
    font-family: "Roboto", sans-serif;
    border-right: 2px solid #eff0f0;
    box-sizing: border-box;
    color: #626262;
    font-size: 14px;
    font-weight: 350;
    user-select: none;
    justify-content: space-between;
  }
  .top-menu-item-container {
    border-bottom: 2px solid #eff0f0;
    font-family: "Roboto", sans-serif;
    border-right: 2px solid #eff0f0;
    box-sizing: border-box;
    color: #626262;
    font-size: 14px;
    font-weight: 350;
    user-select: none;
    flex: 1;
    justify-content: space-between;
  }
  .active-border-bottom {
    align-items: center;
    display: flex;
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
    border-bottom: 3px solid #eb2028;
    box-sizing: border-box;
  }
  .inactive-border-bottom {
    align-items: center;
    display: flex;
    padding-left: 20px;
    padding-right: 20px;
    height: 100%;
  }
  .top-menu-item-active {
    cursor: pointer;
    font-family: "Roboto", sans-serif;
    padding: 5px;
    font-family: "Roboto", sans-serif;
    box-sizing: border-box;
    color: #1d1d1d;
    font-size: 14px;
    font-weight: 350;
    user-select: none;
    align-items: center;
    justify-content: center;
    display: flex;
    stroke-width: 0.6px;
    -webkit-text-stroke-width: 0.6px;
    flex: 1;
  }
  .top-menu-item {
    cursor: pointer;
    padding: 10px;
    font-family: "Roboto", sans-serif;
    box-sizing: border-box;
    color: #626262;
    font-size: 14px;
    user-select: none;
    align-items: center;
    justify-content: center;
    display: flex;
    flex: 1;
  }
  
  .top-menu-item-first {
    cursor: default;
    border-right: 2px solid #eff0f0;
    font-size: 14px;
    padding-right: 20px;
    font-weight: 800;
    border-bottom: 2px solid #eff0f0;
    border-left: none;
    text-align: left;
    justify-content: left;
    flex: 1;
  }
  
  .top-right-menu-item {
    /* margin-right: 50px; */
    border-bottom: 2px solid #eff0f0;
    height: 100%;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
  }
  
  .top-item-logo {
    height: 55px;
    z-index: 100;
    width: 55px;
    object-fit: contain;
  }
  
  .top-menu-icon-container{
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .top-menu-icon {
    cursor: pointer;
    margin-right: 25px;
    margin-left: 25px;
    cursor: pointer;
    width: 14px;
    padding-top: 25px;
    padding-bottom: 25px;
  }
  
  .left-arrow,
  .right-arrow {
    display: none;
  }
  
  @media screen and (max-width: 768px) {
    .constructor-top-container {
      justify-content: center;
      padding-left: 3%;
    }
  }
  
  @media screen and (max-width: 1088px) {
    .top-right-menu-item {
      padding-left: 10px;
      margin-right: 0px;
      border-bottom: 2px solid #eff0f0;
      flex: 1;
      height: 100%;
      display: inline-flex;
      justify-content: flex-end;
      align-items: center;
    }
  
    .main-container-top-menu {
      padding-left: 0;
      padding-right: 0;
      padding-bottom: 3px;
    }
  }
  
  @media screen and (max-width: 414px) {
    .top-menu-icon {
      margin-right: 15px;
      cursor: pointer;
      width: 14px;
      padding-top: 12px;
    }
    .scroll1::-webkit-scrollbar {
      width: 0px;
      height: 0px;
    }
  
    .scroll1::-webkit-scrollbar-track {
      background: #eff0f0;
    }
  
    .scroll1::-webkit-scrollbar-thumb {
      background: #666;
    }
    .top-menu-item-first {
      padding-left: 35px;
    }
  
    .main-container-top-menu {
      transition: 0.2s all;
      min-height: 62px;
    }
    .top-item-logo {
      position: absolute;
      top: 0;
      right: 0px;
      margin: 0;
      padding: 0;
      z-index: 100;
      height: 62px;
      width: 62px;
      object-fit: contain;
    }
  
    .left-arrow {
      height: 60px;
      padding-left: 5px;
      padding-right: 5px;
      background: white;
      display: flex;
      align-items: center;
      position: absolute;
      cursor: pointer;
      color: #d1d1d1;
      top: 0px;
      font-size: 1.6rem;
      left: 0;
      z-index: 5;
      padding-left: 7px;
    }
  
    .right-arrow {
      height: 60px;
      padding-left: 5px;
      padding-right: 5px;
      background: white;
      display: flex;
      align-items: center;
      position: absolute;
      cursor: pointer;
      color: #b1b1b1;
      font-size: 1.6rem;
      left: calc(100% - 88px);
    }
  }
  @media screen and (max-width: 1088px) {
    .main-container-top-menu {
      overflow-x: auto;
      overflow-y: hidden;
      /* display: block; */
      width: 100%;
      white-space: nowrap !important;
    }
  }
  
  @media screen and (max-width: 414px) {
    .main-container {
      padding-left: 0px;
      padding-right: 0px;
    }
  }
  
  .no-suite-title {
    text-transform: uppercase;
    font-size: 1.3em;
    font-weight: 300;
    position: absolute;
    left: 10%;
    top: 50%;
    z-index: 1000;
  }

Workink jsFiddle!

Please help me to make dropdown to fill the menuc without gaps.

Thank you in advance.




ASP NET How to show part of page depenting on some condition?

I would like to ask, how to can I change (show or hide) part of the same web page according to some condition, like in PHP? E.g. I would like to hide log-in formular if user has sent submit button and password was correct. I've seen this technique used in PHP and it looks like:

<?php 
    if (! $logged_in) {
        //<form> ... </form>
?>

//...some common content...

<?php
    else {
    //<p> ... </p>
?>

Is there any way in ASP.NET using C# how to 'recycle' pages like in PHP?

Thank you in advance.




DNS record avalible, ping and browsers can't resolve

intro

Hi,This problem has me stumped. I'm new to this stuff but but wanted to give hosting my own site a go.

problem

anything.gisborne.xyz
Abdhhrwj.gisborne.xyz
Gisborne.xyz

All work in browser

But tutor.gisborne.xyz dose not.

$ ping anything.gisborne.xyz

Resolves and sucseeds Unless anything = tutor

$ ping tutor.gisborne.xyz

Unknown host

$ dig anything.gisborne.xyz
.. ANSWER SECTION:
anything.gisborne.xyz.  499     IN CNAME   gisborne.xyz.
gisborne.xyz.           499     IN      A       51.89.166.160

$ dig tutor.gisborne.xyz
.. ANSWER SECTION:
tutor.gisborne.xyz.     499     IN          A       51.89.166.160

Pinging tutor.gisborne from the VPS itself dose work.

background

I have a Debian 10 instce at ovh. I am useing ufw.

I own a domain name: gisborne.xyz Registrar: Gandhi I have subdomains for different things.

  • gisborne.xyz for a splash page
  • maxwell.gisborne.xyz for a professional page
  • vibe.gisborne.xyz as a fun homepage
  • tutor.gisborne.xyz for my tutoring

I use nginx as a webserver/reverse proxy, I followed the official tutorials.

Following various tutorials I had entered different DNS A records for each subdomain and it's wwww.subdomain.

I used certbot to create SSL certificates for each subdomain.

At this point everything was working.

Then a friend told me about wildcard CNAME enteryes

I replaced some of my A records with a CNAME record *.gisborne.xyz.

I also tried to use Certbot to creat a wiled card SSL certificate.

I was then in a position where http and HTTPS would go to different places, http would go to the default server where as HTTPS would go to the gisborne.xyz homepage.

I decided to remove the wildcard cert with

$ sudo certbod delete 

I then decide to sleep on it and let DNS propergate but in the morning (now) everything works but tutor.gisbore.xyz

I have no idea what's going on.

current DNS records

@ 86400 IN SOA ns1.gandi.net. hostmaster.gandi.net. 1604141215 10800 3600 604800 10800
* 500 IN CNAME gisborne.xyz.
@ 500 IN A 51.89.166.160
@ 10800 IN MX 10 spool.mail.gandi.net.
@ 10800 IN MX 50 fb.mail.gandi.net.
@ 10800 IN TXT "v=spf1 include:_mailcust.gandi.net ?all"
_acme-challenge 500 IN TXT "ETK8mf9ebHGBRT9hRQMHIluYspGHT5BoBlD3-ZAUH-k"
_imap._tcp 10800 IN SRV 0 0 0   .
_imaps._tcp 10800 IN SRV 0 1 993 mail.gandi.net.
_pop3._tcp 10800 IN SRV 0 0 0   .
_pop3s._tcp 10800 IN SRV 10 1 995 mail.gandi.net.
_submission._tcp 10800 IN SRV 0 1 465 mail.gandi.net.
ipfs 300 IN TXT "dnslink=/ipns/QmdeUCxowW85n3t4FQDckq3CEX4WFLEFn1czzPNDQxhx9C"
mail 10800 IN CNAME webredir.gandi.net.
tutor 500 IN A 51.89.166.160
vibe 1800 IN A 51.89.166.160
webmail 10800 IN CNAME  webmail.gandi.net.
www.vibe 500 IN A 51.89.166.160

ufw status

Status: active

To                         Action         From
--                         ------         ----
OpenSSH                    ALLOW       Anywhere
Nginx Full                 ALLOW       Anywhere
DNS                        ALLOW       Anywhere
MSN SSL                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
Nginx Full (v6)            ALLOW       Anywhere (v6)
DNS (v6)                   ALLOW       Anywhere (v6)
MSN SSL (v6)               ALLOW       Anywhere (v6)

Certbot certificates

Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: gisborne.xyz
    Domains: gisborne.xyz www.gisborne.xyz
    Expiry Date: 2021-01-28 20:11:16+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/gisborne.xyz/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/gisborne.xyz/privkey.pem
    Certificate Name: tutor.gisborne.xyz
    Domains: tutor.gisborne.xyz maxwell.gisborne.xyz vibe.gisborne.xyz www.maxwell.gisborne.xyz www.tutor.gisborne.xyz www.vibe.gisborne.xyz
    Expiry Date: 2021-01-28 20:50:52+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/tutor.gisborne.xyz/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/tutor.gisborne.xyz/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

NOTE: I had alot of trouble posting this, getting stack over flow to accept the formatting.




square over BottomNavigationBarItem when curser is above it (flutter web)

I've created a flutter web app and I'm using a scaffold with a bottomnavigationbar. But every time my curser is above a bottomnavigationbaritem there appears a square above it. What is that square and how can I remove it?

Here you can see the square I am talking about




Inserting data from 2 different forms in 2 different tables using same php file

I want to insert data from 2 different forms from 2 different files in 2 different tables of same database. what should i do.




Google Associate Cloud Engineer Certification Examination

Please I need a sample of the Associate Cloud Certification Examination




Bad:my computer cannot login with account

47.112.113.21 root ZZMYzhizhemiaoyin0426 root Zzmy2019! this is my account , who can try it




Using the facebook api, how do I obtain the post id of a post created by sharing content from my website?

After some research apparently until 2018 in the response body you would receive from the share dialog there would be a post-id if certain permissions were given. That seems to have since been removed however. Are there any ways of doing what I want now?




vendredi 30 octobre 2020

ahrefs crawl, why all my website links are discarded

I try to audit my website with ahrefs, but when i try to crawl my website it only finds 1 link, everything else gets discarded. This is my sitemap playtoearn.net/sitemap.xml Every page has a code 200 so there is no problem with that, what is wrong with it?

enter image description here




Using Localstorage with Redux in React

I am working on an ecommerce site in React/Redux. I want to save the user's cart into the localstorage each time after an action has been dispatched in Redux. My code for that looks like this -

import { createSlice } from "@reduxjs/toolkit";

export const cartSlice = createSlice({
  name: "cart",
  initialState: {
    cart: [],
  },
  reducers: {
    addToCart: (state, action) => {
      state.cart = [...state.cart, action.payload];
      localStorage.setItem("Cart", JSON.stringify(state.cart));
    },
    removeFromCart: (state, action) => {
      state.cart = [];
    },
  },
});

export const { addToCart, removeFromCart } = cartSlice.actions;

export const selectCart = (state) => state.cart.cart;

export default cartSlice.reducer;

I did this to solve the problem of the cart getting empty whenever the site refreshes (because I was storing cart in state).

But here, everything works fine until the site refreshes. The products get added to the localstorage.

Now, when I refresh my site, since I am setting localstorage to the state of the cart, each time I refresh, the previous localstorage gets deleted and is overridden by the new state of the cart (because even the state of cart gets changed after refresh).

Is there any other way around it?

I tried by best to explain what I'm facing. Hope it's understandable.

Thanks in advance.




A website not working on one pc while works properly on other pcs

I am facing problem with samsclub.com when i login on samsclub website and go to purchase history, account detail or on any other page it redirects again to login page. And when i enter id and password and click login it never goes further. Even some of the Buttons on front page are hidden. I am facing this problem on a specific pc even on all browsers installed on that specific pc. While there is no problem if i use my other pc
Connected to the same network. I have tried clearing cache, temp files but nothing happened. Once i reinstalled the windows then the issue was solved. But right after a week i am facing that problem again.




What is difference between model class and data class?

I'm new to web development and I'm struggling to differentiate between a model class and a data class, specially when implementing them.

I found this question and I kind of understood the theory about it: the data class contains all the core information about an object and a model class only contains the information that needs to be exposed. So I can have a user data class like this:

public class User {
    public long Id { get; set; }

    public string Name { get; set; }

    public string Password { get; set; }

    public string Email { get; set; }

    public int Score { get; set; }
}

And a model class for the login page like this:

public class UserModel {
    [Required]
    public string Password { get; set; }

    [Required]
    [EmailAdress]
    public string Email { get; set; }
}

And I would have to create another model class for sign up, for example, adding the Name and Password properties. But do I need to be repeating the same properties for each new model? Do the models need to inherit from User data class? Is all of this specific to MVC pattern? How do the model data classes relate to each other?

I'm using Blazor WebAssembly if that helps.




As you can see I am trying to create a link elements?

<html>
  <head>
   <link 
 href="css/styles.css" 
 rel="stylesheet">
  </head>
   <body onload="createImg()">

    <h1>My Website</h1>

    <p>This is my first 
website</p>
    <div id='working_area' >
  
  
     </div>
 <script>
   function createImg(){

    var  img=document.getElementById("working_area");
img.innerHTML="<a src='https://www.google.com'>google</a>";
 }
 </script>
  </body>
 </html>        

So I want to create a hyperlink using this method and not using create elements method Why? Because I want to create a html editor

** Is it possible ?**

Here is the image of results. The link doesn't working. this is the result I am getting




Unable to get property 'sendMessage' of undefined or null reference

while trying to use browser.runtime.sendmessage(object) function above error occurs. runtime API is not available and i see that webruntime api is available on a web page. This error occurs in Microsoft Edge and not in other browser in content scripts




How to implement Web OTP Api in React?

I am trying to use Web Otp APi using docs from https://web.dev/web-otp/. But it is not working. Can anyone tell me how to execute it in reactjs.




Related to JavaScript Classes

I am new to JS.

I want to know if I can destroy or delete a JS class instance during runtime.

For example, its the code :

class Car {
  // code
}

let c = new Car();

//now I want to delete or destroy the class instance c

What can I do now?

Thanks in advance.




My websites downloading pages instead of displaying website [duplicate]

I am facing an issue with my WordPress websites for the last few days. My websites are downloading files instead of displaying Pages. Whatever Url I enter from my website it downloads a file. And this is the problem not with a single website but both on my current hosting.(skillshare)( Siyast) When I open the file with notepad it shows a code.

<?php /** * Front to the WordPress application. This file doesn’t do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define( ‘WP_USE_THEMES’, true ); /** Loads the WordPress Environment and Template */ require __DIR__ . ‘/wp-blog-header.php’;

I couldn’t understand what the problem is. Even I change the browser, change the system, clear the cache. But nothing worked for me. Please Suggest me a solution. Thanks




Why does a "Huawei Cloud Service data center" bot visit my website every 15 minutes, even though I haven't shared a link to it anywhere?

I get a visitor to my website, which hasn't even been shared anywhere yet, and it's very strange because the visitor's ip is coming from Huawei apparently...

I've heard a lot of sketchy stuff about that company and this doesn't ease my suspicion.

I thought maybe it was just some random bot using back referencing or something but I haven't even shared my project with anyone so that just makes this strange.

Is there an explanation for this?




How to center the google docs in an iframe?

I have developed a website with google docs as pages in the iframe. Also i have added a feedback form made with Google Forms to it. Here is my website for your refrence.

The feedback form correctly got aligned to the iframe. But, the google docs sticks to the left. How to bring it to the center without affecting the rest of the elements?

I have used HTML, CSS and some scripts for notification service and animation.




Javascript - Change name of all object keys in nested arrays

This is the array i get:

const packages = [
  {
    id: '641a1690-6c8b-4ada-ae97-8d82cc4fe7a3',
    name: 'com.sample',
    children: {
      id: 'd7384f60-e4ab-4a86-8e2e-0f66cc32f',
      name: 'child.computer.com',
      children: { id: 'e4ab-4a86-0f66cc32f560', name: 'child.com' }
    }
  },
  { id: 'd7384f60-e4ab-4a86-8e2e-0f66cc32f560', name: 'computer.com' },
  { id: 'ca7f972e-64ee-4cb0-80b9-1036fac69d32', name: 'java.util' }
];

So, it is an array of objects, and each object can have children, which again have id, name and possibly children (children is optional), and so on, it can be nested X times. I want to change key names, id to key, name to title and children will remain children. So, my problem is that i don't know how to change keys inside children, i just change the first level and that is all.. It should be like:

{
    key: '641a1690-6c8b-4ada-ae97-8d82cc4fe7a3',
    title: 'com.sample',
    children: {
      key: 'd7384f60-e4ab-4a86-8e2e-0f66cc32f',
      title: 'child.computer.com',
      children: { key: 'e4ab-4a86-0f66cc32f560', title: 'child.com' }
    }   
}



What is a framework? Are they important? [duplicate]

I know that this is probably a silly question but I have been trying to understand that and it still doesn't make sense. How does a framework work? And how is it different than a library? For example I have been studying web development using html css js for front-end and php for back-end. Where does the React framework for example fit in that?




How to Redirect Rocket.Chat websocket from port 80 to port 443?

I have setup the Rocket.Chat server on AWS EC2 instance. Also, I have created the Apache configuration so that it should be accessible from web as well. But for security I have to attach SSL. So, I have attached it to. But problem is, for example, if I access my website without https that is with http://chat.example.com it don't redirects me to https. But when I access the website with https://chat.example.com it shows me the ssl I have applied for. I have two files one is for port 80 and one is for port 443 but both of them not connected. Please help me to redirect my port 80 websocket to port 443.

Following is my configuration for port 80: Port 80 Configuration for Rocket.Chat webApp

This Configuration opens same website without ssl.

<VirtualHost *:80>

    ServerName chat.example.in

    LogLevel info
    ErrorLog /var/log/chat.example.in_error.log
    TransferLog /var/log/chat.example.in_access.log

    <Location />
        Require all granted
    </Location>
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*)           ws://localhost:3000/$1 [P,L]
    RewriteCond %{HTTP:Upgrade} !=websocket [NC]
    RewriteRule /(.*)           http://localhost:3000/$1 [P,L]

    ProxyPassReverse /          http://localhost:3000/

Below is the configuration for port 443 which opens for same website with ssl. Port 443 Configuration for Rocket.Chat webApp

<VirtualHost *:443>

    ServerName chat.example.in

    ProxyPass / http://localhost:3000/

    LogLevel info
    ErrorLog /var/log/chat.example.in_error.log
    TransferLog /var/log/chat.example.in_access.log
    SSLEngine On
    SSLCertificateFile /etc/letsencrypt/live/chat.example.in/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/chat.example.in/privkey.pem
    <Location />
        Require all granted
    </Location>
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*)           ws://localhost:3000/$1 [P,L]
    RewriteCond %{HTTP:Upgrade} !=websocket [NC]
    RewriteRule /(.*)           http://localhost:3000/$1 [P,L]
    ProxyPassReverse /          http://localhost:3000/

Can anyone tell me what should I add to my port 80 Configuration to redirect to 443 port?




Get Website Source Code in Andriod Studio

I am trying to get the source of a website example: "https://www.google.com/" to a textview but the app keeps crashing when i try to open it on my phone so i decided to use firebase lab test I used Galaxy A 2017, API Level 24(It Worked Perfectly) Pixel 2, API Level 27 (It Worked Perfectly) Pixel 2, API Level 28 (It Worked Perfectly) My phone is GIONEE M100 with Android Version 9 (API Level 28) It crashes everytime i try to open it. I also tried it on Redmi Note 8 Android Version 9 (API Level 28) it also crashes I still can't figure out why the same app works perfectly well in firebase lab test on different version and crashes on physical devices. Here is the code

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_website_source_code);

        textView = findViewById(R.id.textView);
        editText = findViewById(R.id.editText);
        button = findViewById(R.id.button);

        textView.setText(getWebsiteSourceCode("https://www.google.com/"));
    }

    public String getWebsiteSourceCode(String website){
        String resString = "";
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
        StrictMode.setThreadPolicy(policy);
        HttpClient httpclient = new DefaultHttpClient();
        HttpGet httpGet = new HttpGet(website);
        try{
            HttpResponse response;
            response = httpclient.execute(httpGet);
            HttpEntity entity = response.getEntity();
            InputStream inputStream = entity.getContent();
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "windows-1251"), 8);
            StringBuilder stringBuilder = new StringBuilder();
            String line = null;
            while ((line = reader.readLine()) !=null){
                stringBuilder.append(line + "\n");
            }
            resString = stringBuilder.toString();
            inputStream.close();
        }catch (Exception e){
            e.printStackTrace();
            Toast.makeText(this, "Error!", Toast.LENGTH_SHORT).show();
        }
        return resString;
    }

In Manifest I added

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

In build gradle I added

useLibrary 'org.apache.http.legacy'



Creating a College CMS | Which one will be suitable Django or Node [closed]

I have a Final Year Project, Now I want to create a College Management System Where students can view their result, Attendance, Fee, announcements and other activities too. It has Multiple Users ( Admin (HOD), Teachers and Students (Semester 1,2,3,4,5,6,7,8 ) ). Now my question is Which tool will be best for this kind of multiple users tasks. Let me Share your Detail Opinion.




Change header for only one website in odoo 13

I have several websites on my odoo and I need to chenge header for one of them. If i did this:

<template id="change_header" inherit_id="website.layout" name="Header">
    <xpath expr="//nav[@class='navbar navbar-expand-md navbar-light bg-light']" position="replace">
        // some new header
    </xpath>
</template>

it changes all of my websites. Is there any way to modify only one website?




PHP Script not working after user closes the connection (I am using ignore_user_abort())

I have two files named playermonitor.php and keepplayeralive.php

playermonitor.php is supposed to run an infinite loop with an interval of 1 second and keep checking the value of column status in the table players of a database, if it is equal to 0, then increase $count else set the value of the column to 0. If $count becomes equal to 3, delete the table from the database. It is as follows

<?php
    session_start();
    ignore_user_abort(true);
    set_time_limit(0);
    /*if (true) is used for testing only*/
    if (true) {
        $_SESSION['playermonitorisrunning'] = 1;
        $link = mysqli_connect('host', 'username', 'password', 'database name');
        $playerid = $_SESSION['playerid'];
        $count = 0;
        while (true) {
            $result = mysqli_query($link, "SELECT `status`, `gameid` FROM `players` WHERE `playerid` = ".$playerid.";");
            $player = mysqli_fetch_array($result);
            $playerstatus = $player['status'];
            $gameid = $player['gameid'];
            if ($playerstatus == 0) {
                $count += 1;
                if ($count == 3) {
                    $result = mysqli_query($link, "SELECT * FROM `games` WHERE `gameid` = ".$gameid.";");
                    if (mysqli_num_rows($result)) {
                        $game = mysqli_fetch_array($result);
                        $gameid = $game['gameid'];
                        $playercount = $game['playercount'] - 1;
                        for ($suff = 1; $suff <= $game['playerlimit']; $suff++) {
                            $playerslotname = 'player'.$suff;
                            if ($game[$playerslotname] == $playerid) {
                                break;
                            }
                        }
                        $result = mysqli_query($link, "UPDATE `games` SET `playercount` = ".$playercount.", `".$playerslotname."` = NULL WHERE `gameid` = ".$gameid.";");
                    }
                    $result = mysqli_query($link, "DELETE FROM `players` WHERE `playerid` = ".$playerid.";");
                    break;
                }
            }
            else {
                $result = mysqli_query($link, "UPDATE `players` SET `status` = 0 WHERE `playerid` = ".$playerid.";");
                $count = 0;
            }
            sleep(1);
        }
    }
    die();
?>

And the keepplayeralive.php is supposed to run an infinite loop with an interval of 0.5 seconds, and keep setting the value of the column status of the table players in the database to 1. And it should break the loop when the user closes the connection. It is as follows

<?php
    session_start();
    ignore_user_abort(true);
    set_time_limit(0);
    $link = mysqli_connect('host', 'username', 'password', 'databse name');
    $playerid = $_SESSION['playerid'];
    while (true) {
        $result = mysqli_query($link, "UPDATE `players` SET `status` = 1 WHERE `playerid` = ".$playerid.";");
        if (connection_aborted()) {
            break;
        }
        sleep(0.5);
    }
    die();
?>

I call these scripts asynchronously through JavaScript using XMLHttpRequest like this

var keepplayeronline = new XMLHttpRequest();
keepplayeronline.open("GET", "keepplayeronline.php", true);
keepplayeronline.send();

var playermonitor = new XMLHttpRequest();
playermonitor.open("GET", "playermonitor.php", true);
playermonitor.send();

If this all worked fine, the row in the database with value of column playerid equal to $playerid should get deleted after the user closes the connection.

However, the row doesn't get deleted after I close my connection to the server. What am I doing wrong?




Problem connecting email listener with backend

I have deployed an app on a private GKE cluster, and i want to connect the backend and the email listener, I inserted all the env variables encoded to base64 in secret k8s manifest. When I apply their deployments i have this error in the workload of the email-list

File "/email_listener/app/imap/common.py", line 31, in connect_to_mail_server
    await imap_client.wait_hello_from_server()   File "/usr/local/lib/python3.8/site-packages/aioimaplib/aioimaplib.py", line 710, in wait_hello_from_server
    yield from asyncio.wait_for(self.protocol.wait('AUTH|NONAUTH'), self.timeout)

I checked everything and seems fine to me, here is the connection code. Any fix suggestiosn? Do i need a special load balancer for the email listener?




Why do I get this grey Background coming when i increase height

my web is like this

enter image description here

enter image description here

enter image description here

When I am trying to increase height why I am getting that grey on top

enter image description here

This is the CSS




I'm trying to create project but with no success , please help me [closed]

I'm trying to create php website and I need following functions. I'm Opening Logistics company in m Country and there is some specific modules I need to create in php user can create account admin can manage user's account (admin can add parcel tracking number manually to users panel) after admin add parcel tracking number to user panel , user can make some changes to it. We need user to make declare , user must choose the category of the parcel and must write the price of the package. also user can manually add tracking number to his panel then admin accept it.

Please help me. Thank you in advance




How to change php ini settings for a particular php file

How can I set custom php ini file for a single php file so that the global settings are not affected? I want to run a script even after the user closes the connection, but only that script should be running, all others should terminate.




How to change website which is opening when I type a URL?

I know it sounds very unusual and very foolish question but I am just a highschool teen trying to learning stuff.

I am a windows user. What I want to do is, whenever I try to open a website or any link related to that website in my browser it should not open that website but an image stored in my computer. What are the settings which I should change in my windows computer to do so.

BACKGROUND STORY-

I am too addicted to some specific website which I want to prevent myself to open in my PC just by clicking. Website blockers dont works for me because it is very easy to uninstall them but changing setting can be a bit hard if someone else is going to perform steps given in answers.




jeudi 29 octobre 2020

How to find out if an Website is embedded with iframe?

I'm programming a Website and i just don't know how to find out using Javascript if an Website is embedded with iFrame. I want to embed it into another site with iFrame but the styles and the content should be different. This means: If the page is embedded, then I want something else to be displayed than if it is not embedded
Thanks, Daniel




How to set group access rights to portal users

So, I'm in this situation on Odoo v13:

I have a bunch of portal user, and on some condition I want to add them to an internal group (this group is result of my code, not others). But on adding process, Odoo return an error of: User can have only one user type. And I know that's caused by I want to add a portal user to an internal group.

My question is: How can I change an internal group to a portal group with the same access rights and record rules?




Modifying format in goaccess

I must use goaccess on a log that looks like this:

176.6.24.77 - - [Nov 05 2020 23:33:42] "GET /fontawesome/css/all.min.css HTTP/1.1" 200 28 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"

I'm trying to use the log-format option and I'm using the following:

goaccess --log-format=COMBINED --log-format="%^[%b %d %Y %T]" access.log

and I get the following error:

Token '04' doesn't match specifier '%d'

But 04 IS supposed to match %d, no ? I'm getting confused here




Web Garden behaves differently depending on the user set on the application pool identity

I have configured my website in IIS (just an ASP.NET MVC application) to use Web Garden. I have noticed that If I set its application pool identity to a domain administrator account (not local administrator account) it is working correctly. However if I set it to any non-administrator account it does not work (user gets kicked off randomly with http errors 401 and system becomes unstable because of this). So Do I need to set permissions for this non-administrator account somewhere else? or maybe... Is it mandatory to be an administrator account in order to Web Garden to work correctly? Does anyone experiencied this before? Could someone confirm this?




How do you make a proxy server that would proxy a site by doing to following: https://ift.tt/37VRtZx?

I want to make a proxy server that gets a URL from the user and proxies it to them. I don't want to have to hard code each proxied site. An example would be whoer.net, although it has recently been marked by Google Chrome as malicious. Currently, I have an apache2 website, hosted on Debian, that I would like this proxy server to be accessed from.




Close Browser's find (CTRL + F)

I am creating a script to register where users are making CTRF + F in my website. For this I made a code that look every time the user is calling the browser's find and I push into an array the name of the page where he did it. Some of my page are in reality tabs that mean that the browser's find doesn't close it self when I change tab. So I would like to have a script to close the browser's when I change tab or page beacuse if not the browser's find could stay open even if the user change tab and do an other research. For now I have this:

var ctrlf = []; 
var url = '';
window.addEventListener("keydown", (event) => {
url = url_parse();
  if ((event.ctrlKey && (event.key == "f")) || (event.key == "F3")) {
    ctrlf.push(url_parse());
//url_parse is a function to parse the url of the page into a string (see this as the id of a page / tab)
  }
document.addEventListener("click", (event) => {
  if(url != url_parse()){
     var e = new KeyboardEvent('keypress', { 'key': 'Escape' })
     document.dispatchEvent(e)
  }
});

My idea is to simulate the keypress of Escape but this is not working.

Any ideas to improve my code is welcome or new ideas on how to close the browser's find when the user change tab (only the hash of the url change when the user change tab).

Thanks




How to center an image in html for mobile view? [closed]

What is the html and css code for centering an image for mobile? I've got a class and I'm giving the img and id and putting the styling in there but it isn't working so what should I do?




How to connect my python-SQlite database to my website?

I have made a database using Python and SQlite .I want to connect this to my website .How Can I do this ?




Getting "page not found" error while trying to go back to the previous page after successful deletion using DeleteView in django

So I'm deleting an object of a model using DeleteView and redirecting to homePage after successful deletion, works fine. But the problem is when I try to get back to the previous page after deletion(using the left arrow button in the browser). I get "page not found" error which makes total sense because I'm trying to get back to the deletion page of an object which no longer exist. How do I prevent this from happening?




Post request in browser gives 404

We have a problem where a POST request gives 404 from the browser but same endpoint works with GET requests. The same POST request also works from Postman.It's also worth mentioning that it works locally but not in the customers environment.

Frontend is React and backend is Aspnet core API.

[GET] api/orders --> works, [POST] api/orders --> 404 in browser but works from Postman




optimized image vs image url which one would be better for fast website rendering?

our WordPress site is too slow. so I have two option

1. optimizing images
2. using image URL

which one would make it more convenient?




Footer error when using bootstraps cover template

When using bootstraps cover template:

https://getbootstrap.com/docs/4.0/examples/cover/#

If I resize the window to a small level to allow scrolling or simply include enough text to warrant scrolling the footer goes a solid colour (see linked picture). It even does this on the template but I'd love to fix it

Can anyone help with this would really really appreciate it The gradient seems to stop and simply go one solid cov=lour




How to redesign a website into WordPress?

I am looking to redesign the website into WordPress. As of now website is designed on an open source PHP platform, I am not too much technical therefore facing issues to maintain a PHP based website. One of my friends has told me to redesign the website into WordPress, it will more easy and manageable as compared to PHP based website. I don't have in-depth knowledge of WordPress, before few weeks I started learning WordPress. This is a PHP based website URL https://www.maxitaxiservices.in/, please have a look and let me know if I need any changes or any kind of modification into hosting part of the website. As a not too much technical person, please also suggest what configuration is compatible for smooth WordPress development. Also provide any online reference from where I can learn WordPress development easily, waiting for helpful reply.




Why div tag not reading mentioned class? [duplicate]

I want my div tags to have different background color than body background color but my browser only shows first div color changed not second one. why?

body {
  background-color: Linen;
}

.names {
  background-color: Yellow;
}

.title {
  background-color: rgb(255, 0, 0)
}
<!doctype html>
<html>

<head>
  <title>Our Blog</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>

  <div class="title">
    <h1 align="center">O</h1>
  </div>

  <div class="names">
    <h2 style="float: left">M</h2>
    <h2 style="float: right">F</h2>
  </div>

</body>

</html>

But output is showing just first div background-color change not the second one




How to hide drop down list in mobile menu?

So I've got a drop down list in my menu for courses but I don't want it to be in a drop down list on the mobile menu, only desktop and tablet. So how can I do this?




Tell me about the CRM’s activity management

In essence, a contact management tool is an address book on steroids. It provides the basic basis (contact information) that you need to develop strategies for sales and marketing and drive customer retention. Technology Counter is an online software recommendation platform . We help businesses , professional and organisations find the best software solution. https://technologycounter.com/crm-software




use nightwatch with async/await

nightwatch version: 1.3.5

I write a commond in PageObject and return a Promise,when I use it like "await xxx",I got some errors.

But I actually return a Promise...

The commond in PageObject:

waitForAllElementNotPresent(selector = '.el-loading-mask', time = 10000) {
    const _that = this;
    return new Promise(function (resolve, reject) {
        _that.api.elements('css selector', selector, function (res) {
            let len = res.value.length;
            let times = 0;
            for (let i = 0; i < len; i++) {
                _that.api.waitForElementNotPresent('css selector', {
                    selector: selector,
                    index: i
                }, time, function () {
                    times++;
                });
            }
            let timeInterval = setInterval(() => {
                if (times >= len) {
                    resolve();
                    clearInterval(timeInterval);
                }
            }, 500);
        });
    });
}

used the commond like this:

await this.topNav.waitForAllElementNotPresent('.el-loading-mask');

the error like this:

   - writing an ES6 async test case? - keep in mind that commands return a Promise;
   - writing unit tests? - make sure to specify "unit_tests_mode=true" in your config.



What am I doing wrong? php script to INSERT INTO database table [duplicate]

This is nothing special. just something for my personal end. Is there something im doing wrong? Similar Code seems to work fine on my other page but on this page it doesn't seem to work. my includes are accurate. my item table structure is correct. im confused? Nothing is getting added into DB,... Page runs fine... no obvious errors....

<!DOCTYPE  html>
<head>
<title>Add Item To Database</title>
</head>
<body>
<?php include'includes/sql.php';?>





<?php
if($_SERVER['REQUEST_METHOD'] != 'POST')
{
    ?>
<form>
    <label for='item_name'>Item Name</label>
        <input type='text' size='50' name='item_name' id='item_name'>
        
    <label for='item_price'>Price</label>
        <input type='text' size='50' name='item_price' id='item_price'>
        
    <label for='item_weight'>Weight</label> 
        <input type='text' size='50' name='item_weight' id='item_weight'>
        
    <label for='item_sku'>Sku</label>
        <input type='text' size='50' name='item_sku' id='item_sku'>
        
        <label for='item_category'>category</label>
        <select name='item_category' id='item_category'>
            <option value="Grain">Grain</option>
            <option value="Cleaning">Cleaning & Sanitation</option>
            <option value="WineKits">Wine Kits</option>
            <option value="BeerKits">Beer Kits</option>
            <option value="Equiptment">Equiptment</option>
            <option value="Yeast">Yeast</option>
            <option value="Hops">Hops</option>
            <option value="Chemicals">Chemicals</option>
            <option value="Books">Books</option>
            <option value="Additives">Additives & Flavorings</option>
            <option value="Racking">Racking & Bottling</option>
        </select>
        <input type="submit" id="Add" name="Add" value="ADD">
</form>
<?php 
}
else {
    
        $name = $_POST['item_name'];
    $price= $_POST['item_price'];
    $weight= $_POST['item_weight'];
    $sku= $_POST['item_sku'];
    $category= $_POST['item_category'];

    $add = "INSERT INTO items(Name, Price, Image, Sku, Weight, Category, Active) VALUES ('".$_POST['item_name']."', '".$_POST['item_price']."', 'NULL', '".$_POST['item_sku']."', '".$_POST['item_weight']."', '".$_POST['item_category']."', '1')"; 
    mysqli_query($conn, $add);



}

?>



</body>



</html>

yet this works just fine

<html>
<head>
<title>Brewtensils - Contact Us</title>
<script>function validateforms() {
  var x = document.forms["commentform"]["email"].value;
  if (x == "") {
    alert("Email must be filled out");
    return false;
  }
  
  var x = document.forms["commentform"]["phone"].value;
  if (x == "") {
    alert("Please enter your phone number");
    return false;
  }
  
  var x = document.forms["commentform"]["comment"].value;
  if (x == "") {
    alert("Comment must be filled out");
    return false;
  }
}
</script>
<link rel="stylesheet" href="css/main.css" type="text/css">
<link rel="stylesheet" href="css/header.css" type="text/css">
<link rel="stylesheet" href="css/footer.css" type="text/css">

</head>


<body style="background-color:66a722;">
<?php $page = 4;?>
<?php include'includes/sql.php'?>
<?php include'includes/header.php'?>



<div id='secondarybg'>

<?php

if($_SERVER['REQUEST_METHOD'] != 'POST')
{

    ?>
    
    <div id='contactinfo'><center><br><br><br><br><br><br><p>If you have any questions, comments, or suggestions<br>
                              feel free to contact us.<br> 937-938-9426 <br>support@brewtensils.store<br>Thanks for your input!</p><br><br><br></center>
                            
                              
                              <center>
                                <form id="commentform" name="commentform" method="post" onsubmit="return validateforms()">
                                    <center><input type="text" name="email" placeholder="Email" class="text" size="32" id="email"/></center><br>
                                    <center><input type="text" name="phone" placeholder="Your Phone No." class="text" size="25" id="phone"/></center><br>
                                    <center><textarea cols="50" rows="4" name="comment" placeholder="Enter your Comment, Suggestion, or Question here."></textarea> </center> 
                                    <center><br>
                                    <input type="submit" class="login" value="Send" name="send">
                                    </center>
                                </form>
                              </center>
    </div>
<?php 
}
else {
    
     
     $required = array('email', 'phone', 'comment');

// Loop over field names, make sure each one exists and is not empty
$error = false;
foreach($required as $field) {
  if (empty($_POST[$field])) {
    $error = true;
  }
}

if ($error) {


echo'';

} else {
 

    
     
 
        //the form has been posted without, so save it
        //notice the use of mysql_real_escape_string, keep everything safe!
        //also notice the sha1 function which hashes the password
        $time= date("Y-m-d h:i:sa");
        $sql = "INSERT INTO
                    comments(email, phone, comment, time)
                VALUES('".$_POST['email']."',
                       '".$_POST['phone']."',
                       '".$_POST['comment']."',
                        '".$time."'
                        )";
                         
        mysqli_query($conn, $sql);
        
        echo'<center><div id="commentsuccess"><p id="commentsuccesstext">Thanks for your submission!<br>
                        Staff will review this info and if necessary get back<br>
                        with you in 1-3 business days.</p></div></center>';
        
        
    }
    
}
            














?>
<br><br><br><br><br><br>

    </div>



<?php include'includes/footer.php';?>








</body>


</html>



Extract all text under an h2 tag using scrapy

I need to search for an h2 tag with certain value and extract all text following it until the next h2 tag or end of page. so if the page is

<h1 id="DDPSupport-InternalResources"><span style="color: rgb(0,51,102);"><strong>Internal Resources</strong></span></h1>
<h2 id="DDPSupport-GeneralInformation">General Information</h2>
<ul><li><a href="/display/ladtechtme/DDP+overview">DDP overview</a></li>
<li><a href="/display/ladtechtme/DDP+Configuration+guide">DDP Config guide</a></li>
<li><a href="/pages/viewpage.action?pageId=1338281922">Custom DPR</a></li>
<li><a href="/display/ladtechtme/Build+custom+package">Build custom package</a></li>
<li><a href="/display/ladtechtme/Unit+testing">Unit testing</a></li>
<li><a href="/display/ladtechtme/FAQ">FAQ </a></li>
<li><a href="/display/ladtechtme/Misc+BKMs">Misc BKMs</a></li></ul>
<h2 id="DDPSupport-UseCases">Use Cases</h2>
<ul><li><a href="/pages/viewpage.action?pageId=1338281922">Custom DPR </a></li>...

, the expected output is

DDP overview
DDP Config guide
Custom DPR
Build custom package
Unit testing
FAQ
Misc BKMs

I am using the following code:

for head in response.xpath("//div[@class='wiki-content']/h2"):
   if sub == 'General Information':
        lines = head.xpath("//following-sibling::*[count(following-sibling::h2)=1]//text()").extract()
        print(str(lines))

I am getting some result but not the desired one. My output consists of the text of the next h2 tag. Any help would be appreciated.




How to integrate Live video streaming with chat in single window option

  • Live streaming video with Chat ,Poll and Ask question options - All in one window - Backend will provide to ask question and create our polls - Analytics - Support Web,Android and iOS Platforms



is there any function to find erros in php? [closed]

Notice: Undefined index: newsname 33

34Notice: Undefined index: news in

    $news = $newsname = "";

    $news = mysqli_real_escape_string($link,$_POST['newsname']);   //line 33
    $newsname = mysqli_real_escape_string($link,$_POST['news']);   //line 34

    $sql = "INSERT INTO news(news,newsname)
    VALUES('{$news},{$newsname}')";

    if (mysqli_multi_query($link,$sql)) {
      header("location: ../pages/news.php");
    }else{
      echo "<div class='alert alert-danger'>Query Failed</div>";
    }



mercredi 28 octobre 2020

Hit counter data to be stored in a cookie

Write a program in jsp java to create a webpage where the hit counter data has to be saved in a cookie.Is there any way by which we can store the hit counter value inside a cookie. If yes can anyone help me.




Which ID should I use for SSL registration?

I am using SSL for free website for SSL for my website . There I need to register. My question is when we register there , which email id I shall be using for registering? Gmail I'd or the email id created under hosting for my site?




How can I find an element using selenium in this code?

I am trying to use Selenium in Python to select the following element, how would I do it?

Applications

I have tried find_element_by_id, find_element_by_name, find_element_by_link_text but no luck.




A way to find all JSON Post or outputs from website

Im tracking a website in order to automate some transactions. So far I found the JSONs paths to get login and get some relevant information by checking the XHR generated, at Chrome, on each request (Inspect -> Network -> XHR). I already can get the token to perform JSON GETS to have more data. However this site have a section where you will submit data through a form but this POST is not appearing at the XHR, no trace at all. The final goal is to automate this form submission. So my question is which tool o method can I use to track all output information generated by this submission. PS: This site have no API.




Apache Proxy balancerMember with query string parameter [closed]

I'm working on with apache proxy, I want to use Proxy balancer member with query string value, but it's not worked I expected.

Here's my configuration.

Listen 49154 
<VirtualHost *:49154> 
         <Proxy balancer://vncServer> 
                BalancerMember ws://server1 route=1 retry=1 
                BalancerMember ws://server2 route=2 retry=1 
                BalancerMember ws://server3 route=3 retry=1 
                ProxySet stickysession=JSESSIONID 
        </Proxy> 

        RewriteEngine on 
        RewriteCond %{QUERY_STRING} port=(.*) 

        #to make ws://server1:(port value from query string)/websockify
        RewriteRule (.*) balancer://vncServer:%1/websockify [P]
        ProxyPassReverse (.*) balancer://vncServer:%1/websockify 
</VirtualHost> 

but I checked in log that, always connect with 80 port.

works fine without balancer like

Listen 49154 
<VirtualHost *:49154> 

        RewriteEngine on 
        RewriteCond %{QUERY_STRING} port=(.*) 
        RewriteRule (.*) ws://server1:%1/websockify [P]
        ProxyPassReverse (.*) ws://server1:%1/websockify 

</VirtualHost> 

Is there any way to connect with balancer memeber with query string ports value? Any help will be thankful.




How important css flex and grid layout in web design? and What's the best blog post where I learn this?

I try to understand the topic css flex and grids. But after read some blog post, I haven't clear concept about this. Please suggest me a video or a blog post where I learn this.




I am install sabai directory in wordpress website Something is wrong with the plugin. When I click on a doctor it lists gibbersh below

Something is wrong with the plugin. When I click on a doctor it lists gibbersh below




I am devloping a discord bot that take query from discord, thn search that query on a site and perform some action

Basically I take input in form of

b!card(this is prefix for bot command)
b!card t6 light

thn I have to enter that data on a page enter image description here

t6 will be the tier select via dropdown and light will go in search after click on search, their are some related result will show. I have to click on first result and thn enter image description here this is card result page, i have to print the users data to discord in form of embeded.Like whick user has this issue enter image description here like above.

So I wrote a code in python using selenium and beautifulSoup, but i get a very much time delay. Thn I ask to someone who work on same bot, they said don't use any module, they just use simple js. I don't get that I want to know how to do this in js and make it very optimize.




Django | The id of the records of more than 1000 have a period

when I use the id of an object that is greater than 1000 on my django template I get a period.

For example: should be 1200 but the ouput is 1.200 How can I solve this?




How can I host SVG images on my website using firebase?

I have deployed a site to Firebase hosting and everything works great, expect that the images are not loading.

I'm linking to them in the public folder that I deploy to the host.

Do I need to add them to something like FireStore and link to that URL?

<img class="img-fluid img" src="/Users/myprofile/desktop/folder/public/name.svg" alt="">

(I have removed the original path)

The alt is empty.

Thank you




Button text color is not changing to white in SCSS code

I was practicing my CSS(SCSS) at codepen link: https://codepen.io/zubaer41/pen/XWKzomo?editors=1100 but there is a problem I faced and couldn't fix it. There are two buttons that should appear and the text in them should be white. I can change the background color of the buttons but I can't make the button text color white even though I couldn't find any reason why it's happening. HELP PLEASE !!
//==== HTML & CSS(SCSS) CODE ====


    <nav >
      <ul class="navigation">
        <li><a href="#">About us</a></li>
        <li><a href="#">Pricing</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
      <div class="button">
        <a class="btn-main" href="#">Sign up</a>
        <a class="btn-hot" href="#">Get a quote</a>
      </div>
    </nav>```
      
    
    =========================================================
    =================== CSS (SCSS) CODE =====================
    =========================================================
    
    ```* {
      margin: 0;
      padding: 0;
    }
    
    $color-primary: #f9ed69; //yellow color
    $color-secondary: #f08a5d; //orange color
    $color-tertiary: #b83b5e; //pink color
    $color-text-dark: #333;
    $color-text-light: #eee;
    
    $width-button: 150px;
    
    @mixin clearfix {
         &::after {
        content: "";
        clear: both;
        display: table;
      }
    }
    
    @mixin style-link-text($color) {
      text-decoration: none;
      text-transform: uppercase;
      color: $color;
    }
    
    @function divide($a, $b) {
      @return $a / $b;
    }
    
    nav {
      margin: divide(60, 2) * 1px;
      background-color: $color-primary;
      
      @include clearfix;
    }
    
    .navigation {
      list-style: none;
      float: left;
      
      li {
        display: inline-block;
        margin-left: 30px;
        margin-top: 10px;
        
        &:first-child {
        margin: 10px;
        }
        
        a {
          @include style-link-text($color-text-dark);
        }
      }
    }
    
    .button {
      float: right;
    }
    
    %btn-placeholder {
      padding: 10px;
      display: inline-block;
      text-align: center;
      border-radius: 100px;
      width: $width-button;
      @include style-link-text($color-text-light);
    }
    
    .btn-main {
      &:link {
        @extend %btn-placeholder;
        background-color: $color-secondary;
      }
      
      &:hover {
        background-color: darken($color-secondary, 10%);
      }
    }
    
    .btn-hot {
      &:link {
        @extend %btn-placeholder;
        background-color: $color-tertiary;
      }
      
      &:hover {
        background-color: lighten($color-tertiary, 10%);
      }
    }```




How am I supposed to use an API that requires OAuth for an app that shouldn't let the user log in?

Rough plan: I want to make an app that displays a virtual pc keyboard. When you click on a specific key, you can search for a term. This search goes out to an API call. I then want to receive the result and do stuff with it. If it helps: Its meant for planning keybinds for world of warcraft.

The battle.net API requires OAuth so I get an access token and use it for the API calls I mentioned.

But I don't want users to log in to my app with their battle.net account. So I have to generate that access token somewhere else. I thought of a small nodejs service that authenticates with my clientID and clientsecret ... but I'm not sure how to get the access key then. OAuth does always mean I have to grant my nodejs service access manually, right?

How am I supposed to set up such a project?




tpyo/amazon-s3-php-class Install region eu-west-1 default

How to set the correct region in S3.php? I need eu-west-1, when installing the composer, us-east-1 is installed.




bootstrap Table after page refresh sorted columns filter are not stored in cookies

I have tried below method for to save bootstrap cookies table date after page refresh(https://live.bootstrap-table.com/example/extensions/cookie.html)

but I could not able to store the sorted data after page refresh. setTimeout(function() { getSubrackOpticalChassis(document.getElementById("subrack").value); }, 60000);




Ordering Software needed for an Marketing Agency Team - integrating with Zapier, Mondays.com [closed]

For a marketing agency I need to identify the best way to take customer orders through a website, or over the phone.

The team uses Monday.com which is a project management tool which allow the agency team members to provide status updates regarding various projects. I wish to use Zapier to integrate an ordering software which allows an agent to put in an order and then it is captured in Monday.com.

The order service will need to provide an order with a price and then at the end of the transaction, provide an invoice to the customer. All this needs to be communicated to the team through Monday.com.

My problem is I do not know what ordering program would be best for this service? I don't think Quickbooks is appropriate. Any suggestions? Is Zapier the best service for this?




To add information from a different website or URL to my website

I have a basic static website in which I want to add announcements/events in the future. I have to submit the files to my college. Can someone suggest a way to add some small announcements after a few days?

Is it possible to just pull some data from a temp website or some database or something and display that in my website.




what is the reason behind using these lines in CSS

why people use this in their CSS code what is the reason behind it? what is the advantage of this?

display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;



How to make a support or messaging system on a website?

So, I want to make a messaging feature on my website for support. People give their name, email and the message itself. I’m currently using HTML for my website, can someone explain how do I do that type of messaging feature on my website?




mardi 27 octobre 2020

nginx redirect on proxy connection instead of proxy_pass

Got 3 servers

"server3" which runs nginx and two backend servers (server1,server2).

Got the following configuration on server3 :

server {
    listen       80;

    location     @onerror {
        return 302  http://server2.com$request_uri;
    }

    location / {
        proxy_connect_timeout   1s;
        proxy_pass http://server1.com/;
        error_page 400 401 402 403 404 405 500 501 502 503 504  @onerror
    }
}

My goal is , request reaches server3 and it tries server1 , if it can not connect or got other error it redirects to server2.

This works just fine but not fully "optimized" since if server1 works all the traffics goes trough server3, which is not really needed since 302 redirect would do the job and client would be redirected to server1.

Load balancing is not an option if server1 is up and running all clients needs to use it , only if it is down client needs to use server2.

Now for my question,

Any way i can config nginx to "try" to connect to server1 , if it works don't use proxy_pass but use 302 redirect instead ?

Thanks in advance.




PHP have same rand() value saved in SESSION variable across page refresh

I am attempting to create a per-request CSRF token (basically, I create a value on every page load, set the SESSION value to equal it, and then it gets sent in an HTTP request upon which I verify if it matches the SESSION value). For now, I crudely use the rand() function like this:

$c_token = rand();
$_SESSION['token'] = $c_token;

however, on page refresh, SESSION does not preserve the chosen value of $c_token, instead calling the rand function again and getting a new value. How can I ensure the SESSION preserves the same value as $c_token on a page reload (i.e., how do I prevent the SESSION value from re-calling the rand() function and getting assigned a different value?).

I have looked at a similar problem - EDIT: one answer suggests using a function to return the rand() value. However, given each form is created via for loop, I get a cannot redeclare function error so this way would not work it seems.




How to play live HLS file on a react web app

I have a url http://xxxxxx:25461/category/xxxxx/folder/file.m3u8 that if i put on a vlc player it reproduces the content perfectly.

I would like to play that on a web app created with ReactJS. I was trying to use the 'react-hls-player' library but when i start playing, it just plays the sound but no pictures.

The url contains a live HLS. A streaming that i want to play in a web app.

Any of you know about a player that i can use?




Outlook Calendar link to create a new event URL is no longer working?

In our web application we providing the below link to create a calendar event when I click on the button it will open the outlook mail portal and add an event link

https://outlook.live.com/owa/?path=/calendar/view/month&rru=addevent

&startdt=20200419T133000Z

&enddt=20200419T134000Z

&subject=Dear Andy, Calender description here&location=Mumbai

But unfortunately, the above link is no longer working, could anybody help us to fix the issue and tell what is the exact link format that will create a calendar event.




React JS - Bagaimana cara mengatur agar kedua komponen yang terpisah dapat menerima state yang sama?

I am a beginner in using the React JS framework. Based on the official React JS documentation, an example is given for changing the state of a component that has a connected hierarchy. But in my case this time I split the components for Header and Main separately.

index.js

ReactDOM.render(
  <React.StrictMode>
    <Header />
    <Main />
  </React.StrictMode>,
  document.getElementById('root')
);

In the Header component I also have another sub component that functions to activate / deactivate the sidebar which is also a sub menu for the Main component.

Header.js

import { BtnSidebarOnClick } from './Sidebar';

const Header = () => {
  return (
    <header className="header">
      <div className="header__logo">
        <BtnSidebarOnClick />
        <div className="header__logo_img">
          <a className="link"
            href="/">
            <img src=""
              alt="Schedule App" />
          </a>
        </div>
      </div>
      <nav className="header__nav">
        ...
      </nav>
    </header>
  );
}

export default Header;

Main.js

import { Sidebar } from './Sidebar';

const Main = () => {
  return (
    <main className="main">
      <Sidebar />
      <div className="main__content">
        ...
      </div>
    </main>
  );
}

export default Main;

Notice that the BtnSidebarOnClick and Sidebar components are not connected. In my case, this time I want to make the Sidebar component accept state to detect whether the button contained in the BtnSidebarOnClick component is clicked / not.

Sidebar.js

class BtnSidebarOnClick extends React.Component {
  constructor(props) {
    super(props);
    this.state = { onClick: false };
  }

  handleClick() {
    this.setState(state => ({ onClick: !state.onClick }));
  }

  render() {
    return (
      <div className="header__logo_btn">
        <div className="button button--hover button--focus" 
          role="button"
          tabIndex="0"
          onClick={this.handleClick.bind(this)}>
          <i className="material-icons">menu</i>
        </div>
      </div>
    );
  }
}

const Sidebar = () => {
  return (
    <div className="main__sidebar"> {/* set style if BtnSidebarOnClick clicked */}
      <div className="main__sidebar_menu">
        
        <div className="tag-link">
          <a className="link link--hover link--focus link--active"
            href="/">
              <i className="material-icons">insert_drive_file</i>
              <span className="link-title">Files</span>
          </a>
        </div>
      
      </div>
    </div>
  );
}

export { Sidebar, BtnSidebarOnClick };

So how do you set these two components to receive the same state?




You think it is difficult to work with designers and if so, would you give me an example [closed]

I have only worked for a while as Front-end and Back-end, so I would like to know what it is like to work with designers and others ...

Thank you




The sequence of Robot TXT

Does ROBOT.TXT work with sequentially? For example,

User-agent: * Disallow: /en/sales/ Allow: /en/sales/product.php Allow: /en/sales/shoplocation.html

I would like to block all files under /en/sales , but only allow product and shop location. Are product.php and shoplocation.html able to be searched by google ?

Thank you for your help.




Problem with react version in proyect and dependency

I am having trouble with a React dependency that I installed in a project. It throws me an error when compiling and from what I was investigating it is a conflict of the react version of the project and that of the dependency. In the photo bellow you can see a screenshot of the console. I've been seeing some of the npm link command but I can't get the versions to match.

enter image description here




Page Transition between pages

I have a question i have been searching for how do these websites do page transition like when i click on a button or on a link it move to the next page with no time or with animations like these websites :

First site

Second site




How to refresh page After Focus in ecosia?

Is there a way to refresh the page after focus in ecosia?

This code works fine on chrome and webkit:

var blurred = false;
window.onblur = function() { blurred = true; };
window.onfocus = function() { blurred && (location.reload()); };

But does not trigger refresh in ecosia. Do you have any ideas to achieve the same result in ecosia browser?




What are the key points to remember while developing web Widget with HTML, CSS, JS (and PHP and MYSQL on BE)

What are the key points to remember while developing web Widget with HTML, CSS, JS (and PHP and MYSQL on BE)? For example: calling the script within anonymous function, because we don't want to update anything on the client side. What else? I mean also in terms of secure.

Br




WEB DEV - HOW TO CHANGE PATH HTML

I have a simple question about a website I am currently working on.

How to transform a simple URL like www.example.com/pages/welcome.html into www.example.com/welcome ?

I know it exists, I saw a tuto a long time ago about it but don't remember where and I really don't find anything on google.

Thank You in advance ;) Thomas




how to replace all - with blank space in variable. '.$griditem['title'].' [closed]

original line

<a href="article.php?title='.$griditem['title'].'">**'.$griditem['title'].'**</a>

want to replace every ('-') with (' ') space

tried a lot with

str_replace("-"," "$griditem['title']) 

but not working



Building a secure web server to test dynamic .txt file for blocked ip's

I am attempting to test out an at home build for hosting an internal web server that will get a dynamic txt file uploaded to then be pulled down to my firewall for blocklists. I know this can be done with various alternatives already built but, i want to learn this on my own.

Concept: Build simple webserver with secure access via python using ssl. Send file from local linux box to web server daily have firewall pointed at my server web link to pull list daily

Any help is appreciated.

Current pieces of code:

from flask import Flask
app = Flask(__name__)

@app.route("/var/tmp/somefile.txt")
def test():
    return "/var/tmp/somefile.txt"

if __name__ == "__main__":
    app.run(ssl_context=('cert.pem', 'key.pem'))


'#SFTP to web server from linux box
import pysftp

with pysftp.Connection('host', username='test', password='password') as sftp:

    with pysftp.cd('/var/tmp'):
        'sftp.put('/test.txt')
print 'sftp.put' , "was uploaded"



Attribute Error with web scraping using BeautifulSoup

I am trying to crawl data from 'etherscan.io' using BeautifulSoup and Python. Here is the website: https://etherscan.io/txs

page_soups = []
for page in range(1, 51):
  url = 'https://etherscan.io/txs?p=' + str(page)
  print(url)
  req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
  webpage = urlopen(req).read()
  page_soup = soup(webpage, "html.parser").find('tbody').find_all('a')
  page_soups += page_soup

I use a loop to scrape multiple webpages but I can just get data 30 first pages. The 31th one has error as follow

Error

I check that webpage and see that it still has same tag and elements as others. Please help me.




Reactjs: make a function to promise with axios in it

so I have this function in my context provider i want it to return a promise so that i can access to returned data from axios

    const sendRquest =(service,data,method,url)=>{
        let base = api.find(item => item.name ===service )
        let config = {
            method: method,
            url: `${base.url}/${url}`,
            headers: {
              'x-clientId': clientId,
              'Content-Type': 'application/json',
            },
            data: data
          };
          axios(config)
          .then(function (res) {
            return res
          })
          .catch(function (error) {
            return error
          });
    }

and the result I'm looking for is to write such code in every other component whenever I needed

sendRquest('usermanagement',data,'post','foo/bar').then(res=>console.log(res.data)).catch(err=>console.log(err))



jQuery - Hiding One Div & Showing Multiple Other Divs

http://jsfiddle.net/cEJtA/


$(function () {

    $(".div1, .div2").hide();
    
    $(".link1, .link2").bind("click", function () {

      $(".div1, .div2").hide();        
        
      if ($(this).attr("class") == "link1")
      {
        $(".div1").show();
      }
      else 
      { 
        $(".div2").show();
      }
    });

});

Can anyone please help with this code.

I want 5 divs that work based on the link that's clicked, so there are 5 divs either shown/hidden.

I can do everything except the if/else statement for more divs - any help please?




Django/Heroku AJAX Request Doesn't Seem To Execute

I am needing to save the contents of a javascript variable in the main page of my site (index.html), to the database that my heroku/django app is connected to. I found a related post here but my AJAX request to send a variable from JavaScript to then access in python is not running.

Javascript/HTML and AJAX in index.html:


    <button type="button" id="send-my-url-to-django-button">Send URL to Django View</button>
    
    <script type="text/javascript">
        $(document).ready(function() {
            var url = data.result.docs[i].source.enriched.url.url;
            alert("ok");
            $("#send-my-url-to-django-button").click(function() {
                $.ajax({
                    url: "/process_url_from_client",
                    type: "POST",
                    dataType: "json",
                    data: {
                        url: url,
                        csrfmiddlewaretoken: ''
                        },
                    success : function(json) {
                        alert("Successfully sent the URL to Django");
                    },
                    error : function(xhr,errmsg,err) {
                        alert("Could not send URL to Django. Error: " + xhr.status + ": " + xhr.responseText);
                    }
                  return false;
                });
            });
        });
    </script>

relevant lines from urls.py

url(r'^process_url_from_client/$', hello.views.process_url_from_client, name='process_url_from_client'),

relevant lines from views.py


    def process_url_from_client(request):
        url = request.POST.get('url')
        save = SaveFile(data=str(url));
        save.save();

This is supposed to send the URL from index.html to then be accessed in views.py and saved to the database. However clicking the button does not seem to execute the AJAX script at all. I don't get a success or error message.

Any ideas why this isn't working? Any help would be appreciated.

NOTE: There is no issue saving to the database, the issue is posting the data to then be accessed in views.py.




How to disable pdf download in react native webview?

I use webview and that shows a preview from pdf file,but its also getting downloaded into users mobile.

I removed file read and write permission... its not downloaded...but showing a toater telling no access to file.Permission denied.

I also tried allowFileAccess={false} onShouldStartLoadWithRequest={false} But that did not work.




How to get images to show on Website, using Plesk, Godaddy

Ive uploaded my website files to Godaddy using Plesk. When I open the webpage the HTML and CSS are exact, except for no images are showing.

Im hoping its just something to do with file location on plesk but Im new to it and cant figure it out. Any suggestions?

Many thanks




sqlmap extracted data to python list to display in website

Introduction I'm a creating a web application for testing sql injection vulnerabilities, User can submit the url and tests are performed on website and result is displayed. Problem What I'm trying to do is to use sqlmap in python not in shell. I want to save the results in lists in python and display it user. I can use " subprocess.call('sqlmap -u https://ift.tt/3jBPaNs) but that command shows the data in command and I want to have this data in python lists. I've find the sqlmap library but documentation is not very useful. There's another option that I can craft the sqlmap and use it as I like but that is very time consuming process or I can write my own sql injection. If anybody have any suggestions, lemme know. Thanks!




Python Scrapy text() function unable to get empty td element

I'm very, VERY new to web scraping and I'm still learning as I go. Currently, I'm using Python and Scrapy to build my own web scraper but I encountered something really odd.

I tried to go to scrape this webpage right here just as an exercise: https://worldpopulationreview.com/countries/countries-by-national-debt

That's basically a webpage which lists the Debt to GDP ratio for various countries in the world. Now, if you noticed, Sudan does not have any Population number recorded in the table on that web page.

Empty Population for Sudan

I tried to scrape the population for each country from that web page using this xpath expression:

import scrapy
import pandas as pd


class GdpDebtSpider(scrapy.Spider):
    name = 'gdp_debt'
    allowed_domains = ['worldpopulationreview.com']
    start_urls = ['https://worldpopulationreview.com/countries/countries-by-national-debt/']

    def parse(self, response):

        populations = response.xpath("//tbody/tr/td[3]/text()").getall()

The problem here is that it seems like with the xpath expression above which is

"//tbody/tr/td[3]/text()"

it's unable to capture the empty population table cell in Sudan, it basically skips the population of Sudan entirely because I believe the td element does not contain any text node.

Is there any solution to this where we can extract elements without any text node as an empty string like this: '' instead of skipping it entirely?

Thanks so much everyone!




Support didChangeAppLifecycleState for flutter web?

I want to refresh the whole website if the app has been paused. DidChangeAppLifecycleState works smoothly on ios and android but does not support flutter web. Is there an alternative?




How to detect if flutter website is running in the background of browser?

WidgetsBindingObserver is not working on my flutter web project. Is there something similar to detect when the user closes the browser like closing on the native device app with widgetbinding?

I want to rebuild the whole website after every time the browser was rebuilt regardless if the website was left open before.




How can i manage the contents of my website

I am making a website using python. Can you recommend a good way of managing things like navigation lists items and things. Like will it be beneficial to create a code database table of navigation lists with each list item (like 'home', 'about', etc.) and make another column like destination and define the destination page source in it? If not, then recommend a good way of managing web page content.




lundi 26 octobre 2020

Notice: Array to string conversion in C:\xampp\htdocs\PROJEKTBS\cart.php on line 62 [duplicate]

I got notice that says

Notice: Array to string conversion in C:\xampp\htdocs\PROJEKTBS\cart.php on line 62

Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in C:\xampp\htdocs\PROJEKTBS\cart.php:64 Stack trace: #0 {main} thrown in C:\xampp\htdocs\PROJEKTBS\cart.php on line 64

and my sources are

<?php
            $total = 0;
            if(!empty($_SESSION['cart'])){
            $conn = new mysqli('localhost', 'root', '', 'tbodyshop');
            $index = 0;
            if(!isset($_SESSION['qty_array'])){
              $_SESSION['qty_array'] = array_fill(0, count($_SESSION['cart']), 1);
            }
            $sql = "SELECT * FROM produk WHERE id_produk IN (".implode(',',$_SESSION['cart']).")";
            $query = $conn->query($sql);
              while($row = $query->fetch_assoc()){
                ?>

line 62 is $sql




Focus auto jump between several

I have a web with several <p:inputNumber> (Primefaces) form with several <p:inputNumber> (Primefaces)

Example of <p:inputNumber>

<p:inputNumber id="sbAddXm" value="#{point.xm}"
           styleClass="coordinate-field"
           maxlength="2"
           inputStyle="margin: 0 0 7px 0; font-size: 16px;"
           autocomplete="off"
           onkeyup="clearError(this)"
           decimalPlaces="0" thousandSeparator=""
           validator="fractionNumberValidator">
<p:keyFilter mask="pint" preventPaste="false" />
<f:attribute name="minimum" value="0"/>
<f:attribute name="maximum" value="59"/>
<f:attribute name="summary" value="Ошибка: "/>
<f:attribute name="detail" value="«Долгота - минуты» должно быть число от 0 до 59"/>
<p:ajax event="focus" oncomplete="select(this)"/>
<p:ajax event="change" listener="#{editEntityView.doReRender}"/>
<f:ajax event="keyup" render="addOrEditSubsoilBorderModal:SBmessage
                                addOrEditSubsoilBorderModal:addSubsoilBorderSaveBtn
                                addOrEditSubsoilBorderModal:editSubsoilBorderSaveBtn"/>

</p:inputNumber>

The problem appear when I try to fill several inputs (switch between inputs by press tab or by mouse click on field).

Problem is: focus begin to jump between input fields automatically in cycle. If I pause script in Chrome debuger by F8, I see that looping somewhere in jQuery, but I didn't use jQuery in this form.




R: readLines on a URL leads to missing lines

When I readLines() on an URL, I get missing lines or values. This might be due to spacing that the computer can't read.

When you use the URL above, CTR + F finds 38 instances of text that matches "TV-". On the other hand, when I run readLines() and grep("TV-", HTML) I only find 12.

So, how can I avoid encoding/ spacing errors so that I can get complete lines of the HTML?




Web Dev - How to shorten URL?

I have a simple question about a website I am currently working on.

How to transform a simple URL like www.example.com/pages/welcome.html into www.example.com/welcome ?

Thank You in advance ;) Thomas




Node-sass compile scss into css

this is probably some easier problem to solve it but I've just started using node-sass nmp etc. When I save something in main.scss I get this message in terminal:

=> changed: C:\Users\Administrator\Desktop\modern_portfolio\scss\main.scss
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! modern_portfolio@1.0.0 sass: `node-sass --w scss/ -o dist/css/ --recursive`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the modern_portfolio@1.0.0 sass script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-10-27T00_35_14_521Z-debug.log
/c/Program Files/nodejs/npm: line 37:  2008 Segmentation fault      "$NODE_EXE" "$NPM_CLI_JS" "$@"

How can I solve this? Thanks in advance.




How does a website knows I am conected from an rdp

Hello I am using an rdp (aws ec2) to connect to this website https://whatleaks.com/ and I want to know how does this website know that Iam using an rdp and is there any way I can stop that? Thanks




India's best domain registrar list

india's best domain registrar list




ADVICE ON MULTI VENDOR WEBSITE LIKE AMAZON OR ALIBABA ON A WAY SMALLER SCALE? How to Start [closed]

I’m looking to create a multi vendor website for the country I live in , because at this moment it doesn’t have one , I have coded websites with HTML, CSS and JavaScript and also build websites with Wordpress but with this particular project I just can’t see where to start or find any advice on how to do it , I’m not asking for a handout on how to do it exactly but advice. Do I host the page on Sites like Blue host with woocommerce and use template for wordpress or do I code and hire full stack developers to help me a build a website? Where one is way cheaper than other , I just don’t know where to start because Im scared I invest a lot of money and time and it doesn’t work, I want the website to have features like amazon like product tracking , log in and features for vendors so they can log in and add products. I just really don’t know what to do so here I am asking for guidance, should I go to Wordpress first and then eventually code up a proper webpage after income as a cheaper option Or code a proper webpage with developers but which way more expensive. Or even find a service to help me developer a proper Wordpress site and advice on the matter




How can making watermark, math equation?

<label for="name">Please write your real estate's sqm size</label>
<input type="text" id="sqm" name="sqm" required
       minlength="4" maxlength="8" size="10" > 
<label for="name">Please price of real estate</label>
<input type="text" id="price" name="price" required
       minlength="4" maxlength="8" size="10" >

Basically what I want to achieve is to take the input from the SQM size from the first input and take the price of the real estate values. After taking both values dividing them in this order Price/SQM, I want to get the price per sqm of the real estate automatically, so I can connect it to my backend.