Solved

jQuery POST data to PHP

Posted on 2010-08-15
3
460 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
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP get fieds value 2 20
window close link 7 32
Put POST values into cookies. 14 29
using jQuery hide all table rows where the column value is exactly 20 4 12
Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
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…

685 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