Auto return and refresh pages
I have seen a site developed in PHP where the user can view their member details, and if they wish to update any info, click on a 'update details' link which opens a form in a pop-up window. When the user updates the info and clicks submit in the new window, the info is updated, the pop-up window closes and the original window then re-loads to display the updated member info.
This is not very hard to do. Do you have experience with PHP and SQL? If you have a solid understanding of both, we can guide you through the rest.
JayM, yeah, i have a pretty good understanding of both PHP and MySQL. I am keen to hear how it can be done!
When the user clicks 'Update Info', what you do is query the SQL database with a SELECT clause, selecting the fields that you want to allow the user to edit, and assign the value of each field to a variable.
You then display your form, with each field value displayed in the text boxes (assuming you will have them displayed in text boxes).
Ex: <input type="text" value="<?php echo $variable_name ?>">
The user can then change the values displayed in the form.
Once the form is submitted, you have to query the database with the UPDATE caluse.
Ex: UPDATE table_name SET age = 12 WHERE member_id = 02
Hopefully this should get you started. If you need any more clarification let me know.
Thanks but I really don't have a problem with updating the information. What you wrote is all pretty straight forward for me. The problem im having is knowing how to automatically refresh a page when the user returns to it. I'll clarify the process so you know what i'm trying to do.
Now, here's the bit I am uncertain about. Once the record has been updated, the pop-up window automatically closes, returning the user to the main browser window, which then automatically refreshes displaying the updated information. I guess the real question is how does the pop-up window automatically close, and how does the original browser window know that the user has returned to it and subsequently refresh in order to display the up-to-date info?
I was buying concert tickets online the other day from http://www.princebandroom.com.au and their site worked just like this when I updated my contact details and I thought it would be nice to replicate that for my site.
I hope i've been clear describing this. I'm not even sure if it is PHP that is able to control this but I'd appreciate any ideas you have.
Last edited by Cowboy Killer; 12-17-2006 at 07:45 PM.
you can use the meta refresh tag..to refresh the page every 600 seconds
<meta http-equiv="refresh" content="600">
Thanks aussie girl. I know about this option, however, i don't want to refresh after a specified amount of time, only when the pop-up window closes because thats the only time any information has been changed.
good day friend...,
I think you need a conditional loop, after the submit button you have to close your pop up window and loop to start.
I have discovered what is needed here... I have created a conditional loop and provided it all checks out, i need to run the following:
This closes the pop-up window and refreshes the parent window automatically!
Hey, thanks for all your help!
you are welcome friend...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)