hi all iam learning PHP and iam doing pretty good...so far iam struck with a problem
i created a PHP page called admin.php and saved it in htdocs then i send the url http://my url/admin.php to my frd then he cus see my page and i asked him to enter his name and when he submits it i wanted the details to be written in a text file inside my htdos .
i have a text file called detail insice htdocs and i want the date my frd entered to be inside this txt file when he clicks submit button
the homepage.php is the page where he enters the data and submits then he will be take to this page
<?
$filename ="http:\my rul\details.txt";
if(file_exists($filename))
{
$mytext = $day.'.'.$month.'.'.$year;
$newfile = @fopen($filename,"w+") or die("cannot create");
@fwrite($newfile,$mytext) or die("cannot write");
fclose($newfile);
$msg = "The date is updated";
}
?>
<html>
<head>
<title> Date updated </title>
</head>
<body>
<h3> Date updated</h3>
<? echo "$msg"; ?>
<h4> please click the button to go to the home page</h3>
<form action = "http://my url/finalhomepage.php" method = "post">
<input type="submit" value="Home Page" >
</form>
</body>
</html>
but the date is not there in my details.txt :mad:
hope u understand my probs and i need some help on this