wopopd83 Posted March 5, 2010 Share Posted March 5, 2010 I'm a newbie (4 months). I'm doing pretty good, however once in a while I need to do something real simple but can't seem to find the proper function to do it with. I'm simply trying to load a page eg. $active = $Zip_Rows['active']; if ($active==1){ what function do I put here to load example1.php }else { what function do I put here to load example2.php } It's always the simple things that get you!! Thanks for you freaks help! Link to comment https://forums.phpfreaks.com/topic/194203-how-do-i-load-a-page-using-a-php-function/ Share on other sites More sharing options...
trq Posted March 5, 2010 Share Posted March 5, 2010 include. Link to comment https://forums.phpfreaks.com/topic/194203-how-do-i-load-a-page-using-a-php-function/#findComment-1021764 Share on other sites More sharing options...
wopopd83 Posted March 5, 2010 Author Share Posted March 5, 2010 Duh...ok thanks a bunch for this simple resolution, it's common sense; don't know why I couldn't figure that out. Now that I have proved that works just fine, I have another question regarding loading a new page; I'm using 3 frames, how do I target another frame using include(example1.php)? Link to comment https://forums.phpfreaks.com/topic/194203-how-do-i-load-a-page-using-a-php-function/#findComment-1022058 Share on other sites More sharing options...
GingerRobot Posted March 5, 2010 Share Posted March 5, 2010 I'm using 3 frames, how do I target another frame using include(example1.php)? What are you trying to achieve? You want to (re)load a page in one frame, during which another frame's content is changed via a PHP include? You can't do that. I *guess* you could reload the page that defines the frameset with some parameters passed in the URL, but that's pretty messy (plus it requires all the frames to be re-loaded). Alternatively, you could use some javascript. Maybe if you explain what it is you're trying to do, we could suggest a better method. Link to comment https://forums.phpfreaks.com/topic/194203-how-do-i-load-a-page-using-a-php-function/#findComment-1022061 Share on other sites More sharing options...
wopopd83 Posted March 5, 2010 Author Share Posted March 5, 2010 Actually, my correction, it's more of a HTML thing I think...sorry. I had to go back and review what I was doing from last week. Basically I'm using a form in frame2 and on submit I load 3 calendars in frame3. At the same time I want to load a new page in frame2. But now that I look at it closer, I think your right; I need to use JSript "onclick" to load the new page in frame2. Anyway, sorry for wasting your time...next time I'll look deeper into what I'm doing before I post! Link to comment https://forums.phpfreaks.com/topic/194203-how-do-i-load-a-page-using-a-php-function/#findComment-1022081 Share on other sites More sharing options...
kavisiegel Posted March 5, 2010 Share Posted March 5, 2010 Is example1.php an actual php script, or is it a HTML file? If it's not a php script, you'd be much better off with echo file_get_contents('example1.php'); Link to comment https://forums.phpfreaks.com/topic/194203-how-do-i-load-a-page-using-a-php-function/#findComment-1022133 Share on other sites More sharing options...
ialsoagree Posted March 5, 2010 Share Posted March 5, 2010 Anyway, sorry for wasting your time...next time I'll look deeper into what I'm doing before I post! Sometimes it helps to have a push in the right direction, though! Yes, you do need to use javascript, PHP can't really fiddle around with existing frames since they're stateless client side. Link to comment https://forums.phpfreaks.com/topic/194203-how-do-i-load-a-page-using-a-php-function/#findComment-1022136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.