Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7413629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:56:14+00:00 2026-05-29T06:56:14+00:00

Here is my javascript. I am trying to have jQuery send my sign in

  • 0

Here is my javascript. I am trying to have jQuery send my sign in form data over to my PHP file. I then tell it to grab the data from the php file and display it. But all that is coming back is “null”. If I request another value such as bio, it can display it. But it cant display data sent from my form.

<script type="text/javascript">
    $(document).ready(function() {
        $("img").click(function() {
            var data = $('form#signin').serialize();
            $.ajax({
                url:'signin.php',
                type:'POST',
                data: data,
                success:function(data) {
                    $("p.test").html(data);
                    $.getJSON("signin.php", function(data) {
                        localStorage.email = data[0];

                    });
                },
                error:function(data) {
                }
            });
        });
    });
</script>

Here is my PHP

<?php

$email = $_POST["email"];

$profile = array($email, "Karl", "Clement", "Gangsta Love!", "bio bio bio bio bio bio bio     bio bio bio bio bio bio bio bio bio bio bio", "Ottawa",     "http://a3.twimg.com/profile_images/1459354642/IMG_1560_normal.jpg");

header('Content-Type:text/json');
echo json_encode($profile);

?>

Thank you so much for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:56:15+00:00Added an answer on May 29, 2026 at 6:56 am

    getJSON sends a GET-request, but you try to access a POST-variable.(to be exactly you don’t send any variables via $.getJSON )

    The $.ajax()-request with a datatype set to ‘json’ should be sufficient:

    <script type="text/javascript">
        $(document).ready(function() {
            $("img").click(function() {
                var data = $('form#signin').serialize();
                $.ajax({
                    url:'signin.php',
                    type:'POST',
                    data: data,
                    dataType:'json',
                    success:function(data) {
    
                            localStorage.email = data[0];
    
                    },
                    error:function(data) {
                    }
                });
            });
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to post some data to a PHP file using jQuery. If I
I am trying to insert php variables into javascript. Here is the broken code:
Very confused here, trying out the yuicompressor on a simple javascript file. My js
The thing I'm trying to have is a JQuery/JavaScript code that will automatically pass
My jquery scripts have some php in them to initiate variables, etc. I'm trying
I'm using the jQuery-UI dialog and I'm trying to send the data in my
I have a JSON file here: http://dalexl.webs.com/products.json I'm trying to read it on my
I was reading about output buffering in JavaScript here , and was trying to
I am working with javascript and here is what I am trying to do:
Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.