Jump to content

I am lost...I have tried everything I can find, but this form still doesn't work


JenLiss

Recommended Posts

Ok. I have read everything I could find on how to fix this problem...but nothing seems to work. I have some suspect reasons why I think it doesn't work, but I don't know how to fix it. I read the notice about posting "headers already sent" and nothing in there helped me either. I am at my wits end!

 

I have a form that is contained in a left navigation file that is an "include" file for other pages of the website. Here is the code for the left navigation file:

 

<?php

//process the email
if (array_key_exists('send', $_POST)) {
   $to = 'jliss32@gmail.com';
   $subject = 'Form Submission from JudeLaw LLC for Bankruptcy';

//list expected fields
$expected = array('name', 'street','city', 'phone', 'email', 'time', 'hearaboutus', 'otherwho', 'who', 'needs', 'question');

//set required fields
$required = array('name', 'street', 'city', 'phone', 'email');

//create empty array for missing fields
$missing = array();

// assume that there is nothing suspect
  $suspect = false;

// create a pattern to locate suspect phrases
  $pattern = '/Content-Type:|Bcc:|Cc:/i';

// function to check for suspect phrases
  function isSuspect($val, $pattern, &$suspect) {
    
// if the variable is an array, loop through each element
// and pass it recursively back to the same function
   if (is_array($val)) {
      foreach ($val as $item) {
       isSuspect($item, $pattern, $suspect);
       }
     }
    else {

// if one of the suspect phrases is found, set Boolean to true
     if (preg_match($pattern, $val)) {
        $suspect = true;
       }
     }
    }

// check the $_POST array and any sub-arrays for suspect content
  isSuspect($_POST, $pattern, $suspect);
  
  if ($suspect) {
    $mailSent = false;
   unset($missing);
   }
  else {

// process the $_POST variables
foreach ($_POST as $key => $value) {

//assign to temporary variable and strip whitespace if not an array
$temp = is_array($value) ? $value : trim($value);

//if empty and required, add to $missing array
if (empty($temp) && in_array($key, $required)) {
   array_push($missing, $key);
}

//otherwise, assign to a variable of the same name as $key
elseif (in_array($key, $expected)) {
   ${$key} = $temp;
}
}
}

// validate the email address
  if (!empty($email)) {
    
// regex to ensure no illegal characters in email address 
   $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';

// reject the email address if it doesn't match
   if (!preg_match($checkEmail, $email)) {
     array_push($missing, 'email');
     }
   }

// go ahead only if not suspect and all required fields OK
  if (!$suspect && empty($missing)) {

//set default values for variables that might not exist
$hearaboutus = isset($hearaboutus) ? $hearaboutus : 'Nothing selected';
$needs = isset($needs) ? $needs : array('None selected');

//build the message
$message = "$name\n\n";
$message .= "$street\n\n";
$message .= "$city\n\n";
$message .= "$phone\n\n";
$message .= "$email\n\n";
$message .= "Best time to reach you? $time\n\n";
$message .= "How did you hear about us? $hearaboutus\n\n";
$message .= "Other: $otherwho\n\n";
$message .= "Referred by: $who\n\n";
$message .= 'What do you need? '.implode(', ', $needs). "\n\n";
$message .= "$question\n\n";

//send it
$mailSent = mail($to, $subject, $message);
if ($mailSent) {
   
// redirect the page with a fully qualified URL
   header('Location: http://www.judelawllc.com/contact-thank-you-bk.php');
   exit;
      }
   }
}
?>
<div id="sidebarItem1">
<p><a href="http://www.referrallist.com/listing/judelaw-llc.html" target="_blank"><img src="http://www.judelawllc.com/images/martinoLogo.gif" width="216" height="168" alt="Tom Martino Referral List" /></a><br />
  <br />
  <a href="http://www.bbb.org/denver/business-reviews/60075-112/jude-law-llc-90107441" target="_blank"><img src="http://www.justgoodbusiness.biz/logoonline/getimage.php?bid=90107441&c=blue&h=1" width="187" height="83" border="0" title="Click to verify BBB accreditation and to see a BBB report." alt="Click to verify BBB accreditation and to see a BBB report." /></a></p>
<p><img src="http://www.judelawllc.com/images/ColoradoBarAssoc_Logo.jpg" width="180" height="40" alt="Colorado Bar Association" /></p>
    <p><img src="http://www.judelawllc.com/images/nacba-logo.jpg" width="180" height="35" alt="National Association of Consumer Bankruptcy Attorneys" /></p>
<!-- start RatePoint Widget - Please, do not change -->
<iframe src="//sitetools.ratepoint.com/widget/36561?style=2&color=3&wide=1&number_of_reviews=1&average_rating=1&rotate_reviews=1&show_links=1" width="200" height="204" scrolling="no" frameborder="0" border="0">
</iframe>
<p>
  <!-- end RatePoint Widget - Please, do not change -->
</p>
<A class=the_url href="http://ratepoint.com/tellus/36561" target=_blank>Rate us and write a review!</A> 
</div>
  <div id="sidebarItem4">
    <h1 class="FormFill">Fill out the form below...<br />
      Get a Call TODAY!</h1>
    <div id="sidebarItem4Content">
      <?php
