sending and receiving data on php
# May 16, 2013 at 8:34 am
I believe the best way to accomplish this is with AJAX.
Data is entered into the form and on clicking submit, instead of being taken to login.php, data is sent to login.php behind the scenes, the data is processed and returned to index.php as you wish, all seemingly in an instant without leaving index.php# May 16, 2013 at 8:47 am
I think AJAX would be a good solution too. I don’t see why you’re not just posting to index.php, check if there is $_POST data and if there is, include login.php to handle that data.
If you really want to post to login.php without using AJAX you could use session variables to set the return value/errors and redirect to index.php using the header. Then in index.php read those session variables.# May 16, 2013 at 9:17 am
> I believe the best way to accomplish this is with AJAX.
well i havnt used ajax yet so i dont know the method of using it….
@crocodillion i succesfully did it using $_SESSION variables but i wanted to know just one more thing that can i send those errors which initially i am echoing thru $_SESSION variable
You must be logged in to reply to this topic.