fluidsharp Posted December 22, 2009 Share Posted December 22, 2009 Hello. How I can involve immediately for execute other php-file from main php-file by condition. I've tried to use require() and include() but they just share variable. And looked at forum but didn't find solution, or didn't understand ). Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/186003-involve-other-php-file-by-condition/ Share on other sites More sharing options...
Deoctor Posted December 22, 2009 Share Posted December 22, 2009 the php files which u are including will do any action on the variables that u are having from the main.php file Link to comment https://forums.phpfreaks.com/topic/186003-involve-other-php-file-by-condition/#findComment-982212 Share on other sites More sharing options...
ChemicalBliss Posted December 22, 2009 Share Posted December 22, 2009 Also, you need to state what "conditions" you require beofre including the file, give us some info on what you are trying to do . -CB- Link to comment https://forums.phpfreaks.com/topic/186003-involve-other-php-file-by-condition/#findComment-982213 Share on other sites More sharing options...
fluidsharp Posted December 22, 2009 Author Share Posted December 22, 2009 I've found way, i've changed rules and involve those files from form and use POST, and conditions (if-else) is in involved file. sorry for distraction but yours reply set thinking me. Thanks. ps. go to next step... Link to comment https://forums.phpfreaks.com/topic/186003-involve-other-php-file-by-condition/#findComment-982223 Share on other sites More sharing options...
ChemicalBliss Posted December 22, 2009 Share Posted December 22, 2009 I'm glad you found your solution . Just a note on security; Never do this: <?php include($_POST['filename']); ?> Instead do this: <?php Switch($_POST['filename']){ default: include('index.php'); break; case 'file1': Include('path/to/file1.php'); break; } ?> I'm sure you will understand why -CB- Link to comment https://forums.phpfreaks.com/topic/186003-involve-other-php-file-by-condition/#findComment-982250 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.