Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/165423-trying-to-add-headerfooter-to-this-page/
Share on other sites

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.

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.