Chrisj Posted July 10, 2009 Share Posted July 10, 2009 I have header and footer showing on most web pages, but not this one added later. I tried copying a few lines from another page that HAS the header and footer appearing, but got many errors which I've listed below. (The page code shown below I've extracted some lines of private data) Any help with trying to add header and footer to it will be appreciated. Working page without header/footer: <?php // Get Details $amount = $_POST['valu']; $credits = $_POST['cre']; $user_id = $_POST['uid']; $item_name = $_POST['itnm']; // Include the paypal library include_once ('Paypal.php'); // Create an instance of the paypal library $myPaypal = new Paypal(); // Specify your paypal email // Specify the url where paypal will send the user on success/failure // Specify the url where paypal will send the IPN // Specify the product information $myPaypal->addField('item_name', $item_name); $myPaypal->addField('amount', $amount); $myPaypal->addField('item_number', $credits); // Specify any custom value $myPaypal->addField('custom', $user_id); // Enable test mode if needed ///$myPaypal->enableTestMode(); // Go $myPaypal->submitPayment(); Added some lines from other page that has header/footer as an attempt, but got errors: <?php (include_once ('classes/config.php'); (include_once ('classes/sessions.php'); // Get Details $amount = $_POST['valu']; $credits = $_POST['cre']; $user_id = $_POST['uid']; $item_name = $_POST['itnm']; // Include the paypal library include_once ('Paypal.php'); // Create an instance of the paypal library $myPaypal = new Paypal(); // Specify your paypal email // Specify the url where paypal will send the user on success/failure // Specify the url where paypal will send the IPN // Specify the product information $myPaypal->addField('item_name', $item_name); $myPaypal->addField('amount', $amount); $myPaypal->addField('item_number', $credits); // Specify any custom value $myPaypal->addField('custom', $user_id); // Enable test mode if needed ///$myPaypal->enableTestMode(); // Go $myPaypal->submitPayment(); The errors were: Warning: include_once(classes/config.php) [function.include-once]: failed to open stream: No such file or directory in /home/public_html/payment/thispage.php on line 3 Warning: include_once() [function.include]: Failed opening 'classes/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/payment/thispage.php on line 3 Warning: include_once(classes/sessions.php) [function.include-once]: failed to open stream: No such file or directory in /home/public_html/payment/thispage.php on line 4 Warning: include_once() [function.include]: Failed opening 'classes/sessions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/payment/thispage.php on line 4 Any help/thoughts/suggestions will be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/ Share on other sites More sharing options...
curtis_b Posted July 10, 2009 Share Posted July 10, 2009 well, this failed: include_once ('classes/config.php'); the syntax is correct, but the path provided is not. It looks like you are trying to include: /home/public_html/payment/classes/config.php Does that file exist? Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872446 Share on other sites More sharing options...
xtopolis Posted July 10, 2009 Share Posted July 10, 2009 Your includes are pointing to the wrong spot it seems. You probably just need to make it: include '../classes/config.php'; include '../classes/sessions.php'; (just a guess from the other errors) Find out where those scripts lay relative to your current page. Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872447 Share on other sites More sharing options...
The Eagle Posted July 10, 2009 Share Posted July 10, 2009 Please post the code of "thispage.php" so we can identify the integers and variables that this script is trying to pass-through. Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872458 Share on other sites More sharing options...
seventheyejosh Posted July 10, 2009 Share Posted July 10, 2009 Please post the code of "thispage.php" so we can identify the integers and variables that this script is trying to pass-through. that shouldnt matter at all. it is clearly a bad include. as was mentioned, try putting one or two ../ 's or just put the full path from public html Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872462 Share on other sites More sharing options...
Chrisj Posted July 10, 2009 Author Share Posted July 10, 2009 Thanks. To reply: /home/public_html/payment/classes/config.php does not exist. ../ 's or just put the full path from public html - this showed no errors, but also no header/footer. Any other suggestions. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872558 Share on other sites More sharing options...
p2grace Posted July 10, 2009 Share Posted July 10, 2009 Which files actually contain the header and the footer? Is it really contained within the config and session classes? Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872563 Share on other sites More sharing options...
Chrisj Posted July 10, 2009 Author Share Posted July 10, 2009 The file that contains the header and footer is main.htm Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872966 Share on other sites More sharing options...
p2grace Posted July 10, 2009 Share Posted July 10, 2009 I don't see where that file is included. Quote Link to comment https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/#findComment-872967 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.