fareedreg Posted December 22, 2009 Share Posted December 22, 2009 how to call 2nd.php from 1st.php (along with variable ID) and get back value of 2nd.php variables in 1st.php.. Link to comment https://forums.phpfreaks.com/topic/186012-call-php/ Share on other sites More sharing options...
anthylon Posted December 22, 2009 Share Posted December 22, 2009 You may use few directives. Depends what you want achieve try with: require_once("2nd.php"); From that point you may call/use variables and functions from 2nd.php as your local - depends of range. It acts like you have code from both scripts executing in one single file. Cheers! Link to comment https://forums.phpfreaks.com/topic/186012-call-php/#findComment-982242 Share on other sites More sharing options...
oni-kun Posted December 22, 2009 Share Posted December 22, 2009 Do you know how to use GET/POST? You can send them to "page2.php?id=1&form=submitted" On page2.php, $_GET['id'] and $_GET['form'] will be passed there (as it's in the url) POST does not change the url, but it's a bit more complex if you don't know how to use forms/headers. Link to comment https://forums.phpfreaks.com/topic/186012-call-php/#findComment-982245 Share on other sites More sharing options...
Deoctor Posted December 22, 2009 Share Posted December 22, 2009 u can use the function like this echo ("<br><a href = 'index.php?<variable>=<string>'>$name_re</a>"); example echo ("<br><a href = 'index.php?rss=$url'>$name_re</a>"); Link to comment https://forums.phpfreaks.com/topic/186012-call-php/#findComment-982246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.