if ($_POST && isset($missing) && !empty($missing)) {
?>
<p class="warning">Please complete the missing item(s) indicated.</p>
<?php
}
elseif ($_POST && !$mailSent) {
?>
<p class="warning">Sorry, there was a problem sending your message. Please try again later. If you need immediate assistance, please call(303)757-5833! Thank you.</p>
<?php } ?>
        <form id="contact" method="post" action="">
          <p>
            <label for="name">Name:<?php
            if (isset($missing) && in_array('name', $missing)) { ?>
            <span class="warning">Please enter your name</span><?php } ?></label><br />
              <input name="name" id="name" type="text" class="formbox" 
              <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['name']).'"';
           } ?>
              />
          </p>
          <p>
            <label for="street">Street Address:<?php
            if (isset($missing) && in_array('name', $missing)) { ?>
            <span class="warning">Please enter your street address</span><?php } ?></label><br />
              <input name="street" id="street" type="text" class="formbox" 
              <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['street']).'"';
           } ?>
              />
          </p>
          <p>
            <label for="city">City/State/Zip<?php
            if (isset($missing) && in_array('name', $missing)) { ?>
            <span class="warning">Please enter your city/state/zip</span><?php } ?></label><br />
              <input name="city" id="city" type="text" class="formbox" 
              <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['city']).'"';
           } ?>
              />
          </p>
          <p>
            <label for="phone">Phone:<?php
            if (isset($missing) && in_array('phone', $missing)) { ?>
            <span class="warning">Please enter your phone number</span><?php } ?></label><br />
              <input name="phone" id="phone" type="text" class="formbox" 
              <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['phone']).'"';
           } ?>/>
          </p>
          <p>
            <label for="email">E-mail:<?php
            if (isset($missing) && in_array('email', $missing)) { ?>
            <span class="warning">Please enter your email</span><?php } ?></label><br />
              <input name="email" id="email" type="text" class="formbox" 
              <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['email']).'"';
           } ?>/>
              </p>
                <p>
                <label for="select">Best Time To Reach You?</label><br />
                <select name="time" id="time">
                <option value="No reply"
                <?php
            if (!$_POST || $_POST['time'] == 'No reply') { ?>
                selected="selected"
                <?php } ?>
                >Select one</option>
                  <option value="Any"
                  <?php
                  if (isset($missing) && $_POST['time'] == 'Any') { ?>
                  selected="selected"
                  <?php } ?>
                  >Any</option>
                  
                  <option value="Morning"
                  <?php
                  if (isset($missing) && $_POST['time'] == 'Morning') { ?>
                  selected="selected"
                  <?php } ?>
                  >Morning</option>
                  
                  <option value="Afternoon"
                  <?php
                  if (isset($missing) && $_POST['time'] == 'Afternoon') { ?>
                  selected="selected"
                  <?php } ?>
                  >Afternoon</option>
                  
                  <option value="Evening"
                  <?php
                  if (isset($missing) && $_POST['time'] == 'Evening') { ?>
                  selected="selected"
                  <?php } ?>
                  >Evening</option>
                </select>
              </p>
           <fieldset id="hearaboutus">
              <p><strong class="FormText">How did you hear about us?</strong></p>
              <p>
              <input name ="hearaboutus" type="radio" value="Google" id="google"
              <?php
           $OK = isset($_POST['hearaboutus']) ? true:false;
           if($OK && isset($missing) && $_POST['hearaboutus'] == 'Google') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="google">Google</label>
              
              <input name ="hearaboutus" type="radio" value="Yahoo" id="yahoo"
              <?php
           if ($OK && isset($missing) && $_POST['hearaboutus'] == 'Yahoo') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="yahoo">Yahoo</label>

              <input name ="hearaboutus" type="radio" value="Bing" id="bing"
              <?php
           if ($OK && isset($missing) && $_POST['hearaboutus'] == 'Bing') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="bing">Bing</label>
              <br />
              <input name ="hearaboutus" type="radio" value="Tom Martino" id="tommartino"
              <?php
           if ($OK && isset($missing) && $_POST['hearaboutus'] == 'Tom Martino') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="tommartino">Tom Martino</label>
             
              <input name ="hearaboutus" type="radio" value="Craigslist" id="craigslist"
              <?php
           if ($OK && isset($missing) && $_POST['hearaboutus'] == 'Craigslist') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="craigslist">Craigslist</label>
               <br />
              <input name ="hearaboutus" type="radio" value="Backpage" id="backpage"
              <?php
           if($OK && isset($missing) && $_POST['hearaboutus'] == 'Backpage') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="backpage">Backpage</label>
              
              <input name ="hearaboutus" type="radio" value="Facebook" id="facebook"
              <?php
           if($OK && isset($missing) && $_POST['hearaboutus'] == 'Facebook') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="facebook">Facebook</label>
              
               <br />
              <input name ="hearaboutus" type="radio" value="AngiesList" id="angieslist"
              <?php
           if($OK && isset($missing) && $_POST['hearaboutus'] == 'AngiesList') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="angieslist">Angie's List</label>
              <br />
              <input name ="hearaboutus" type="radio" value="Other" id="othersite"
              <?php
           if ($OK && isset($missing) && $_POST['hearaboutus'] == 'Other') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="othersite">Other</label><br />
              <label for="otherwho">Please tell us where?</label><br />
            <input name="otherwho" type="text" class="formbox" id="otherwho" value="" size="22" <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_post['otherwho']).'"';
           } ?>="<?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['otherwho']).'"';
           } ?>" />
              <br />
              <input name ="hearaboutus" type="radio" value="Referral" id="referral"
              <?php
           if ($OK && isset($missing) && $_POST['hearaboutus'] == 'Referral') { ?>
              checked="checked"
              <?php } ?>
              />
              <label for="referral">Referral</label><br />
            <label for="who">Who referred you?</label><br />
            <input name="who" type="text" class="formbox" id="who" value="" size="22" <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_post['who']).'"';
           } ?>="<?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['who']).'"';
           } ?>" />
            </p>
              </fieldset>
            <fieldset id="needs">
            <p><strong class="FormText">What do you need?</strong></p>
         <p>
            <input type="checkbox" name="needs[]" value="I Want a Free Consultation" id="consult"
            <?php
         $OK = isset($_POST['needs']) ? true: false;
         if ($OK && isset($missing) && in_array('Schedule a showing', $_POST['needs'])) { ?>
            checked="checked"
            <?php } ?>
            />
            <label for="consult">I Want a Free Consultation</label>
            <br />
            <input type="checkbox" name="needs[]" value="Have a question" id="havequestion"
            <?php
         if ($OK && isset($missing) && in_array('Have a question', $_POST['needs'])) { ?>
            checked="checked"
            <?php } ?>
            />
            <label for="haveaquestion">I Have A Question</label>
            </p>
            </fieldset>
            <p>
            <label for="question">How may we help you?</label><br />
            <textarea name="question" cols="22" class="formbox" id="question" <?php if (isset($missing)) {
              echo 'value="'.htmlentities($_POST['question']).'"';
           } ?>"></textarea>
          </p>
            <p>
            <input name="send" id="send" type="submit" value="Send message" />
            <input name="reset" id="reset" type="reset" value="Reset Form" />
            </p>
        </form>
        <br />
    </div>
  </div>

