IIS not working like Apache

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jacotheron
    New Member
    • Jan 2008
    • 44

    IIS not working like Apache

    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.dt d">

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

    <head>
    <meta http-equiv="content-type" content="text/html;charset=ut f-8" />
    <meta name="generator " content="Adobe GoLive" />
    <title>inteke n 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="Ingetek en.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_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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="Verkenne r" />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_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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="selec ted">Kies een</option>
    </select></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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="Braaipakk e" size="3" maxlength="3" /> Aantal</div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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="Inskrywin gsfooi" value="R 30" readonly="reado nly" size="3" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.gif" alt="" height="10" width="10" border="0" /></div>
    </td>
    <td>
    <div align="left">
    <img src="../NewFiles/Spacer_invisibl e.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.dt d">

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

    <head>
    <meta http-equiv="content-type" content="text/html;charset=ut f-8" />
    <meta name="generator " content="Adobe GoLive" />
    <title>Inteke n 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'];
    $Inskrywingsfoo i = $_POST['Inskrywingsfoo i'];
    $Totaal = $_POST['Totaal'];
    ?>
    <body>
    <form id="FormName" action="inteken db.php" method="post" name="FormName" >
    <div align="left">
    <h1>Inteken Oord Transmagalies Nagmars - Stap 2</h1>
    <h2>Kontrolee r 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="Braaipakk e" value="<?php echo $Braaipakke?>" size="3" /><br />

    Inskrywingsfooi : <input type="text" name="Inskrywin gfooi" value="<?php echo $Inskrywingsfoo i?>" 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:we bmaster@starsit es.co.za">webma ster@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" >Bankbesonderhe de</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"><i nput 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.dt d">

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

    <head>
    <meta http-equiv="content-type" content="text/html;charset=ut f-8" />
    <meta name="generator " content="Adobe GoLive" />
    <title>Untitl ed Page</title>
    <?php
    $Naam = $_POST['Naam'];
    $Van = $_POST['Van'];
    $Klas = $_POST['Klas'];
    $Geslag = $_POST['Geslag'];
    $Kommando = $_POST['Kommando'];
    $Kontak = $_POST['Kontak'];
    $Braaipakke = $_POST['Braaipakke'];
    $Inskrywingsfoo i = $_POST['Inskrywingsfoo i'];
    $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 : $Inskrywingsfoo i, Totaal Verskuldig: $Totaal
    ";
    echo $textline;
    $FILE = fopen("intekend b.txt","a+");
    fputs($FILE,$te xtline);
    Fclose ($FILE);
    ?>
    </p>
    <script type="text/javascript">
    document.locati on = "Tuis.html" </script></body>

    </html>[/PHP]

    Sorry for the Afrikaans text but the event is only Afrikaans (South Africa).
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #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.

    Comment

    • Jacotheron
      New Member
      • Jan 2008
      • 44

      #3
      Originally posted by ak1dnar
      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.

      Comment

      • Jacotheron
        New Member
        • Jan 2008
        • 44

        #4
        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?

        Comment

        Working...