Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP Ajax
echo '<head>
			<script type="text/javascript">
			function Application'.$col1.'() {
				$.ajax({
					url: "?page=acp_apps_check",
					type: "post",
					data: {capp:'.$col1.'},
					success: function(){
						alert("a");
					}
				});
			}
			</script>
			</html></head>';
 
When its called, it says in alert 'a' but dosen't forward or when checked the 'capp' is not defined.
Posted 10-May-13 2:25am
Comments
ryanb31 at 10-May-13 8:02am
   
Can you be more clear? So, it IS hitting your success function? However, I have never used a url the way you are, relative, so I don't know if that works. Have you tried the full URL?
NextGenDeveloper at 10-May-13 9:28am
   
It is hitting the success function, and I tried the full URL thingy, dosen't work.
ryanb31 at 10-May-13 9:35am
   
So, it is hitting your page. It sounds like you need to debug that.
Oso Oluwafemi Ebenezer at 10-May-13 8:32am
   
It might not be from the AJAX part. It might be from the way you are handling the sent data at the server-side!
NextGenDeveloper at 10-May-13 9:28am
   
I didn't understand what you were trying to say ..
Oso Oluwafemi Ebenezer at 10-May-13 10:10am
   
First ensure you are actually sending the right data. Second, ensure you are sending it to the right URL, that "?page=acp_apps_check" looks suspicious to me (am not saying it is wrong) why not use "xxx.php?page=acp_apps_check" so as to know exactly where you are sending to
Sergey Alexandrovich Kryukov at 10-May-13 9:30am
   
You own words just tells us that it does send the POST. :-)
—SA
NextGenDeveloper at 10-May-13 9:44am
   
Yeah, but why.
type: "post", ~ meaning it should send post. But its not ...
Oso Oluwafemi Ebenezer at 10-May-13 10:12am
   
Are you saying you are getting it as a GET instead of a POST?
Sergey Alexandrovich Kryukov at 10-May-13 11:08am
   
Apparently, it does, it can be seen from your own words. Let's say, it does, but by some reason you fail to recognize it. Let's start from this point.
—SA
NextGenDeveloper at 11-May-13 3:36am
   
How can it seen by my own words that it works? When it dosent.
Its not sending POST, Its not redirecting the only thing that works is the message.
I tried to GET, POST with my own redirect towards the next page, dosen't work. Returns that its not setted.
Sergey Alexandrovich Kryukov at 11-May-13 23:06pm
   
If says "alert" on success, according to your words. It means the POST was successful.
—SA
Killzone DeathMan at 17-May-13 12:08pm
   
My post works very good:
 
$.ajax({
type: "POST",
dataType: "json",
url: 'ws.php',
data: {'action': 'myaction', 'some': 'blablabla'}
}).done(function(response){
alert('post ok');
}).error(function(err){
alert('Error: ' + err);
});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 275
1 Maciej Los 230
2 Sergey Alexandrovich Kryukov 185
3 Afzaal Ahmad Zeeshan 152
4 ProgramFOX 130
0 OriginalGriff 6,524
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,218
3 Manas Bhardwaj 4,657
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100