tags:

views:

98

answers:

2

hello I develope one small project(finance online game),I`m student and I have not much work experience, therefor I need your advise.
In my home.php file player seeing his estates(money,credit,factories,...). Player can take an credit .For it he must click "take credit" button and after that open new window(credit.php) .In credit.php user can see available money and he must to write count of money.After closing window I want that user automativcally show his new credit. How can I support this. Thanx

+1  A: 

you have the option of either using javascript and on close of credit.php, reload home.php. Or in home.php you can use ajax to check every few seconds for an update to the credit value and if it changes, change it on screen. I would suggest using ajax because it shouldn't require the entire page to be reloaded to update one element and this is one thing that ajax does well.

Jonathan Kuhn
A: 

It sounds like you're trying to have two pages in your web-based game: a summary of holdings (home.php) and make a purchase (credit.php). Since it sounds like this is your first project, why not keep it simple and just keep everything in one window? Put a link to credit.php on home.php and then when the user submits credit.php, you can redirect back to home.php with all the new data displayed.

If you're determined to have more than one window, then you should look into AJAX toolkits like jQuery.

Don Kirkby