Click here to Skip to main content
15,885,767 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Dialog auto-resize Pin
Rockstar_7-Oct-12 21:01
professionalRockstar_7-Oct-12 21:01 
GeneralRe: Dialog auto-resize Pin
awedaonline12-Oct-12 1:12
awedaonline12-Oct-12 1:12 
QuestionMultilingual webpage Pin
Akash Patel25-Sep-12 6:27
Akash Patel25-Sep-12 6:27 
AnswerRe: Multilingual webpage Pin
Andrei Straut25-Sep-12 6:58
Andrei Straut25-Sep-12 6:58 
AnswerRe: Multilingual webpage Pin
Mighty Raju27-Sep-12 2:55
Mighty Raju27-Sep-12 2:55 
QuestionModifying accept header with IE9 and above Pin
Rajesh R Subramanian25-Sep-12 0:41
professionalRajesh R Subramanian25-Sep-12 0:41 
Questionvariable element id Pin
safa223-Sep-12 20:29
safa223-Sep-12 20:29 
AnswerRe: variable element id Pin
Andrei Straut24-Sep-12 20:25
Andrei Straut24-Sep-12 20:25 
Not taking into consideration the issues in your code (lack of prepared statements, hardcoded DB connection values, etc.) you should do the following. I also you suggest you use jQuery instead of plain JS, it makes working asynchronously much easier and shorter:

Taking the id of an element using jQuery is pretty easy and straightforward,
you use the bind() function:
JavaScript
$('#button_id').bind('click', function(event) {
    //Logic that triggers when the button is clicked
});

Then you submit your request to the server, also using jQuery:
JavaScript
$.ajax({
	type: 'GET' //GET or POST, depending on what you want to do
	url: 'the_link_to_your_script.php',
	data: {
            request_param1_name: request_param1_value,
            request_param2_name: request_param2_value,
	},
	success: function(data) {
            /*Your request was a success, you should have your data available in the 'data' variable*/
	},
	error: function(data) {
            /*Your request failed, treat it properly*/
	}
);

Further reading you can find for bind()[^] and ajax()[^]

I also suggest you take a look at PHP prepared statements[^]
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.

GeneralRe: variable element id Pin
safa226-Sep-12 4:35
safa226-Sep-12 4:35 
GeneralRe: variable element id Pin
Andrei Straut26-Sep-12 6:12
Andrei Straut26-Sep-12 6:12 
AnswerRe: variable element id Pin
Sebastiaan Meijerink30-Oct-12 4:08
professionalSebastiaan Meijerink30-Oct-12 4:08 
QuestionGet webcam capture Pin
Killzone DeathMan21-Sep-12 1:16
Killzone DeathMan21-Sep-12 1:16 
AnswerRe: Get webcam capture Pin
Joan M22-Sep-12 1:31
professionalJoan M22-Sep-12 1:31 
GeneralRe: Get webcam capture Pin
Killzone DeathMan22-Sep-12 11:10
Killzone DeathMan22-Sep-12 11:10 
QuestionHUGE Web Service Performance Issue Pin
Jammer21-Sep-12 0:53
Jammer21-Sep-12 0:53 
AnswerRe: HUGE Web Service Performance Issue Pin
jkirkerx21-Sep-12 11:04
professionaljkirkerx21-Sep-12 11:04 
GeneralRe: HUGE Web Service Performance Issue Pin
Mohibur Rashid22-Sep-12 3:00
professionalMohibur Rashid22-Sep-12 3:00 
GeneralRe: HUGE Web Service Performance Issue Pin
jkirkerx22-Sep-12 8:35
professionaljkirkerx22-Sep-12 8:35 
GeneralRe: HUGE Web Service Performance Issue Pin
manak chand22-Oct-12 0:24
manak chand22-Oct-12 0:24 
SuggestionStore the history of links the user visits of any browser Pin
Rockstar_19-Sep-12 18:21
professionalRockstar_19-Sep-12 18:21 
GeneralRe: Store the history of links the user visits of any browser Pin
Andrei Straut19-Sep-12 21:09
Andrei Straut19-Sep-12 21:09 
GeneralRe: Store the history of links the user visits of any browser Pin
Zamshed Farhan12-Jan-13 15:31
Zamshed Farhan12-Jan-13 15:31 
Questionsocket read on a keep alive request waits until connection timeout Pin
Jayapal Chandran17-Sep-12 4:50
Jayapal Chandran17-Sep-12 4:50 
QuestionPHP Pin
dashing_z14-Sep-12 14:23
dashing_z14-Sep-12 14:23 
AnswerRe: PHP Pin
M-Badger14-Sep-12 20:43
M-Badger14-Sep-12 20:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.