Add unobfuscated code from @SirWumpus

The entries 2004/hibachi and 2005/mynx have unobfuscated code now.

2004/hibachi has a configure script that is used along the lines of the
original entry (with some adjustments and fixes) and the hibachi.alt.c
had to have ctype.h included too. The directory src/localhost was copied
to src-alt/localhost but the rest of src/ was from Anthony. The Makefile
had to be updated to build this version.

2005/mynx does have a configure script but it is, just like the original
entry, unused and so the unobfuscated (in source-alt/) is also unused.
The mynx.alt.c was changed to mynx.alt2.c and the unobfuscated code was
made mynx.alt.c.

Updated manifest, rebuilt .entry.json and index.html files.

After a question is answered and taken care of (in one of 199[1-3]/ant -
not sure which one) issue #2513 can possibly be closed as complete
(though the manifest updates will have to be looked at more when 2004
and 2005 are reviewed).
This commit is contained in:
Cody Boone Ferguson committed 2024-07-08 13:11:00 -07:00
1 parent 60ce3d9155
commit 0d65af1b2b
65 files changed
+15579 -218

No files matched your search

@@ -0,0 +1,557 @@
<?
class Date
{
var $date;
var $time;
//
// Create a new date object set to the time now.
//
function Date()
{
$this->setTime(time());
}
function isLeapYear(/* year */)
{
if (func_num_args() == 1)
$year = func_get_arg(0);
else
$year = $this->date['year'];
if ($year % 4000 == 0)
return false;
if ($year % 400 == 0)
return true;
if ($year % 100 == 0)
return false;
if ($year % 4 == 0)
return true;
return false;
}
//
// Return the number of seconds since system epoch.
//
function getTime()
{
return $this->time;
}
//
// Set the date / time in seconds for the object.
//
function setTime($t)
{
$this->time = $t;
$this->date = getdate($t);
}
function getHour()
{
return $this->date['hour'];
}
function getMinute()
{
return $this->date['minutes'];
}
function getSecond()
{
return $this->date['seconds'];
}
function getMonth()
{
return $this->date['mon'];
}
function getYear()
{
return $this->date['year'];
}
function getDayOfWeek()
{
return $this->date['wday'];
}
function getDayOfMonth()
{
return $this->date['mday'];
}
function getDayOfYear()
{
return $this->date['yday'];
}
function getDaysInMonth(/* year, month */)
{
if (func_num_args() == 2) {
$year = func_get_arg(0);
$month = func_get_arg(1);
} else {
$year = $this->date['year'];
$month = $this->date['mon'];
}
$endOfMonth = Array(
31,
28 + Date::isLeapYear($year),
31,
30,
31,
30,
31,
31,
30,
31,
30,
31
);
return $endOfMonth[$month-1];
}
function getPreviousMonth()
{
if ($this->date['mon'] <= 1)
return 12;
return $this->date['mon']-1;
}
function getNextMonth()
{
if (12 <= $this->date['mon'])
return 1;
return $this->date['mon']+1;
}
function getFirstWeekDayOfMonth(/* year, month */)
{
if (func_num_args() == 2) {
$y = func_get_arg(0);
$m = func_get_arg(1);
} else {
$y = $this->date['year'];
$m = $this->date['mon'];
}
// Day of the week 0..6 (Sunday..Saturday).
$weekDay = strftime("%w", mktime(0, 0, 0, $m, 1, $y));
// Day of the week 1..7 (Monday..Sunday).
return $weekDay == 0 ? 7 : $weekDay;
}
function getNumberOfWeeks(/* year */)
{
if (func_num_args() == 1)
$year = func_get_arg(0);
else
$year = $this->date['year'];
/* An ISO calendar year y is long (contains 53 weeks) if:
*
* p(y) modulo 7 = 4
*
* or if:
*
* p(y-1) modulo 7 = 3
*
* with:
*
* p(y) = y + floor(y/4) - floor(y/100) + floor(y/400)
*
* http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
*/
if (($year + floor($year/4) - floor($year/100) + floor($year/400)) % 7 == 4)
return 53;
if ((--$year + floor($year/4) - floor($year/100) + floor($year/400)) % 7 == 3)
return 53;
return 52;
}
/*
* Return ISO 8601:2000(E) week number. This is a work around for
* Windows, which does not support a working strftime %V format.
*/
function getWeekNumber(/* year, month, day */)
{
if (func_num_args() == 3) {
$year = func_get_arg(0);
$month = func_get_arg(1);
$day = func_get_arg(2);
} else {
$year = $this->date['year'];
$month = $this->date['mon'];
$day = $this->date['mday'];
}
/* The week number of the current year as a decimal number, range
* 00 to 53, starting with the first Monday as the first day of
* week 01.
*/
$week = strftime("%W", mktime(0, 0, 0, $month, $day, $year));
/* Week days numbered 0 (Sunday) to 6 (Saturday). */
$firstWeekDayThisYear = strftime("%w", mktime(0, 0, 0, 1, 1, $year));
$firstWeekDayNextYear = strftime("%w", mktime(0, 0, 0, 1, 1, $year+1));
/* The first ISO calendar week of a year is the one that includes the
* first Thursday of that year. In other words, the first week of the
* ISO calendar year is the earliest week that contains at least four
* days of the month of January.
*/
if (1 < $firstWeekDayThisYear && $firstWeekDayThisYear < 5) {
/* The first Thursday of the current ISO year was in week zero. */
$week++;
}
if ($week == 53 && 1 < $firstWeekDayNextYear && $firstWeekDayNextYear < 5) {
/* The first Thursday of the following ISO year is this week. */
$week = 1;
}
if ($week == 0) {
/* Number of weeks last year. */
$week = Date::getNumberOfWeeks($year-1);
}
return $week+0;
}
//
// Return the number seconds as of zero hour today.
//
function getDate()
{
return mktime(0, 0, 0, $this->date['mon'], $this->date['mday'], $this->date['year']);
}
//
// Set date as of zero hour that day.
//
function setDate($year, $month, $day)
{
$this->setDateTime($year, $month, $day, 0, 0, 0);
}
//
// Return the date / time array.
//
function getDateTime()
{
return $this->date;
}
//
// Set the date / time for the object.
//
function setDateTime($year, $month, $day, $hour, $minute, $second)
{
$time = mktime($hour, $minute, $second, $month, $day, $year, 0);
$this->setTime($time);
}
//
// Adjust the date / time of the object.
//
function addDateTime($year, $month, $day, $hour, $minute, $second)
{
$t = mktime(
$this->date['hour'] + $hour,
$this->date['minutes'] + $minute,
$this->date['seconds'] + $second,
$this->date['mon'] + $month,
$this->date['mday'] + $day,
$this->date['year'] + $year
);
$this->setTime($t);
}
//
// Return the date / time as an ISO date string.
//
function getDateISO()
{
return strftime("%Y-%m-%d %H:%M:%S", $this->time);
}
//
// Set the date / time of the object using an ISO date string.
//
function setDateISO($str)
{
if (!ereg('([0-9]+)-([0-9]+)-([0-9]+)', $str, $ymd))
$ymd = array('','0','0','0');
if (!ereg('([0-9]+):([0-9]+):([0-9]+)\+([0-9]+)', $str, $hms))
$hms = array('','0','0','0');
// Assume local time, ignore timezone.
$this->setDateTime(
intval($ymd[1]),
intval($ymd[2]),
intval($ymd[3]),
intval($hms[1]),
intval($hms[2]),
intval($hms[3])
);
}
function setDateMySQL($str)
{
$n = sscanf($str, "%4d%2d%2d%2d%2d%2d", $y, $m, $d, $H, $M, $S);
$this->setDateTime($y, $m, $d, $H, $M, $S);
}
//
// Relational operations between Date vs time or Date vs Date.
//
function eq($t)
{
if (is_object($t)) $t = $t->getTime();
return $this->time == $t;
}
function ne($t)
{
if (is_object($t)) $t = $t->getTime();
return $this->time != $t;
}
function lt($t)
{
if (is_object($t)) $t = $t->getTime();
return $this->time < $t;
}
function le($t)
{
if (is_object($t)) $t = $t->getTime();
return $this->time <= $t;
}
function gt($t)
{
if (is_object($t)) $t = $t->getTime();
return $this->time > $t;
}
function ge($t)
{
if (is_object($t)) $t = $t->getTime();
return $this->time >= $t;
}
/*
* $obj->getSmallCalendar()
* Date::getSmallCalendar($year, $month)
*/
function getSmallCalendar(/* [$year, $month] */)
{
if (func_num_args() == 2) {
$year = func_get_arg(0);
$month = func_get_arg(1);
} else {
$year = $this->date['year'];
$month = $this->date['mon'];
}
$name = date('F', mktime(0,0,0,$month,1,$year));
$weekNumber = Date::getWeekNumber($year, $month, 1);
$daysInMonth = Date::getDaysInMonth($year, $month);
$weekDay = Date::getFirstWeekDayOfMonth($year, $month) - 1;
$thisDate = getdate(time());
$thisDay = mktime(0, 0, 0, $thisDate['mon'], $thisDate['mday'], $thisDate['year']);
$thisWeek = Date::getWeekNumber($thisDate['year'], $thisDate['mon'], $thisDate['mday']);
if ($year != $thisDate['year']) {
$thisWeek = 0;
}
$rc = <<<EOT
<table class="smCalendarTable">
<tr>
<td class="smCalendarCell smCalendarMonthTitle" colspan="8" align="center">{$name} &nbsp; {$year}</td>
</tr>
<tr>
<td class="smCalendarCell smCalendarDayTitle">&nbsp;</td>
<td class="smCalendarCell smCalendarDayTitle">Mo</td>
<td class="smCalendarCell smCalendarDayTitle">Tu</td>
<td class="smCalendarCell smCalendarDayTitle">We</td>
<td class="smCalendarCell smCalendarDayTitle">Th</td>
<td class="smCalendarCell smCalendarDayTitle">Fr</td>
<td class="smCalendarCell smCalendarDayTitle">Sa</td>
<td class="smCalendarCell smCalendarDayTitle">Su</td>
</tr>
<tr>
<td class="smCalendarCell smCalendarWeekNumber" valign='top'>{$weekNumber}</td>
EOT;
if ($weekNumber == $thisWeek) {
$style = "smCalendarThisWeek";
$thisDayStyle = "smCalendarThisWeek smCalendarThisDay";
} else {
$style = $thisDayStyle = "smCalendarDay";
}
for ($i = 0; $i < $weekDay; $i++) {
$rc .= sprintf(
"\t<td class='smCalendarCell %s%s'>&nbsp;</td>\n",
$i == $thisDate['wday'] ? $thisDayStyle : $style,
$i < 5 ? "" : " smCalendarWeekend"
);
}
for ($i = 1; $i <= $daysInMonth; $i++, $weekDay = ($weekDay + 1) % 7) {
if (1 < $i && $weekDay == 0) {
$weekNumber = Date::getWeekNumber($year, $month, $i);
$week = $weekNumber < 10 ? "&nbsp;&nbsp;{$weekNumber}" : $weekNumber;
$rc .= "</tr>\n<tr>\n\t<td class='smCalendarCell smCalendarWeekNumber' valign='top'>{$week}</td>\n";
if ($weekNumber == $thisWeek) {
$style = "smCalendarThisWeek";
$thisDayStyle = "smCalendarThisWeek smCalendarThisDay";
} else {
$style = $thisDayStyle = "smCalendarDay";
}
}
$key = sprintf("%04d-02d-02d", $year, $month, $i);
$rc .= sprintf(
"\t<td class='smCalendarCell %s%s' valign='top'><span class='smCalendarNumber'>%d</span></td>\n",
$i == $thisDate['mday'] ? $thisDayStyle : $style,
$weekDay < 5 ? "" : " smCalendarWeekend", $i
);
}
for ( ; $weekDay != 0; $weekDay = ($weekDay + 1) % 7) {
$rc .= sprintf(
"\t<td class='smCalendarCell %s'>&nbsp;</td>\n",
$weekDay < 5 ? "smCalendarDay" : "smCalendarWeekend"
);
}
$rc .= "</tr>\n</table>\n";
return $rc;
}
/*
* $obj->getLargeCalendar($notes)
* Date::getLargeCalendar($notes, $year, $month)
*/
function getLargeCalendar(/* $notes [, $year, $month] */)
{
switch (func_num_args()) {
case 3:
$notes = func_get_arg(0);
$year = func_get_arg(1);
$month = func_get_arg(2);
break;
case 1:
$notes = func_get_arg(0);
$year = $this->date['year'];
$month = $this->date['mon'];
break;
default:
return '';
}
$name = date('F', mktime(0,0,0,$month,1,$year));
$weekNumber = Date::getWeekNumber($year, $month, 1);
$daysInMonth = Date::getDaysInMonth($year, $month);
$weekDay = Date::getFirstWeekDayOfMonth($year, $month) - 1;
$thisDate = getdate(time());
$thisDay = mktime(0, 0, 0, $thisDate['mon'], $thisDate['mday'], $thisDate['year']);
$thisWeek = Date::getWeekNumber($thisDate['year'], $thisDate['mon'], $thisDate['mday']);
if ($year != $thisDate['year']) {
$thisWeek = 0;
}
$rc = <<<EOT
<table class="lgCalendarTable">
<tr>
<td class="lgCalendarCell lgCalendarMonthTitle" colspan="8" align="center">{$name} &nbsp; {$year}</td>
</tr>
<tr>
<td class="lgCalendarCell lgCalendarDayTitle" width="2%">W</td>
<td class="lgCalendarCell lgCalendarDayTitle" width="14%">Mo</td>
<td class="lgCalendarCell lgCalendarDayTitle" width="14%">Tu</td>
<td class="lgCalendarCell lgCalendarDayTitle" width="14%">We</td>
<td class="lgCalendarCell lgCalendarDayTitle" width="14%">Th</td>
<td class="lgCalendarCell lgCalendarDayTitle" width="14%">Fr</td>
<td class="lgCalendarCell lgCalendarDayTitle" width="14%">Sa</td>
<td class="lgCalendarCell lgCalendarDayTitle" width="14%">Su</td>
</tr>
<tr>
<td class="lgCalendarCell lgCalendarWeekNumber" valign='top' style='padding-left: 0; padding-right: 1;'><img align='left' width='1' height='80' src='pixel.gif'>{$weekNumber}</td>
EOT;
if ($weekNumber == $thisWeek) {
$style = "lgCalendarThisWeek";
$thisDayStyle = "lgCalendarThisWeek lgCalendarThisDay";
} else {
$style = $thisDayStyle = "lgCalendarDay";
}
for ($i = 0; $i < $weekDay; $i++) {
$rc .= sprintf(
"\t<td class='lgCalendarCell %s%s'>&nbsp;</td>\n",
$i == $thisDate['wday'] ? $thisDayStyle : $style,
$i < 5 ? "" : " lgCalendarWeekend"
);
}
for ($i = 1; $i <= $daysInMonth; $i++, $weekDay = ($weekDay + 1) % 7) {
if (1 < $i && $weekDay == 0) {
$weekNumber = Date::getWeekNumber($year, $month, $i);
$week = $weekNumber < 10 ? "&nbsp;&nbsp;{$weekNumber}" : $weekNumber;
$rc .= "</tr>\n<tr>\n\t<td class='lgCalendarCell lgCalendarWeekNumber' valign='top' style='padding-left: 0; padding-right: 1;'><img align='left' width='1' height='80' src='pixel.gif'>{$week}</td>\n";
if ($weekNumber == $thisWeek) {
$style = "lgCalendarThisWeek";
$thisDayStyle = "lgCalendarThisWeek lgCalendarThisDay";
} else {
$style = $thisDayStyle = "lgCalendarDay";
}
}
$key = sprintf("%04d-%02d-%02d", $year, $month, $i);
$rc .= sprintf(
"\t<td class='lgCalendarCell %s%s' valign='top' style='text-align: left;'><span class='lgCalendarNumber'>%d&nbsp;&nbsp;</span>%s</td>\n",
$i == $thisDate['mday'] ? $thisDayStyle : $style,
$weekDay < 5 ? "" : " lgCalendarWeekend",
$i, isset($notes[$key]) ? $notes[$key] : ''
);
}
for ( ; $weekDay != 0; $weekDay = ($weekDay + 1) % 7) {
$rc .= sprintf(
"\t<td class='lgCalendarCell %s'>&nbsp;</td>\n",
$weekDay < 5 ? "lgCalendarDay" : "lgCalendarWeekend"
);
}
$rc .= "</tr>\n</table>\n";
return $rc;
}
}
?>
+106
View File
@@ -0,0 +1,106 @@
#!/usr/bin/php
<?
header("HTTP/1.0 299 OK");
header("Content-Type: text/html");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>
Hibachi - A Calendar Generator in PHP
</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style>
<!--
.smCalendarTable {
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 9pt;
border-spacing: 0;
border-width: 1;
border-style: groove;
}
.smCalendarCell {
padding: 3;
text-align: right;
}
.smCalendarMonthTitle {
color: #ff0000;
text-align: center;
border-collapse: collapse;
border-color: #000000;
border-width: 2 0 0 0;
border-style: solid;
}
.smCalendarDayTitle {
color: #0000cc;
text-align: center;
border-collapse: collapse;
border-color: #000000;
border-width: 1 0 1 0;
border-style: solid;
}
.smCalendarWeekNumber {
color: #cc00cc;
font-weight: bold;
background-color: #eeeeee;
}
.smCalendarDay {
color: #0000cc;
}
.smCalendarWeekend {
color: #0000cc;
background-color: #cae4ff;
}
.smCalendarThisWeek {
color: #0000cc;
background-color: #ffcccc;
}
.smCalendarThisDay {
padding: 1;
border-color: #ff0000;
border-width: 2;
border-style: solid;
}
-->
</style>
</head>
<body background="../../Img/hot-coal-edge-110-indent.png" style="margins: 0 0 0 0; padding: 0 0 0 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="130">
<img alt="" src="../../Img/mrpixel.gif" width="130" height="1">
</td>
<td>
<div align="center">
<table border="0" cellspacing="0" cellpadding="5">
<h2>A Calendar Generator in PHP</h2>
<?
include('Date.php');
$date = new Date();
for ($i = 0; $i < 12; $i++) {
if ($i % 4 == 0)
print("<tr valign='top'>\n");
print("<td>");
print Date::getSmallCalendar($date->getYear(), $i+1);
print("</td>\n");
if ($i % 4 == 3)
print("</tr>\n");
}
?>
</table>
</div>
<hr>
<a href="../../#Test">Return to HIBACHI</a>
</td>
</tr>
</table>
</body>
</html>
@@ -0,0 +1,106 @@
#!@php_exe@
<?
header("HTTP/1.0 299 OK");
header("Content-Type: text/html");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>
Hibachi - A Calendar Generator in PHP
</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style>
<!--
.smCalendarTable {
font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 9pt;
border-spacing: 0;
border-width: 1;
border-style: groove;
}
.smCalendarCell {
padding: 3;
text-align: right;
}
.smCalendarMonthTitle {
color: #ff0000;
text-align: center;
border-collapse: collapse;
border-color: #000000;
border-width: 2 0 0 0;
border-style: solid;
}
.smCalendarDayTitle {
color: #0000cc;
text-align: center;
border-collapse: collapse;
border-color: #000000;
border-width: 1 0 1 0;
border-style: solid;
}
.smCalendarWeekNumber {
color: #cc00cc;
font-weight: bold;
background-color: #eeeeee;
}
.smCalendarDay {
color: #0000cc;
}
.smCalendarWeekend {
color: #0000cc;
background-color: #cae4ff;
}
.smCalendarThisWeek {
color: #0000cc;
background-color: #ffcccc;
}
.smCalendarThisDay {
padding: 1;
border-color: #ff0000;
border-width: 2;
border-style: solid;
}
-->
</style>
</head>
<body background="../../Img/hot-coal-edge-110-indent.png" style="margins: 0 0 0 0; padding: 0 0 0 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="130">
<img alt="" src="../../Img/mrpixel.gif" width="130" height="1">
</td>
<td>
<div align="center">
<table border="0" cellspacing="0" cellpadding="5">
<h2>A Calendar Generator in PHP</h2>
<?
include('Date.php');
$date = new Date();
for ($i = 0; $i < 12; $i++) {
if ($i % 4 == 0)
print("<tr valign='top'>\n");
print("<td>");
print Date::getSmallCalendar($date->getYear(), $i+1);
print("</td>\n");
if ($i % 4 == 3)
print("</tr>\n");
}
?>
</table>
</div>
<hr>
<a href="../../#Test">Return to HIBACHI</a>
</td>
</tr>
</table>
</body>
</html>
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/php
<?
// Bug #27026: header('HTTP/1.0 200 OK') never sent when explicitly
// requested.
//
// Send a 2xx status code not defined by RFC 2616. A 200 value would
// be the correct value, but PHP/CGI refuses to send it when explicitly
// set.
//
// This works for Opera 7, Mozilla 1.6, and IE 6.0 SP1.
//
header("HTTP/1.0 299 OK");
phpinfo();
?>
@@ -0,0 +1,15 @@
#!@php_exe@
<?
// Bug #27026: header('HTTP/1.0 200 OK') never sent when explicitly
// requested.
//
// Send a 2xx status code not defined by RFC 2616. A 200 value would
// be the correct value, but PHP/CGI refuses to send it when explicitly
// set.
//
// This works for Opera 7, Mozilla 1.6, and IE 6.0 SP1.
//
header("HTTP/1.0 299 OK");
phpinfo();
?>
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8">
<title>
Hibachi - Form Processing Example in PHP
</title>
<meta name="description" content="Form Processing Example in PHP">
<meta name="keywords" content="IOCCC, 2004/hibachi, from, PHP">
</head>
<body style="background-image: url(../../Img/hot-coal-edge-110-indent.png); padding: 0 0 0 10%;">
<h2>Form Processing Example in PHP</h2>
<p>This example takes the output of a form POST and reformats it from
its encoded format into human readable output suitable for sending
by email.
</p>
<hr style="width:10%;text-align:left;margin-left:0">
<form method="POST" action="sendform.php">
<table style="border-spacing: 0; padding: 0; margin-right:auto;">
<tr style="vertical-align: top;">
<td style="text-align: right;">
Who am I?
</td>
<td>
<input name="who" value="Snert" size="24">
</td>
</tr>
<tr style="vertical-align: top;">
<td style="text-align: right;">
What am I?
</td>
<td>
<input name="what" value="A sick puppy" size="24">
</td>
</tr>
<tr style="vertical-align: top;">
<td style="text-align: right;">
Where am I?
</td>
<td>
<textarea rows="4" cols="20" name="where" wrap="hard">I live in the south of France now.</textarea>
</td>
</tr>
<tr style="vertical-align: top;">
<td>
&nbsp;
</td>
<td>
<input type="submit" value="SEND">
</td>
</tr>
</table>
</form>
<hr style="width:10%;text-align:left;margin-left:0">
<h3>The above PHP will NOT work on on www.ioccc.org, Sorry!</h3>
<hr style="width:10%;text-align:left;margin-left:0">
<a href="../../../../index.html">Return to 2004/hibachi</a>
</body>
</html>
+81
View File
@@ -0,0 +1,81 @@
#!/usr/bin/php
<?
header("HTTP/1.0 299 OK");
header("Content-Type: text/html");
///////////////////////////////////////////////////////////////////////
// CHANGE THE VALUES BELOW HERE
///////////////////////////////////////////////////////////////////////
$SEND_TO = 'achowe@snert.com';
$SUBJECT = 'From the web form...';
///////////////////////////////////////////////////////////////////////
// CHANGE THE VALUES ABOVE HERE
///////////////////////////////////////////////////////////////////////
$maxWidth = 0;
foreach ($_GET as $name => $value) {
if ($maxWidth < strlen($name))
$maxWidth = strlen($name);
}
foreach ($_POST as $name => $value) {
if ($maxWidth < strlen($name))
$maxWidth = strlen($name);
}
$body = '';
$fmt = "%{$maxWidth}s: %s\n";
foreach ($_GET as $name => $value) {
$body .= sprintf($fmt, $name, $value);
}
foreach ($_POST as $name => $value) {
$body .= sprintf($fmt, $name, $value);
}
//mail($SEND_TO, $SUBJECT, $body);
///////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>
Hibachi - Form Processing Example in PHP
</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>
<body background="../../Img/hot-coal-edge-110-indent.png" style="margins: 0 0 0 0; padding: 0 0 0 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="130">
<img alt="" src="../../Img/mrpixel.gif" width="130" height="1">
</td>
<td>
<h2>Form Processing Example in PHP</h2>
<p>Formatted output of web form as would be seen in an email message (without decorations).
This example does not send any actual email, though it could with some minor changes.
</p>
<pre>
<?= $body; ?>
</pre>
<hr>
<a href="../../#Test">Return to HIBACHI</a>
</td>
</tr>
</table>
</body>
</html>
@@ -0,0 +1,81 @@
#!@php_exe@
<?
header("HTTP/1.0 299 OK");
header("Content-Type: text/html");
///////////////////////////////////////////////////////////////////////
// CHANGE THE VALUES BELOW HERE
///////////////////////////////////////////////////////////////////////
$SEND_TO = 'achowe@snert.com';
$SUBJECT = 'From the web form...';
///////////////////////////////////////////////////////////////////////
// CHANGE THE VALUES ABOVE HERE
///////////////////////////////////////////////////////////////////////
$maxWidth = 0;
foreach ($_GET as $name => $value) {
if ($maxWidth < strlen($name))
$maxWidth = strlen($name);
}
foreach ($_POST as $name => $value) {
if ($maxWidth < strlen($name))
$maxWidth = strlen($name);
}
$body = '';
$fmt = "%{$maxWidth}s: %s\n";
foreach ($_GET as $name => $value) {
$body .= sprintf($fmt, $name, $value);
}
foreach ($_POST as $name => $value) {
$body .= sprintf($fmt, $name, $value);
}
//mail($SEND_TO, $SUBJECT, $body);
///////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>
Hibachi - Form Processing Example in PHP
</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>
<body background="../../Img/hot-coal-edge-110-indent.png" style="margins: 0 0 0 0; padding: 0 0 0 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="130">
<img alt="" src="../../Img/mrpixel.gif" width="130" height="1">
</td>
<td>
<h2>Form Processing Example in PHP</h2>
<p>Formatted output of web form as would be seen in an email message (without decorations).
This example does not send any actual email, though it could with some minor changes.
</p>
<pre>
<?= $body; ?>
</pre>
<hr>
<a href="../../#Test">Return to HIBACHI</a>
</td>
</tr>
</table>
</body>
</html>