raydenl Posted March 7, 2007 Share Posted March 7, 2007 Hi, I have am in the process of creating a PHP shopping cart admin site for our custome Flash based e-commerce website. I have found this demo admin site that I am using to give me ideas: Username:admin, Password:admin http://www.cartweaver.com/demos/php/basic/cw2/Admin/AdminHome.php I am wondering how they do their POSTBACKS. For instance if you go to their: Store Settings -> Admin Users, and add a new user then click the back button you go back to the page before the Admin Users page... it's as if the page didn't refresh... but it did... I've looked at the HTML and the Add button definately does a "submit". When ever I try this after I have submited, if I click the back button I end up at the same page... which is what I would expect. Any ideas on what's going on with their code??? Quote Link to comment Share on other sites More sharing options...
flappy_warbucks Posted March 7, 2007 Share Posted March 7, 2007 Any ideas on what's going on with their code??? Why dont you read and study the code to find out? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 7, 2007 Share Posted March 7, 2007 I don't get what you mean, it just adds a user and then renders the table afterwards. Quote Link to comment Share on other sites More sharing options...
raydenl Posted March 7, 2007 Author Share Posted March 7, 2007 Ummmm... PHP's a server side language... and I don't think they would be too happy to give me their source code... I have studied the HTML and they use a "submit" button with a form action equal to the name of the page, i.e. it's just doing a POSTBACK... which is exactly what I am doing Quote Link to comment Share on other sites More sharing options...
trq Posted March 7, 2007 Share Posted March 7, 2007 I don't see what your talking about, can you be clearer in your description? Quote Link to comment Share on other sites More sharing options...
raydenl Posted March 7, 2007 Author Share Posted March 7, 2007 Yeah it renders the table by refreshing the page right... so you would expect the back button to take you back to the same page before the refresh... which is what my code does... but if you click the back button on theirs it takes you to the page you were on before 'Admin User' Quote Link to comment Share on other sites More sharing options...
raydenl Posted March 7, 2007 Author Share Posted March 7, 2007 This is as clear as I can be: 1) Go to the site: http://www.cartweaver.com/demos/php/basic/cw2/Admin/AdminHome.php 2) Enter username: admin, password: admin 3) Go to Store Settings -> Admin Users 4) Add a new user 5) Click "ADD" 6) Table renders, now Click your browser back button 7) You will now be at "Admin Home", not "Admin Users" My problem is: with my code, when I click the back button after adding a user I end up back at "Admin Users" with blank fields. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted March 7, 2007 Share Posted March 7, 2007 My problem is: with my code, when I click the back button after adding a user I end up back at "Admin Users" with blank fields. that's because of the way your browser handling 'post data'. Quote Link to comment Share on other sites More sharing options...
Snooble Posted March 7, 2007 Share Posted March 7, 2007 which browser are you using, i'm assuming firefox. (form post issue) An option would be to use javascript to send back the page. (Twice if nes) Snooble Quote Link to comment Share on other sites More sharing options...
suzzane2020 Posted March 7, 2007 Share Posted March 7, 2007 yeah n if u notice..when u insert users more tham once and then click back..it goes back to the same page Quote Link to comment Share on other sites More sharing options...
Snooble Posted March 7, 2007 Share Posted March 7, 2007 well you could look at the referrer. If it refers from: THESE PAGES header etc. Would work. Snooble Quote Link to comment Share on other sites More sharing options...
raydenl Posted March 7, 2007 Author Share Posted March 7, 2007 Not sure what you mean by looking at the referrer? Internet Explorer/Firefox doesn't seem to make any difference, same behaviour. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 7, 2007 Share Posted March 7, 2007 Not sure what you mean by looking at the referrer? The referrer means the page from which you were directed to another page. At least in this context. It is the page that referred you to it. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted March 8, 2007 Share Posted March 8, 2007 When you add the new user, it doesn't seem to be submitting the form to a new page, the current page is just altered with javascript. Therefore you have the same problem as with many ajax applications - it breaks the back button. I checked out their javascript files and they have some very dense looking code there - probably mostly for controlling the drop down menu on the left but it also probably captures the form submit event and just js processes it. Quote Link to comment 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.