hcdarkmage Posted August 3, 2010 Share Posted August 3, 2010 Okay, this is a very odd problem. I had this code working for a total of 30 seconds and then it wouldn't work anymore. All I added was some header-location script, but even with that commented out, the code doesn't work anymore. Maybe a little help, please? session_start(); include_once("/home/www-data/landing_pages/configtest.php"); $title="Voucher Blitz"; foreach ($_POST as $key => $value){ $$key = $value; } $errors = false; echo "Default: ".$errors."<br />"; //testing code echo $submit."<br />Blah blah blah!"; //testing code if(isset($submit)){ //Validation Checks echo "<br />First: ".$first_name; //testing code if($first_name == ""){ $errors = true; $disError = "You must enter your first name!<br />"; } echo "<br />Last: ".$last_name; //testing code if($last_name == ""){ $errors = true; $disError .= "You must enter your last name!<br />"; } echo "<br />Email: ".$email; //testing code if($email == ""){ $errors = true; $disError .= "You must enter your email!<br />"; } echo "<br />Errors: ".$errors; //testing code echo "<br />".$disError; //testing code if($errors = false){ //<----- Wasn't going in here echo "This should be working!"; //testing code //enter info into table //header("Location: http://whereitshouldgo.yes"); //exit(); } } ?> <!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" /> <title><?php echo $title?></title> <style> .leftbar { float:left; background: url('<?php echo $basePath?>img/edge.jpg'); width: 5px; height: 31px; } </style> <link rel="icon" href="<?php echo $basePath?>img/logosmall.png" type="image/png"> <link href="<?php echo $basePath?>css/style.css" rel="stylesheet" type="text/css" /> <script src="<?php echo $basePath?>js/jQuery.js"></script> <script src="<?php echo $basePath?>js/jquery.corners.min.js"></script> <script src="<?php echo $basePath?>js/main.js"></script> </head> <body> <center> <div id="mainCont"> <div id="top" class="rounded"> <div id="header"><a href="http://voucherblitz.biz"><img src="<?php echo $basePath ?>img/header_1a.jpg" border="0" alt="Voucher Blitz" /></a></div> <div class="leftbar"></div> <div id="nav" class="fLeft"> <ul> <li><a href="http://voucherblitz.biz/index.php">Home</a></li><li><a href="http://voucherblitz.biz/pages/contact.php">Contact</a></li> <li><a href="http://www.memberweb.com/memberweb/NewLogin.asp?groupID=2150">Login</a></li> </ul> </div> <div id="rightMenu" class="fLeft"><img src="<?php echo $basePath ?>img/header_2.jpg" border="0" alt="Voucher Blitz"/></div> <div class="clear"> </div> </div> <div class="space"></div> <div id="main" class="rounded"> <div class="clear"></div> <div id="leftBox" class="fLeft rounded"> <center> <form action="" method="POST" id="demo" name="demo"> <?php if($errors == true){?> //<---- This stopped showing up when there are errors! <div class="box rounded"> <table width="260px" class="info"> <tr> <td><h3 style="color: #ff0000; text-align: center;">Errors</h3></td> </tr> <tr> <td><font style="color: #ff0000;"><?php echo $disError; ?></font></td> </tr> </table> </div> <?php }?> <div class="box rounded"> <table width="260px" class="info"> <tr> <td><center>* Please fill out all the information to proceed to the demo.</center></td> </tr> </table> </div> <div class="box rounded"> <table width="260px" class="info"> <tr> <td colspan="2"><h3 style="color: #4b678b; text-align: center;">Personal Information</h3></td> </tr> <tr> <td><strong>First Name *</strong></td> <td><input type="text" value="<?php echo $first_name ?>" id="first_name" name="first_name" /></td> </tr> <tr> <td><strong>Last Name *</strong></td> <td><input type="text" value="<?php echo $last_name ?>" id="last_name" name="last_name" /></td> </tr> <tr> <td><strong>Email *</strong></td> <td><input type="text" value="<?php echo $email ?>" id="email" name="email" /></td> </tr> </table> </div> <div class="box rounded"> <table width="260px" class="info"> <tr> <td><input style="height: 30px; width: 250px;" id="submit" type="submit" action="Submit" value="Go To Demo" name="submit" /></td> </tr> </table> </div> </form> </center> </div> <div class="clear"> </div> </div><!--end mainCont--> <div class="space"></div> <center> <div id="footer" class="rounded">© 2009 Voucher Blitz :: <a href="http://voucherblitz.biz/pages/contact.php">Contact Us </a>::</div> </center> </div> </center> </body> </html> Link to comment https://forums.phpfreaks.com/topic/209688-it-brokeded/ Share on other sites More sharing options...
AbraCadaver Posted August 3, 2010 Share Posted August 3, 2010 = is assignment. == and === are comparison. Link to comment https://forums.phpfreaks.com/topic/209688-it-brokeded/#findComment-1094677 Share on other sites More sharing options...
hcdarkmage Posted August 3, 2010 Author Share Posted August 3, 2010 Sometimes it takes a second eye to check your work. Thanks for that. I would have spent hours looking for the wrong issue. Link to comment https://forums.phpfreaks.com/topic/209688-it-brokeded/#findComment-1094680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.