Everything worked fine until I wanted to redirect the user to another page for email confirmation. I need to have the user go to a new page so I can use the Google Analytics tracking code for PPC campaigns. So, here is a sample of how this file is included in other pages of the site. I suspect this is the problem, the other pages contain HTML before this file is included.

<!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 name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<title>Thank You! | JudeLaw LLC</title>
<meta name="description" content="JudeLaw has a qualified and experienced attorney that practices in all (5) Federal Bankruptcy Courts in Colorado. JudeLaw is the lawyer with the experience that is able to file your case not only in the Denver Bankruptcy Court, but also in Fort Collins, LoveLand, Greeley, Colorado Springs, Grand Junction and Pueblo bankruptcy courts." />
<meta name="keywords" content="about JudeLaw, judelaw, jude law, bankruptcy, personal injury, attorney, lawyer, judelaw employees" />
<!-- STYLES -->
<link href="http://www.judelawllc.com/styles/base.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="outerWrapper">
<div id="headerWrapper"><img src="../images/header-logo-01.jpg" width="800" height="137" alt="JudeLaw LLC" /></div>
<div id="navWrapper"><?php require ('includes/mainNav.php'); ?></div>
<div id="bodyWrapper">
<div id="sidebarWrapper"><?php require ('includes/content-nav-sidebar_thank.php'); ?></div>
    <div id="contentContainer">
      <div id="contentContainerTitle">
        <h1>Thank You for contacting us!</h1>
      </div>
      <div id="contentContainerBody">
        <h5>Your message has been sent.</h5>
        <p>We will review your inquiry and will be able to help you with your situation very shortly. Thank you for considering Jude Law for your legal needs. <br /><br />If you need immediate assistance, please call 303-757-5833 and someone will be able to assist you. Thank you!</p>
      <!-- Google Code for contact form thank you Conversion Page -->
<script type="text/javascript">
<!--
var google_conversion_id = 1035626379;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "9RXqCPXzgwEQi8_p7QM";
var google_conversion_value = 0;
if (800.00) {
  google_conversion_value = 800.00;
}
//-->
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1035626379/?value=800.00&label=9RXqCPXzgwEQi8_p7QM&guid=ON&script=0"/>
</div>
</noscript>

<SCRIPT>
microsoft_adcenterconversion_domainid = 799687;
microsoft_adcenterconversion_cp = 5050;
microsoft_adcenterconversionparams = new Array();
microsoft_adcenterconversionparams[0] = "dedup=1";
</SCRIPT>
<SCRIPT SRC="https://0.r.msn.com/scripts/microsoft_adcenterconversion.js"></SCRIPT>
<NOSCRIPT><IMG width=1 height=1 SRC="https://799687.r.msn.com/?type=1&cp=1&dedup=1"/></NOSCRIPT><a href="http://advertising.microsoft.com/MSNadCenter/LearningCenter/adtracker.asp" target="_blank">::adCenter::</a>

<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! Inc.
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid  = "1TKLPE8MB57H8SOJHVOE3OU6KOO";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' " 
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid 
+ "></SCR" + "IPT>");
// -->
</SCRIPT>
      </div>
    </div>
    <div class="clear"></div>
  <div id="footerWrapper"><?php require ('includes/footer.php'); ?></div>
</body>
</html>

 

Please give me some new ideas on what to try in order to make this work. I just need to have the redirect work so I can still use the code for analytics to track conversions.

 

Thank You!

 

Mod edit:

 . . . 

tags added.

Link to comment
Share on other sites

I am not sure how to do that...wrap the code?? I tried to search for help on how to post on here, but I don't see anything. Here is the error I get though:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/l/a/jladm1n/html/test.php:7) in /home/content/j/l/a/jladm1n/html/includes/content-nav-sidebar_test.php  on line 106

 

