Including other PHP files in PHP script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

Including other PHP files in PHP script

Post by fresh »

Hey,

looking for a confirmation. I would like to break down my login page, via include, so would it work like this:

Before:

Code: Select all

<?php
phpcodephpcode { //1st.php
phpcodephpcode
phpcodephpcode
}
phpcodephpcode{ //2nd.php
phpcodephpcode
phpcodephpcode
}
?>
After:

Code: Select all

<?php
include("1st.php");

include("2nd.php");
?>

just don't want to go threw what I did last night... :) I changed a few things and the whole thing went nuts... lol

thanks in advance
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Yep that will work fine...just copy..paste..and save!
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

great

Post by fresh »

thanks ;)
Post Reply