View Full Version : config.php
Shibby-Shabs
13-11-2009, 08:16 AM
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
LMS16
13-11-2009, 04:27 PM
include("codes.php");
// Random values...
$user = $user['username'];
Basic.
Lew.
Shibby-Shabs
14-11-2009, 12:39 AM
Whats with the
$user = $user['username'] ?
Blinger1
14-11-2009, 12:47 AM
I think that is the code in the config.php file.
Shibby-Shabs
14-11-2009, 02:56 AM
<?php include("codes.php"); ?>
That was linking it together so I'm guessing that was a string..
<?php
include("codes.php");
$version = "You're currently running on version 1.0";
echo $version
?>
Thanks Lew, got it working.
Dentafrice
15-11-2009, 02:33 AM
config.php:
<?php
$version = 1.3;
$site_name = "Test Site";
?>
other_page.php:
<?php
include "config.php";
echo "Welcome to {$site_name}, we are currently version number {$version}";
?>
Simple.
Shibby-Shabs
15-11-2009, 11:30 AM
config.php:
<?php
$version = 1.3;
$site_name = "Test Site";
?>
other_page.php:
<?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}
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.