if statment between 2 pages

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
nite4000
Forum Contributor
Posts: 209
Joined: Sun Apr 12, 2009 11:31 am

if statment between 2 pages

Post by nite4000 »

i know this is going to be hard to understand but please be patient with me.

I have this if statement I will give example

Code: Select all


<?php if($settings['field']=='TRUE') { ?>

SHOW THIS
<?php 
} else { ?>
SHOW THIS
<?php } ?>


Now that is on page1.php

what i need to do is make a new page and put that on a page by itself

so on page1.php i would do a include pgwiif.php

but that closeing bracket of the if needs to be on page1.php while the rest is on the other page how can i do this without getting an error


hope this makes since.

Thanks
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: if statment between 2 pages

Post by Eric! »

PHP code can't execute across multiple page requests as one script. Why don't you tell us why you need to do this on two pages? Perhaps there is an easier way to do what you want.
nite4000
Forum Contributor
Posts: 209
Joined: Sun Apr 12, 2009 11:31 am

Re: if statment between 2 pages

Post by nite4000 »

well this is code that has to be on all pages and i was trying to make it easier on myself without haveing to type so much code
Post Reply