post/get javascript -> php
- gumOnShoe
-
gumOnShoe
- Member since: May. 29, 2004
- Offline.
-
- Send Private Message
- Browse All Posts (15,244)
- Block
-
- Forum Stats
- Member
- Level 15
- Blank Slate
I'm attempting to pass variables to a PHP file using javascript. Its a basic log in function. I know I'm not getting a 404 because my error reporting comes back, but when, in PHP I check for
$_GET("username")
, nothing comes up. I checked post too just to be sure. Clearly I'm doing something wrong here. Thoughts?
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "myAccepter.php", true);
xmlhttp.send("username=" + uName + "&pass=" + pWord); - citricsquid
-
citricsquid
- Member since: Jun. 25, 2005
- Offline.
-
- Send Private Message
- Browse All Posts (18,412)
- Block
-
- Forum Stats
- Member
- Level 23
- Blank Slate
[ not (
$_GET['username'];
enable PHP errors (have it set to report all during local development) as it would have caught this.
- gumOnShoe
-
gumOnShoe
- Member since: May. 29, 2004
- Offline.
-
- Send Private Message
- Browse All Posts (15,244)
- Block
-
- Forum Stats
- Member
- Level 15
- Blank Slate
At 9/11/11 06:45 PM, citricsquid wrote: [ not (
$_GET['username'];
enable PHP errors (have it set to report all during local development) as it would have caught this.
I typed it up wrong here. It turned out to be something completely different. I must have had a type somewhere after re-writing it over and over again I must have just done it right. I move back to using ?, found it the vars in the $_GET[] array and went from there.
Thanks for the help, though.
Web programming is soooo messy. Ugh.


