Hey all,
I'm new to PHP, but I've been coding JS, Perl and ASP for a quite a bit so I'm used to the syntax. However, I can't figure out the following issues. I get this error:
from this script:
Any help would be much appreciated.
- MT
I'm new to PHP, but I've been coding JS, Perl and ASP for a quite a bit so I'm used to the syntax. However, I can't figure out the following issues. I get this error:
Code:
Warning: Cannot add header information - headers already sent by (output started at /var/[URL unfurl="true"]www/html/handle_form02.php:6)[/URL] in /var/[URL unfurl="true"]www/html/handle_form02.php[/URL] on line 28
from this script:
Code:
<html>
<head>
</head>
<body>
<?php
// Create a shorthand for the form data.
$partNo = $_REQUEST['partNumber'];
$ipAddr = $_SERVER['REMOTE_ADDR'];
$today = getdate();
$currentSeconds = $today['seconds'];
$currentMinutes = $today['minutes'];
$currentHour = $today['hours'];
$currentDate = $today['mday'];
$currentDay = $today['weekday'];
$currentMonth = $today['month'];
$currentYear = $today['year'];
$timeStamp = $currentDay . ', ' . $currentMonth . ' ' . $currentDate . ', ' . $currentYear . "\t" . $currentHour . ':' . $currentMinutes . ':' . $currentSeconds;
$writeString = "<tr><td>$partNo</td><td>$ipAddr</td><td>$timeStamp</td></tr>\n";
$filename = '/var/[URL unfurl="true"]www/partNoSearchIPs.txt';[/URL]
$fp = fopen($filename, "a"); // open for writing only and place the cursor at the end of the file
$write = fputs($fp, $writeString);
fclose($fp);
header('Location: [URL unfurl="true"]http://www.newpage.com/');[/URL]
exit;
?>
</body>
</html>
Any help would be much appreciated.
- MT