It is telling me that the error is on this line:

header('Location: http://www.judelawllc.com/contact-thank-you-bk.php');

Link to comment
Share on other sites

Test.php is one of the pages of the website. This website was set up with div tags and php include files. Each page of the site has a header, main nav, left nav, and footer file that is included. The form is located in that left navigation include file. Here is the code for the test.php page....

 

<!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 name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<title>Bankruptcy Package Details | JudeLaw LLC</title>
<meta name="description" content="JudeLaw has a qualified and experienced attorney that practices in all (5) Federal Bankruptcy Courts in Colorado. JudeLaw is the lawyer with the experience that is able to file your case not only in the Denver Bankruptcy Court, but also in Fort Collins, LoveLand, Greeley, Colorado Springs, Grand Junction and Pueblo bankruptcy courts." />
<meta name="keywords" content="bankruptcy, personal injury, attorney, lawyer" /><!-- META TAGS -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><!-- STYLES -->
<link href="styles/base.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="outerWrapper">
<div id="headerWrapper"><img src="images/header-logo-01.jpg" width="800" alt="JudeLaw LLC" /></div>
<div id="navWrapper"><?php require ('includes/mainNav.php'); ?></div>
<div id="bodyWrapper"><script src="Scripts/swfobject_modified.js" type="text/javascript">
</script>
<div id="sidebarWrapper"><?php require ('includes/content-nav-sidebar_test.php'); ?></div>
<div id="contentContainer">
        	<div id="contentContainerTitle" class="bankruptcy">
        	  <h1>Bankruptcy Package Details</h1>
        	</div>
            <div id="contentContainerBody">
              <table width="490" border="1">
                <tr>
                  <td valign="top" bgcolor="#cfd9fd"><table width="490" cellspacing="10">
                    <tr>
                      <td colspan="3" valign="top"><span class="StepTitleNoUnderline">*** HOPE PAYMENT PLAN ***</span></td>
                    </tr>
                    <tr>
                      <td colspan="3" valign="top" class="asteriskText"><span class="asteriskTextBold">Payment Plan Includes:</span></td>
                    </tr>
                    <tr>
                      <td width="22" align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td width="432" colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">Attorney Fee</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"> </td>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td valign="middle"><span class="BankruptcyLandingSubTitle">Free Consult</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"> </td>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td valign="middle"><span class="BankruptcyLandingSubTitle">JudeLaw Drafts and Files your petition</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"> </td>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td valign="middle"><span class="BankruptcyLandingSubTitle">You are represented at the 341 Court Hearing</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">First Financial Management Debtors Class is FREE</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">Post Debtors Financial Management Course</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">Creditors May Call Judelaw</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">Pay your Federal Court File Fee of $299.00 <br />
in (4) Equal Payments</span></td>
                    </tr>
                    <tr>
                      <td colspan="3" valign="top"><span class="StepTitleNoUnderline">Payment Schedule</span><span class="StepTitle"><span class="AsLowAs"></span></span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">$300.00 Down</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">Make Payments at your convenience</span></td>
                    </tr>
                  </table></td>
                </tr>
              </table>
<p> </p>
              <table width="490" border="1">
                <tr>
                  <td valign="top" bgcolor="#cfd9fd"><table width="490" cellspacing="10">
                    <tr>
                      <td colspan="3" valign="top"><span class="StepTitleNoUnderline">As low as: $499.99*</span><span class="StepTitle">ProSe Bankruptcy <span class="AsLowAs">(What you get):</span></span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td width="418" colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">Free consult with attorney</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">You file your own petition</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">You represent yourself in court</span></td>
                    </tr>
                      <tr>
                    <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">We DO NOT legally represent you</span></td>
                    </tr>
                      <tr>
                        <td colspan="3" align="left" valign="top"><span class="asteriskTextBold">*DOES NOT INCLUDE FEDERAL CRT. FILE FEE OF $299.00<br />
*DOES NOT INCLUDE (2) FINANCIAL MGMT. COURSES</span></td>
                      </tr>
                  </table></td>
                </tr>
              </table>
              <p> </p>
              <table width="490" border="1">
                <tr>
                  <td valign="top" bgcolor="#cfd9fd"><table width="490" cellspacing="10">
                    <tr>
                      <td colspan="3" valign="top"><span class="StepTitleNoUnderline">$799.99 </span><span class="StepTitle">Bankruptcy<span class="AsLowAs"> (What you get):</span></span></td>
                    </tr>
                    <tr>
                      <td colspan="3" valign="top" class="asteriskTextBold">(Denver Metro Area, Colorado Springs, Fort Collins, Greeley)</td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">FREE consultation with an attorney on your case!</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">FLAT FEE* Attorney Fee is a Flat Fee! NO HIDDEN FEES!</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">FULL Attorney Representation Includes:</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"> </td>
                      <td width="30" align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td width="388" valign="middle"><span class="BankruptcyLandingSubTitle">JudeLaw drafts and files your Chapter 7 petition</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"> </td>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td valign="middle"><span class="BankruptcyLandingSubTitle">JudeLaw represents you in court</span></td>
                    </tr>
                    <tr>
                      <td colspan="3" align="left" valign="top"><span class="asteriskTextBold">*DOES NOT INCLUDE FEDERAL CRT. FILE FEE OF $299.00<br />
