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 6580251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:00:11+00:00 2026-05-25T16:00:11+00:00

im working on a script that sends a few data stored using GET to

  • 0

im working on a script that sends a few data stored using GET to a PHP script(process it then put it into database).

here’s the ajax script , im using jQuery ajax
(i have included the latest jQuery script)

function send(){
  $.ajax({
     type: "GET",
     url: "http://examplewebsite.com/vars/parse.php",
     data: "id=" + id + "&purl=" + purl + "&send" + "true",
     cache: false,
     success: function(){
       alert("Sent");

     }
  });
}

id and purl are JavaScript variables .

send() function is set in :

<a href="#" onclick="send()">Send</a>

PHP code:

<?php

//Connect to database
include ("config.php");

//Get the values
$id = $_GET['id'];
$purl = $_GET['purl'];
$send = $_GET['send'];

if ($send == 'true') {


    $insertdata = "INSERT INTO data (id,purl,send) VALUES ('$id','$purl',+1)";
    mysql_query($insertdata) or die(mysql_error());
} else {
    //do nothing
}
?>

when i type http://examplewebsite.com/vars/parse.php?id=123&purl=example&send=true
it works, the php injects the data into the database as i wanted but when i use send() and wanted to use ajax to send the data, failed.

Is there any mistakes that im making?

  • 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-25T16:00:12+00:00Added an answer on May 25, 2026 at 4:00 pm

    You’re missing the = after send,

    function send(){
    
      $.ajax({
         type: "GET",
         url: "http://examplewebsite.com/vars/parse.php",
         data: "id=" + id + "&purl=" + purl + "&send=" + "true",
         cache: false,
         success: function(){
           alert("Sent");
    
         }
      });
    }
    

    should fix it, also. post more information about your javascript. We just have to assume id and purl are filled out. Did you try debugging them (if this doesn’t work).

    Also, debug the URL that is requested, you can use firefox or chrome dev-tools for this. What url is being send to the PHP page and is it correct

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that generates images from text using PHP. It's working fine
I am working on a script that will process user uploads to the server,
I'm working on a python script that starts several processes and database connections. Every
I'm currently working on a jQuery script that will translate the site's text into
I'm working on a PHP script that runs a Python script on the server.
I'm working on a Python script that transforms this: foo bar Into this: [[Component
I am working on a comment script using PHP and jquery. My jquery post
I'm trying to write a PHP script that sends a POST request to a
I have a code that sends POST data to a PHP website. Code: request
I'm working on a script that needs to set up a Xerox Phaser printer

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.