Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 05:09:14 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Code  (Read 668 times)
RedGnomos

Offline Offline

Posts: 65


« on: December 03, 2007, 01:19:03 AM »

I have researched the forum however am unable to find an appropriate solution. All my pages have been set up to use a blank template. I have also created 2 forms i.e. login and register however obviously am unable to "bind" the registration page to an actual registration process.

1) Is there a way I can copy and paste editing code when creating a new page and the type is set to "Code"?

2) Where can I copy and paste the code from?
Logged
RedGnomos

Offline Offline

Posts: 65


« Reply #1 on: December 03, 2007, 01:52:40 AM »

I tried parsing the following code to test if the type "Code" works however noting is returned on the screen

<?php
phpinfo()
?>

I did remove the PHP declarations e.g. <?php and ?>
Logged
RedGnomos

Offline Offline

Posts: 65


« Reply #2 on: December 03, 2007, 02:06:11 AM »

I'm trying to parse the following code.

require_once('../config.php');

if(!is_numeric(FRONTEND_SIGNUP)) {
    if(INTRO_PAGE) {
        header('Location: '.WB_URL.PAGES_DIREC TORY.'/index'.PAGE_EXTENSION);
        exit(0);
    } else {
        header('Location: '.WB_URL.'/index'.PAGE_EXTENSION);
        exit(0);
    }
}

// Load the language file
if(!file_exists(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php')) {
    exit('Error loading language file '.DEFAULT_LANGUAGE.', please check configuration');
} else {
    require_once(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
    $load_language = false;
}


// Required page details
$page_id = 0;
$page_description = '';
$page_keywords = '';
define('PAGE_ID', 0);
define('ROOT_PARENT', 0);
define('PARENT', 0);
define('LEVEL', 0);
define('PAGE_TITLE', $TEXT['SIGNUP']);
define('MENU_TITLE', $TEXT['SIGNUP']);
define('MODULE', '');
define('VISIBILITY', 'public');

// Set the page content include file
if(isset($_POST['username'])) {
    define('PAGE_CONTENT', WB_PATH.'/account/signup2.php');
} else {
    define('PAGE_CONTENT', WB_PATH.'/account/signup_form.php');
}

// Set auto authentication to false
$auto_auth = false;

// Include the index (wrapper) file
require(WB_PATH.'/index.php');
Logged
doc
Guest
« Reply #3 on: December 03, 2007, 05:31:41 AM »

Hello,

on some server configuration the code will not work properly due to security measurements of your provider. Is any code exectuted e.g.:
echo "test";

However, the header command can not be executed twice. Try to search the forum, but I doubt there was a fix to your problem, as the code form works on about 99% of all installations.

Regards Christian
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!