Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Posts posted by phpretard

  1. replace:

     

    $info="SELECT * from post_reply where parentid='0' AND forumid="$forumid" ORDER BY lastrepliedto DESC";

     

    with:

     

    replace: $info="SELECT * from post_reply where parentid='0' AND forumid='$forumid' ORDER BY lastrepliedto DESC";
    
    // ADDED
    
    forumid='$forumid' // no double quotes
    
    
    

  2. I kind of backed myself into a corner here.

     

    I have stored dates in my DB like 04/06/2009

     

    Now I need to edit via form.  The trick is geting the format stored into a select box.

     

    So I gues the question is how can I turn this: 04/06/2009 back into this:

     

    
    // MONTHS
    <OPTION VALUE='04'>04 - Apr</OPTION> // THIS OPTION SHOULD BE THE DB VALUE
    <OPTION VALUE="01">01 - Jan</OPTION>
    <OPTION VALUE="02">02 - Feb</OPTION>
    <OPTION VALUE="03">03 - Mar</OPTION>
    <OPTION VALUE="04">04 - Apr</OPTION>
    <OPTION VALUE="05">05 - May</OPTION>
    <OPTION VALUE="06">06 - Jun</OPTION>
    ...and so on
    
    // DAYS
    
    <OPTION VALUE='06'>06</OPTION> // THIS OPTION SHOULD BE THE DB VALUE
    <OPTION VALUE="01">01</OPTION>
    <OPTION VALUE="02">02</OPTION>
    <OPTION VALUE="03">03</OPTION>
    <OPTION VALUE="04">04</OPTION>
    <OPTION VALUE="05">05</OPTION>
    <OPTION VALUE="06">06</OPTION>
    <OPTION VALUE="07">07</OPTION>
    <OPTION VALUE="08">08</OPTION>
    ...and so on
    
    // YEARS
    <option value="2009">2009</option> // THIS OPTION SHOULD BE THE DB VALUE
    <option value="2010">2010</option>
    <option value="2011">2011</option>
    <option value="2012">2012</option>
    <option value="2013">2013</option>
    
    

     

     

    Thanks for the help...I am stumped

  3. I only want to allow letter and numbers and a space in between.

     

    If there is a space after then I need to strip that but, that might be another issue.

     

    
    <?php
    
    $docName="Appraisal Agreement";
    
    if (preg_match('/^[^a-z0-9-_ ]+$/i',$docName)){
    echo "No Pass";
    }else{echo "Passed";}
    
    ?>
    
    

     

     

    Any help today?

     

     

  4. Why doesn't this work?

     

     

    
    $LicenseMM="01";
    $LicenseDD="29";
    $LicenseYY="2010";
    
    $CurrentDay=date(d);
    $CurrentMonth=date(m);
    $CurrentYear=date(Y);
    
    
    
    if ($LicenseMM < $CurrentMonth || $LicenseDD < $CurrentDay && $LicenseYY == $CurrentYear){
    echo"Your License Has Expired";
    }
    
    // I HAVE TRIED THIS WAY TOO (extra parenthasize)
    
    if (($LicenseMM < $CurrentMonth || $LicenseDD < $CurrentDay) && ($LicenseYY == $CurrentYear)){
    echo"Your License Has Expired";
    }
    
    
    

     

    Thanks again.

  5. I am trying to set up an array to force login on certain requested pages.

     

    
    $secure_page_array=(secure1, secure2, secure3);
    
    I can write in english but struggle with the code...
    
    
    if a value in $secure_page_array is set as $_GET[''] and the $_SESSION['LoggedIn'] is not set{
    include ("loginSlash.php");
    }
    
    else {include ("requestedPage.php");}
    
    // PS IS THIS EVEN SECURE?
    
    

     

    Hope this makes sence...

     

    Thank you!

  6. I have no idea what to do with this ???

     

    
    string substr  ( string $string  , int $start  [, int $length  ] )
    
    

     

    I thought it was easy and I was just being ingnorant but could you explain that a little more?

  7. I just want the first charactor of any string.

     

    $var="ADFKLADHFH" // Strip all but A
    or
    $var="HKLJHKLDJKL"; // Strip all but H
    or
    $var="LSDFGKSJFH"; // Strip all but L

     

    AND SO ON

  8. I always build 2 different style sheets...one for IE and one for FF.

     

    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="IE-stylesheet.css" />
    <![endif]-->
    <![if !IE]>
    <link rel="stylesheet" type="text/css" href="default-stylesheet.css" />
    <![endif]>
    

     

     

    This method does not rely on javascript, so it will work even if javascript is disabled. The <![if IE]>,  <![if !IE]>, and <![endif]> tags are only recognized by Internet Explorer.

     

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