Jump to content

DBookatay

Members
  • Posts

    334
  • Joined

  • Last visited

Posts posted by DBookatay

  1. What is wrong with this code?
    [code]$ap_ss = ($_POST['ap_ss1']) . ($_POST['ap_ss2']) . ($_POST['ap_ss3']);[/code]

    I'm trying to combine 3 (Social Security Number) input boxes into my dB, but it keeps coming up blank...
      POST 1 = 123
      POST 2 = 45
      POST 3 = 6789
    How do I make it become "123456789"?
  2. Does anyone know of a good (preferably free) "Live Help" program that will appear on my site if I'm logged into the program?

    I currently use [url=http://www.contactatonce.com/]http://www.contactatonce.com/[/url] which is alright, but not very customizable. Plus, there are a few things about their chat windows/ program that I don't like. Plus, at $700 a year, I'd like it to have more options than it does.
  3. FYI: I added [code]$nmF = ucfirst($_POST['ap_nmF']);
    $nmM = ucfirst($_POST['ap_nmM']);
    $nmL = ucfirst($_POST['ap_nmL']);

    $query = "INSERT INTO creditapps (nmF, nmM, nmL, submitted) VALUES ('$nmF', '$nmM', '$nmL', NOW() )";
    $result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error());
    [/code] on line 93, so I don't really know if it is in the right place or not...

    Since it doesnt work properly, I assume it is in the wrong spot.

    Any help would be GREATLY apprechiated!
  4. I paid someone to design required fields in forms that I built, which work properly, but I cant figure out why the results wont insert into my database... (Just to make it easy, I only used 3 of the 100+ values)

    Also, where on the page should I put a "thank you" code, if everything went ok?

    The code: (because it was more than the allowed number of characters, I edited 2 of the 3 $show="___" out...)

    [code]<?php
    session_start();
    $page_title = 'EZ Financing Application';
    include ('include/forms_content.php');
    require_once ('include/mysql_connect.php');
       
       
    //------------------------new code--------------------------------------------------//
       
        if (!isset($_SESSION['ispassed']))
        {
        $_SESSION['ispassed'] = true;//$_SESSION['ispassed']=true; // after all the dust has settled if this is still true, then upload to the database.   
        }
       
       
    function formatText3($inputName1,$inputName2,$inputName3,$text)// checks to verify 3 fields are not empty, and then prints out what needs to be
    {
          if ($_SERVER['REQUEST_METHOD']=="POST")
          {
                if(empty($_POST[$inputName1]) || empty($_POST[$inputName2]) || empty($_POST[$inputName3]) )
                  {
                  echo "<span class='redBold'>" . $text . "</span>";
                  $_SESSION['ispassed']=false;
                  }
                else
                  {
                    echo $text;
                  }
              }
          else
              echo $text;
    }
    function formatText($inputName,$text)//checks a givin field to see if its empty, if so change color and print it out.
    {
       
          if ($_SERVER['REQUEST_METHOD']=="POST")
          {
              if(empty($_POST[$inputName]))
              {
                  echo "<span class='redBold'>" . $text . "</span>"; 
                  $_SESSION['ispassed']=false;
              }
                 
              else
              {
                  echo $text;
              }
          }
          else
            echo $text;
           
    }
    function verifyEmail($inputName,$text)//checks to see if the email is valid
    {
          if ($_SERVER['REQUEST_METHOD']=="POST")
          {
            if(!(empty($_POST[$inputName])))   
            {
                  if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})", $_POST[$inputName]))
                  {
                  echo $text;
                  }
                  else
                  {
                  echo "<span class='redBold'>" . $text . "</span>";
                  $_SESSION['ispassed']=false;
                  }
            }
          else
            echo "<b>" . $text . "</b>";
            $_SESSION['ispassed']=false; 
          } 
       
    }
    function moreThen0Years($inputName)//checks the years field to see if it is required or not.
    {
        if ($_SERVER['REQUEST_METHOD']=="POST")
          {
            if(($_POST[$inputName])<1) 
            {
                    return true;
            }
          else
          {
                return false;
          } 
        }
    }

    if($_SESSION['ispassed']) //if true, everything passed and you can upload it to your database and do what you will.
    {

    $nmF = ucfirst($_POST['ap_nmF']);
    $nmM = ucfirst($_POST['ap_nmM']);
    $nmL = ucfirst($_POST['ap_nmL']);

    $query = "INSERT INTO creditapps (nmF, nmM, nmL, submitted) VALUES ('$nmF', '$nmM', '$nmL', NOW() )";
    $result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error());
    }


      //------------------------end of code-----------------------------------------------//


     
    $query = "select * from vehicles where stock = '{$_GET['stock']}'";
    $result = mysql_query($query);
    $row = mysql_fetch_array($result);

    $stock = ($row['stock']);
    $year = ($row['year']);
    $make = ($row['make']);
    if ($row['trim'] == "N / A") {$model = $row['model'];} else {$model = $row['model'] . ' ' . $row['trim'];}
    $color = ($row['color_exterior']);

    if(isset($_GET['vehicle']));
    switch($_GET['vehicle']) {
    case 'true':
    $vehicle = '
    <input type="hidden" name="app_veh1" value="' . $stock . '" />
    <input type="hidden" name="app_veh2" value="' . $color . '" />
    <table>
    <tr>
    <td class="frm">Year</td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm">Make</td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm">Model</td>
    </tr>
    <tr>
    <td><input name="app_veh3" size="3" value="' . $year . '" /></td>
    <td><input name="app_veh4" size="17" value="' . $make . '" /></td>
    <td><input name="app_veh5" size="25" value="' . $model . '" /></td>
    </tr>
    </table>';
    break;

    default:
    $vehicle = '
    <table>
    <tr>
    <td class="frm">Year</td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm">Make</td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm">Model</td>
    </tr>
    <tr>
    <td>'.$vehYears.'</td>
    <td>'.$vehMakes.'</td>
    <td>'.$vehModels.'</td>
    </tr>
    </table>';
    break;
    }



    include ('include/header.php');
        $app= $_GET['applicant'];

    ?>
    <table class="SubHldr" width="777" height="31">
    <tr><td class="subMenu"><a href="company.php?cat=Terms" onmouseover="MM_swapImage('s1','','images/SubNav/terms_Over.gif',1)" onmouseout="MM_swapImgRestore()"><img src="images/SubNav/terms_Off.gif" width="115" height="21" name="s1" /></a><a href="apply.php"><img src="images/SubNav/apply_On.gif" width="115" height="21" /></a><a href="company.php?cat=Calculator" onmouseover="MM_swapImage('s3','','images/SubNav/calc_Over.gif',1)" onmouseout="MM_swapImgRestore()"><img src="images/SubNav/calc_Off.gif" width="115" height="21" name="s3" /></a><a href="testimonials.php" onmouseover="MM_swapImage('s4','','images/SubNav/testimonials_Over.gif',1)" onmouseout="MM_swapImgRestore()"><img src="images/SubNav/testimonials_Off.gif" width="115" height="21" name="s4" /></a></td></tr>
    </table>

    <table class="appHldr">
    <tr><td class="pgTitle">EZ Financing Application</td></tr>
    <tr>
    <td class="pgText">
    <form name="credit" method="post" action="apply.php?applicant=<? echo $app; ?>" onSubmit="return checkme();">
    <?
                   
        if(isset($_GET['applicant']));
        //echo $app;
    switch($_GET['applicant']) {

    default:
    ?>
    In order for us to properly process your information,<br />please choose which application you would like:
    <div class="appMain">
    <select onChange="faqRedirect(this)">
    <option>Please Select Your Choice</option>
    <option value="apply.php?applicant=single" class="red">&nbsp;&nbsp;&nbsp; Apply As An Individual</option>
    <option value="apply.php">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;------ or ------</option>
    <option value="apply.php?applicant=coapply" class="red">&nbsp;&nbsp;&nbsp; Apply With A Co-Applicant</option>
    <option value="apply.php">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;------ or ------</option>
    <option value="apply.php?applicant=business" class="red">&nbsp;&nbsp;&nbsp; Apply As A Business</option>
                </select>
    </div>
    <p>If you are unsure, <a href="contact.php?body=Request">Request A Call</a> from one of our financing specialists.<p>&nbsp;<p>
    <a href="#">Why has your EZ Financing application recently changed?</a>';
    <?
                    break;

    case 'single':
    //$show = '
                       
                    ?>
                   
                   
    <div align="center">
    <table>
    <tr>
    <td class="appHldr_L">
    <div class="appTitle">Personal Information</div>
    <div class="appSecTitle">Name</div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_nmF","First:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="5" height="1" /></td>
    <td class="frm">&nbsp;M</td>
    <td rowspan="2"><img src="images/spacer.gif" width="5" height="1" /></td>
    <td class="frm"><span class="red">*</span><? formatText("ap_nmL","Last:"); ?></td>
    </tr>
    <tr>
    <td><input class="input" maxlength="60" size="17" name="ap_nmF" value="<?php if (isset($_POST['ap_nmF'])) echo $_POST['ap_nmF']; ?>" /></td>
    <td><input class="1char" maxlength="1" size="1" name="ap_nmM" value="<?php if (isset($_POST['ap_nmM'])) echo $_POST['ap_nmM']; ?>" onKeyup="autotab(this, document.credit.ap_nmL)" /></td>
    <td><input class="input" maxlength="60" size="17" name="ap_nmL" value="<?php if (isset($_POST['ap_nmL'])) echo $_POST['ap_nmL']; ?>" /></td>
    </tr>
    </table>
    </div>
    <div class="appSecTitle">Birthday</div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_dob1","Month:"); ?></td>
    <td width="10">&nbsp;</td>
    <td class="frm"><span class="red">*</span><? formatText("ap_dob2","Day:"); ?></td>
    <td width="10">&nbsp;</td>
    <td class="frm"><span class="red">*</span><? formatText("ap_dob3","Year:"); ?></td>
    </tr>
    <tr>
    <td><select name="ap_dob1"><option value="<?php if (isset($_POST['ap_dob1'])) echo $_POST['ap_dob1']; ?>"><?php if (isset($_POST['ap_dob1'])) echo $_POST['ap_dob1']; ?></option>'<? echo $months_list;?>'</select></td>
    <td width="10" align="center"> / </td>
    <td><select name="ap_dob2"><option value="<?php if (isset($_POST['ap_dob2'])) echo $_POST['ap_dob2']; ?>"><?php if (isset($_POST['ap_dob2'])) echo $_POST['ap_dob2']; ?></option>'<? echo $days; ?>'</select></td>
    <td width="10" align="center"> / </td>
    <td><input class="4char" name="ap_dob3" size="3" maxlength="4" value="<?php if (isset($_POST['ap_dob3'])) echo $_POST['ap_dob3']; ?>" onKeyup="autotab(this, document.credit.ap_ss1)" /></td>
    </tr>
    </table>
    </div>
    <div class="appSecTitle"><span class="red">*</span><? formatText3("ap_ss1","ap_ss2","ap_ss3","Social Security:"); ?></div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><input class="3char" type="text" name="ap_ss1" size="3" maxlength="3" value="<?php if (isset($_POST['ap_ss1'])) echo $_POST['ap_ss1']; ?>" onKeyup="autotab(this, document.credit.ap_ss2)" /></td>
    <td width="10" align="center"> - </td>
    <td class="frm"><input class="2char" type="text" name="ap_ss2" size="3" maxlength="2" value="<?php if (isset($_POST['ap_ss2'])) echo $_POST['ap_ss2']; ?>" onKeyup="autotab(this, document.credit.ap_ss3)" /></td>
    <td width="10" align="center"> - </td>
    <td class="frm"><input class="4char" type="text" name="ap_ss3" size="3" maxlength="4" value="<?php if (isset($_POST['ap_ss3'])) echo $_POST['ap_ss3']; ?>" onKeyup="autotab(this, document.credit.ap_ph1)" /> <a href="javascript:openWin('include/popups/definitions.php?term=SS','520','200','no','no')"><img src="images/icon_Ques.gif" alt="Why do you need my Social Security number?" /></a></td>
    </tr>
    </table>
    </div>
    <div class="appSecTitle">Contacts</div>
    <div class="appSecHldr">
    <table>
    <tr><td class="frm"><span class="red">*</span><? formatText3("ap_ph1","ap_ph2","ap_ph3","Home Phone:"); ?></td></tr>
    <tr><td><input class="3char" name="ap_ph1" size="1" maxlength="3" value="<?php if (isset($_POST['ap_ph1'])) echo $_POST['ap_ph1']; ?>" onKeyup="autotab(this, document.credit.ap_ph2)" /> - <input class="3char" name="ap_ph2" size="1" maxlength="3" value="<?php if (isset($_POST['ap_ph2'])) echo $_POST['ap_ph2']; ?>" onKeyup="autotab(this, document.credit.ap_ph3)" /> - <input class="4char" name="ap_ph3" size="1" maxlength="4" value="<?php if (isset($_POST['ap_ph3'])) echo $_POST['ap_ph3']; ?>" onKeyup="autotab(this, document.credit.ap_ph4)" /></td></tr>
    <tr><td class="frm">&nbsp; Cell Phone:</td></tr>
    <tr><td><input class="3char" name="ap_ph4" size="1" maxlength="3" value="<?php if (isset($_POST['ap_ph4'])) echo $_POST['ap_ph4']; ?>" onKeyup="autotab(this, document.credit.ap_ph5)" /> - <input class="3char" name="ap_ph5" size="1" maxlength="3" value="<?php if (isset($_POST['ap_ph5'])) echo $_POST['ap_ph5']; ?>" onKeyup="autotab(this, document.credit.ap_ph6)" /> - <input class="4char" name="ap_ph6" size="1" maxlength="4" value="<?php if (isset($_POST['ap_ph6'])) echo $_POST['ap_ph6']; ?>" onKeyup="autotab(this, document.credit.ap_email)" /></td></tr>
    </table>
    <table>
    <tr><td class="frm"><span class="red">*</span><? verifyEmail("ap_email", "Email Address:"); ?></td></tr>
    <tr><td><input class="input" name="ap_email" size="22" maxlength="40" value="<?php if (isset($_POST['ap_email'])) echo $_POST['ap_email']; ?>" /> <a href="javascript:openWin('include/popups/definitions.php?term=Email','520','140','no','no')"><img src="images/icon_Ques.gif" alt="What will you do with my email address?" /></a></td></tr>
    </table>
    </div>
    <div class="appSecTitle">Address</div>
    <div class="appSecHldr">
    <table>
    <tr><td class="frm" colspan="5"><span class="red">*</span><? formatText("ap_add1","Street:"); ?></td></tr>
    <tr><td colspan="5"><input class="input" maxlength="60" size="30" name="ap_add1" value="<?php if (isset($_POST['ap_add1'])) echo $_POST['ap_add1']; ?>" /></td></tr>
    <tr>
    <td class="frm" class="frm"><span class="red">*</span><? formatText("ap_add2","City:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm" class="frm"><span class="red">*</span><? formatText("ap_add3","State:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm" class="frm"><span class="red">*</span><? formatText("ap_add4","Zip:"); ?></td>
    </tr>
    <tr>
    <td><input class="input" name="ap_add2" size="20" value="<?php if (isset($_POST['ap_add2'])) echo $_POST['ap_add2']; ?>" /></td>
    <td><select name="ap_add3"><option value="<?php if (isset($_POST['ap_add3'])) echo $_POST['ap_add3']; ?>"><?php if (isset($_POST['ap_add3'])) echo $_POST['ap_add3']; ?></option>'<? echo $states; ?>'</select></td>
    <td><input class="5char" name="ap_add4" size="2" maxlength="5" value="<?php if (isset($_POST['ap_add4'])) echo $_POST['ap_add4']; ?>" /></td>
    </tr>
    </table>
    </div>
    <div class="appSecTitle">Length at current address</div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_add5","Years:"); ?></td>
    <td>&nbsp;</td>
    <td clsss="frm">&nbsp; <? if(moreThen0Years("ap_add5")) formatText("ap_add6","Months:"); else  echo "Months"; ?></td>
    </tr>
    <tr>
    <td valign="top"><select name="ap_add5"><option value="<?php if (isset($_POST['ap_add5'])) echo $_POST['ap_add5']; ?>"><?php if (isset($_POST['ap_add5'])) echo $_POST['ap_add5']; ?></option>'<? echo $years; ?>'</select></td>
    <td width="20" align="center"> / </td>
    <td valign="top"><select name="ap_add6"><option value="<?php if (isset($_POST['ap_add6'])) echo $_POST['ap_add6']; ?>"><?php if (isset($_POST['ap_add6'])) echo $_POST['ap_add6']; ?></option>'<? echo $months; ?>'</select></td>
    </tr>
    </table>
    </div>
    <div class="appSecTitle">Housing Payments</div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_add7","Type:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="20" height="1" /></td>
    <td class="frm">&nbsp;</td>
    <td class="frm"><span class="red">*</span><? formatText("ap_add8","Payment:"); ?></td>
    </tr>
    <tr>
                                  <td valign="top" rowspan="2">
    <select name="ap_add7">
                                    <option value="<?php if (isset($_POST['ap_add7'])) echo $_POST['ap_add7']; ?>"><?php if (isset($_POST['ap_add7'])) echo $_POST['ap_add7']; ?></option>
                                  <option value="Rent">Rent</option>
                                    <option value="Own">Own</option>
                                    <option value="Family">Family</option>
                                    <option value="Other">Other</option>
                                    </select>
                                    </td>
                                    <td>$&nbsp;</td>
                                    <td><input class="input" name="ap_add8" size="7" maxlength="5" value="<?php if (isset($_POST['ap_add8'])) echo $_POST['ap_add8']; ?>" /> Monthly</td>
    </tr>
    </table>
    </div>
    <br />
    <div class="appTitle">Employment Information</div>
    <div class="appSecTitle">Company</div>
    <div class="appSecHldr">
    <table>
    <tr><td colspan="5"><span class="red">*</span><? formatText("ap_wrk1","Company Name:"); ?></td></tr>
    <tr><td colspan="5"><input class="input" maxlength="60" size="35" name="ap_wrk1" value="<?php if (isset($_POST['ap_wrk1'])) echo $_POST['ap_wrk1']; ?>" /></td></tr>
    <tr><td class="frm" colspan="5"><span class="red">*</span><? formatText("ap_wrk2","Street:"); ?></td></tr>
    <tr><td colspan="5"><input class="input" name="ap_wrk2" size="30" maxlength="60" value="<?php if (isset($_POST['ap_wrk2'])) echo $_POST['ap_wrk2']; ?>" /></td></tr>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_wrk3","City:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm"><span class="red">*</span><? formatText("ap_wrk4","State:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm"><span class="red">*</span><? formatText("ap_wrk5","Zip:"); ?></td>
    </tr>
    <tr>
    <td><input class="input" name="ap_wrk3" size="20" value="<?php if (isset($_POST['ap_wrk3'])) echo $_POST['ap_wrk3']; ?>" /></td>
    <td><select name="ap_wrk4"><option value="<?php if (isset($_POST['ap_wrk4'])) echo $_POST['ap_wrk4']; ?>"><?php if (isset($_POST['ap_wrk4'])) echo $_POST['ap_wrk4']; ?></option>'<? echo $states; ?>'</select></td>
    <td><input class="5char" name="ap_wrk5" size="2" maxlength="5" value="<?php if (isset($_POST['ap_wrk5'])) echo $_POST['ap_wrk5']; ?>" onKeyup="autotab(this, document.credit.ap_wrk6)" /></td>
    </tr>
    </table>
    <table>
    <tr><td class="frm"><span class="red">*</span><? formatText3("ap_wrk6","ap_wrk7","ap_wrk8","Phone:"); ?></td></tr>
    <tr><td><input class="3char" name="ap_wrk6" size="1" maxlength="3" value="<?php if (isset($_POST['ap_wrk6'])) echo $_POST['ap_wrk6']; ?>" onKeyup="autotab(this, document.credit.ap_wrk7)" /> - <input class="3char" name="ap_wrk7" size="1" maxlength="3" value="<?php if (isset($_POST['ap_wrk7'])) echo $_POST['ap_wrk7']; ?>" onKeyup="autotab(this, document.credit.ap_wrk8)" /> - <input class="4char" name="ap_wrk8" size="1" maxlength="4" value="<?php if (isset($_POST['ap_wrk8'])) echo $_POST['ap_wrk8']; ?>" onKeyup="autotab(this, document.credit.ap_wrk9)" /></td></tr>
    <tr><td class="frm">&nbsp; Position:</td></tr>
    <tr><td><input class="input" name="ap_wrk9" size="20" value="<?php if (isset($_POST['ap_wrk9'])) echo $_POST['ap_wrk9']; ?>" /></td></tr>
    </table>
    </div>
    <table>
    <tr>
    <td valign="top">
    <div class="appSecTitle">Length at current job</div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_wrk10","Years:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="10" height="1" /></td>
    <td class="frm"><? if(moreThen0Years("ap_wrk10")) formatText("ap_wrk10","Months:"); else  echo "Months:"; ?></td>
    </tr>
    <tr>
    <td><select name="ap_wrk10"><option value="<?php if (isset($_POST['ap_wrk10'])) echo $_POST['ap_wrk10']; ?>"><?php if (isset($_POST['ap_wrk10'])) echo $_POST['ap_wrk10']; ?></option><? echo $years; ?>'</select></td>
                                    <td><select name="ap_wrk11"><option value="<?php if (isset($_POST['ap_wrk11'])) echo $_POST['ap_wrk11']; ?>"><?php if (isset($_POST['ap_wrk11'])) echo $_POST['ap_wrk11']; ?></option>'<? echo $months; ?>'</select></td>
                                    </tr>
    </table>
    </div>
    </td>
    <td><img src="images/spacer.gif" width="30" /></td>
    <td valign="top">
    <div class="appSecTitle">Weekly Income</div>
    <div class="appSecHldr">
    <table>
    <tr><td class="frm">&nbsp;<span class="red">*</span><? formatText("ap_wrk12","Gross:"); ?> </td></tr>
    <tr><td>$ <input class="input" name="ap_wrk12" size="7" maxlength="5" value="<?php if (isset($_POST['ap_wrk12'])) echo $_POST['ap_wrk12']; ?>" />  <a href="javascript:openWin('include/popups/definitions.php?term=GWI','520','200','no','no')"><img src="images/icon_Ques.gif" alt="What does \'Gross Weekly Income\' mean?" /></a></td></tr>
    </table>
    </div>
    </td>
    </tr>
    </table>
    </td>
    <td><img src="images/spacer.gif" width="30" height="1" /></td>
    <td class="appHldr_R">
    <div class="appTitle">Financial Information</div>
    <div class="appSecTitle"><span class="red">*</span><? formatText("ap_bnk1","Account Types"); ?></div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm" width="60" align="center">Checking</td>
    <td class="frm" width="60" align="center">Savings</td>
    <td class="frm" width="60" align="center">Both</td>
    <td class="frm" width="60" align="center">None</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td align="center"><input type="radio" class="radio" name="ap_bnk1" value="Checking" <? if($row['feature_pl'] == 'yes') {echo 'checked';} ?> /></td>
    <td align="center"><input type="radio" class="radio" name="ap_bnk1" value="Savings" /></td>
    <td align="center"><input type="radio" class="radio" name="ap_bnk1" value="Checking & Savings" /></td>
    <td align="center"><input type="radio" class="radio" name="ap_bnk1" value="No bank accounts" /></td>
    <td align="center"><a href="javascript:openWin('include/popups/definitions.php?term=accounts','520','200','no','no')"><img src="images/icon_Ques.gif" alt="Why do you need to know which type of bank accounts I have?" /></a></td>
    </tr>
    </table>
    </div>
    <div class="appSecTitle">Previous</div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_bnk2","Repossessions:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="20" height="1" /></td>
    <td class="frm"><span class="red">*</span><? formatText("ap_bnk3","Bankruptcies:"); ?></td>
    </tr>
    <tr>
    <td>
    <select name="ap_bnk2">
    <option value="<?php if (isset($_POST['ap_bnk2'])) echo $_POST['ap_bnk2']; ?>"><?php if (isset($_POST['ap_bnk2'])) echo $_POST['ap_bnk2']; ?></option>
                      <option value="Never">Never</option>
                  <option value="Less than a year ago">Less than a year ago</option>
                <option value="1 - 3 years">1 - 3 years ago</option>
                    <option value="More than 3 years ago">More than 3 years ago</option>
                    </select>
                    </td>
    <td>
    <select name="ap_bnk3">
    <option value="<?php if (isset($_POST['ap_bnk3'])) echo $_POST['ap_bnk3']; ?>"><?php if (isset($_POST['ap_bnk3'])) echo $_POST['ap_bnk3']; ?></option>
    <option value="Never">Never</option>
    <option value="Pending">Pending</option>
    <option value="Discharged">Discharged</option>
    </select>
    </td>
    </tr>
    </table>
    <table>
    <tr><td class="frm" colspan="3"><span class="red">*</span><? formatText("ap_bnk5","Have you ever previously financed a vehicle? "); ?><select name="ap_bnk4"><option value="<?php if (isset($_POST['ap_bnk4'])) echo $_POST['ap_bnk4']; ?>"><?php if (isset($_POST['ap_bnk4'])) echo $_POST['ap_bnk4']; ?></option><option value="Yes">Yes</option><option value="No">No</option></select></td></tr>
    <tr><td class="frm" align="right">Which bank? <input class="input" name="ap_bnk5" size="14" value="<?php if (isset($_POST['ap_bnk5'])) echo $_POST['ap_bnk5']; ?>" /></td></tr>
    </table>
    </div>
    <br />
    <div class="appTitle">Vehicle Information</div>
    <div class="appSecTitle">Is there a specific vehicle that you are interested in?</div>
    <div class="appSecHldr">
    <? echo $vehicle; ?>
    </div>
    <div class="appSecTitle">Payment Options</div>
    <div class="appSecHldr">
    <table>
    <tr>
    <td class="frm"><span class="red">*</span><? formatText("ap_veh6","Down Payment:"); ?></td>
    <td rowspan="2"><img src="images/spacer.gif" width="30" height="1" /></td>
    <td class="frm"><span class="red">*</span><? formatText("ap_veh7","Monthly Payment:"); ?></td>
    </tr>
    <tr>
    <td class="small">$ <input class="input" name="ap_veh6" size="7" maxlength="5" value="<?php if (isset($_POST['ap_veh6'])) echo $_POST['ap_veh6']; ?>" /> <span class="small">(Est.)</span></td>
    <td>
    <select name="ap_veh7">
    <option value="<?php if (isset($_POST['ap_veh7'])) echo $_POST['ap_veh7']; ?>"><?php if (isset($_POST['ap_veh7'])) echo $_POST['ap_veh7']; ?></option>
    <option>$200 - $300</option>
    <option>$350 - $400</option>
    <option>$400 +</option>
                                  </select> <span class="small">(Est.)</span>
    </td>
    </tr>
    </table>
    </div>
    <div class="appSecTitle">Special instructions, questions, or comments:</div>
    <div class="appSecHldr">
    <table>
    <tr><td><textarea name="ap_cmnts" rows="5" cols="60"><?php if (isset($_POST['ap_cmnts'])) echo $_POST['ap_cmnts']; ?></textarea></td></tr>
    <tr><td class="dots"><img src="images/spacer.gif"></td></tr>
    </table>
    </div>
    <div class="appSecTitle">Legal Disclaimers:</div>
    <div class="appSecHldr">
    <table>
    <tr><td><? echo $disclaimer; ?></td></tr>
    <tr><td class="appAcpt"><span class="red">*</span> I have read and accept the terms stated above <input type="checkbox" class="radio" name="agree" value="<?php if (isset($_POST['agree'])) echo $_POST['agree']; ?>" /></td></tr>
    <tr><td class="appBtn"><input type="image" class="submit" src="images/buttons/submit_off.gif" srcover="images/buttons/submit_on.gif" value="Submit" name="single" /></td></tr>
    </table>
    </div>
    </td>
    </tr>
    </table>
    </div>
                            <?
    break;



    }
                   
                   
                   
                   
                   
                      ?>
    <input type="hidden" name="ip" value="<?php echo $_SERVER['REMOTE_ADDR'];?>">
    </form>
    </td>
    </tr>
    </table>

    <table class="btmIcns">
    <tr><td class="btmIcns"><a href="javascript:openWin('include/popups/sendlink.php','350','200','no','yes');" onmouseover="MM_swapImage('email','','images/icon_Email_over.gif',1)" onmouseout="MM_swapImgRestore()"><img src="images/icon_Email_off.gif" name="email" alt="Send page to a friend" /></a></td></tr>
    </table>

    <?php include ('include/footer.php'); ?>[code][/code][/code]
  5. JavaScript:

    Insert into the <head> of the page:
    [code]
    <script>
    // Dropdown Redirect
    function faqRedirect(selectBox)
    {
    var faqURL = selectBox.options[selectBox.selectedIndex].value
    if (faqURL != "")
    {
    if (faqURL.substr(0, 4) != "http")
    faqURL = "../" + faqURL

    location.href = faqURL
    }
    }
    </script>
    [/code]


    Insert into the body of the page:
    [code]
    <select onChange="faqRedirect(this)">
        <option>Please Select Your Choice</option>
        <option value="_____.php">01</option>
        <option value="_____.php">10</option>
        <option value="_____.php">100</option>
    </select>
    [/code]
  6. [quote author=jesirose link=topic=122891.msg507494#msg507494 date=1169087381]
    Buy the software if it's what you want, or research AJAX and do it your self and value the freaking time it takes.
    [/quote]

    No my dear jesirose,

    This is supposed to me a help forum, not a place to bash someone.... I don't want to buy a piece of software because that wont teach you how to do this, it will only do it for you... I learned html years ago, and am now learning php by example! By looking at code and seeing how it works... By asking questions, and usually getting really intelligent answers from extremely smart people who are willing to help, not by buying a piece of software that will do all the coding for me, or by paying someone to do it for me.
  7. [quote author=trochia link=topic=122891.msg507484#msg507484 date=1169086206]
    And you have a problem buying software?..<laugh>  If it works, does what you want EXACTLY...isn't it worth it?

    :-)
    [/quote]

    You're kidding me right?
    Have you ever downloaded an mp3, or a movie, or a template?
  8. I've seen forms where if you hit submit and any of the required fields were left blank, the field names for each has a message, right on the form.
    Like "Name" would return: "Please enter your name," and so on...

    A good example is [url=http://myhosting.com/Contact/Default.asp]http://myhosting.com/Contact/Default.asp[/url]

    Anyone have any ideas what I mean, or how to accomplise this?

  9. [quote author=Monkeymatt link=topic=114496.msg465861#msg465861 date=1163138876]
    Here's an example for 50 words:
    [code]
    <?php
    $temp=explode(" ", stripslashes($row['cmnts']), 51); // 51 is 50 words +1 (extra words)
    array_pop($temp); // remove extra words from end
    $text=nl2br(implode(" ", $temp)."..."); // add spaces back in and add '...'
    ?>
    [/code]

    Monkeymatt
    [/quote]

    Thank you Monkey, worked like a charm... (No offense josh, this one was easier for a noobie like me to understand)
  10. I'm trying to create a blog  from scratch, and I will admit that I am a "noobie" to php, so I am having a bit of trouble...
    Here is a page I call "blog_view.php" where users view the post, and can add their own comments to the origional post:

    [code]<?php
    require_once ('include/mysql_connect.php');
    $query = "select * from blog_Posts where id = '{$_GET['id']}'";
    $result = mysql_query($query);
    $numrows = mysql_num_rows($result);
    while($row = mysql_fetch_array($result)){

    $date = substr($row['posted'], 5, 2) . '/ ' . substr($row['posted'], 8, 2) . '/ ' . substr($row['posted'], 2, 2);
    $title = $row['title'];
    $text = nl2br(stripslashes($row['comments']));
    if ($row['reply'] == "off")
    {
    $replyTitle = "&nbsp;";
    $replyBox = "&nbsp;";
    }
    else
    {
    $replyTitle = "<div class=\"blgCmntsTitle\"><a name=\"add\">Reader Comments</a></div>";
    $replyBox = "
    <div style=\"padding: 0 0 0 50\">
    <form>
    <input type=\"hidden\" name=\"id\" value=\"sendPage\">
    <table>
    <tr><td>Name:</td></tr>
    <tr><td class=\"frmPad\"><input type=\"text\" name=\"name\" class=\"text\" size=\"25\" /></td></tr>
    <tr><td>Email:</td></tr>
    <tr><td class=\"frmPad\"><input type=\"text\" name=\"email\" class=\"text\" size=\"25\" /></td></tr>
    <tr><td>Website:</td></tr>
    <tr><td class=\"frmPad\"><input type=\"text\" name=\"url\" class=\"text\" size=\"25\" /></td></tr>
    <tr><td>Message:</td></tr>
    <tr><td class=\"frmPad\"><textarea name=\"message\" class=\"TextArea\" cols=\"24\" rows=\"5\" wrap=\"physical\" maxlength=\"500\"></textarea></td></tr>
    <tr><td class=\"frmBTN\"><input type=\"image\" name=\"submit\" src=\"images/BTN/Submit_off.gif\" srcover=\"images/BTN/Submit_on.gif\" value=\"Send\" name=\"submit\" /></td></tr>
    </table>
    </form>
    </div>";
    }
    }

    $query = "select * from blog_Replies where origional_id = '{$_GET['id']}' order by reply_posted DESC";
    $result = mysql_query($query);
    $numrows = mysql_num_rows($result);
    while($row = mysql_fetch_array($result)){

    $reply_text = nl2br(stripslashes($row['reply_comments']));
    $reply_date = substr($row['reply_posted'], 5, 2) . '/ ' . substr($row['reply_posted'], 8, 2) . '/ ' . substr($row['reply_posted'], 2, 2);
    $reply_name = $row['reply_name'];
    $reply_email = $row['reply_email'];
    $poster = '<a href="mailto:' . $reply_email . '"><img src="images/icon_blgCmnt.gif" /> ' . $reply_name . '</a>';

    $replies = "
    <div class=\"blgTopicHldr\">
    <table width=\"80%\">
    <tr><td class=\"blgReplyText\">$reply_text</td></tr>
    <tr>
    <td class=\"blgReplyLnkHldr\">
    <table width=\"100%\">
    <tr>
    <td class=\"blgReplyLnks\"><img src=\"images/icon_blgPstd.gif\" /> Posted: $date</td>
    <td class=\"blgReplyLnks\">by: $poster</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </div>\n";
    $row_count++;
    }
    if (!$row_count) {$replies = "<div class=\"blgNoPosts\">No users have posted comments yet.</div>"; }
    ?>

    <div class="blgTopicHldr">
    <table width="90%">
    <tr><td class="blgTitle"><?php echo $title; ?></td></tr>
    <tr><td class="blgText"><?php echo $text; ?></td></tr>
    <tr><td class="blgLnkHldr">
    <table width="100%">
    <tr>
    <td class="blgLnks"><img src="images/icon_blgPstd.gif" /> <?php echo $date; ?></td>
    <td class="blgLnks">by: <a href="contact.php?body=email"><img src="images/icon_blgCmnt.gif" /> Brad Guy</a></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </div>
    <?php echo $replyTitle; ?>
    <?php echo $replies; ?>
    <?php echo $replyBox; ?>[/code]

    The code is not finished yet, (like the form to add comments doesnt work yet) so I have been adding test examples manually into my DB, but the problem is that for the second query [code]"select * from blog_Replies where origional_id = '{$_GET['id']}' order by reply_posted DESC"[/code] it will only return 1 result.

    Can anyone help?
  11. [!--quoteo(post=382107:date=Jun 9 2006, 08:00 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 9 2006, 08:00 PM) [snapback]382107[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    Use the [a href=\"http://www.php.net/number_format\" target=\"_blank\"]number_format()[/a] function when displaying your numbers.

    Ken
    [/quote]

    I tried that:
    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$balance = '$ ' . number_format($row['balance']);[/quote]

    but then it takes off the cents leaving me with only a whole dollar ammount...
  12. [!--quoteo(post=382103:date=Jun 9 2006, 07:36 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 9 2006, 07:36 PM) [snapback]382103[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    [b]EDIT:[/b] 666th post...
    [/quote]

    Thanks for the help, Satan!


    One more quick question, my "balance" row is "float" and if I insert $30.70 it inserts it into the db as 30.7.
    How do I change this:
    [code]$balance = '$ ' . $row['balance'];[/code] so that when it displays it will show again as $30.70.
    Or if it's an even $30, how do I make it $30.00?
  13. [!--quoteo(post=382091:date=Jun 9 2006, 07:05 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 9 2006, 07:05 PM) [snapback]382091[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    That's basic math... But do you want to

    1. ADD the percentage: $value * (1 + $rate/100);
    2. SUBTRACT the percentage: $value * (1 - $rate/100)
    3. or simply GET the adjusted value: $value * $rate/100
    [/quote]



    "soldAmt" + "soldFees" + "rate" = _______ - "down"
  14. Someone help, before I pull the rest of my hair out of my head...

    I am attempting to create an accounting DB and need help with a line of code.

    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]$balance = ($_POST['soldAmt']) + ($_POST['soldFees']) * ($_POST['rate']) - ($_POST['down']); [/quote]

    Basically what Im trying to say is the "balance = soldAmt + soldFees x rate (which is %) - down. I'm having trouble turning ($_POST['rate']) into a percentage, and then x (multiply) it by ($_POST['soldAmt']) + ($_POST['soldFees']) - ($_POST['down'])

    Any help?
  15. [!--quoteo(post=375398:date=May 19 2006, 08:12 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 19 2006, 08:12 PM) [snapback]375398[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    [code]
    $last_six = substr($_POST['vin'], -6);
    [/code]
    [/quote]

    I don't get it! How do I make it work based on the example I posted?
  16. I am working on a site for an auto dealership where users can search based on certain criteria, one of which is the VIN number.

    I have this one input: [code]if($_POST['vin']) {$where[] = "vin = '{$_POST['vin']}'";}[/code] which works with the search script I was able to hack together, but what I want to do is also have the ability to search by the last 6 of the VIN. Meaning if a user enters all 17 alpha-numeric characters it returns a result, and as well if they only enter the last 6 characters of the vin...

    Does anyone have any idea how I can go about this?
  17. [!--quoteo(post=372839:date=May 10 2006, 02:55 AM:name=askjames01)--][div class=\'quotetop\']QUOTE(askjames01 @ May 10 2006, 02:55 AM) [snapback]372839[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]

    here study this link --> [a href=\"http://www.php-mysql-tutorial.com/form-validation-with-php.php\" target=\"_blank\"]The validation form.[/a]
    GOOD LUCK!
    [/quote]


    I'd like to do it via PHP not java scripts....
    Thanks anyway though!
  18. This is a very new-B question, but can someone show me a working code that will return an error message if required fields are not filled in?

    I built a 2 part form, new.php and order.php, and when someone enters info into new.php it is passed along to order.php as hidden fields, then instered into my db. What I now need to do is make the form fields required, but cant get that hang of it. And I have tried and tried and tried...

    If someone can show me an example I would REALLY apprechiate it.

    [code]
    <?php
        include ('../common/include/header.php');
        include_once ("../auth.php");
        include_once ("../authconfig.php");
        include_once ("../check.php");
    ?>
            <td class="lftNavHldr" rowspan="2">
                <?php include ('../common/include/lftNav_Vendor.php'); ?>
            </td>
            <td class="mainNavBlank">Logged in as: <span class="user"><? echo $USERNAME; ?></span></td></tr>
            <tr>
                <td class="main">
                    <table>
                        <tr><td class="hdr">Post A New Add</td></tr>
                        <tr>
                            <td class="index">
                                <div class="form">

                                <form name="form1" method="post" action="order.php">
                                <table>
                                    <tr>
                                        <td>Primary Trade Channel:</td>
                                        <td rowspan="2"><img src="../common/images/spacer.gif" width="20" height="1" /></td>
                                        <td>Secondary Trade Channel:</td>
                                    </tr>
                                    <tr>
                                        <td class="inptHldr">
                                            <select class="DropDown" name="Primary_Trade">
                                                <option></option>
                                                <option value="Accessories">Accessories</option>
                                                <option value="Automotive">Automotive</option>
                                                <option value="Beauty">Beauty Supplies</option>
                                                <option value="Bedding">Bedding</option>
                                                <option value="Computer">Computer/Software/Peripherals</option>
                                                <option value="Electronics">Consumer Electronics</option>
                                                <option value="Fashion">Fashion</option>
                                                <option value="Food">Food & Drug</option>
                                                <option value="Furniture">Furniture</option>
                                                <option value="Garden">Garden</option>
                                                <option value="Giftware">Giftware</option>
                                                <option value="Healthcare">Healthcare/OTC</option>
                                                <option value="Doctor">Healthcare/Doctor/Detailing/Hospital</option>
                                                <option value="Home">Home Improvement</option>
                                                <option value="Housewares">Housewares</option>
                                                <option value="Jewelry">Jewelry</option>
                                                <option value="Luggage">Luggage</option>
                                                <option value="Outdoor">Outdoor</option>
                                                <option value="Pet">Pet Supply</option>
                                                <option value="Security">Security</option>
                                                <option value="Sports">Sporting Goods</option>
                                                <option value="Travel">Travel</option>
                                            </select>
                                        </td>
                                        <td class="inptHldr">
                                            <select class="DropDown" name="Secondary_Trade">
                                                <option></option>
                                                <option value="Accessories">Accessories</option>
                                                <option value="Automotive">Automotive</option>
                                                <option value="Beauty">Beauty Supplies</option>
                                                <option value="Bedding">Bedding</option>
                                                <option value="Computer">Computer/Software/Peripherals</option>
                                                <option value="Electronics">Consumer Electronics</option>
                                                <option value="Fashion">Fashion</option>
                                                <option value="Food">Food & Drug</option>
                                                <option value="Furniture">Furniture</option>
                                                <option value="Garden">Garden</option>
                                                <option value="Giftware">Giftware</option>
                                                <option value="Healthcare">Healthcare/OTC</option>
                                                <option value="Doctor">Healthcare/Doctor/Detailing/Hospital</option>
                                                <option value="Home">Home Improvement</option>
                                                <option value="Housewares">Housewares</option>
                                                <option value="Jewelry">Jewelry</option>
                                                <option value="Luggage">Luggage</option>
                                                <option value="Outdoor">Outdoor</option>
                                                <option value="Pet">Pet Supply</option>
                                                <option value="Security">Security</option>
                                                <option value="Sports">Sporting Goods</option>
                                                <option value="Travel">Travel</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr><td colspan="3">Product Title:</td></tr>
                                    <tr><td class="inptHldr" colspan="3"><input class="Input" type="text" name="Product_Title" size="78" maxlength="255" /></td></tr>

                                    <tr><td colspan="3">Description of product:</td></tr>
                                    <tr><td class="inptHldr" colspan="3"><textarea name="Product_Description" class="TextArea" rows="9" cols="80"></textarea></td></tr>

                                    <tr><td colspan="3">Description of Engagement:</td></tr>
                                    <tr><td class="inptHldr" colspan="3"><textarea name="Engagement_Description" class="TextArea" rows="5" cols="80"></textarea></td></tr>

                                    <tr>
                                        <td colspan="5">
                                            <table>
                                                <tr>
                                                    <td>Contact Name:</td>
                                                    <td rowspan="2"><img src="../images/spacer.gif" width="20" height="1" /></td>
                                                    <td>Title:</td>
                                                </tr>
                                                <tr>
                                                    <td class="inptHldr"><input class="Input" type="text" name="Contact_Name" size="33" maxlength="100" /></td>
                                                    <td class="inptHldr"><input class="Input" type="text" name="Contact_Title" size="33" maxlength="100" /></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>

                                    <tr><td class="dots" colspan="3"><image src="../images/spacer.gif" height="18" width="1" /></td></tr>
                                    <tr><td class="btnHldr" colspan="3"><input type="image" src="../images/BTN_Go.gif" name="submit" border="0" /></td></tr>
                                </table>
                                </form>

                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>

    <?php
        include ('../common/include/footer.php');
    ?>[/code]

×
×
  • 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.