*DOES NOT INCLUDE (2) FINANCIAL MGMT. COURSES</span></td>
                    </tr>
                  </table></td>
                </tr>
              </table>
              <p> </p>
              <table width="490" border="1">
                <tr>
                  <td valign="top" bgcolor="#cfd9fd"><table width="490" cellspacing="10">
                    <tr>
                      <td colspan="3" valign="top"><span class="StepTitleNoUnderline">$999.99 </span><span class="StepTitle">Bankruptcy<span class="AsLowAs"> (What you get):</span></span></td>
                    </tr>
                    <tr>
                      <td colspan="3" valign="top" class="asteriskText"><span class="asteriskTextBold">(Pueblo/Grand Junction Areas)</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">FREE consultation with an attorney on your case!</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">FLAT FEE* Attorney Fee is a Flat Fee! NO HIDDEN FEES!</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td colspan="2" valign="middle"><span class="BankruptcyLandingSubTitle">FULL Attorney Representation Includes:</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"> </td>
                      <td width="30" align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td width="388" valign="middle"><span class="BankruptcyLandingSubTitle">JudeLaw drafts and files your Chapter 7 petition</span></td>
                    </tr>
                    <tr>
                      <td align="center" valign="top"> </td>
                      <td align="center" valign="top"><img src="../images/checkbox.jpg" width="24" alt="Checkbox" /></td>
                      <td valign="middle"><span class="BankruptcyLandingSubTitle">JudeLaw represents you in court</span></td>
                    </tr>
                    <tr>
                      <td colspan="3" align="left" valign="top"><span class="asteriskTextBold">*DOES NOT INCLUDE FEDERAL CRT. FILE FEE OF $299.00<br />
*DOES NOT INCLUDE (2) FINANCIAL MGMT. COURSES</span></td>
                    </tr>
                  </table></td>
                </tr>
              </table>
              <p> </p>
              <p><a href="NovTrivia3.php"><img src="images/turkey.jpg" width="216" height="212" alt="November Trivia #3" /></a></p>
    </div>
  </div>
        <div class="clear"></div>
</div>
<div id="footerWrapper"><?php require ('includes/footer.php'); ?></div>
</body>
</html>

Link to comment
Share on other sites

Hmmmm...I was suspecting that is why it wasn't working. I inherited this site and there are alot of pages set to work this way. Since there doesn't seem to be a way to have the "header redirect" sent before the html on each of the pages, is there any other way to redirect the user to a new page when their form is submitted? That would still allow me to track the conversions with Google??

Link to comment
Share on other sites

I think I don't know enough about all the different ways to make a .php form work. The existing form works and goes to a new page just like I want this one too. However, the form is basic and doesn't have any sticky fields or required fields. If I post the existing pages that work maybe you could help me figure out how to modify those to include the fields I added in the previous posts? Would you be willing to do that?

Link to comment
Share on other sites

Thank you!

 

Ok...so here are the codes for the existing pages...first the left navigation file with the form:

 

<div id="sidebarItem1">
<p><a href="http://www.referrallist.com/listing/judelaw-llc.html" target="_blank"><img src="http://www.judelawllc.com/images/martinoLogo.gif" width="216" height="168" alt="Tom Martino Referral List" /></a><br />
  <br />
  <a href="http://www.bbb.org/denver/business-reviews/60075-112/jude-law-llc-90107441" target="_blank"><img src="http://www.justgoodbusiness.biz/logoonline/getimage.php?bid=90107441&c=blue&h=1" width="187" height="83" border="0" title="Click to verify BBB accreditation and to see a BBB report." alt="Click to verify BBB accreditation and to see a BBB report." /></a></p>
<p><img src="http://www.judelawllc.com/images/ColoradoBarAssoc_Logo.jpg" width="180" height="40" alt="Colorado Bar Association" /></p>
    <p><img src="http://www.judelawllc.com/images/nacba-logo.jpg" width="180" height="35" alt="National Association of Consumer Bankruptcy Attorneys" /></p>
<!-- start RatePoint Widget - Please, do not change -->
<iframe src="//sitetools.ratepoint.com/widget/36561?style=2&color=3&wide=1&number_of_reviews=1&average_rating=1&rotate_reviews=1&show_links=1" width="200" height="204" scrolling="no" frameborder="0" border="0">
</iframe>
<p>
  <!-- end RatePoint Widget - Please, do not change -->
