mardi 31 juillet 2018

how to access create js using javascript and make interactive

this.ans2_txt = new cjs.Text("", "bold 35px TektonPro-Bold", "#FFFFFF");

this.ans2_txt.textAlign = "center";

this.ans2_txt.lineHeight = 37;

this.ans2_txt.lineWidth = 39;

this.ans2_txt.setTransform(411.1,357.9);




How to create a singular cookie (HELP!)

So I recently started to work with web. I need your help. I need to create a cookie who can remmember what a visitor chose in accessibility tab. I was reading a lot about them and still I'm not so good programmer I guess :D I started like this:

<?php
add_action( 'init', 'accessibility' );
function accessibility() {
setcookie($visitor_ip, $ip_value,7 * DAYS_IN_SECONDS);
}
?>`

but idk if it is right. After that idk how to call him that he will remmember this..:

<?php
if(!isset($_COOKIE[$visitor_ip])) {} 
else {}
?>`

If you can help me, would be wonderful. Website: web.kga.lt




union of two query return null when one of query result is empty. how to handle it?

i have a query where i wrap two query by union in another select query for example:

select A,B from (select x,y from firsttable where bla bla bla 
union
select C,D from secondtable where bla bla bla) group by Z;

Now when firstTable or secondtable have empty result because of where condition then it return result as

1st row> NULL | NULL | NULL

2nd row> 1 | 2 | 3 <- this is result of second or first (but one table) when one table where clause have something to return.

note: when both where condition have values to return then no such problem. the problem occre only when one of wrapped query return empty set. when both where query have values then it give desirable result which is only one row because it is grouped




Force use of browser's right click menu instead on CKEditor's ContextMenu?

I need to add contextmenu due to various table plugins (i need contextmenu), but I want to use the default browser right click due to spell checking / suggestions.

I am playing with the "onShow" of contextMenu but I dont know how to call the default browser right click menu.

Is this even possible?




Integrating REST APIs within an Angular 6 Application

I am working creating a new Angular 6 application. The back-end for the application is Spring. I am expected to consume the backend REST APIs at the frontend. Please advice on the configuration required to achieve the same with in the Angular Application. Below are few changes that I can think of to be made at the frontend:

  • Importing the HttpClientModule with in the app.module.ts

  • Configure the environment.ts & environment.prod.ts files with the apiurl information

  • Create a rest api service to call various end point

Can anyone suggest on the right steps for the REST API consumption starting from scratch. Are there any configurations required in package.json or any other files ?

Please advice !




How to manage resource of web application without JSP and only html

I want to make up web application without JSP only use html and html templates.

main page has only one tag to wrap whole html.

main.jsp

<html>
    <head>
        <!-- css -->
    </head>
    <body>
        <div id="wrap">
            <!-- insert html code on here -->
        </div>
        <!-- js library -->
    </body>
</html>

page operation sequence is like below.

1.load main.jsp

2.load html and javascript dynamically

And I want to recycle html and templates.

What is the good method to manage html on this configuration?? just separate with folders?? or other method?? Did you know about some web pages that solve this problems??

please help.




Is web browser JavaScript runtime?

In Node.js website, they say Node.js is a JavaScript runtime.

Are web browsers like Chrome, Firefox, Edge, ... JavaScript runtimes?

I thought of course, web browser is JS runtime. But I'm confused, In this video 12:10~ He says Web browser is not just JavaScript runtime because it can do more things at one time, it can give us other things.

But I think V8 engine only can do one thing at one time, while JS runtime can do more things than one at one time.

Am I wrong?




Python 3 md5 hashes in webpage

I'm building this md5 password crack to find hashes hidden in a webpage. My url page is in a separate file while im using the function (html) to call the website in order to find and crack the hashes. I'm kind of stuck on how to finish off the code, at least to find the hashed without cracking them at this point. This is my code to find the hidden hashes. Thanks

def dictionary_attack(html):
dictionary = ['qwerty','qwerty1','password','password1','default','default','123','12345','123456']
password_found = False

for dictionary_value in dictionary:
    hashed_value = (hashlib.md5(dictionary_value)).hexdigest()
    if hashed_value == password_hash:
        password_found = True
        recovered_password = dictionary_value

if password_found -- True:
    print ('Found \n',password_hash)
    print ('password rec' , recovered_password)

else:
    print ('pass not found')
if __name__ == '__main__':
    main(html)




How can be specified to Google Analytics not to proceed a page visit after using particular element of web app?

*

How can be specified to Google Analytics not to proceed a page visit after using particular element of webpage?

* After clicking on some element of web app I need to not to proceed to visit of the webpage/app. In this order I would need any other advices/informations of this kind, well particular or special settings of GA in case of web app.




how to make a line as a pseudo element?

So, I have stuck on this one. At the picture below you can see what should I do. However, I don't really understend how to make those crossed lines between the divs.

picture

Here is the code I have done so far: https://codepen.io/kaeses_developer/pen/wxyYdb

As I think, I have to create :before and :after pseudo element for .menu-item--large.

.menu-item--large {
flex-basis: 100%;
font-size: 36px;
background: none;
margin: 0 50%;
}

But how do I do it right? Or are there any different ways to make it?




Webpage styling disappears when using it in JSP

I have an issue displaying a dashboard developed using few javascript libraries and CSS files. Whenever I check the html file it looks amazing with the styling and colors. The problem is when i use the same HTML code as part of my JSP page all the styling just goes away.

