469,946 Members | 2,062 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

IIS not working like Apache

Jacotheron
I have a site that needs an enrollment form. I have made the form and it works without a fault on my Apache testing server, but I have to get it to work on an IIS server. the first page should take info and send it to the next page which should echo the inputted information for the viewer to make sure everything is correct. This page then sends the data to the handler which records the information into a .txt file and redirects the viewer to the home page. The problem is that for this event they have to enroll young and old could come and only one person can be enrolled at a time and they may need to enroll a few people but the server does not record new information into the .txt. What is wrong?

First Page:
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>inteken by die nagmars 2008</title>
<link href="../css/basic.css" rel="stylesheet" type="text/css" media="all" />
</head>

<body>
<div align="center">
<form id="Inteken" action="Ingeteken.php" method="post" name="Inteken">
<h1>Inteken Oord Transmagalies Nagmars - Stap 1</h1>
<table border="1" cellspacing="2" cellpadding="0">
<tr>
<td>
<div align="left">
Kommando Naam:</div>
</td>
<td>
<div align="left">
<input type="text" name="Kommando" size="14" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
<tr>
<td>
<div align="left">
<input type="radio" name="Klas" value="Offier" />Offisier</div>
</td>
<td>
<div align="left">
<input type="radio" name="Klas" value="Penkop/Drawwetjie" />Penkop/Drawwertjie</div>
</td>
<td>
<div align="left">
<input type="radio" name="Klas" value="Verkenner" />Verkenner</div>
</td>
<td>
<div align="left">
<input type="radio" name="Klas" value="Ouer" />Ouer</div>
</td>
<td>
<div align="left">
<input type="radio" name="Klas" value="Ander" />Ander</div>
</td>
</tr>
<tr>
<td>
<div align="left">
Naam</div>
</td>
<td>
<div align="left">
<input type="text" name="Naam" size="14" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
<tr>
<td>
<div align="left">
Van</div>
</td>
<td>
<div align="left">
<input type="text" name="Van" size="14" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
<tr>
<td>
<div align="left">
Kontak Nommer:</div>
</td>
<td>
<div align="left">
<input type="text" name="Kontak" size="14" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
<tr>
<td>
<div align="left">
Geslag</div>
</td>
<td>
<div align="left">
<select name="Geslag" size="1">
<option value="Manlik">Manlik</option>
<option value="Vroulik">Vroulik</option>
<option selected="selected">Kies een</option>
</select></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
<tr>
<td>
<div align="left">
Braai Pakkies @ R30</div>
</td>
<td>
<div align="left">
<input type="text" name="Braaipakke" size="3" maxlength="3" /> Aantal</div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
<tr>
<td>
<div align="left">
Inskrywingsfooi</div>
</td>
<td>
<div align="left">
<input type="text" name="Inskrywingsfooi" value="R 30" readonly="readonly" size="3" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
<tr>
<td>
<div align="left">
Totaal</div>
</td>
<td>
<div align="left">
<input type="text" name="Totaal" size="5" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
<td>
<div align="left">
<img src="../NewFiles/Spacer_invisible.gif" alt="" height="10" width="10" border="0" /></div>
</td>
</tr>
</table>
Jammer die funksie werk nog nie. <input type="submit" value="Stuur" />
</form>
<p></p>
</div>
</body>

</html>[/HTML]

Second Page:
[PHP]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>Inteken Stap 2</title>
<link href="../css/basic.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript"><!--
function goback()
{
history.back()
}
//-->
</script>
<style type="text/css">
<!--
.style2 {
font-size: large;
font-style: italic;
}
-->
</style>
</head>
<?php
$Naam = $_POST['Naam'];
$Van = $_POST['Van'];
$Klas = $_POST['Klas'];
$Geslag = $_POST['Geslag'];
$Kommando = $_POST['Kommando'];
$Kontak = $_POST['Kontak'];
$Braaipakke = $_POST['Braaipakke'];
$Inskrywingsfooi = $_POST['Inskrywingsfooi'];
$Totaal = $_POST['Totaal'];
?>
<body>
<form id="FormName" action="intekendb.php" method="post" name="FormName">
<div align="left">
<h1>Inteken Oord Transmagalies Nagmars - Stap 2</h1>
<h2>Kontroleer asseblief die ingevoerde inligting:</h2>
<p>Naam en Van: <input type="text" name="Naam" value="<?php echo $Naam?>" size="14" /> <input type="text" name="Van" value="<?php echo $Van?>" size="14" /><br />