</p>
<A class=the_url href="http://ratepoint.com/tellus/36561" target=_blank>Rate us and write a review!</A> 
</div>
  <div id="sidebarItem4">
    <h1 class="FormFill">Fill out the form below...<br />
      Get a Call TODAY!</h1>
    <div id="sidebarItem4Content">
      <form action="/webformmailer.php" method="post">
        <input type="hidden" name="subject" value="Submission" />
        <input type="hidden" name="redirect" value="contact-thank-you.php" />
        <table width="200" border="0" cellspacing="0" cellpadding="5">
          <!--DWLayoutTable-->
          <tr>
            <td width="278" height="35" valign="top"><p><strong class="FormText">Name:</strong><br />
                <input name="Name" type="text" id="Name" size="25" />
              </p></td>
          </tr>
          <tr>
            <td height="35" valign="top"><p> <strong class="FormText">Street Address:</strong> <br />
                <input name="Address" type="text" id="Address" size="25" />
              </p></td>
          </tr>
          <tr>
            <td height="35" valign="top"><p> <strong class="FormText">City / State / Zip</strong><br />
                <input name="Address2" type="text" id="Address3" size="25" />
              </p></td>
          </tr>
          <tr>
            <td height="35" valign="top"><p> <span class="FormText"><strong>Phone:</strong></span><strong><br />
                </strong>
                <input name="Phone" type="text" id="Phone" size="25" />
              </p></td>
          </tr>
          <tr>
            <td height="35" valign="top"><p> <strong class="FormText">Email:</strong><br />
                <input name="Email" type="text" id="Email" size="25" />
              </p></td>
          </tr>
          <tr>
            <td height="41" valign="top"><p> <strong class="FormText">Best time to contact you?<br />
                </strong>
                <select name="Best time to reach" id="Best_time_to_reach">
                  <option value="Any">Any</option>
                  <option value="Morning">Morning</option>
                  <option value="Afternoon">Afternoon</option>
                  <option value="Evening">Evening</option>
                </select>
              </p></td>
          </tr>
          <tr>
            <td height="140" valign="top"><p> <strong class="FormText">How may we help you?</strong><br />
                <textarea name="Comments" cols="19" rows="4" id="Comments"></textarea>
                <br />
                <input type="submit" name="Submit" value="Submit" /></p>
            </td>
          </tr>
        </table>
      </form>
    </div>
  </div>

 

 

Then, the contact thank you page the user goes to when the hit the submit button:

 

<!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 name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<title>Thank You! | JudeLaw LLC</title>
<meta name="description" content="JudeLaw has a qualified and experienced attorney that practices in all (5) Federal Bankruptcy Courts in Colorado. JudeLaw is the lawyer with the experience that is able to file your case not only in the Denver Bankruptcy Court, but also in Fort Collins, LoveLand, Greeley, Colorado Springs, Grand Junction and Pueblo bankruptcy courts." />
<meta name="keywords" content="about JudeLaw, judelaw, jude law, bankruptcy, personal injury, attorney, lawyer, judelaw employees" />

<!-- META TAGS -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- STYLES -->
<link href="../styles/base.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="outerWrapper">
<div id="headerWrapper"><img src="../images/header-logo-01.jpg" width="800" height="137" alt="JudeLaw LLC" /></div>
<div id="navWrapper"><?php require ('includes/mainNav.php'); ?></div>
<div id="bodyWrapper">
<div id="sidebarWrapper"><?php require ('includes/content-nav-sidebar.php'); ?></div>
    <div id="contentContainer">
      <div id="contentContainerTitle">
        <h1>Thank You for contacting us!</h1>
      </div>
      <div id="contentContainerBody">
        <h5>Your message has been sent.</h5>
        <p>We will review your inquiry and will be able to help you with your situation very shortly. Thank you for considering Jude Law for your legal needs. <br /><br />If you need immediate assistance, please call 303-757-5833 and someone will be able to assist you. Thank you!</p>
      <!-- Google Code for contact form thank you Conversion Page -->
<script type="text/javascript">
<!--
var google_conversion_id = 1035626379;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "9RXqCPXzgwEQi8_p7QM";
var google_conversion_value = 0;
if (800.00) {
  google_conversion_value = 800.00;
}
//-->
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1035626379/?value=800.00&label=9RXqCPXzgwEQi8_p7QM&guid=ON&script=0"/>
</div>
</noscript>

<SCRIPT>
microsoft_adcenterconversion_domainid = 799687;
microsoft_adcenterconversion_cp = 5050;
microsoft_adcenterconversionparams = new Array();
microsoft_adcenterconversionparams[0] = "dedup=1";
</SCRIPT>
<SCRIPT SRC="https://0.r.msn.com/scripts/microsoft_adcenterconversion.js"></SCRIPT>
<NOSCRIPT><IMG width=1 height=1 SRC="https://799687.r.msn.com/?type=1&cp=1&dedup=1"/></NOSCRIPT><a href="http://advertising.microsoft.com/MSNadCenter/LearningCenter/adtracker.asp" target="_blank">::adCenter::</a>

<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! Inc.
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid  = "1TKLPE8MB57H8SOJHVOE3OU6KOO";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' " 
+ "SRC=//" + "srv3.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid 
+ "></SCR" + "IPT>");
// -->
</SCRIPT>
      </div>
    </div>
    <div class="clear"></div>
  <div id="footerWrapper"><?php require ('includes/footer.php'); ?></div>
</body>
</html>

 

 

And finally...a random page in the site that uses php require to include the left navigation file.

 

<!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 name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<title>Business Bankruptcy Attorney Colorado | Business Bankruptcy Denver | Ch 7, Ch 11, Ch 13 | JudeLaw LLC</title>
<meta name="description" content="Is your business in trouble? Do you need to reorganize or file bankruptcy to get out of debt? We can help, call now! You can file a chapter 7, chapter 11 or chapter 13 bankruptcy with a business." />
<meta name="keywords" content="colorado, bankruptcy, lawyer, attorney, business bankruptcy, lowest cost business bankruptcy, filing business bankruptcy, business bankruptcy information, colorado business bankruptcy lawyer, colorado business bankruptcy, business bankruptcy attorney, business bankruptcy denver, business bankruptcy lawyer colorado, business bankruptcy law firms, declare business bankruptcy" /><!-- META TAGS -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- STYLES -->
<link href="../../styles/base.css" rel="stylesheet" type="text/css" />
<!-- SCRIPTS -->

<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script type='text/javascript' src='http://www.judelawllc.com/collapse.js'></script>
                