HTML code:

        <!DOCTYPE html>
    <html lang="en">

    <head>
      <meta charset="utf-8" />
      <link rel="apple-touch-icon" sizes="76x76" href="../assets/img/apple-icon.png">
      <link rel="icon" type="image/png" href="../assets/img/favicon.png">
      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
      <title>
        Material Dashboard by Creative Tim
      </title>
      <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
      <!--     Fonts and icons     -->
      <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:400,700|Material+Icons" />
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
      <!-- CSS Files -->
      <link href="../assets/css/material-dashboard.css?v=2.1.0" rel="stylesheet" />
    </head>

    <body class="">
      <div class="wrapper ">
        <div class="sidebar" data-color="purple" data-background-color="white" data-image="../assets/img/sidebar-1.jpg">
          <div class="logo">
            <a href="http://www.creative-tim.com" class="simple-text logo-normal">
              Creative Tim
            </a>
          </div>
          <div class="sidebar-wrapper">
            <ul class="nav">
              <li class="nav-item active  ">
                <a class="nav-link" href="./dashboard.html">
                  <i class="material-icons">dashboard</i>
                  <p>Dashboard</p>
                </a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="./user.html">
                  <i class="material-icons">person</i>
                  <p>User Profile</p>
                </a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="./tables.html">
                  <i class="material-icons">content_paste</i>
                  <p>Table List</p>
                </a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="./typography.html">
                  <i class="material-icons">library_books</i>
                  <p>Typography</p>
                </a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="./icons.html">
                  <i class="material-icons">bubble_chart</i>
                  <p>Icons</p>
                </a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="./map.html">
                  <i class="material-icons">location_ons</i>
                  <p>Maps</p>
                </a>
              </li>
              <li class="nav-item ">
                <a class="nav-link" href="./notifications.html">
                  <i class="material-icons">notifications</i>
                  <p>Notifications</p>
                </a>
              </li>
              <!-- <li class="nav-item active-pro ">
                    <a class="nav-link" href="./upgrade.html">
                        <i class="material-icons">unarchive</i>
                        <p>Upgrade to PRO</p>
                    </a>
                </li> -->
            </ul>
          </div>
        </div>
        <div class="main-panel">
          <!-- Navbar -->
          <nav class="navbar navbar-expand-lg navbar-transparent navbar-absolute fixed-top ">
            <div class="container-fluid">
              <button class="navbar-toggler" type="button" data-toggle="collapse" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
                <span class="sr-only">Toggle navigation</span>
                <span class="navbar-toggler-icon icon-bar"></span>
                <span class="navbar-toggler-icon icon-bar"></span>
                <span class="navbar-toggler-icon icon-bar"></span>
              </button>
            </div>
          </nav>
          <!-- End Navbar -->
          <div class="content">
            <div class="container-fluid">
              <div class="row">
                <div class="col-lg-6 col-md-12">
                  <div class="card">
                    <div class="card-header card-header-tabs card-header-primary">
                      <div class="nav-tabs-navigation">
                        <div class="nav-tabs-wrapper">
                          <span class="nav-tabs-title">Tasks:</span>
                          <ul class="nav nav-tabs" data-tabs="tabs">
                            <li class="nav-item">
                              <a class="nav-link active" href="#profile" data-toggle="tab">
                                <i class="material-icons">bug_report</i> Bugs
                                <div class="ripple-container"></div>
                              </a>
                            </li>
                            <li class="nav-item">
                              <a class="nav-link" href="#messages" data-toggle="tab">
                                <i class="material-icons">code</i> Website
                                <div class="ripple-container"></div>
                              </a>
                            </li>
                            <li class="nav-item">
                              <a class="nav-link" href="#settings" data-toggle="tab">
                                <i class="material-icons">cloud</i> Server
                                <div class="ripple-container"></div>
                              </a>
                            </li>
                          </ul>
                        </div>
                      </div>
                    </div>
                    <div class="card-body">
                      <div class="tab-content">
                        <div class="tab-pane active" id="profile">
                          <table class="table">
                            <tbody>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="" checked>
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Sign contract for "What are conference organizers afraid of?"</td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="">
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Lines From Great Russian Literature? Or E-mails From My Boss?</td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="">
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Flooded: One year later, assessing what was lost and what was found when a ravaging rain swept through metro Detroit
                                </td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="" checked>
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Create 4 Invisible User Experiences you Never Knew About</td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                            </tbody>
                          </table>
                        </div>
                        <div class="tab-pane" id="messages">
                          <table class="table">
                            <tbody>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="" checked>
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Flooded: One year later, assessing what was lost and what was found when a ravaging rain swept through metro Detroit
                                </td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="">
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Sign contract for "What are conference organizers afraid of?"</td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                            </tbody>
                          </table>
                        </div>
                        <div class="tab-pane" id="settings">
                          <table class="table">
                            <tbody>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="">
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Lines From Great Russian Literature? Or E-mails From My Boss?</td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="" checked>
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Flooded: One year later, assessing what was lost and what was found when a ravaging rain swept through metro Detroit
                                </td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                              <tr>
                                <td>
                                  <div class="form-check">
                                    <label class="form-check-label">
                                      <input class="form-check-input" type="checkbox" value="" checked>
                                      <span class="form-check-sign">
                                        <span class="check"></span>
                                      </span>
                                    </label>
                                  </div>
                                </td>
                                <td>Sign contract for "What are conference organizers afraid of?"</td>
                                <td class="td-actions text-right">
                                  <button type="button" rel="tooltip" title="Edit Task" class="btn btn-primary btn-link btn-sm">
                                    <i class="material-icons">edit</i>
                                  </button>
                                  <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-link btn-sm">
                                    <i class="material-icons">close</i>
                                  </button>
                                </td>
                              </tr>
                            </tbody>
                          </table>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <footer class="footer">
            <div class="container-fluid">
              <nav class="float-left">
                <ul>
                  <li>
                    <a href="https://www.creative-tim.com">
                      Creative Tim
                    </a>
                  </li>
                  <li>
                    <a href="https://creative-tim.com/presentation">
                      About Us
                    </a>
                  </li>
                  <li>
                    <a href="http://blog.creative-tim.com">
                      Blog
                    </a>
                  </li>
                  <li>
                    <a href="https://www.creative-tim.com/license">
                      Licenses
                    </a>
                  </li>
                </ul>
              </nav>
              <div class="copyright float-right">
                &copy;
                <script>
                  document.write(new Date().getFullYear())
                </script>, made with <i class="material-icons">favorite</i> by
                <a href="https://www.creative-tim.com" target="_blank">Creative Tim</a> for a better web.
              </div>
            </div>
          </footer>
        </div>
      </div>
      <!--   Core JS Files   -->
      <script src="../assets/js/core/jquery.min.js" type="text/javascript"></script>
      <script src="../assets/js/core/popper.min.js" type="text/javascript"></script>
      <script src="../assets/js/core/bootstrap-material-design.min.js" type="text/javascript"></script>
      <script src="../assets/js/plugins/perfect-scrollbar.jquery.min.js"></script>
      <!--  Google Maps Plugin    -->
      <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script>
      <!-- Chartist JS -->
      <script src="../assets/js/plugins/chartist.min.js"></script>
      <!--  Notifications Plugin    -->
      <script src="../assets/js/plugins/bootstrap-notify.js"></script>
      <!-- Control Center for Material Dashboard: parallax effects, scripts for the example pages etc -->
      <script src="../assets/js/material-dashboard.min.js?v=2.1.0" type="text/javascript"></script>
      <script>
        $(document).ready(function() {
          // Javascript method's body can be found in assets/js/demos.js
          md.initDashboardPageCharts();

        });
      </script>
    </body>

    </html>

This is needed for the webpage to send AJAX requests in order to update the items in the dashboard based on the data received back from the servlet class in the java project. For the AJAX request and response I already got that figured out I'm only suffering with the way the page appears in JSP.




Extract anchor links from a list of html links

I have a list of html page links. Each one leads to a page (different one accordingly). Whats common is that all pages contain a link leading to a google drive pdf direct download document. So I want to get these google drive links from every html link in the list in one go so that I can bulk download them.

My list looks like:

https://www.link....../....html
https://www.link....../....html
https://www.link....../....html
https://www.link....../....html
https://www.link....../....html

Can anyone show me a sufficient way? I'm still new to programming :)




How do I assign fetch data to $scope.variable

I am fairly new to both javascript and angular. My code retrieves data from an API and can print it to the console, but when I try to assign it to $scope.saveData, it only works inside the fetch. I've gotten as far as understanding that my problem has something to do with the code running asynchronously and the way promises work, but I can't seem to find any resources that work to solve my problem. Here is my code.

Angular

angular.module('myApp',[])
.controller('testCtrl',['$scope',  function($scope){

   const response = await fetch("http://localhost:3000/conferences").then(res=>{
      // $scope.saveData = null;
        if(res.url == "http://localhost:3000/outlook"){
            res.json().then(data=> {
                window.location.replace(data.url)
            })
       }else{
           res.json().then(data=> {
            $scope.saveData = data
            console.log($scope.saveData)
           });
       }
   });
   console.log($scope.saveData)
}]);

html

<!DOCTYPE html>
<html ng-app = 'myApp'>
    <head>
        <title>Scheduled Calls</title>
        <link rel="stylesheet/less" type = "text/css" href="./scheduledCalls.less" />
    </head>
    <body>
        <header style="text-align: center">
            <h1 class = "header" >Scheduled Calls</h1>
        </header>
        <div ng-controller="testCtrl" >
            <p></p>
        </div>
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
        <script src = "scheduledCalls.js"></script>
    </body>
</html>

the console.log under $scope.saveData = data works. It does not work for the console.log at the bottom of the js code.




I'm not getting the right random value. There are 6 values in my database. I give Limit 3. But the first 4 items shows randomized

I need 3 question from 6. but every time randomize show fast 4 question.

    /*for random question*/
public function qustionShow($question){

    $query = $this->conn->query("select * from question where cat_id='$question'");
    $c = mysqli_num_rows($query);
    $rand = rand(3, $c)-3;


    $show = $this->conn->query("select * from question where cat_id ='$question' and id >'$rand' LIMIT 4");
    while ($row=$show->fetch_array(MYSQLI_ASSOC)){
        $this->qus[]=$row;
    }
    return $this->qus;  
}




Should file scheme behave exactly the same as http?

What interests me is whether there is a documented set of differences that one should expect in a client browser when accessing some site using those two different schemes (http and file). I assume this site is available for both http and file.




Angular 5 - selected option not shown on top of dropdown list

I have 3 contacts which is displayed on dropdown list and an optional value "Please select contact person" as can be seen below.

enter image description here

However, when page loads it shows the last entry in the dropdown list. Optional value "Please select contact person" should rather be shown as default initial value when page initially loads.

Component template for the dropdown list is setup as follows:

<div class="col-lg-6" *ngIf="dealer.contacts && dealer.contacts.length" >
    <label>Contact person</label><br>
    <select class="form-control" [ngModel]="survey.answer.contact.email" (ngModelChange)="onContactChange($event)">
        <option selected [ngValue]="null">Please select contact person</option>
        <option *ngFor="let contact of dealer.contacts" [ngValue]="contact.email">   , </option>
    </select>
</div>

Component class method related to the ngModelChange is as shown below. Please note that $event value is email and when it is null, an empty object is sent back - please let me know if you have comments on this as well.

onContactChange(email: any){
    if (email) {
        var contact: any = this.survey.answer.contact;
        if (contact && contact.email == email) {
            return;
        }
        this.survey.answer.contact = this.dealer.contacts.find((contact: any)=>{
            return contact.email == email;
        });
        if(this.survey.answer.emailStatus != '') {
            this.survey.answer.emailStatus = '';
        }
        this.updateSurveyContact();
    } else {
        this.survey.answer.contact = {};
    }
}




Which data is collected by Google Analytics PageView?

I am reviewing the privacy of data collected by Google Analytics when collecting on the default PageView action. Here is the code snippet being used:

<script> 
                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

                })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

                ga('create', 'UA-1111111-11', 'auto'); 
                ga('send', 'pageview'); 
</script> 

I can't find any clear answer as to exactly which data is being collected. I want to make sure that no PII or PHI will be collected by accident if the page being tracked contains some, such as name, phone, medical info, etc.

Is there any clear guide that states which data is collected for PageView?




