Jump to content

DBookatay

Members
  • Posts

    334
  • Joined

  • Last visited

Posts posted by DBookatay

  1. You could do javascript...

     

    <script language="JavaScript">
    function confirmLogout()
    {
    var agree=confirm("Are you sure you want to log out?");
    if (agree)
    return true ;
    else
    return false ;
    }
    </script>
    

     

    then for a link

     

    <a href="logout.php" onClick="return confirmLogout()">logout</a>
    

     

    I just tried using this script on my site, exactly as it was written, and with both buttons "Cancel" and "Agree" I was still logged out...

  2. Also you should mysql_real_escape_string() all $_POST vars before putting them in the db.

     

    Can you please explain, or show me an example, I do not know what that means?

     

     

    BTW: Thank you, your code solved my problem... Should I rewrite the 2 other querys (or is it "queries,") the same way?

  3. Hi Freaks!

     

    I have a page with (technically) 3 forms on the same page, I say technically because of which "forms_view.php?body=________" you are on determines which form you are actually seeing.

     

    For some reason I can only get 2 out of the 3 post querys to function, and I've tried EVERYTHING...

    Moving the order of them around, moving them to different locations on the page, renaming the querys, everything, still the last one (query3) will not work...

     

    Can anyone spot the error?

    if (isset($_POST['edit'])){
    $query = "UPDATE EZFinancing_Apps SET
    status = '{$_POST['status']}',
    apScore = '{$_POST['apScore']}',
    coapScore = '{$_POST['coapScore']}',
    Citi = '{$_POST['Citi']}',
    AL = '{$_POST['AL']}',
    UCF = '{$_POST['UCF']}'
    where id = '$id'"; 
    if ($result = mysql_query ($query)) {header('Location: forms_view.php?id=' . $id );}
    
    
    if ($_POST['cmnts']){
    $post_comments = addslashes(escape_data($_POST['cmnts']));
    $query2 = "INSERT INTO EZFinancing_Notes SET
    App_id = '$id',
    comments = '$post_comments',
    posted = NOW()"; }
    if ($result = mysql_query ($query2)) {header('Location: forms_view.php?id='.$id.'&body=Notes');}
    
    
    if ($_POST['vehYear']){
    $query3 = "INSERT INTO EZFinancing_Figures SET
    App_id = '$id',
    year = '{$_POST['year']}',
    make = '{$_POST['make']}',
    model = '{$_POST['model']}',
    A = '{$_POST['A']}',
    B = '{$_POST['B']}',
    C = '{$_POST['C']}',
    D = '{$_POST['D']}',
    E = '{$_POST['E']}',
    F = '{$_POST['F']}',
    G = '{$_POST['G']}',
    H = '{$_POST['H']}',
    I = '{$_POST['I']}',
    J = '{$_POST['J']}',
    K = '{$_POST['K']}',
    L = '{$_POST['L']}',
    M = '{$_POST['M']}',
    O = '{$_POST['O']}',
    1 = '{$_POST['1']}',
    2 = '{$_POST['2']}',
    amtFin = '{$_POST['amtFin']}',
    finChrg = '{$_POST['finChrg']}',
    totalPymts = '{$_POST['totalPymts']}',
    totalPrce = '{$_POST['totalPrce']}',
    finRsrve = '{$_POST['finRsrve']}',
    price = '{$_POST['price']}',
    weekly = '{$_POST['weekly']}',
    monthly = '{$_POST['monthly']}'"; }
    if ($result = mysql_query ($query3)) {header('Location: forms_view.php?id='.$id.'&body=Notes');} else {echo mysql_error();}
    

  4. I currently have Nextel, have used them for over 10 years now, but I am starting to get VERY upset with their service.

    My last phone, an i860 broke after only 1 year, and only 1 drop on the floor. (The drop is not what broke the phone... One day the display decided that it no longer wanted to work anymore!) Since my contract wasn’t up, I wasn’t eligible for any upgrades and had to pay full price for any new phone I wanted. $500 for a i870.

     

    For a few reasons I think once my contract ends, (next month,) I think I'm going to get a new carrier. Question is, what does everyone else think is the best provider / phone out there.

     

  5. I occasionally still use FP, it makes split view code/layout easy to see.

    However the majority of my coding is with Notepad++. I think that as long as you don’t use the extensions, it can be a valuable tool, among others.

     

    Will someone, anyone please agree with me the despite its flaws, Frontpage is still WAY better that DreamWeaver?

     

  6. Brad, 26, Danbury, CT.

    I learned html about 10 years ago, when my fathers business needed a website.

    I would go to sites that I liked, view source the pages, and figure out what in the code made the page act the way it did.

    I have a few of my early site versions on a hard drive, and laugh when I go back and view them now.

     

    Viewing page sources worked great for learning html and javascripts, but when I needed to make the site dynamic, books and forums taught (and still teach,) me a lot!

     

    Thanks EVERYONE!

  7. It seams like whenever I post a question on said website, (that is supposed to be a community that actually HELPS people) I either get a rude comment by some a$$h@!*, or no one ever is willing to respond. Yet if I post the same question, in the same exact text, there are a ton of nice, friendly answers that always help.

     

    Has anyone else had any problems with this site?

  8. I dont know if what these are really called, but in php I think their called "case statements."

     

    nogrey & fenway gave me a great code for dropdown hidden layers:

     

    java code:

    function show_hide(val) {
         if ((val == "0") || (val == "1")) document.getElementById('ap_preWork').style.display = "";
         else document.getElementById('ap_preWork').style.display = "none";
    }

     

    html code:

    <select name="ap_wrk10" onchange="show_hide(this.value);">

     

    What I'm trying to do is make it so that the code can be used on a few different layers, "previous work", "previous address", ect.

    I wrote this:

    function show_hide(val) {
    if ((val == "") || (val== "0") || (val == "1")) {
    switch (val) {
            case 'AA':
                 document.all('apAdd').style.display = "";
            break;
            case 'AE':
                 document.all('apWrk').style.display = "";
            break;
          }
    }
    else {
    switch (val) {
            case 'AA':
                 document.all('apAdd').style.display = "none";
            break;
            case 'AE':
                 document.all('apWrk').style.display = "none";
            break;
           }
    }

     

    The html:

    <select name="ap_add5" onchange="show_hide('AA',document.forms[0].apAdd.value);">

     

    This doesnt work, so obviously something is wrong. Problem is, I have NO IDEA what I'm doing, or how to go about getting this to work... Is my javascript code wrong, is the html code wrong, or is all of it just junk?

     

    Any ideas or advise would really help.

    Thank you...

     

  9. I have an application form on my site that requires users to insert information, to apply for credit.

     

    I am trying to make a script that shows a hidden layer, named "Previous" if the user selects "01" or "0" from a select box nammed "ap_add5". Which basically means that if the person filling out the form has lived at their current address for less than 2 years a layer showing "Previous Address" fields will appear.

     

    Can anyone help with this?

  10. On my index page (in the employee only section) of my url I have a stats section, that counts values of our dB. Problem is that there are many many values that it counts, based on the business year.

    It counts sales based on salesman, month, make (Audi, Ford, Honda, ect.), and so on and so on... The (edited down) "count" code I have now is:[code]$query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' salesman = 'Brad'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_BG = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' salesman = 'Charles'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_CG = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' salesman = 'Doug'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_DD = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' salesman = 'Jerry'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_JF = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' salesman = 'Joe'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_JC = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' salesman = 'Jennifer'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_JL = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '01'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_01 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '02'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_02 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '03'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_03 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '04'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_04 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '05'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_05 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '06'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_06 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '07'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_07 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '08'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_08 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '09'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_09 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '10'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_10 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '11'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_11 = $row[thecount];
    $query = "SELECT count(*) as thecount from sold where sold_dte3 = '{$_POST['sold_dte3']}' sold_dte1 = '12'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $stats_12 = $row[thecount];[/code]

    Is there a way to simplify all of this?
  11. I have a form, that if required fields arent inserted and error page displays telling the user to complete the required fields. Problem is that when the user clicks back to correct the problems all the data is lost. I figured out that on a text box you can use
    [code]<input size="20" name="ap_nmF" value="<?php if (isset($_POST['ap_nmF'])) echo $_POST['ap_nmF']; ?>" />[/code] and it will hold  the information, but how do you do the same type thing on a radio button if all the radio buttons use the same name, just have different values?

    The page I'm working on is here. [url=http://www.carcityofdanbury.com/apply.php?applicant=single]http://www.carcityofdanbury.com/apply.php?applicant=single[/url]

    (Hopefully my explanation helps...)
  12. How do I do this: [code]<input size="20" name="ap_nmF" value="<?php if (isset($_POST['ap_nmF'])) echo $_POST['ap_nmF']; ?>" />[/code]
    on a "radio" button, when all the radio buttons use the same name?
    [code]
    <input type="radio" class="radio" name="ap_bnk1" value="Apple">
    <input type="radio" class="radio" name="ap_bnk1" value="Grape">
    <input type="radio" class="radio" name="ap_bnk1" value="Orange">
    <input type="radio" class="radio" name="ap_bnk1" value="Pear">
    [/code]

    Any help would be apprechiated?
×
×
  • 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.