gwolgamott Posted February 16, 2010 Share Posted February 16, 2010 I have a log script that at every page that displays content according to logged user... Now what would you consider being the proper or best method to get the current php page you are working with. For curiosity sake, since I've in the past have used javascript, sessions with php, cookie tags, and various other methods even creating/using/modifing functions for the entire url address. This is the scenario say have the below form we would want to pass it to the $my_last_page variable. This form would be created dynamically through includes or requires when a page views a user is not logged in send them to a created the login page, but what we want is the action to actually go right back to page that called this page creation if the login was successful with a macro or something displaying they are logged in.... etc... etc... you get the drift. Just looking for opinions. form action="<?php echo $my_last_page; ?>" method="post"> Link to comment https://forums.phpfreaks.com/topic/192275-what-is-the-standard-or-proper-method-for-getting-the-current-page/ Share on other sites More sharing options...
aeroswat Posted February 16, 2010 Share Posted February 16, 2010 I have a log script that at every page that displays content according to logged user... Now what would you consider being the proper or best method to get the current php page you are working with. For curiosity sake, since I've in the past have used javascript, sessions with php, cookie tags, and various other methods even creating/using/modifing functions for the entire url address. This is the scenario say have the below form we would want to pass it to the $my_last_page variable. This form would be created dynamically through includes or requires when a page views a user is not logged in send them to a created the login page, but what we want is the action to actually go right back to page that called this page creation if the login was successful with a macro or something displaying they are logged in.... etc... etc... you get the drift. Just looking for opinions. form action="<?php echo $my_last_page; ?>" method="post"> You could just put everything on one page and set the action to itself. Have it display whatever part you need it to display based on whatever variable you choose. Display the initial form from the start and if some error happens display the 2nd form. Then clear the error and send the POST back to the same page. Would be the best way to do it in my opinion Link to comment https://forums.phpfreaks.com/topic/192275-what-is-the-standard-or-proper-method-for-getting-the-current-page/#findComment-1013235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.