Solved

jQuery POST data to PHP

Posted on 2010-08-15
3
461 Views
Last Modified: 2013-11-08
I've got this code, but it's not correct since the parameters I'm posting aren't correctly yet.

var artistname = $("input#artistname").val();
            
            jQuery.post('get-albums.php',
            {parameterSentToServer1:'value', param2:'value2'},

I need the parameters replaced by the var artistname, I just can't figure it out.

In the PHP file it needs to be catched by: $artistname = trim($_POST['artistname']);

Someone help please
0
Comment
Question by:Serellyn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 33442537
You only need to send artistname as parameter :

jQuery.post('get-albums.php',
{"artistname":$("#artistname").val()},

Open in new window

0
 
LVL 1

Author Closing Comment

by:Serellyn
ID: 33442545
You did it, once again. Thank you my friend
0
 
LVL 82

Expert Comment

by:leakim971
ID: 33442551
You're very welcome! Thanks for the points!
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to size popup in jquery mobile 4 63
Make New Browser Window Fully Functional 7 36
close window in firefox 3 38
Angular - difference between these 2 codes 3 16
What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question