Jump to content

Clearing $_GET or $_POST data


supertrucker

Recommended Posts

Is there a way to remove $_GET or $_POST elements? I.e., I have a chat room that I wrote that is setup to auto refresh (it's for mobile). If a user uses the form to send some text to the room, then every time after that, that the page refreshes, it resends the chat text. Is there a way to clear out say a single element from the $_GET or $_POST so that it won't do this?Thanks,ST

Link to comment
Share on other sites

What you should do is to have one page to receive the sent messages and a separate page to display them. This way, the page that's refreshing the one is not the page that's obtaining the data.What would be best would be to use AJAX to call the PHP applications and receive the information.

Link to comment
Share on other sites

What you should do is to have one page to receive the sent messages and a separate page to display them. This way, the page that's refreshing the one is not the page that's obtaining the data.
Ok, I didn't want to have to do that, but I broke down and did it, and then just used header() to shove them back into the "chat room".
What would be best would be to use AJAX to call the PHP applications and receive the information.
What's AJAX?Thanks for the advice,ST
Link to comment
Share on other sites

AJAX is a method using Javascript to make an HTTP request to another page on the server after the page has loaded. In other words, running PHP whenever you want to.If you did the chatroom with AJAX, you would send the information to one page, and you would call the other page to retrieve the information every X seconds using setTimeout() or setInterval()W3Schools' AJAX Tutorial

Link to comment
Share on other sites

AJAX is a method using Javascript to make an HTTP request to another page on the server after the page has loaded. In other words, running PHP whenever you want to.If you did the chatroom with AJAX, you would send the information to one page, and you would call the other page to retrieve the information every X seconds using setTimeout() or setInterval()W3Schools' AJAX Tutorial
Gotcha. Sadly, the platform is aimed at mobiles, most of which suffer from JavaScript envy, so it wouldn't be a viable method as those that do support it, almost all support a different version of it... One of these days all mobiles will use the same JavaScript that is used on PC's, I hope!
Link to comment
Share on other sites

Didn't we had this conversation already?I'm starting to wonder why didn't you asked there. AJAX is a technique which refers to using JavaScript to send HTTP requests.I already told you the best algoritm in that other topic. Read the AJAX and JavaScript tutorials on W3Schools for more info.(I'd give a link, but the site seems to be overloaded right now, it first barely loaded, now it doesn't load at all)There's no way to make a flawless chat on mobile phones. The least flawed method is the one I described to you there.

Link to comment
Share on other sites

Didn't we had this conversation already?I'm starting to wonder why didn't you asked there. AJAX is a technique which refers to using JavaScript to send HTTP requests.I already told you the best algoritm in that other topic. Read the AJAX and JavaScript tutorials on W3Schools for more info.(I'd give a link, but the site seems to be overloaded right now, it first barely loaded, now it doesn't load at all)There's no way to make a flawless chat on mobile phones. The least flawed method is the one I described to you there.
We probably did, sorry!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...