• Log in or sign up for an account here: https://www.sythe.org/login

Integrating variables into another page

root

Member
Banned
Joined
Sep 29, 2007
Sythe Gold
5
Messages
92
Integrating variables into another page
Note, in the variables (things starting with $) you'd want to remove the slash (/) after the $. Sythe appears to block out the variables.

Here I'm going to show you how to use PHP variables to edit things on another page.

First, the original HTML code:

HTML:
<html>
 <head>
  <title>root's Integration Tutorial</title>
 </head>
    <body>
      <p>How are you today?</p>
    </body>
</html>


Now for a little integration.


First, we'd create a file. Name it, oh, "randomfile.php".
Inside, you'd put this:

PHP:
<?php
$/title = "root's Integration Tutorial";
$/simpleQ = "How are you today?";
?>

Now all thrown together:


PHP:
<?php
include("randomfile.php");
?> 

<html>
 <head>
  <title><? echo $/title; ?></title>
 </head>
    <body>
      <p><? echo $/simpleQ; ?></p>
    </body>
</html>


Explanation


Basically, the variable's are editable from another page, so that you don't have to edit your main index page. This can be done for security issues, and is alot quicker to edit a variable, rather than scroll through your file and change random things.
Note, you can start a php doc. with either
PHP:
<?
or
PHP:
<?php
.


Enjoy! :)
 
Integrating variables into another page
Very basic and unless you know what php is its worthless
 
Integrating variables into another page
SuF, lolwut? PHP is worthless? Nearly all server-side software on the web is written in PHP. Vbulletin, along with the majority of the other forum software is written in PHP. Not worthless.

include(randomfile.php); will return an error... (You need quotes.)
 
Runescape Gamblingrunescape gambling
Back
Top