code not working

Alles, was PHP betrifft, kann hier besprochen werden.

code not working

Postby pathfinder80 » 29. June 2007 00:18

I am developing a web application. The below mentioned code creates a form. everything seemd to work fine except that when I click on the Cancel button it should direct to the tools_page.php page, but this i snot working.
Could anybody please help me out.

Code: Select all
<?php
include_once("tools_page");
include_once("functions.php");

$_SESSION['var'] = "Software Localization tools";
$var =& $_SESSION['var'] ;
$form=& $_SESSION['form'];
            
switch($_POST['!submit'])
{
 case "Clear":
               
            clrfrm("integrity_");
 break;

 case "Cancel":

            header( "Location: tools_page.php" );
            exit;
            break;

 case "Integrity Check":

             break;
}

?>

<html>

   <head>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <title>
         <?=$var ?>
      </title>
      <link href="style.css" rel="stylesheet" type="text/css">
   </head>

   <div align="right"><a href="exit_page.php">Exit<br></div></a>

   <body>
      <br>
       <h3 align="center">
         Integrity Check
      </h3>

   <form name="integrity_form" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
      
      <table border="0" cellspacing="0" cellpadding="4" align="center">
         <tr>
         <td>Enter the name of the English string.info file:</td>
         </tr>
         <tr>
         <td><input type="file" name="file1"></td>
         </tr>
         <tr><td><br></td></tr>
         <tr>
         <td>Enter the name of the Target string.info file:</td>
         </tr>
         <tr>
         <td><input type="file" name="file2" ><br></td>
         </tr>
         <tr><td><br></td></tr>
         <tr>
         <td><input name="!submit" type="submit" value="Integrity Check">
         &nbsp;&nbsp;
         <input name="!submit" type="submit" value="Clear">
         &nbsp;&nbsp;
         <input name="!submit" type="submit" value="Cancel"></td>
         </tr>
      </table>
   </form>

   </body>

</html>


Thanks! in advance.
pathfinder80
 
Posts: 12
Joined: 26. June 2007 22:13

Postby Wiedmann » 29. June 2007 00:30

but this i snot working.

- Why not?
- What happens instead?
- Your error_reporting level?
- Any error message?
- Does the switch reach the "Cancel" case? (Make a debug output before header())?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby pathfinder80 » 29. June 2007 00:36

Yes! the switch case reaches the "Cancel" case. but the header function is not working. When I click on the "Cancel button" directs to the same page where the Cancel button is present (but the page is empty)
pathfinder80
 
Posts: 12
Joined: 26. June 2007 22:13

Postby KingCrunch » 29. June 2007 00:56

Yes! the switch case reaches the "Cancel" case.
Are you sure? You should start the name-attribut with a letter and you should not use any special chars.

Put error_reporting(E_ALL) at the top of the script.

Whats happened, when you are using an absolute uri as Location-target? (http://blablub/tools_page.php)
Nicht jeder Fehler ist ein Bug ...
KingCrunch
 
Posts: 1724
Joined: 26. November 2005 19:25

Re: code not working

Postby Knight1 » 29. June 2007 13:32

pathfinder80 wrote:I am developing a web application. The below mentioned code creates a form. everything seemd to work fine except that when I click on the Cancel button it should direct to the tools_page.php page, but this i snot working.
Could anybody please help me out.

Code: Select all
<?php
include_once("tools_page");
include_once("functions.php");

$_SESSION['var'] = "Software Localization tools";
$var =& $_SESSION['var'] ;
$form=& $_SESSION['form'];
            
switch($_POST['!submit'])
{
 case "Clear":
               
            clrfrm("integrity_");
 break;

 case "Cancel":

            header( "Location: tools_page.php" );
            exit;
            break;

 case "Integrity Check":

             break;
}

?>

<html>

   <head>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <title>
         <?=$var ?>
      </title>
      <link href="style.css" rel="stylesheet" type="text/css">
   </head>

   <div align="right"><a href="exit_page.php">Exit<br></div></a>

   <body>
      <br>
       <h3 align="center">
         Integrity Check
      </h3>

   <form name="integrity_form" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
      
      <table border="0" cellspacing="0" cellpadding="4" align="center">
         <tr>
         <td>Enter the name of the English string.info file:</td>
         </tr>
         <tr>
         <td><input type="file" name="file1"></td>
         </tr>
         <tr><td><br></td></tr>
         <tr>
         <td>Enter the name of the Target string.info file:</td>
         </tr>
         <tr>
         <td><input type="file" name="file2" ><br></td>
         </tr>
         <tr><td><br></td></tr>
         <tr>
         <td><input name="!submit" type="submit" value="Integrity Check">
         &nbsp;&nbsp;
         <input name="!submit" type="submit" value="Clear">
         &nbsp;&nbsp;
         <input name="!submit" type="submit" value="Cancel"></td>
         </tr>
      </table>
   </form>

   </body>

</html>


Thanks! in advance.


Hi pathfinder80,
try this:

switch(!$_POST['submit'])


Kai aka Knight1
Image
User avatar
Knight1
 
Posts: 310
Joined: 18. October 2003 10:03
Location: Trier
Operating System: Windows 7 Ultimate x64

Postby KingCrunch » 29. June 2007 14:57

Sorry, but thats ... What should it do? ;)
Nicht jeder Fehler ist ein Bug ...
KingCrunch
 
Posts: 1724
Joined: 26. November 2005 19:25


Return to PHP

Who is online

Users browsing this forum: No registered users and 16 guests