Jump to content

therealwesfoster

Members
  • Posts

    345
  • Joined

  • Last visited

Posts posted by therealwesfoster

  1. Wildcard subdomains are ON. I've done this many times before, but it's not working now.. and it's a hostgator server so I'm unsure why.. here's my code

     

    Options +FollowSymlinks
    Options All -Indexes
    
    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/sub555
    <Files php.ini>
       order allow,deny
       deny from all
    </Files>
    </IfModule>
    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(.*)\.site\.com$ [NC]
    RewriteCond %1 !^(www|ftp|mail)$ [NC]
    RewriteRule ^(.*)$ ./runner.php?url=%1 [L]

     

    It all works EXCEPT for the subdomain part...

     

    Wes

  2. Negatory, here's the new code:

     

    $headers  = "MIME-Version: 1.0 \r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
    $headers .= "From: email@amil.com \r\n";
    $headers .= "Reply-To: email@amil.com \r\n";
    $headers .= "Return-Path: email@amil.com \r\n";
    mail("me@gmail.com,another@mydomain.com","Literature Request",$msg,$headers);
    

  3. This is weird and happens a lot.

     

    When I send an email from a php script

    mail("email@gmail.com","Literature Request",$msg);

     

    I receive the email in my GMAIL account, no problem. But when sending to any other email address (that ISN'T GMAIL), it doesn't get received. Not even in the spam folder.

     

    Whats up with that?

     

    Wes

  4. What's the best way to mass email WITHOUT using any other email servers? I'm just wanting to use the default mail server (it has to be done this way).

     

    So should I do:

    mail('email1, email2, email3',.....);

     

    Or in a loop:

    foreach ($var as $key){
       mail($key,...);
    }

     

    Or, if there is another way, let me know!

     

    Thanks

  5. FIXED IT!

     

    I put i--; in my for loop, this fixed it somehow.

     

    Final Code:

    // This is a simple function to check if a value is in an array
    Array.prototype.inArray=function(value){var i;for(i=0;i<this.length;i++){if (this[i] == value){return true;}}return false;};
    
    // This is the selectbox object
    var obj = document.getElementById("selbox");
    
    // Keep: CA, DC, CO, FL, GA, IA, MO, MN, NC, NV, NH, NM, OH, OR, SC, VA, WL
    var keepStates = ['New Mexico','North Carolina','Ohio','Oregon','South Carolina','Virginia'];
    
    for(var i=0;i<obj.length;i++){
       if (!keepStates.inArray(obj[i].innerHTML)){
          // Ok, so the value of the selectbox isn't in the array of states we want to keep, so remove it
          obj.remove(i);
    
          // THE FIX
          i--;
       }
    }

  6. Fixed:

     

    // This is a simple function to check if a value is in an array
    Array.prototype.inArray=function(value){var i;for(i=0;i<this.length;i++){if (this[i] == value){return true;}}return false;};
    
    // This is the selectbox object
    var obj = document.getElementById("selbox");
    
    // Keep: CA, DC, CO, FL, GA, IA, MO, MN, NC, NV, NH, NM, OH, OR, SC, VA, WL
    var keepStates = ['New Mexico','North Carolina','Ohio','Oregon','South Carolina','Virginia'];
    
    for(var i=0;i<obj.length;i++){
       if (!keepStates.inArray(obj[i].innerHTML)){
          // Ok, so the value of the selectbox isn't in the array of states we want to keep, so remove it
          obj.remove(i);
       }
    }

     

    That removes the whole object, not just the option

     

    Wes

  7. I'm doing this as a 1ShoppingCart modification. On the cart page there is a dropdown list of states, but since the product being sold (wine) is limited to where it can be shipped, we're wanting to eliminate some of the state in the dropdown.

     

    The script above works in a way. It leaves all the states that it's supposed to leave, but not all of the other states get removed. Just every other one, or every other 2 ones. Does remove() reset the dropdown's index? If so, this could be the problem (because var i is always incrementing)

     

    Wes

  8. Ok, here's the idea. There is a selectbox on the page with all 50 states listed. I'm wanting to remove all the states in the selectbox EXCEPT for the ones I have listed in the keepStates array.

     

    Below is my code. I can't get this to work! Either nothing happens or I get a "obj.remove() is not a function" error.

     

    <script type="text/javascript">
    // This is a simple function to check if a value is in an array
    Array.prototype.inArray=function(value){var i;for(i=0;i<this.length;i++){if (this[i] == value){return true;}}return false;};
    
    // This is the selectbox object
    var obj = document.getElementById("selbox");
    
    // Keep: CA, DC, CO, FL, GA, IA, MO, MN, NC, NV, NH, NM, OH, OR, SC, VA, WL
    var keepStates = new Array('New Mexico','North Carolina','Ohio','Oregon','South Carolina','Virginia');
    
    for(var i=0;i<obj.length;i++){
    if (!keepStates.inArray(obj[i].innerHTML)){
    	// Ok, so the value of the selectbox isn't in the array of states we want to keep, so remove it
    	obj.remove(i);
    }
    }
    </script>

     

    This does not work. Please help!

     

    Wes

  9. <?php
    $weekStart = strtotime( "-1 Sunday 00:00" );
    $weekEnd = strtotime( "+1 Saturday 23:59" );
    $todayStart = strtotime( "00:00" );
    $todayEnd = strtotime( "23:59" );
    
    echo date( "d/m/y H:i", $weekStart ) . "<br />";
    echo date( "d/m/y H:i", $weekEnd ) . "<br />";
    echo date( "d/m/y H:i", $todayStart ) . "<br />";
    echo date( "d/m/y H:i", $todayEnd ) . "<br />";
    ?>
    

     

    That should do the trick.

     

     

    You're awesome. Thanks!

     

    Wes

  10. I'm having trouble getting the 4 timestamps.

     

    I had to do this for the previous month's beginning/ending timestamp and I did it like this:

    $prev_month1 = strtotime(date("1 F Y",strtotime('-1 month')));
    $prev_month2 = strtotime(date("t F Y",strtotime('-1 month')));

     

    This snippet gets the beginning and ending timestamp for the previous month. I'm needing to do the same for the current week and current day.. but I'm stuck

     

    Wes

  11. I'm needing to generate a total of 4 UNIX Timestamps.

    1. The beginning timestamp of the current week (Sunday at 0:00:00)

    2. The ending timestamp of the current week (Saturday at 23:59:59)

    3. The beginning timestamp of the current day (today at 0:00:00)

    4. The ending timestamp of the current day (today at 23:59:59)

     

    The current day/week of the script can be whenever, so the script should be able to function no matter what day/month/year it is :)

     

    Thanks!

     

    Wes

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