</head>
<body>
<div id="outerWrapper">
<div id="headerWrapper"><img src="../../images/header-logo-01.jpg" width="800" height="137" alt="JudeLaw LLC" /></div>
<div id="navWrapper"><?php require ('../../includes/mainNav.php'); ?></div>
<div id="bodyWrapper">
<div id="sidebarWrapper"><?php require ('../../includes/content-nav-sidebar.php'); ?></div>
<div id="contentContainer">
<div id="contentContainerTitle" class="bankruptcy">
<h1>Business Bankruptcy</h1>
</div>
<div id="contentContainerBody">
  <table width="491">
    <tr>
      <td width="479" align="left" valign="top"><h3sitemap>Is your business in trouble?</h3sitemap></td>
      </tr>
    <tr>
      <td align="left" valign="top">
        <h3>Should my business file bankruptcy?</h3><img src="http://www.judelawllc.com/images/businessBankruptcy.jpg" class="floatRight" alt="Business Bankruptcy" />
        <p>Is bankruptcy right for your business? Can filing bankruptcy help save your company? The only way to know for sure is to speak with a qualified business bankruptcy attorney. Call now and have a free consultation with an experienced business bankruptcy attorney! 303.757.5833.
        <p>With a business you can file a chapter 7, chapter 11 or chapter 13 bankruptcy. One key thing to remember, an individual can receive discharge through bankruptcy, not a business. A business can file for bankruptcy in their own right...however, most business owners personally guarantee their debt, which ultimately causes the owner to file for bankruptcy.                
<p>For small and medium sized entities, debt relief may be sought by the   business owner personally filing for bankruptcy under <a href="http://www.judelawllc.com/bankruptcy/chapter7/Chapter7-Bankruptcy-Attorney-Colorado-Google.php" target="_blank" lid="chapter 7">chapter 7</a> or <a href="http://www.judelawllc.com/bankruptcy/chapter13/Chapter13-Bankruptcy-Attorney-Colorado-Google.php" target="_blank" lid="chapter 13">chapter   13</a> of the Bankruptcy Code. In these cases, there is not a distinction   between the business and the debtor. As experienced bankruptcy lawyers, we will   assist business owners in correctly filing a chapter 7 or chapter 13 bankruptcy   so that they are able to get a fresh start. However, if the business is   incorporated, the corporation itself may need to seek reorganization under   chapter 11.</p>
<p>Chapter 11 bankruptcy is available for corporations, partnerships, and   individuals, but is used mostly by troubled corporations and partnerships.   Chapter 11 allows the debtor to remain in operation while working out a   reorganization plan in which the debtor proposes a plan of paying or settling   the debts. The creditors vote on the reorganization plan, and the plan also must   be approved by the court. Chapter 11 is designed to preserve a viable business   that otherwise would be lost in a liquidation.</p>
<p>For more information on chapter 7 or chapter 13 bankruptcies, click on the links below. Additionally, you can read through the FAQ in the Just Ask Jude FAQ.</p>
<li class="sidebarSubnav"><a href="../chapter7/Chapter7-Bankruptcy-Attorney-Colorado-Google.php" target="_blank">Chapter 7</a></li>
        <li class="sidebarSubnav"><a href="../chapter13/Chapter13-Bankruptcy-Attorney-Colorado-Google.php" target="_blank">Chapter 13</a></li>
        <li class="sidebarSubnav"><a href="../FAQ/Just_Ask_Jude.php" target="_blank">Just Ask Jude FAQ</a></li>
        <p>Deciding whether bankruptcy is appropriate for your business may be one of the most difficult decisions you’ll ever make. But having information about what could happen to you and your business in the bankruptcy process can help. </p>
        <h3>Should the business be reorganized or liquidated? </h3>
        <p>How do you decide if your company has no life left? The debts of a business can often be very detrimental to a small business owner.   If your business is facing uncontrollable debt, we may be able to assist you. </p>
        <p>Your best option is to contact an experienced business bankruptcy attorney that you can trust to discuss all the options available to you and your company. Call now for your free consultation, 303-757-5833.</p>
        <h3>Concerned that your company won't survive the recession?</h3>
        <p>Are you experiencing any of the following?</p>
        <p>- Can’t pay your employees on time?</p>
        <p>- Can't pay your taxes? What happens when the IRS padlocks your door?</p>
        <p>- Is bankruptcy the right answer? Will this save your company or kill it?</p>
        <p>- Can't make your loan payment? Is the bank going to foreclose?</p>
        <p>- Will I be working the rest of my life to pay these debts? Could they take my house?</p>
        <h3>What bankruptcy can't do:</h3><p>Bankruptcy can't make the recession go away, increase consumer spending or increase your revenue. </p>
        <h3>What bankruptcy can do:</h3><p>Bankruptcy can free up money being paid towards old debt and make it available to your company to finanace current operations.</p>
<h3>JudeLaw can HELP!</h3>
        <p>At JudeLaw we care about our clients and their business. Many factors are involved when determining what is the best legal solution for your business. Call us now for a free consultation and speak with an experienced, caring business bankruptcy lawyer!</p>
        <h3>CALL NOW! 303-757-5833</h3>        
      </tr>
</table>
</div>
</div>
<div class="clear"></div>
<div id="footerWrapper"><?php require ('../../includes/footer.php'); ?></div>
</div>
</body>
</html>

 

 

