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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:25:00+00:00 2026-05-24T22:25:00+00:00

HI im trying to send a jquery post/ajax to send some variables to a

  • 0

HI im trying to send a jquery post/ajax to send some variables to a php file.

<script src="/jquery.js"></script>
<script type="text/javascript">

var music ='';
var genre ='';
var language ='';
var nasheedid = "<? echo $postid; ?>";
var session = "<? echo $_SESSION['SESS_TMP']; ?>";

$(function(){
$('.submit').click(function(){
var postdata = {pmusic: music, pgenre: genre, plang: language, psession: session};

$.ajax({
type: 'post',
cache: false,
url: 'addmusic.php',
data: postdata,
success: function (msg) {
alert(msg);
},
dataType: "text",
});

}); 
});   

now regardless of where i post the stuff to, (even if i change the url to url: blahblah.php123 I still get the same results (which is):

The alert displays the entire source code of the file (that the above code is on)

  • 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-24T22:25:01+00:00Added an answer on May 24, 2026 at 10:25 pm

    thanks guys i fixed the problem myself. My server was using rewrite so i had to use url: "/addmusic.php" instead of url: "addmusic.php".

    • 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 very simple data to a php file using jquery
I am trying to send 2 variables in a JQuery Ajax call, but for
I am trying to send a form to a PHP file via jQuery. The
I'm trying to send some data via JQuery ajax to a grails controller Here's
I am trying to send a php script some content to be stored in
I am trying to send an extra $php_var with jQuery to an Ajax post
I'm trying to send a form to a PHP using $.ajax in jQuery .
I am trying to get send json from my javascript (using jquery post) to
I'm trying to send an ajax request using jquery. From the tutorial, I try
I am trying to submit data using Jquery AJAX (using the following script) and

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.