Be a Supporter!

post/get javascript -> php

  • 222 Views
  • 2 Replies
New Topic Respond to this Topic
gumOnShoe
gumOnShoe
  • Member since: May. 29, 2004
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
post/get javascript -> php 2011-09-11 18:07:23 Reply

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);

Newgrounds Anthology? 20,000 Word Max. [Submit]

Music? Click Sig:

BBS Signature
citricsquid
citricsquid
  • Member since: Jun. 25, 2005
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to post/get javascript -> php 2011-09-11 18:45:00 Reply

[ 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.
Forum Stats
Member
Level 15
Blank Slate
Response to post/get javascript -> php 2011-09-11 19:03:02 Reply

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.


Newgrounds Anthology? 20,000 Word Max. [Submit]

Music? Click Sig:

BBS Signature