how to bypass form filling of asp form with direct http request

As i guess, filling an asp form will finally pack all data filled and make a post request to a certain url to update the data. How could i bypass the form filling efforts and pass the required values with other external methods, e.g via making http request. How could i investigate what have to pass and what the destination url of the form is.

I have tried to look into the html scripts but could only know the web will trigger a javascript when pressing the button. However, i have no clue on the next step.

Thanks!!




What is a good video platform that I can capture user data from?

I am looking at creating an online university that will offer on demand videos as an option for attendance. However, in order to ensure that the information was covered and the user actually watched the video we need to be able to capture playback data for the user. Essentially if a video is 10 minutes long we need to be able to capture data in order to determine that the user watched 90% of the video before considering the user to have attended the class.

So I'm currently in search of a either a video plugin or platform that can give us the data we need to complete this. I'm open to options here.




How to write your own search for your website from URL

I have seen that you type domain name to the url and put a space, then the website automatically waits for you to enter the string to be searched.

http://i.prntscr.com/g0-tLmvhTCCnBwyh7J0zKQ.png

For example: type youtube.com to the URL bar from your browser then put space character then type your search string.

How can I do that for my website?




Float left not working when used nth-child

HTML:

________________________________________

CSS:

enter image description here

Output in chrome:

enter image description here

The problem here is that the last div floats to left instead of floating to right I'm confused what's the reason for floating to left? background-color property works fine and gives the div red color but the float property is'nt working




Does an API for dictionary with transcription exist?

Now I am using abbyy linguo I am not sure I like it. Such scarce docs over there. https://developers.lingvolive.com/en-us/Help I can get a list of words from this endpoint https://api.lingvolive.com/Translation/WordListPart But I can't find in docs how to get more information about the word I need to translate. I need to get a transcription. And I also would like to get some examples of using this word.

Please, if you know an endpoint for getting an info with transcription from abbyy linguo or if you know another good API with transcriptions, suggest me it

Thanks in advance!




Configure Multiple projects for one web application

I created two different projects in firebase Project-A and Project-B. I am developing a web application using html, css and javascript and deployed(Hosted) to project-A. I want to get the data from Project-B into my web application. I have configured two projects in my web application like below

  var config = {
     apiKey: "<API_KEY>",
     authDomain: "<PROJECT_ID>.firebaseapp.com",
     databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
     storageBucket: "<BUCKET>.appspot.com",
  };

  var secondaryAppConfig = {
      apiKey: "<API_KEY>",
      authDomain: "<PROJECT_ID>.firebaseapp.com",
      databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
      storageBucket: "<BUCKET>.appspot.com",
    };

  var secondary = firebase.initializeApp(secondaryAppConfig, "secondary");

  var secondaryDatabase = secondary.database();

  (this declared in .js file and this file called in index.html)

Now i want to get data from firestore from secondaryAppConfig project.

Thanks in Advance.




Web: Redirecting to a webpage with data(not as URL or query params)

I have a webapp, say, example1.com and the user logged into it. I have the user data in my localStorage. After a particular event, say, button click, I want to redirect the user to example2.com with the user data from localStorage. But the user data shouldn't be sent as url or query params. It shouldn't be visible to the enduser at all.

What are the ways we can achieve this ?




Programming Languages for making wordpress-like(blog) website

I was assigned to make a website which is like a blog, so that future or past posts can be edited easily by people managing it in the future. So it will be something like wordpress, and needs to have an admin/dashboard page for setting up the website easily. Also I need enter image description here to implement something like this when editing the posts.

Note that I am required to make it from scratch. I have 2 language in my mind; python(django framework) and PHP. Is there any other I should consider?

What are the cons and pros of using this language for this website?

Thanks!




how to join two query result and grouped it by a column

i have query joined by union and it give me desirable result separatly in rows i want to join those two rows and add its values but i dont know how to do it

the query is

SELECT `b`.`main_code`,`b`.`account_title`,SUM(CASE WHEN `a`.`type`='CP' AND `a`.`interactive_person`='6' 
AND `a`.`date` BETWEEN '2018-02-12' AND '2018-07-31' THEN `a`.`balance` ELSE 0 END) AS `credit`, 
SUM(CASE WHEN `a`.`type`='CR' AND `a`.`interactive_person`='6' AND `a`.`date` BETWEEN '2018-02-12' 
AND '2018-07-31' THEN `a`.`balance` ELSE 0 END) AS `debit`, SUM(CASE WHEN `a`.`type`='CR' AND 
`a`.`interactive_person`='6' AND `a`.`date` BETWEEN '2018-02-12' AND '2018-07-31' 
THEN `a`.`balance` WHEN `a`.`type`='CP' THEN -1 * `a`.`balance` ELSE 0 END) AS `balance` 
FROM `vouchers` AS `a`,`data` AS `b` WHERE `a`.`interactive_person`='6' AND `a`.`post_status`='yes' 
AND `a`.`interactive_person`=`b`.`main_code` AND `a`.`date` BETWEEN '2018-02-12' AND '2018-07-31'
UNION 
SELECT `b`.`main_code`,`b`.`account_title`,IFNull(SUM(`a`.`debit`),0) AS `debit`, 
IFNull(SUM(`a`.`credit`),0) AS `credit`, (`debit` - `credit`) AS `balance` FROM `journal_vouchers` AS `a`,
`data` AS `b` WHERE `a`.`account_id`='44' AND `a`.`date` BETWEEN '2018-02-12' AND '2018-07-31'
AND `post_status`='yes' AND `cancel_status`='off' AND `a`.`account_id`=`b`.`account_code` 
GROUP BY `b`.`main_code`;

the query is a bit complex let me explain it little: this query takes the result from 3 tables but main thing is that before union its take result from two table and after union two tables in which one table data interact with both. in short the result i get is

main_code | account_title | credit | debit | balance

6 | cash account | 5200 | 520 | -4680

6 | cash account | 0 | 200 | -200

i want the full query grouped by maincode but i dont know how do it i want result to be

6 |cash account | 5200 | 320 | -4880




ASP.NET Web Application working perfectly on local machine but not on live server

ASP.NET Web Application working perfectly on local machine but not when I publish it on live server, Inspite when I Upload the full source code it works perfectly, No Errors are found just some dropdown lists are not working, values are not getting bind on grid. Few pages work properly and few don't work,




