Click here to Skip to main content
11,796,631 members (73,157 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: PHP Ajax
echo '<head>
			<script type="text/javascript">
			function Application'.$col1.'() {
					url: "?page=acp_apps_check",
					type: "post",
					data: {capp:'.$col1.'},
					success: function(){

When its called, it says in alert 'a' but dosen't forward or when checked the 'capp' is not defined.
Posted 10-May-13 1:25am
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. :-)
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.
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.
Killzone DeathMan at 17-May-13 12:08pm
My post works very good:

type: "POST",
dataType: "json",
url: 'ws.php',
data: {'action': 'myaction', 'some': 'blablabla'}
alert('post ok');
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 Maciej Los 505
1 Abhinav S 417
2 OriginalGriff 360
3 CPallini 285
4 KrunalRohit 249
0 OriginalGriff 2,012
1 Maciej Los 1,725
2 KrunalRohit 1,310
3 CPallini 1,055
4 ppolymorphe 858

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2015
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