Hey all,
I'm just hoping to receive great help from you people..
I'm tryin to fix my PHP coding and it looks good,but the server says that a particular line is broken..
<?php
$hd = fopen('content.txt', 'r');
$line = fgets($hd);
$content = array();
while($line)
{
$word = explode(',', $line);
$content [$word[0]] => array('img_path' => $word[1], 'description' => $word[2], 'price' => $word[3]); // the error message is indicating this line is broken!! Is it because of an equal sign missing? I tried putting an equal sign, but still it doesn't run.
$line = fgets($hd);
}
fclose($hd);
And also, I'm trying to implement a log-in system without using Database management system.. I just want to use an array..
session_start();
$users = array("user1" =>"3202", "user2" =>"2002", "user3" =>"1061", "user4"=>"1400", "user5"=>"1001");
//So, inside the if statement .... Would that be ok to use $_REQUEST or GET or even isSet?
if($_REQUEST['username'] == "user" && $_REQUEST['password'] == "3202"){
<-- This condition is NOT right.. and I don't really know how to re-set it up.. like how to check if the username is matching with its corresponding password
$_SESSION['username'] = "user1" ;
$_SESSION['password'] = "3202" ;
$_SESSION['username'] = "user2" ;
$_SESSION['password'] = "2002" ;
$_SESSION['username'] = "user" ;
$_SESSION['password'] = "1001" ;
$_SESSION['username'] = "user3" ;
$_SESSION['password'] = "1061" ;
$_SESSION['username'] = "user4" ;
$_SESSION['password'] = "1400" ;
header("Location: home.php ");
I'm looking forward to hearing from you Champions..