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
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
include("codes.php");
// Random values...
$user = $user['username'];
Basic.
Lew.
Whats with the?Code:$user = $user['username']
I think that is the code in the config.php file.
That was linking it together so I'm guessing that was a string..PHP Code:<?php include("codes.php"); ?>
Thanks Lew, got it working.PHP Code:<?php
include("codes.php");
$version = "You're currently running on version 1.0";
echo $version
?>
config.php:
other_page.php:PHP Code:<?php
$version = 1.3;
$site_name = "Test Site";
?>
Simple.PHP Code:<?php
include "config.php";
echo "Welcome to {$site_name}, we are currently version number {$version}";
?>
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!