Groep: <input type="text" name="Klas" value="<?php echo $Klas?>" size="14" /><br />

Geslag: <input type="text" name="Geslag" value="<?php echo $Geslag?>" size="14" /><br />

Kommando Naam: <input type="text" name="Kommando" value="<?php echo $Kommando?>" size="14" /><br />

Konatak Nommer: <input type="text" name="Kontak" value="<?php echo $Kontak?>" size="14" /><br />

Aantal Braaipakkies @ R 30: <input type="text" name="Braaipakke" value="<?php echo $Braaipakke?>" size="3" /><br />

Inskrywingsfooi: <input type="text" name="Inskrywingfooi" value="<?php echo $Inskrywingsfooi?>" size="5" /><br />

Totaal: <input type="text" name="Totaal" value="<?php echo $Totaal?>" size="5" />
</p>
<p><span class="style2">(indien die inligting wat op die vorige bladsy ingevoeg is, nie hier bo verskyn nie, moet nie voortgaan nie en kontak my dadelik by <a href="mailto:webmaster@starsites.co.za">webmaster@ starsites.co.za</a>)</span><br />
</p>
<hr />
<h2>Betaal</h2>
<p>Indien die inligting korrek is, kan die bedrag van <?php echo $Totaal ?> so gou moontlik inbetaal wordin die volgende rekening:</p>

<p>Die inligting kan hier as 'n teks file afgelaai word: <a href="Bank.txt" target="_blank">Bankbesonderhede</a></p>
<hr />
<h2>Skryf In</h2>
<p>Om <?php echo $Naam?> in te skryf, moet die inligiting korrek wees. Die inligting wat op die bladsy se invoer velde sal in die databasis opgeneem word. Inligting kan nie verander word na diť vorm gestuur is nie. Om aan te gaan, moet op die &quot;Skryf In&quot; knoppie geklik word. U sal dadelik na die tuis blad gevoer word sodra die inskrywing voltooi is.</p>
</div>
<div align="center">
<p align="left"><input type="button" onclick="goback()" value="&lt; Terug" /> <input type="submit" name="" value="Skryf In &gt;" /></p>
</div>
</form>
</body>

</html>[/PHP]

Handler:
[PHP]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>Untitled Page</title>
<?php
$Naam = $_POST['Naam'];
$Van = $_POST['Van'];
$Klas = $_POST['Klas'];
$Geslag = $_POST['Geslag'];
$Kommando = $_POST['Kommando'];
$Kontak = $_POST['Kontak'];
$Braaipakke = $_POST['Braaipakke'];
$Inskrywingsfooi = $_POST['Inskrywingsfooi'];
$Totaal = $_POST['Totaal'];
?>
</head>

<body>
<p><?php
$textline = "Naam en Van: $Naam $Van, Kontak Nommer: $Kontak, Groep: $Klas, Gelsag: $Geslag, Kommando: $Kommando, Aantal Kospakkies: $Braaipakke, Inskrywingsfooi: $Inskrywingsfooi, Totaal Verskuldig: $Totaal
";
echo $textline;
$FILE = fopen("intekendb.txt","a+");
fputs($FILE,$textline);
Fclose ($FILE);
?>
</p>
<script type="text/javascript">
document.location = "Tuis.html"</script></body>

</html>[/PHP]

Sorry for the Afrikaans text but the event is only Afrikaans (South Africa).
Jul 21 '08 #1
3 1413
ak1dnar
1,584 Expert 1GB
I am not quite sure about this answer, but this may happen due a file permission issue. your IIS server might be not allowing to access/change the text file for multiple users at same time.
Jul 21 '08 #2
I am not quite sure about this answer, but this may happen due a file permission issue. your IIS server might be not allowing to access/change the text file for multiple users at same time.
I have changed the permissions of the files needed and now it is all read, write and execute and still it does not work.
How can I make that only if the enrollment was successful, it should redirect to the next page and else display a custom error message.
Sometimes the php works and a line is entered into the .txt, but other times it do nothing else than the redirect.
Jul 22 '08 #3
I have finaly came across the answer: the setting of the fopen command is disabled on the server. How can I change that setting without changing the php.ini file? Could it work with a .htaccess command and what command?
Oct 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by gwerk | last post: by
3 posts views Thread by Vik Rubenfeld | last post: by
reply views Thread by Robert Mazur | last post: by
7 posts views Thread by 7 | last post: by
1 post views Thread by saturday | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.