Get form values (regular post form submit) using jquery [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a form inside a page A, with 2 fields, user and password, the action of my form is a page B.
I would like to get the form values of the request header using javascript when the page B is loaded. Is this possible? Or something similar?
Thanks.

No. Expect for a few exceptions (useragent) the HTTP request headers are not available in client-side Javascript.
The only way to access the values of the POST:ed form would be to place them in the document when processing the request server side.
This however does not apply to Ajax requests, where the entire request and response are exposed to Javascript.
But, if the form uses the GET method the form values are encoded as query parameters and are available by parsing window.location.

Related

XMLHttpRequest without server feedback [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
This post was edited and submitted for review 3 days ago.
Improve this question
xht = new XMLHttpRequest();
xht.open("POST", "nload");
xht.send(fg);
Shown code send a POST request to server. "nload" flag signals the server to don´t send data back. This is deliberately want! The flag is self programmed and not official. When strstr(str1, "nload") server don´t send data back. My client (Chrome) print a error because server doesn´t send data back shown in picture.
I tried to use "GET" instead of "POST" and navigator.sendBeacon() but booth has same result.
I looking for solutions to solve the error

Simple question: POST or GET, regarding image upload? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 months ago.
Improve this question
In my backend API, I return information based on an image that a user uploads; ie. the user "gets" data depending on the image they inputted. Should this be a GET request or a POST request?
I was thinking it should be a GET request, but my code only seems to work if it's a POST request (specifically, the backend server only seems to get the inputted image if the request is a POST request).
Thanks!
Use POST Method only to upload files.
GET won't work as it doesn't have body to pass on values/files

User credentials seen in header form data even after using https [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Passing user credential from Angular to PHP, they are totally visible in developer tools > Network > Headers > Form data, see below image:
I am using Https everywhere but still my credentials are seen in plain text.
What am I doing wrong?
There are 4 ways to "hide" parameters from appearing in the developers tools:
1st (weakest) encode it
Depending on the algorithm, the data is unreadable afterwards but can easily be decoded to the plaintext
2st Hash the data
The data is unreadable afterwards but you cannot read it yourself too.
3rd Encrypt data
Requires passwords / keys to be sent, leaving you with a dilemma.
4th and probably strongest: Don't send the data at all
Store the secret on the server and link it to the public session id.

Is there a way to check an email ID and a value next to it in database from frontend without submitting the form? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a registration form and I would like to check if the email is already in database (PSQL) without submitting the form. Vanilla javascript or jQuery only please. No PHP
Create a blur event on your email input field
https://www.w3schools.com/jquery/event_blur.asp
When it will be called (user clicked out of email input field) make AJAX call to API which will check if email exists and return feedback that you can then present to user via notification. All that can be done without any submitting of form, but you need PHP for API or something similar on the server side.
About AJAX calls:
https://api.jquery.com/jQuery.ajax/
You don't have to submit the form, You can build an API on Your server to tell you if a certain email is already in the system. Then from the front end you request this API to check whether this email is already registered or not.
Obviously on your server once the form is submitted, you need to check again for that, because front-end validations are meant just to make the experience more smooth, and everything important should also be validated on the back end.

How to pass data from an email to a landing page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
So my question is that for example lets say a
customer receives an email
and then they click on the link which is in the email that they receive
What I want to do is that when they click on the link
this link will take them to a webpage where there will be a form
What the webpage should do is automatically fill in the customers details depending on who the customer was so for example their email address, firstname and lastname.
What is the best way to do this? I was thinking of using PHP but is it possible to do using Javascript or any other languages?
you can pass user email or any other information in url using abc.com?data=email and then you retrieve details from your db and don't forget to escape the get parameter for security reasons
set url data like http://localhost/dispatch.php?link=www.google.com
so here link will be your get parameter check on the link given below
refer this link:GET URL parameter in PHP
Only GET data can be sent from an email.
So you can pass the email : mylandingpage.com?email#email.com
Then you could retrieve the user informations from your database (PHP/MySQL)

Categories