ardyandkari Posted July 18, 2007 Share Posted July 18, 2007 hello. i was wondering how a php page calls pages to itself... what i mean is this: i have a contact form. when i submit information to the form, i basically want a new page to be up, but the page should still be contact.php. i have seen it done in shopping carts and stuff...now i want to figure it out to use on my site. does it have something to do with includes or something? thanks a lot. ardy Quote Link to comment https://forums.phpfreaks.com/topic/60556-calling-pages/ Share on other sites More sharing options...
per1os Posted July 18, 2007 Share Posted July 18, 2007 www.php.net/include www.php.net/require Quote Link to comment https://forums.phpfreaks.com/topic/60556-calling-pages/#findComment-301241 Share on other sites More sharing options...
lewis987 Posted July 18, 2007 Share Posted July 18, 2007 try this: <?PHP if($_GET['act'] == 'next'){ include 'xxxx.php'; // or use code... } else { include 'xxxx.php'; // or use code... } ?> Quote Link to comment https://forums.phpfreaks.com/topic/60556-calling-pages/#findComment-301243 Share on other sites More sharing options...
king arthur Posted July 18, 2007 Share Posted July 18, 2007 You can get the same page to behave differently depending on if the form has already been submitted or not. When a form is submitted by POST method for example, there will be $_POST variables containing the values from the form fields. So you can check to see if these exist. if(isset($_POST["your_form_field_name"])) { .....do something with the submitted form values... } else { ....output the form as it has not yet been submitted... } Quote Link to comment https://forums.phpfreaks.com/topic/60556-calling-pages/#findComment-301253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.