View Single Post
Old 04-18-2008, 02:03 AM   #1 (permalink)
Seraskier
The Contributor
 
Join Date: Mar 2008
Posts: 62
Thanks: 2
Seraskier is on a distinguished road
Default external data into a text file

ok, so dont ask why, just trying something....

I am wanting to put that actual data into a text file and using fwrite to go to the end and add the data in.

But I seem to not be able to get the data into an array.

array.txt
Code:
'1'=>array
	(
		'xxxxx@xxxxxxxx.xx.xxx',
		'xxxxxxxxx'
	),
	
'2'=>array
	(
    	'xxxxx@xxxxxxx.xxx',
		'xxxxxx'
	),
users.php
Code:
<?php
///////////////////////////////////////
//gets the id inputed by the user    //
$id=$_GET['id'];                     //
	                            //
//initializes the array              //
$users=array();                      //
                                     //
//shortcut for data in the array     //
$users=$users[$id];                  //
///////////////////////////////////////

//Beginning of the profile code
echo "Email Address: <b>".$users[0]."</b>";
echo "<br />Username: <b>".$users[1]."</b>";
//And, the ending of the profile code

//just here to test something (temporary)
echo "<br /><br />";
echo "<b>We have ".count($users)." registered users.";
?>
I took out the code that I used to try to read the array.txt, doesnt work.

I cant seem to get it to work and I cant find anything online.

Jordan
Send a message via MSN to Seraskier
Seraskier is offline  
Reply With Quote