Additionally, I believe this file is required to make the form work...it is called webformmailer.php (this is the file that I don't understand...it doesn't make any sense to me. I haven't ever created a form to work this way.)

 

<?php

if ( !isset($_SERVER['SPI'])) {
        die();
}

if (!isset($_SERVER['DOCUMENT_ROOT'])) {
echo("CRITICAL: we seem to be running outside of the norm.\n");
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
die("CRITICAL: Document root unavailable.\n");
}

$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET") {
$query_vars = $_GET;
}
elseif ($request_method == "POST") {
$query_vars = $_POST;
}
reset($query_vars);

function customsort($a,$b) {
// $a is array for form vars, $b is comma seperated case sensitive field order
// this is case sensitive -- good idea to hrc that.
        $data = array();
        if ( strstr($b,',') == FALSE )  {
                $b = $b.",";
        }
        $ordering = split(',',$b);
        foreach ($ordering as $orderitem) {
                if ( ($orderitem != null) && ($orderitem != "") ) {
                        if (isset($a[$orderitem])) {
                                $data[$orderitem] = $a[$orderitem];
                        }
                }
        }
        foreach ($a as $key=>$val) {
                $data[$key] = $a[$key];
        }
        return $data;
}

function xmlentities($string) {
return str_replace ( array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $string);
}

$t = date("U");

$formhomedir = preg_replace('/.*\/home\/content/','',$_SERVER['DOCUMENT_ROOT']);
$formhomedir = explode('/',$formhomedir);
$formhome="/home/content".$formhomedir[0]."/".$formhomedir[1]."/".$formhomedir[2]."/".$formhomedir[3]."/".$formhomedir[4]."/data/";

$file_order = ".default";
$file_format = ".text";
$file_interval = ".15m";
$field_order = "";

if (isset($query_vars['form_order'])) {
if ($query_vars['form_order'] != "alpha") {
	$field_order=$query_vars['form_order'];
	$file_order=".custom";
	$query_vars = customsort($query_vars,$field_order);
}
else {
	switch ($query_vars['form_order']) {
		case "alpha":
			uksort($query_vars,'strnatcasecmp');
			$file_order=".alpha";
		break;
		default:
			$file_order=".default";
		break;
	}
}
}

if (isset($query_vars['form_format'])) {
switch ($query_vars['form_format']) {
	case "csv":
		$file_format = ".csv";
	break;
	case "html":
		$file_format = ".html";
	break;
	case "xml":
		$file_format = ".xml";
	break;
	case "text":
	case "default":
	default:
		$file_format = ".text";
	break;
}
}

if (isset($query_vars['form_delivery'])) {
switch ($query_vars['form_delivery']) {
	case "hourly":
		$file_interval = ".60m";
	break;
	case "hourly_digest":
		$file_interval = ".60mc";
	break;
	case "daily":
		$file_interval = ".24h";
	break;
	case "daily_digest":
		$file_interval = ".24hc";
	break;
	case "digest":
		$file_interval = ".15mc";
	break;
	case "default":
	default:
		$file_interval = ".15m";
	break;
}
}

$file = $formhome."form_".$t.$file_order.$file_format.$file_interval;
$fp = fopen($file,"w");

switch ($file_format) {
case ".csv":
	$csvkeys = "";
	$csvvals= "";
	$firsttime = "";
	while (list ($key, $val) = each ($query_vars)) {
		if ( ($key == "form_order") ||
			($key == "form_format") ||
			($key == "form_delivery") ||
			($key == "redirect") ) {
		}
		else {
			if ($csvkeys != "") {
				$firsttime=",";
			}
			$tmpkey=escapeshellcmd($key);
			$csvkeys = $csvkeys.$firsttime."'".$tmpkey."'";
			$tmpval=escapeshellcmd($val);
			$csvvals = $csvvals.$firsttime."'".$tmpval."'";
		}
	}
	fputs($fp,"$csvkeys\n");
	fputs($fp,"$csvvals\n");
break;
case ".html":
	fputs($fp,"<table border=\"1\" cellspacing=\"1\" cellpadding=\"2\">\n");
break;
case ".xml":
	fputs($fp,"<form>\n");
break;
}

while (list ($key, $val) = each ($query_vars)) {
if ($key == "redirect") {
	$landing_page = $val;
}
if ( ($key == "form_order") ||
	($key == "form_format") ||
	($key == "form_delivery") ||
	($key == "redirect") ) {

}
else {
	switch ($file_format) {
		case ".html":
			fputs($fp,"\t<tr>\n");
			fputs($fp,"\t\t<td><b>$key</b></td>\n");
			fputs($fp,"\t\t<td>$val</td>\n");
			fputs($fp,"\t</tr>\n");

		break;
		case ".csv":
			// content is already output
		break;
		case ".xml":
			fputs($fp,"\t<field>\n");
			fputs($fp,"\t\t<fieldname>".xmlentities($key)."</fieldname>\n");
			fputs($fp,"\t\t<fieldvalue>".xmlentities($val)."</fieldvalue>\n");
			fputs($fp,"\t</field>\n");
		break;
		case ".text":
		default:
			fputs($fp,$key.": ".$val."\n");
		break;
	}
}
}

switch ($file_format) {
case ".html":
	fputs($fp,"</table>\n");
break;
case ".xml":
	fputs($fp,"</form>\n");
break;
}


fclose($fp);

if ($landing_page != "") {
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
}
else {
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}


?>

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.