0

I can't seem to figure out why it keeps showing me this error,where am i doing wrong?, can someone help me please

<?php
 include_once "cinc/Tbox.php";  # include the class file for textbox validation
 

// BEGIN PROCESSING HERE
// this version uses POST so we will see the data in the url   

   $showform = NULL;
   
	$theform = "<form method='post' action='links.php'>\n
	 <fieldset>\n
	     <ol>\n
	      <li><label for='Uname'>UserName<em>*</em></label></li>\n
	      <li><input type='text' name='Uname' id='Uname' /></li>\n
	      <li><label for='pwd'>Password<em>*</em></label></li>\n
	      <li><input type='password' name='pwd' id='pwd' /></li>\n
		  <li><label><input type ='checkbox' name='check1' id='check1' />Remember Me<br /></label></li>\n
	      <li><label><input type='submit'  name='submit' value='submit' /></label></li>\n
	    </ol>\n
	 </fieldset>\n
	</form>\n";
	/*******************************************************************
	 *
	 * if the submit button was pressed the form was
	 *    was in the browser and needs processing (and error checking),
	 *    $showform = 'process';
	 * 
	 * if the submit button was not pressed then
	 *    deliver the form to start the process
	 *    $showform = 'show';
	 *
	 ******************************************************************/
 
    if ( isset ($_POST['submit']) ){ 
	
        $box1 = new Tbox("Uname", $_POST['Uname'], "Username");  
        $box2 = new Tbox("pwd", $_POST['pwd'], "Password");  
	
	if( $box1 -> checkNotNull() || $box2 -> checkNotNull() ){
		
	    $showform = 'process';
	    
	} // if
	
    }else{
    	    
	 	$showform = 'show';
    
    } 
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
 <head>
 
  <meta name="description" content="The Department of Computer Information Systems at
Buffalo State College provides a four year undergraduate degree program in information
technology, systems administration, network administration, internet programming, database
programming, and project management." />
<meta name="keywords" content="buffalo state college, computer information systems, cis,
buffalo, undergraduate, IT, college, SUNY, State University of New York, Buff state,
information technology, 475, CIS-475, CIS475, internet programming, xhtml, css, javascript,
dom, php, mysql" />


  <title>Form Delivery</title>
  <link rel="stylesheet" type="text/css" href="../style/cis.css"  />
  <style type="text/css">
    fieldset {
     border: none;
    }
	fieldset li {
	 list-style: none;
	 padding: 5px;
	 margin: 0;
	}
    </style>
    <body link="#FFF" alink="#006699" vlink="#CCC">

	

 </head>
<body>
<div id="header">Duy Nguyen</div>

<div id="center" class="column">
		<h1 align="center">Login Form</h1>
<?
  switch($showform){
  	     	    
    
 
    case 'process':
?>
	<form method='post' action='links.php'>
	 <fieldset>
	     <ol>
	     
	     <? $box1 -> giveForm(); ?>
	     
	     <? $box2 -> giveForm(); ?>
	    
	      <li><label><input type='submit' name='submit' value='submit'  /></label></li>
	    </ol>
	 </fieldset>
	</form>
<?
    
    
	/*************************************************************************
    * case show is entered if the we are visiting the page for the first time
    *************************************************************************/
	
    case 'show':  

	print $theform;
	
	break;
		
?>
	
		
		
	</div>


	<div id="left" class="column">
		<h2 align="center">Site Navigation</h2>
        	<a href="../index.php">Home</a><p />

		<p>&nbsp; </p> <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
		<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
		<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
		
	</div>

	<div id="right" class="column">
		<h2 align="center">Dummy Sites</h2>
		
        	<a href="http://www.yahoo.com">Yahoo!</a><p />
            	<a href="http://www.google.com">Google</a><p />
            	<a href="http://www.facebook.com">Facebook</a><p />
            	<a href="http://www.scionlife.com">Scionlife</a><p />
            	<a href="http://www.ebay.com">Ebay</a><p />
            	<a href="http://www.buffalostate.edu">Buffalo State </a><p />
            	<a href="http://www.amazon.com">Amazon</a>
		<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
		<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
		
            
	</div>

	<div id="footer">Computer Information Systems @ Buffalo State College,
					 Spring 2010</div>


</body> 
</html>
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by =OTS=G-Man
0

looks like you are missing the closing } to your switch statement

also, if I'm remembering right, the way your switch is setup, your "show" case is always going to show, because of the missing break in the "process". Might be the way you wanted it, but just in case after getting the script to run you wont be wondering why its always showing your "show" form.

anyway, hope the missing } fixes your problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.