PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
The code you posted there is actually almost the identical way I'm doing it.
Except instead of attached ?xmlrequest as a get, I'm adding it as a POST.
So:
[syntax="javascript"]
function startRequest(){
...
var postText = 'variable=data';
postText += 'javascript=yes';
xmlHttp.open("POST","bar.php",true);
xmlHttp.send(postText);
}
Except "bar.php" looks something like this:[/syntax]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Well maybe this is a personal preference of mine, but I say you use a session. If you want to use a post variable because it only lasts for one page, unset() the session variable when you're done with it.
Yeah, I was thinking about using a session, and I still may end up doing that. I was just afraid that it may not always work as well. That's what I will probably end up using, thanks for you help everyone!
I must be missing the point. Redirect? Session? What for?
The request tells you what the data is supposed to look like. Let the script render the data accordingly and you're done