Programmatically (C#) - How to convert Image to an Excel [on hold]

This is the image, which I want to convert as excel.




How to determine the dates of execution of a cron until a certain date?

I want to determine the dates with the hours when Crons (of a Crontab) are going to run.

Is there a solution to recover all the dates of execution of a cron? For example, the variable crontab is "15 7 * * *" and the end date is "2018-08-05", i would like to find these dates :

  • 2018-08-01 07:15:00 UTC
  • 2018-08-02 07:15:00 UTC
  • 2018-08-03 07:15:00 UTC
  • 2018-08-04 07:15:00 UTC
  • 2018-08-05 07:15:00 UTC

All my scripts are in PHP. If there is a solution in php it would be better.. Or an API ? Thanks for purpose...




Align text with title tag (h2) in HTML [duplicate]

This question already has an answer here:

I have this code :

<div class="row margin-bt-5">
   <div class="col-xs-4 ft-bold">Name  &nbsp;:</div>
   <div class="col-xs-8">
      <h2>Content</h2>
   </div>
</div>

But because I have different font size, they are not aligned vertically. I get this :

enter image description here

How can I align the middle of "Name" with the middle of "Content" ? Thanks




lundi 30 juillet 2018

Deploy Rails 5 app

I developped an app with Rails 5. I have a HPE ProLiant ML350 Gen9 physical server on which I will install Ubuntu Server 16.04.4.

I also have a domain name bought on Gandi.

Could you please explain me the steps to do to have a working deployed Rails app ?

I seen a lot of tutorials, but I don't really understand what do I need. Do I need to do simple hosting ? or cloud hosting ? And what do I do with my physical server concretely ?

(Sorry, it's my first deployment ever)




dart: How to dynamically transfer data?

I want to make a modal window component. In order to be able to transfer it to the head, content, footer.

When you change the data, the changes do not occur in the template:

page.dart

ModalComponent MC = new ModalComponent()..init(mTitle:'TitleX');

modal.dart

class ModalComponent {
  String title = 'sss';
  Future init({String mTitle = 'title'}) async{
    this.title = mTitle;
    print(title);
  }
}

modal.html

...
<h4 class="modal-title"></h4>
...

In the template, I see "sss". In the console I see a print with "TitleX". Why is the data in the template not updated? In the template there is an inscription "sss".

How to correctly do what I want?




How to upload a webpage to a local network(connected using WiFi or ehernet cable) so that users connected to that network can access it?

I have created a login page(html form page) that asks for username and password and then sends it to ABC.php and if correct, it redirects them to another site.I have installed xampp server for it. But now I want that this feature should extend to my friends connected to my pc by some WiFi or Ethernet cable i.e. they should able to access login page...enter there creditials and access the other site..




How to modify the package name of the Spring MVC project?

As shown, I want to change 'web' to another name. What documents do I need to modify?

enter image description here




How to handle getting a blank page instead of the url specified in NightWatch?

I'm new in NightWatch, so I followed several Tutorials, I did everything they said, but now I am getting a blank page with the header "data;", instead of the page I wanna see wich is "https://www.ghandi.com.mx".

This is the json file. It seems like this problem is about the json configuration. Any help? Thanks so much!

  {
    "src_folders" : ["tests"],
    "output_folder" : "reports",

    "selenium": {
      "start_process": true,
      "start_session" :  true,
      "server_path": "C:\\Users\\Esau Alvarez\\Desktop\\selenium-server-standalone-3.13.0.jar",
      "port": 4444,
      "cli_args": {
        "webdriver.chrome.driver": "C:\\Users\\Esau Alvarez\\Desktop\\chromedriver.exe"
      }
    },

    "test_settings" : {
      "default": {
        "launch_url": "https://www.gandhi.com.mx/",
        "screenshots": {
          "enabled": false
        },
        "desiredCapabilities": {
          "browserName": "chrome",
          "marionette": true
        }
      },

      "chrome" : {
        "desiredCapabilities": {
          "browserName": "chrome",
          "webdriver": {
            "server_path": "C:\\Users\\Esau Alvarez\\Desktop\\NightWatch\\chromedriver.exe"
          }
        }
      }
    }
  }


This is my test file

            module.exports = {
                "Test": function (browser) {
                    browser
                        .windowMaximize()
                        .url("https://www.gandhi.com.mx/")
                        .waitForElementVisible('body', 1000)
                }
            }




why does HTTP impose universal interface to interact with resources? why not user defined methods?

what is the benefit of using GET, POST, PUT, DELETE, and other methods defined by HTTP and not defining custom methods to interact with resources?




how to write endpoint for web api

I have a project i need to write an endpoint for in asp.net web api. Here is my custom class. Im new to asp.net and i need help on this urgently. Thanks

  public class express
{

    public string firstname { get; set; }
    public string lastname { get; set; }
    public string middlename { get; set; }
    public string dateOfBirth { get; set; }
    public string identityType { get; set; }
    public string email { get; set; }
    public string mobileNo { get; set; }
    public string gender { get; set; }
    public string street { get; set; }
    public string city { get; set; }
    public string state { get; set; }
     }
    }




JavaFX: How to check if page available or not

In my project I use simple JavaFX browser, that works in background and do some stuff without displaying it.

More precisely it submitted some form to one online page.

So, I ran into a problem: when this page doesn't available, I can't figure it out from my Java code, it looks like form wasn't submitted and clicks on Submit button do nothing, but in Chrome for example I see that the page isn't available.

So, is there an option to check from Java code if page is available?

Thanks in advance and sorry for bad English.




My website was hacker copied + database run realtime

My website is being hacker copied code + database real time. When I change the html: website name, the other website also changes. They can customize javascript, css, edit html on copy version in another domain. I checked they do not use an iframe. They can use this domain to index the sitemap just like my website but for the purpose of tricking users into clicking on the download button in their domain. My server is secure, the website uses SSL. Does anyone know what kind of attack this is? How to overcome and prevent?




htaccess GET friendly url instead of?

I have a problem with, i need to do so instead of i have to write "shop.php?id=0" i can write "shop/something", it works well BUT if i for example write "support/", then i goes to the shop php file, how can i remove this so support also can do like "support/something" and the shop also can be "shop/something"

I can write "support", then it works fine but when i want to do "support/something" it mess up, its when i just add a "/"

How can i fix this issue? (Ive made comments with // in the code, its not in the actual code, ive removed them there)

RewriteEngine On
//Do so instead of i write shop.php?id=0 i can do /shop/something
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^.*\.php$ shop.php [NC,L]



//Remove the .php extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]



//404
ErrorDocument 404 /404.php




Cant lunch draw.io api

hi i have a probleme with the draw.io api when i try to incorporate him with a node server the api doesn't work he tell me check if Js is actived but he still active so offline or not he doesn't work. If some one know how resolve this problem or know some api like mxgraph with an interface for create diagrams and for import or export im enjoye to take it

best regards clemcy




SQLAlchemy Pandas Flask Slow

After doing some testing with Flask running a webpage, I've noticed that when I connect flask to a database using SQLAlchemy, it takes about 40s to load the page.

zengine = sqlalchemy.create_engine("oracle+cx_oracle://CONNECTION")
summary_sql = "select distinct hub, value, date_inserted from ZE_DATA.AESO_CSD_SUMMARY order by date_inserted desc fetch first 10 rows only" 
summary = pd.read_sql_query(summary_sql, zengine)

Is there a way to optimize the code or is there a better option of connecting to a database that would improve the speed?

Thanks!




are there scenarios (i.e. browsers) that it matters the trailing backslash in base tag

Is there any browser that handles differently the values of the <base> tag?
Are

<base href="http://www.example.com" />

and

<base href="http://www.example.com/" />

the exact same thing in all modern browsers? (notice the trailing slash in the second example).




Angular 5 formgroup list controls or iterate them

I am using angular 5 with formgorup and wish to iterate the controls, in order to create a dynamic component based on a form, the forms fields are given by an external data service (database etc.)

It is declares as follows

check = new FormGroup({
    firstName : new FormControl(true),
    lastName : new FormControl(false)
  });

I found this explaining how to iterate the controls but It does not work. I try to use:

for(let item of this.check.controls){}

and get this is the chrome debug:

Cannot read property 'length' of undefined

I can't access this.check.controls.keys or keys()

How can I iterate the keys?

Thanks




web scraping with beautiful soup in python

I want to crawl the homepage of youtube to pull out all the links of videos. Following is the code

from bs4 import BeautifulSoup
import requests

s='https://www.youtube.com/'
html=requests.get(s)
html=html.text

s=BeautifulSoup(html,features="html.parser")

for e in s.find_all('a',{'id':'video-title'}):
    link=e.get('href')
    text=e.string
    print(text)
    print(link)
    print()

Nothing is happenning when I run the above code. It seems like the id is not getting discovered. What am I doing wrong




How to handle search Functionality in android or web

I'm using NodeJs and MongoDB.I made successful a REST API to search the data from the database. But now I want to integrate into the Android app and also on the web using PHP and HTML. Now, How can I do this please provide me some reference :

Note: While a user typing it fetches the data from database




Unable to display edited value

I am working on writing and reading XML data using LINQ. The reading part is okay but the wirting part is not working.

The post data from my xml is loading properly, but as soon the user trying to save new changes, the data remain unchange.Wonder why ? enter image description here

Reading post data :

public partial class EditPost : System.Web.UI.Page
{
    private void Page_Load(object sender, EventArgs e)
    {

        string new_title = newtitle.Text.ToString();
        string new_description = update_des.Value.ToString();

        string path = "C:\\Users\\user\\Source\\Repos\\FoodBlog\\FoodBlog\\Data\\blog_post.xml";
        string postid = Request.QueryString["pid"];





        if (postid != null)
        {
            FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
            XDocument xdoc = XDocument.Load(fs);
            var post = from p in xdoc.Descendants("post")
                       select new
                       {
                           Title = p.Element("title"),
                           Subtitle = p.Element("subtitle"),
                           Desc = p.Element("description"),
                           PID = p.Element("pid")

                       };
            foreach (var ePosts in post)
            {
                if (ePosts.PID.Value == postid)
                {
                    newtitle.Text = ePosts.Title.Value;
                    Subtitle.Value = ePosts.Subtitle.Value;
                    update_des.Value = ePosts.Desc.Value;
                }
            }

        }


    }

Writing post data :

protected void Update_btn_click(object sender, EventArgs e)
    {
        string postid = Request.QueryString["pid"];
        if (postid != null)
        {

            string path = "C:\\Users\\user\\Source\\Repos\\FoodBlog\\FoodBlog\\Data\\blog_post.xml";

            FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
            XDocument xdoc = XDocument.Load(fs);
            var post = from p in xdoc.Descendants("post")
                       where (string)p.Element("pid")== postid
                       select new
                       {
                           Title = p.Element("title"),
                           Subtitle = p.Element("subtitle"),
                           Desc = p.Element("description"),
                           PID = p.Element("pid")


                       };

            foreach (var ePosts in post)
            {
                if(ePosts.PID.Value==postid)
                ePosts.Title.ReplaceWith(newtitle.Text);

                ePosts.Subtitle.ReplaceWith(Subtitle.Value);
                ePosts.Desc.ReplaceWith(update_des.Value);
            }




        }

XML data structure :

<Posts>
  <post>Something<
  <pid>p9119</pid>
  <title>Something</title>
  <description>Something</description>
  <subtitle>Something</subtitle>
  <date>Something</date>
  <author>Something</author>
</Posts>




















    }
}

}




VBA selecting a value from dropdown box on a webpage

I'm trying to use VBA to log me into a secure webpage, then navigate to a webpage where I need to select a value from a drop down box before searching the database.

I cannot get the last part where it selects the value in the drop down box to work, I have used the below code.

The drop down box Name is = District, text value is "South" and combo value for South is A in HTML code. Can someone please help (read a couple of other posts but didn't understand them).

    Sub database()

Dim IE As Object
Dim objElement As Object
Dim objCollection As Object

'add worksheet
Sheets.Add After:=ActiveSheet


'destination
 Set destsheet = ActiveSheet
'use internet explorer
 Set IE = CreateObject("InternetExplorer.application")
' with internet open, make this visable and go to webpage x, enter username 
and passwork
With IE
    .Visible = True
    .Navigate ("URL")
    While .Busy Or .ReadyState <> 4: DoEvents: Wend
'.Document.getElementsbyname("User name").Focus
.Document.getElementsByName("username")(0).Value = "username"
.Document.getElementsByName("password")(0).Value = "Pword"
While .Busy Or .ReadyState <> 4: DoEvents: Wend
Set objCollection = IE.Document.getElementsByTagName("input")
'log in (submit)
i = 0
While i < objCollection.Length
           If objCollection(i).Type = "submit" And _
           objCollection(i).Name = "" Then
             ' "Search" button is found
            Set objElement = objCollection(i)

    End If
    i = i + 1
Wend
'upon logging in naviage to webpage...
objElement.Click
.Navigate ("URL 2")

    While .Busy Or .ReadyState <> 4: DoEvents: Wend
    Debug.Print .LocationURL
End With

With IE
IE.doc.getElementsByName("district").Item(A).Selected = True

End With
End Sub




Does choice of programming language affect protection against DoS, specifically Ping Flood?

I am building a REST website and have to pick programming tools based on their protection against DoS, specifically Ping Flood.

I have searched multiple blogs and read research papaers on IEEE; however, none of them mention how choice of programming language affects DoS protection.

Is there any difference between Java Spring Boot, Ruby on Rails, MEAN stack or other framework I haven't mentioned from the perspective of defence agaisnt Ping Flood?

I would like to leave Firewall aside, for research purposes.

Thanks in advance




How to send the value of Radio Button with Ajax to PHP when selecting

my problem is when I sent my variables through ajax to my .php. The variable 'data.estado' marks me an error once it returns, I already could bring the element that selects and obtain its value but there is an error in my return of ajax data. I do not know what it is. A help please and thanks for giving me a return to my question hehehe :).

My ajax code and controlling the selected radius:

var ComprobarSeleccion = false;

$('input[type=radio][name=radioStacked]').change(function(){

    ComprobarSeleccion = true;

    $.ajax({
         url: "cuestionario.php",
         type: "POST",
         data:{ valor:this.value, verificar:ComprobarSeleccion},
         dataType:"jsonp",
         jsonp:"jsoncallback",
         contentType:'application/json; charset=utf-8',
         crossDomain: true,
         cache: false,
         success:function($data){
            //unselect(this);
             //console.log($data.estado);
             if($data.estado=="seleccionado"){
                alert("Exito");
             }

             console.log($data.estado);

         },
         error: function($data){
            alert( "Error en la petición: " +  JSON.stringify($data));
         }
    });

});

My PHP code where I try to catch the value of the radio button:

<?php
        session_start();
        if(isset($_SESSION['sesion_iniciada']) == true ){

                $id_alumno = $_SESSION['alumno'] ;

                $datos = array();
                $a = false;    
                if(isset($_GET['verificar']) && !empty($_GET['verificar'])){
                    if($_GET['verificar']){
                       $valor = $_GET['valor'];
                       $a = true;

                       $datos["estado"] = "seleccionado";
                       //var_dump($datos);
                    }else{
                       $datos["estado"] = "error123";  
                       $a = true;

                    }
                 }
                 //var_dump($datos);

                 if($a == true){
                     $resultadoJson = json_encode($datos);

                     //var_dump($resultadoJson);
                     echo $_GET['jsoncallback'] . '(' . $resultadoJson . ');'; 
                 }        
    ?>

The truth is I do not know if I am taking the most appropriate and effective way, please accept suggestions, indications and corrections. Thank you.

My error in the ajax request:

Error en la petición: {"readyState":4,"status":200,"statusText":"load"}

My error in the console:

Uncaught SyntaxError: Unexpected token < 

What the data variable prints on the console when my ajax arrives:

jQuery331004199455651714534_1532107113667({"estado":"seleccionado"});

And it marks me an error in my HTML tag, it highlights it with red color and with an 'x' this one.




dimanche 29 juillet 2018

Warning: Failed prop type: Invalid prop `children` supplied to `TableRow`

Using react-md, I'm trying to build a table from an array of objects. I have one fixed column header but everything else is generated by the keys in the first element of the array.

<TableHeader>
  <TableRow>
    <TableColumn>Actions</TableColumn>
    {Object.keys(list[0])
      .filter((key) =>
        Object.keys(SEARCH_RESULTS_LABELS).includes(key),
      )
      .map((key, i) => (
        <TableColumn key={i}>
          {SEARCH_RESULTS_LABELS[key]}
        </TableColumn>
      ))}
  </TableRow>
</TableHeader>

My fixed column is the <TableColumn>Actions</TableColumn> element. The moment I put it in, I get this error. When I remove it, the error goes away.

I'm not sure why this is happening, how do I get rid of the warning?




what is best site for web design in kashan

I want to design a website . what is best company in Kashan for web design. Thank you




second time submit form with info changed but the action in server didnt get the request

just a login html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>测试的登录页面</title>
<link href="css/mui.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">

</head>
<body>
<header class="mui-bar mui-bar-nav">
            <h1 class="mui-title">登录</h1>
</header>
        <div class="mui-content">
            <form id='login-form' class="mui-input-group" action="/front/login">
                <div class="mui-input-row" style="padding-right: 14px;">                
                    <input name="phone" type="text" style="width: 66%;" class="mui-input-clear mui-input" placeholder="请输入你的手机号">                           
                </div>      
            <div class="mui-content-padded">
                <button id='login' class="mui-btn mui-btn-block mui-btn-primary" type="submit" >登录</NOtton>     
            </div>
            </form>
        </div>

        <script src="js/mui.min.js"></script>
</body>
</html>

the action is here

    package com.neu.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


import com.neu.beans.Userlist;
import com.neu.service.FrontCheckService;



@Controller
public class FrontLoginHandler {
    @Autowired
    private  FrontCheckService service;

      @RequestMapping(value = "/front/login")   
      public  String frontlogin(HttpServletRequest request,HttpServletResponse response)
      {
          //请求和响应的信息都不应该被存储在对方的磁盘系统中; 

          System.out.println("....servlet....frontlogin()......");
         System.out.println("....servlet....frontlogin()......");
        System.out.println("....servlet....frontlogin()......");
        System.out.println("....servlet....frontlogin()......");
        System.out.println("....servlet....frontlogin()......");
         //从数据库查找是否存在这样一个手机号的用户
          //如果存在那么就取出来 返回
          //如果不存在那么就 写入一个
          String phone=request.getParameter("phone");       
          if(service.check(phone)==null)
          {
              Userlist user=new Userlist();
              user.setTel(phone);       
              user.setUname(phone);
             user.setOpenid(phone);
              user.setUserimg("default.jpg");
              adduser(user);
             System.out.println(user.getTel());
             HttpSession session=request.getSession();
             session.setAttribute("user", user);
             System.out.println("存入session成功!");
             return "forward:index.html";
              //如果为空 捏造一个用户 返回 并 写入数据库
          }
          else
          {
             Userlist user= service.check(phone);
             System.out.println(user.getTel());
            HttpSession session=request.getSession();            
             session.setAttribute("user", user);
             System.out.println("存入session成功!");
            return "forward:index.html";
              //如果不为空 那就将返回的对象返回
          }


      }

      public  void adduser(Userlist user)
      {
          String phone= user.getTel();
          service.insert(phone);          
      }

}

the question is that when i first time input a phone number ,login successful,and get the right username . and when i surf the page again ,submit with another phonenumber its ok .but the third time with another phone number login the user name is name before. i check the eclipse console find the third time request didnt send to the action,because the several "System.out.println()" didnt printed. the get name page is a page with ajax to get another action to return the "user" attribute of session.




How does SOCKS configuration works on firefox?

I'm using a manual proxy configuration on Firefox to use a SSH tunnel and everything works fine. However I try to understand how does it works. From my understanding Firefox is just transferring every request to the specified port but I'm not quite sure of what does it means. Also what happen when I don't use a proxy? I guess Firefox is using an other port or something? Basically I'm trying to understand how a web browser connects to internet.




What technologies would you use to make a multiplayer browser game?

im a novice programmer and am trying to make a browser game, already have the layout done but im lost when it comes to the rest, the concept is a text based multiplayer strategy game, where the users would interact with eacth other. I think i should go with nodejs but dont know anything else I would need. Ive been advised to use react but dont know if thats the best way to go.




extracting multiple urls in a script

I want to write a php script etc where I can load a series of urls into an array and loop on them doing a curl request etc.

given the url https://www.basketball-reference.com/leagues/NBA_2015_games.html

i am trying to work out an automatic process to trigger the share & more option and save as excel workbook.

I have searched the html source but can not find where the section that houses this drop down and thus the url to put in a curl request etc in php.

I am reaching out for help to see if any one can work this out. I ultimatly want to save 20 years of nba stats as a xls or csv files.

thanks




Getting "Uncaught SyntaxError: Unexpected token :" while accessing JSON from external URL

I am trying to access JSON data from an external URL.

I am using JSONP and here is my code :

$.ajax({
url: 'https://myurl.com',
dataType: 'JSONP',
jsonpCallback: 'callback',
type: 'GET',
success: function (data) {
    console.log(data);
}});

The status code is 200, even I can see the JSON from that URL but I am getting the error:

Uncaught SyntaxError: Unexpected token :

and unable to work with that JSON data

Can anyone help me to figure this out?




Best Web Hosting

Best cheapest Web Hosting in all word https://www.regxa.com




How to construct maven ear resource

When launching the command mvn install, maven still in error because the web modile is not existing yet. Does you have to make install on the web module before?




ASP.NET WEB API cant upload multipart/form-data (image) to Web server

After uploading image through ASP.NET WEB API successfuly through localhost . I uploaded my project to the hosting server but this time i got the error as

an error has occured

This is my controller

   tutorEntities entities = new tutorEntities();
    [HttpPost]
    public HttpResponseMessage ImageUp()
    {

        var httpContext = (HttpContextWrapper)Request.Properties["MS_HttpContext"];
        img std = new img();
        //      std.Title = httpContext.Request.Form["Title"];
        //           std.RollNo = httpContext.Request.Form["RollNo"];
        //           std.Semester = httpContext.Request.Form["Semester"];
        HttpResponseMessage response = new HttpResponseMessage();
        var httpRequest = HttpContext.Current.Request;
        if (httpRequest.Files.Count > 0)
        {
            string random = Guid.NewGuid().ToString();
            string url = "/UserImage/" + random + httpRequest.Files[0].FileName.Substring(httpRequest.Files[0].FileName.LastIndexOf('.'));
            Console.WriteLine(url);
            string path = System.Web.Hosting.HostingEnvironment.MapPath(url);


            httpRequest.Files[0].SaveAs(path);
            std.Path = "http://localhost:2541/" + url;

        }
        entities.imgs.Add(std);
        entities.SaveChanges();

        return Request.CreateResponse(HttpStatusCode.OK);
    }




Styling With CSS - Float Removing Styling

I'm new to web development and have discovered an issue that I cant find an answer for. I'm attempting to create a navigation bar following the following guide:

--> https://medium.freecodecamp.org/how-to-easily-build-mashables-navigation-bar-with-html-and-css-9e5007af786

My question is more for learning purposes as it just doesn't make much sense to me and I'm hoping someone can shed some light on it.

Here is the HTML for my example:

HTML

<div id="navigation-bar">
  <header id="header">
    <nav id="nav-bar">
      <a href="#">Tab1</a>
      <a href="#">Tab2</a>
      <a href="#">Tab3</a>
      <a href="#">Tab4</a>
      <a href="#">Tab5</a>
      <a href="#">Tab6</a>
      <a href="#">Tab7</a>
      <a href="#">Tab8</a>
    </nav>
  </header>
 </div>

When using CSS to style the guide reference turning each element into blocks using the display:block property and then floating them next to eachother. Much like the following:

<h1>CSS</h1>

nav {
  width: 100%;
  background-color: #0b98de;
}
  nav a {

    display: block;
    float:left;
    border: 1px solid #000;

    font-family: sans-serif;
    font-size: 9px;
    color: white;

    padding-top: 20px;
    padding-right: 10px;
    padding-bottom: 10px;
    padding-left: 10px;

    text-decoration: none;   
 }
  nav a:hover {

    background-color: #17b0cf;

  }

But what this appears to be doing is ignoring the properties in the nav block and only applying the properties in the nav a block. For this examples purpose it will leave nav bar white showing only the black border specified in the nav a block. It ignores the background color specified in the nav block and doesnt extend to width:100%. I've tried using the ID identifier as well as a class.

I have found a way to mitigate this by using display:inline-block as below but I still dont understand what the "hidden chain of command" is.

<h1>CSS</h1>
nav {
  width: 100%;
  background-color: #0b98de;
}
  nav a {

    display: inline-block;
    text-align:center;

    font-family: sans-serif;
    font-size: 9px;
    color: white;

    padding-top: 20px;
    padding-right: 10px;
    padding-bottom: 10px;
    padding-left: 10px;

    text-decoration: none;   
 }
  nav a:hover {

    background-color: #17b0cf;

  }




FIDS | Smart Flight Information Display (What tools and methods to create something like this ?)

 I believe you have ever seen the Flight Information Displays installed on International or Private airport. The flight information always updates/refresh every time when the data changes or not.

I am SQL Server administrator and T-SQL developer, but i don't know about Web Development (lack of experience like HTML or CSS).

 Recently i have a big project of building a custom Flight Information Displays System  for myself, fortunately, I got up-to-date information data export from the DB in every minute, the format is anything like this

1,A,TW,XXAirline,663,A3,2018/07/28,00:05:00,2018/07/27,23:36:55,TAE,Daegu,DestinationA,ARRIVED ,B737-800,,,, ,
1,A,IT,ZZAirline,6611,A3,2018/07/28,00:05:00,2018/07/27,23:36:55,TAE,Daegu,DestinationB,ARRIVED, ,,,, ,
2,A,BR,YYAirline, 179, C6,2018/07/28,00:10:00,2018/07/27,23:44:49,KIX,Osaka Kansai,DELAYED ,A321-200,,,, ,
As you can see, those are the raw data which shows exactly the same information as you see on the Flight Information Monitor.

Question : What kind of Web Dev tools could i able to use to build this ? What kind of methods for this dynamic data mining ?

I'm really look forward to hearing some advice from you.

Jim




Null value while trying to read XML data

I tried to read XML data that matches my post id string (not null) attributes, but it returns null even though I have tried several times.

protected void Update_btn_click(object sender, EventArgs e)
        {
            String new_title = newtitle.Text.ToString();
            String new_description = update_des.Value.ToString();
            String postid = Request.QueryString["pid"];

            System.Diagnostics.Debug.WriteLine(postid); 


            string filename = "C:\\Users\\user\\Source\\Repos\\FoodBlog\\FoodBlog\\Data\\blog_post.xml";
                        XmlDocument xml_doc = new XmlDocument();
            xml_doc.Load(filename);

            XmlTextReader xtr = new XmlTextReader(filename);



            XmlNodeList elemList = xml_doc.GetElementsByTagName("post");
            for (int i=0;i<elemList.Count; i ++)
            {
                string getValue = elemList[i].Attributes[postid].ChildNodes[1].InnerText;
                System.Diagnostics.Debug.WriteLine(getValue);
            }

XML data :

<Posts)
<post pid="pid2623">
    <title>Test</title>
    <description>Test</description>
    <subtitle>Test</subtitle>
    <date>7/29/2018 12:00:00 AM</date>
    <author>est</author>
  </post>
</Posts>




Retaining Firebase auth credentials after redirect

I'm using Firebase authentication (react-firebaseui with Google & Facebook sign-in) in a single page web app in which the user also needs to authenticate against other systems using OAuth redirect flow to gain access to 3rd party APIs.

My problem is that Firebase authentication credentials are lost after the user authenticates to these 3rd party systems through OAuth (redirect flow).

How can I retain the Firebase authentication session and regain Firebase credentials after the redirect?

I've tried persisting the authentication credentials and then invoking signInAndRetrieveDataWithCredential after the redirect, but this doesn't appear to work.




How to get Filename and Filepath in Django based on a Model containing Fileupload?

I making a email delivery WebApp, I have an Email Class with uploadcsvfile to upload the .csv contact file from the user's computer to server at location CONTACT_DIR, what I'm unable to figure out is how to get the saved contacts_some_char.csv name in my views.py, the purpouse of getting it's name is so that I can parse the email list and send email to them.

I have my model.py as follows :

class Email(models.Model):
    fromemail = models.EmailField(blank = False, max_length = 254)
    uploadcsvfile = models.FileField(upload_to = 'Contacts', blank = False)
    subject = models.CharField(blank=False,max_length = 254)
    bodyHeading = models.CharField(blank = False,max_length = 254)
    bodytext = models.TextField(blank = False)
    name = models.CharField(blank = False,max_length = 254)

Here is my views.py :

def index(request):

    if request.method == 'POST':
        email_form = EmailForm(request.POST, request.FILES)
        if email_form.is_valid():
            email_form.save(commit = True)
            print(Email.uploadcsvfile)
            contacts = Contacts()
            #path = settings.CONTACT_DIR
            f = open(settings.CONTACT_DIR+"/"+str(uploaded_file_name))
            csv_f = csv.reader(f)
            Emails = []
            Names= []
            L_Names = []
            for x in csv_f:
                Emails.append(x[0])
                Names.append(x[1])
                L_Names.append(x[2])
            f.close()
            contacts.ListOfEmails = json.dumps(Emails)
            contacts.ListOfFirstNames = json.dumps(Names)
            contacts.ListOfLastNames = json.dumps(L_Names)
            contacts.save()

Here is forms.py for the same :

from django import forms
from dcsvreader.models import Email

class EmailForm(forms.ModelForm):
    class Meta():
        model = Email
        fields = "__all__"

A.K.A How do i get uploaded_file_name in views.py, I'm reading in various QnA at S.O that this is related to FileDescriptor but can't find how exactly also, print(Email.uploadcsvfile) gives <django.db.models.fields.files.FileDescriptor object at 0x03F7DF90> as output.




Tips on creating a web & mobile application

I'm currently trying to learn new frameworks and languages, since it's summer and I have loads of free time. I've decided I should create an application that is deployed in both the web and mobile. As a developer who has knowledge in vanilla:

  • PHP.
  • JavaScript & jQuery.
  • Android.

What frameworks should I use to build my app? Should I use a backend API for both apps, or should I seperate them?

Frameworks I'm considering are:

  • For the web: MEAN Stack or Angular/React + PHP/J2EE.
  • For mobile: React Native/Native Android + PHP/J2EE.
  • For database: MongoDB or MySQL/PostgreSQL.

I'd like to know which frameworks should I learn first, and should I actually go with vanilla PHP for backend or a framework such as Laravel or Symfony.

P.S: I'm only trying to learn new stuff, I'm not looking to create a sophisticated app, but rather an app with an idea that requires learning several frameworks at once.




Getting empty string as a response from a web server app

I have a web server app, and a client app that works like a browser. I get the desired response from the server app if I type my IP in the browser window, if I read the response to the client app I get an empty string. The client app works only if I read the URL of a website, but not with my IP.

Client:

#include "stdafx.h"
#include "WinHttpClient.h"
#include  <iostream>
#include <fstream>
#include  <algorithm>
#include <regex>
#include <string>
#include <vector>
#include <sstream>
#include <utility>

using namespace std;

int getResponse(wstring url) {
    WinHttpClient client(url);
    client.SendHttpRequest();
    wstring page = client.GetResponseContent();

    wcout << page << endl;

    return 1;
}

int _tmain(int /*argc*/, _TCHAR** /*argv*/)
{

    //wstring url = L"http://yahoo.com";
    wstring url = L"104.171.115.164";
    getResponse(url);

    char a;
    cin >> a;
    return 0;
}

Server:

#pragma comment(lib, "WS2_32.lib")
#define _CRT_SECURE_NO_DEPRECATE

#include <stdio.h>
#include <direct.h>
#include <winsock2.h>

long    nbytes;
static char buffer[8096 + 1];

int main(int argc, char **argv)
{
    WSADATA wsaData;
    SOCKET  listenfd, socketfd;
    static struct sockaddr_in cli_addr;  /* static = initialised to zeros */
    static struct sockaddr_in serv_addr; /* static = initialised to zeros */
    int hit;
    size_t  length;


    WSAStartup(MAKEWORD(2,2), &wsaData);

    serv_addr.sin_family = AF_INET;
    serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
    serv_addr.sin_port = htons(80);

    listenfd = socket(AF_INET, SOCK_STREAM, 0);
    bind(listenfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr));
    listen(listenfd, 64);



    for (hit = 1; ; hit++)
    {
        length = sizeof(cli_addr);
        socketfd = accept(listenfd, (struct sockaddr *) &cli_addr, &length);

        recv(socketfd, buffer, 8096, 0);

        sprintf(buffer,"123456");
        send(socketfd, buffer, strlen(buffer), 0);

        shutdown(socketfd, SD_BOTH);
    }
}




Multiple update query in Razor Pages .ASP.NET

I'm trying to develop a tiny front-end for a sqlite DB using Razor Pages (NOT MVC!).

Looks like it supports SQL in a different way, not like I used to in the past.

For example, I need to re-assign value to the field Pl_Pos (position of the record in the list). Now I do this like that:

        for (int i = PlnPos + 1; i<= PlModelIndexModel.PlnModelTotal; i++)
        {
            PlnModel PlnModelRedo = await _context.Plane_Models.FirstOrDefaultAsync(m => m.Pl_Model_Pos == i);
            PlnModelRedo.Pl_Model_Pos = i - 1;
            _context.Attach(PlnModelRedo).State = EntityState.Modified;
            await _context.SaveChangesAsync();
        }

Is there any other way to do it more efficient and do something like:

Update Pl_Models set Pl._Models.Pl_Pos = Pl_Models set Pl._Models.Pl_Pos - 1 where Pl_Models set Pl._Models.Pl_Pos > PlnPos

I stuck a bit...

Thanks in advance!




How to convert static site to dynamic site

I recently built a React site using the static site generator Gatsby.JS and was wondering if there was an easy way for me to convert it to a dynamic site? I'm not sure what's best, extract the Gatsby, deploy as dynamic?




Dollar symbol in eval function php

I am trying to use the eval() function in PHP, but one of my variables (ppi) has a dollar symbol in it.

$operation = "*";
$cname = mysqli_real_escape_string($link, $_REQUEST['cname']);
$to = mysqli_real_escape_string($link, $_REQUEST['email']);
$prod = mysqli_real_escape_string($link, $_REQUEST['prod']);
$desc = mysqli_real_escape_string($link, $_REQUEST['desc']);
$ppi = mysqli_real_escape_string($link, $_REQUEST['ppi']);
$items = mysqli_real_escape_string($link, $_REQUEST['items']);
$total = mysqli_real_escape_string(eval('return '.$ppi.$operation.$items.';'))

Although simplified, the equivalent could be:

$operation = "*";
$cname = mysqli_real_escape_string($link, $_REQUEST['cname']);
$to = mysqli_real_escape_string($link, $_REQUEST['email']);
$prod = mysqli_real_escape_string($link, $_REQUEST['prod']);
$desc = mysqli_real_escape_string($link, $_REQUEST['desc']);
$ppi = '$10';
$items = '5';
$total = mysqli_real_escape_string(eval('return '.$ppi.$operation.$items.';'))

Whenever I try to run this code though, I always get a HTTP error 500.
Thank you in advanced,
Jack




Completely lost and not sure what to study regarding web & mobile dev

I've been studying programming for a year, and not sure what I should study from now on.

I learned...

  • College introductory level python course
  • College introductory level java course
  • Mathmatical logic
  • HTML / CSS

After studying about a year, I came up with two goals, but I'm completely lost, and not sure what I should study to achieve them.

I want to develop a webpage that...

  • runs on AWS
  • includes web community (thread / non-thread)
  • can take polls and ratings of different entities from users
  • suggest best matching entities for individual users based on their past polling and ratings database

I also want to develop an application...

  • scheduler app for android/ios that can sync with Google/Apple callender
  • which can also sync with Google map and
  • sync & take inputs from massenger apps (such as Facebook Messenger, etc)

I browsed through the web for weeks, and at one point, realized that more I search, more I get confused. So I thought that it would be much better to ask for an advise, and follow the given advice until I learn enough so I can make judgement for myself with given information on the web.

Can anyone please suggest a way for this lost wretched soul? What should I study from now on? What would be a good starting point? What tools should I familiarize with? Any advice will be great help.

Thank you very much.




Instead of scrolling, shrink top section of page until it reaches a certain size, then allow scrolling

So, the top of my page is a full-page (100vw x 100vh) div with a (let's say 100)px fixed navbar at the top. When the user is at the top of the page and tries to scroll, I'd like them to remain at the top of the page, but for the top div to shrink in response to their scrolling, until such point as the div becomes the height of the navbar and essentially becomes the background for it; then, scrolling can continue as normal.

When the user scrolls back up, I'd like the process to reverse and the div to return to full size. I really hope there's a pure CSS solution for compatibility and responsiveness's sake, but JavaScript works great too.

I've been working on a JavaScript solution with the littlest bit of heavily flawed success - I've been using $(window).scroll(), getting the distance scrolled, shrinking the div by that, and then e.preventDefault() or window.scrollTo(0,0). This is a really dirty solution that doesn't work well at all in most cases, and I'm at a loss for a better one...

Thanks so much for any help!




samedi 28 juillet 2018

Workplace peers interaction

In the IT industry, how do you cope/deal/manage with double thinking ( or n thinking ) in the workplace ? From what my current experience is telling me, people sometimes are talking about a technical software aspect, but they are thinking about one or many other non-technical specific things. While this is not a problem by itself, acting on particular ideas could be disastrous or illegal.




Angular - Event OnScroll

I'm developing an application in angular 4. Also I'm using Firefox and everything works fine, I can handle the scroll event like this:

@HostListener('window:scroll', ['$event']) onScrollEvent($event) {

        let posY = $event.pageY;
}

The posY starts from 0 which is fine.

But now I'm testing the same application in Google Chrome or Safari and I get "pageY undefined"

I was looking at google that Chrome and Safari not handle PageY. Is there any way to get this value using angular ?

Thanks

UPDATE:

I also tried

console.log($event.target.body.scrollTop);

but keep me showing 0




How Do I Get My Website First Page On Google Search?

https://www.techrax.ooo/ please check it my website and answer to me . how do my website 1st page on google




How do I change my all links like https://ift.tt/2K5tnMe to simple https://ift.tt/2mQOEQV

Actually I have a site but I don't know how exactly one can resolve this kind of issue.

So, my site is qapaper.com and there are some links which redirect on one single page with PHP GET methods which are:

 https://qapaper.com/first.php?id=1
 https://qapaper.com/first.php?id=2
 https://qapaper.com/first.php?id=3
 https://qapaper.com/first.php?id=4

Each having question papers of different year, now here comes the question that how can I change them to something like:

https://qapaper.com/first
https://qapaper.com/second 
https://qapaper.com/third
https://qapaper.com/fourth

And second thing is even my landing page is like:

https://qapaper.com/index.php

Thank You in advance!




Web client Interface for machine learning model

Is there a framework, template that I could use as a reference for my below use case.

I want to create a client web interface that allows non-technical users to upload files & perform some analysis over data. It should give them access to data they have uploaded in the past.

The uploaded files would be sent to my back end which has a machine learning model which would output the result, which should be sent to the web interface.

Please let me know if my question is ambiguous, so i could amend it. Thank you for reading.




Is there a UI development IDE for web as there is for Android

Does anyone know if there's an IDE that would let me design web pages the same way an app view can be designed on android? what I mean specifically is the way you can position elements in relation to each other by connecting them with arrows and springs in android studio




please help me to find the error in my code...!

i been trying to update an entity, but the matter of fact i gotta update them all at update page, else it throws error: here's my code

// to verify if user is an admin
    <?php include "include/uni_header.php"?>
    <?php
    if (isset($_GET['update'])){
        if ($_GET['update'] == null){
            header("Location: error/error.php");
        }else{
            $hlp = $_GET['update'];
        }
    }else{
        header("Location: error/error.php");
    }
    ?>
        <!-- mail -->

        <div class="latest-albums">
            <div class="container">
                <h3 class="agileits_w3layouts_head"> <span>Update existing</span></h3>
                <div class="wthree_latest_albums_grids gallery">
                    <div class="col-md-9 agile_mail_grid_left">
                       // here i am trying to fetch all value & putting them on the field
                        <?php
                                $sql = "select * from music where id=$hlp";
                                $getter = mysqli_query($connection, $sql);
                                while ($row=mysqli_fetch_assoc($getter)) {
                                    $id = $row['id'];
                                    $title = $row['title'];
                                    $singer = $row['singer'];
                                    $description = $row['description'];
                                    $length = $row['length'];
                                    $relese_date = $row['relese_date'];
                                    $lyrics = $row['lyrics'];
                                    $genere = $row['genere'];
                                    $songs = $row['songs'];
                                    $thumbnail = $row['thumbnail'];
                                    $language = $row['language'];
                                    $album_tag = $row['album_tag'];
                                    $youtube_id = $row['youtube_id'];
                                    $feature_tag = $row['feature_tag'];
                                }
                        ?>
                        // trying to update
                        <?php
                        if (isset($_POST['submits'])){
                            $title = $_POST['name'];
                            $singer = $_POST['singer'];
                            $description = $_POST['description'];
                            $length = $_POST['length'];
                            $date = $_POST['release_date'];
                            $lyrics = $_POST['lyrics'];
                            $category = $_POST['cat'];
                            $language = $_POST['cat1'];
                            $youtube = substr($_POST['youtube'], 17);
                            $album = $_POST['album'];

                            //thumbnail
                            $p_image = $_FILES['images']['name'];
                            $post_image_temp = $_FILES['images']['tmp_name'];
                            move_uploaded_file($post_image_temp, "thumbnail/$p_image");

                            //songs
                            $upload_file = $_FILES['files']['name'];
                            $temps = $_FILES['files']['tmp_name'];
                            move_uploaded_file($temps, "songs/$upload_file");
                            //query
                                $query = "update music set title='{$title}', singer='{$singer}', description='{$description}', length='{$length}', relese_date='{$date}', lyrics='{$lyrics}', genere={$category}, songs='{$upload_file}', thumbnail='{$upload_file}', language={$language}, album_tag='{$album}', youtube_id='{$youtube}' where id={$hlp}";
                                $sender = mysqli_query($connection, $query);
                                echo "error".mysqli_error($connection);



                        }
                        ?>
                       // pushing previously pulled value as user can see old values, it helps to update.
                        <form action="" method="post" enctype="multipart/form-data">
                            <label for="name">Enter Song Title</label>
                            <input type="text" name="name" placeholder="Name" value="<?php echo $title; ?>"><br>

                            <label for="email">Singer</label>
                            <input type="text" name="singer" placeholder="Singer" value="<?php echo $singer; ?>"><br>

                            <label for="description">Description</label>
                            <input type="text" name="description" placeholder="Description" value="<?php echo $description; ?>"><br>

                            <label for="length">Run Time</label>
                            <input type="text" name="length" placeholder="Run Time" value="<?php echo $length; ?>"><br>

                            <label for="images">Upload the song</label>
                            <input type="file" name="files" class="btn btn-default">

                            <label for="album">Album name</label>
                            <input type="text" name="album" placeholder="Album name" value="<?php echo $album_tag; ?>"><br>

                            <label for="youtube">Paste the Short URL only</label>
                            <input type="text" name="youtube" placeholder="ex: https://youtu.be/xxxxx" value="<?php echo $youtube_id; ?>"><br>
                            *This field only accepts SHORT URL <b>(open the song vid->share->copy link)</b>
                            <br><br>

                            <label for="country1">Choose Language</label>
                            <div class="btn-group">
                                <select id="country1" class="dropdown" name="cat1">
                                    <?php
                                            $sql1 = "select * from language where id=$language";
                                            $getter1 = mysqli_query($connection,$sql1);
                                            while ($r=mysqli_fetch_assoc($getter1)){
                                                $language=$r['language'];
                                            }
                                    ?>
                                    <option class="dropdown-header" value=""><?php echo $language; ?></option>
                                    <?php
                                    $querys = "select * from language";
                                    $sends = mysqli_query($connection, $querys);

                                    while ($row = mysqli_fetch_assoc($sends)) {
                                        $id = $row['id'];
                                        $language = $row['language'];

                                        echo "<option class='dropdown-item' value='{$id}'>{$language}</option>";
                                    }
                                    ?>
                                </select>

                            </div>
                            <br><br>

                            <label for="release_date">Release Date</label>
                            <input type="date" autocomplete="off" name="release_date" id="date" placeholder="Relese Date" value="<?php echo $relese_date; ?>"><br>

                            <br>
                            <label>Upload A Thumbnail Picture</label>
                            <input type="file" name="images" class="btn btn-default">
                            <br>

                            <label>Post the lyrics</label>
                            <textarea name="lyrics" placeholder="Description of the book"  id = "body"></textarea>
                            <br>

                            <label for="Genre">Choose Genre</label>
                            <div class="btn-group">
                                <select id="country" class="dropdown" name="cat">
                                    <option class="dropdown-header" value=""><?php echo $genere; ?></option>
                                    <?php
                                    $querys = "select * from category";
                                    $sends = mysqli_query($connection, $querys);

                                    while ($row = mysqli_fetch_assoc($sends)) {
                                        $id = $row['id'];
                                        $category = $row['title'];

                                        echo "<option class='dropdown-item' value='{$id}'>{$category}</option>";
                                    }
                                    ?>
                                </select>

                            </div>

                            <br><br>

                            <input type="submit" value="Post Your Song Now" name="submits">
                        </form>
                    </div>

                    <div class="clearfix"> </div>
                </div>
            </div>
        </div>
        <!-- //mail -->
    <?php include "include/about_footer.php"?>

as i am clicking submits it's throwing me an error like bellow: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' album_tag='fefef222', youtube_id='' where id=19' at line 1

please tell me where's my fault, i been trying to figure it out for a long.. please help....!