CRCameron Posted August 9, 2007 Share Posted August 9, 2007 Here is the problem...i have a game where a users id and encrypted password are stored in the address bar on every page of the game. e.g. main.php?P=bank&uid=15&password=faspmi9r329m2d324sd now i have a problem when trying to link to a page through a form while still keeping these variables in the link to be more specific i have a form for a user to deposit gold into their bank upon entering a value in the input box and clicking either deposit or withdraw the form is to reload the same page where the proper if(isset($_POST command will take over and do the correct job. The only problem is if i use a $_SERVER['PHP_SELF'] as the action for the form when it reads back on its self again it doesnt include the uid or password...it simply is reloading main.php ...my question is.... how do i get these variables sent back through the form button so the page will reload with the users information still there? Quote Link to comment https://forums.phpfreaks.com/topic/64107-form-problemsgetting-data-from-address-bar-into-form-action/ Share on other sites More sharing options...
lemmin Posted August 9, 2007 Share Posted August 9, 2007 $_SERVER['PHP_SELF'] . "uid=" . $_GET['uid'] . "&password=" . $_GET['password'] I would strongly recommend against using the GET for login information. You could use a session and you wouldn't need to pass it every time. Quote Link to comment https://forums.phpfreaks.com/topic/64107-form-problemsgetting-data-from-address-bar-into-form-action/#findComment-319492 Share on other sites More sharing options...
CRCameron Posted August 9, 2007 Author Share Posted August 9, 2007 thanks for the help...that worked great. for the way the game is going to work it has to be sent through GET...i have made it very secure though...any attempt to change anything in the address bar and you will be logged out. Quote Link to comment https://forums.phpfreaks.com/topic/64107-form-problemsgetting-data-from-address-bar-into-form-action/#findComment-319500 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.