Results 1 to 7 of 7

Thread: config.php

  1. #1
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default config.php

    I'm still making my project and I'm adding some strings in but I was wondering how I get my page to grab code from another page? Example, cake.php gets string data from codes.php

  2. #2
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    include("codes.php");

    // Random values...
    $user = $user['username'];


    Basic.

    Lew.

  3. #3
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default

    Whats with the
    Code:
    $user = $user['username']
    ?

  4. #4
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    I think that is the code in the config.php file.

  5. #5
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default

    PHP Code:
    <?php include("codes.php"); ?>
    That was linking it together so I'm guessing that was a string..
    PHP Code:
    <?php
    include("codes.php");
    $version "You're currently running on version 1.0";
    echo 
    $version
    ?>
    Thanks Lew, got it working.

  6. #6
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    config.php:

    PHP Code:
    <?php
    $version 
    1.3;
    $site_name "Test Site";
    ?>
    other_page.php:

    PHP Code:
    <?php
    include "config.php";

    echo 
    "Welcome to {$site_name}, we are currently version number {$version}";
    ?>
    Simple.

  7. #7
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default

    Quote Originally Posted by Dentafrice View Post
    config.php:

    PHP Code:
    <?php
    $version 
    1.3;
    $site_name "Test Site";
    ?>
    other_page.php:

    PHP Code:
    <?php
    include "config.php";

    echo 
    "Welcome to {$site_name}, we are currently version number {$version}";
    ?>
    Simple.
    Yeah I know how to do it with lewis' post but +rep for helping me, I didn't know how to get strings in the test, eg. {$version}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •