Artemis Posted November 11, 2011 Share Posted November 11, 2011 Hi, this is a general question based on the user registration scripts found in the back of this book. I was trying to create a single page which could call login.php and registration.php via includes() at the beginning of index.php; and then have two areas on a single page where the user could either sign up and be taken to the activation page, or where the user could login and be taken to the backend. Is there a way to do this on a single page without having to cut and paste the entirety of the two scripts (login and registration) into index.php? Is this how includes() can be used? Any advice would be welcome and appreciated. Link to comment Share on other sites More sharing options...
Larry Posted November 11, 2011 Share Posted November 11, 2011 Yes, absolutely. In fact, I demonstrate exactly that in my PHP 5 Advanced book, Chapter 2. Just modify the login and registration scripts so they're meant to be included (i.e., they wouldn't include the HTML header and footer, the configuration file, or the database file), then add logic to index.php to decide which file to include and where in the script (so the output works properly). Link to comment Share on other sites More sharing options...
Recommended Posts