Jump to content
Larry Ullman's Book Forums

Simple Query About Includes() Function In Relation To Login Script


Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...