PHP does not work like Javascript. For Javascript as long as the user has the page open you can modify variables. But for PHP once it has run it terminates and to run it again (like for an AJAX request) it has to reinitialize everything. PHP runs on request and then ends.
If you wish to change that variable you would have to use PHP to edit the file, which is bad technique. This is why databases are used so you can store, change and then retrieve informtaion. Also you could use sessions to temporarily store a value while the user is on the page, but Javascript can do this also. The other option is to use a cookie to store the value then it would be available to just that one user across multiple sessions. But if you need that value to change and be available to multiple users you should use a database.
Is it possible to "activate" or redirect to a php page which will change the variable once the javascript function is done?
Or better question... how can I change the php membership variable based on the success of the credit card transaction?
And how would I go about using a database to change the variable? I know the membership package installed uses a database which was created.... but accessing that, or changing that is something I am very limited in.
Sorry for all the questions.... This is the last thing I have to do before I get paid for the site!!!! And its the only thing I can't seem to complete.
How about after they click Ok, javascript redirects them to a php page which changes the varaible onload... and the php page is protected by the membership level? Would that work?
Bookmarks