Click here to Skip to main content
15,072,051 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I have a page in php language
I asked to write a piece of code to put in the first plates that automatically initialize variables in each file name with the name of the page and then it Reg.txt Print
Example

PHP
<?php
$aday = 100;
$stdNames = array("Name1", "Name2", "Name3", "Name4", "Name5");
$aday = (16 + 1);
$_SESSION['hello'] = 'hello';
$id = $aday;
.
.
.
.
include("connection.php");
.
.
.
.
$DB=mysql_query("SELECT * FROM users where `userid`='$id' " );
$row = mysql_fetch_assoc($DB(3));
.
.
.
?>

and
PHP
<?php
/*connection.php*/
.
.
.
$SQL_USER = 'username';
$SQL_PASS = 'password';
.
.
.
$this->connection = mysql_connect(SQL_SERVER, $SQL_USER, $SQL_PASS);
mysql_select_db(SQL_DB, $this->connection);
.
.
.
?>


Reg.txt
PHP
Reg :

page one   18:30

18:30
aday :   100
------------
18:30
stdNames :  Name1,Name2,Name3,Name4,Name5
------------
18:31
aday :   17
------------
18:32
session 'hello' :    hello
------------
18:32
id :   17
------------
.
.
.
page connection    18:33

18:33
SQL_USER :    username
------------
18:34
SQL_PASS :    password
------------
.
.
.
18:35
end page connection
------------
18:38
DB :  userid,number1,number2,number3,number4,number5 :
17,12,33,678,1,54
17,45,67,124,56,98
17,987,50,123,34,76
17,15,87,65,489,62
17,18,65,47,25,286
------------
18:38
row :  userid,number1,number2,number3,number4,number5 :
17,987,50,123,34,76
------------
.
.
.
18:42
endpage one
------------
Posted
Updated 14-Oct-13 18:52pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900