therealwesfoster
-
Posts
345 -
Joined
-
Last visited
Posts posted by therealwesfoster
-
-
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);
-
and it also helps if the email account does actually exist
That's my problem!
No, not really I'll add those headers and let you know
Wes
-
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
-
Wow.. that easy. Thanks
Wes
-
I'm needing to create a PHP script that will download an external .bz2 file and extract it's contents onto a local directory.
Could someone point me in the right direction and give me some tips?
Wes
-
Options +FollowSymLinks Options All -Indexes RewriteEngine On RewriteRule ^artisan-(.*?).html ./acpage.php?p=$1 [NC,L] RewriteRule ^(.*?).html ./$1.php [NC,L]
I keep getting 500 errors.
Wes
-
What was I thinking? Of course! One of those days
-
How would you do something like this?
if ($type == ('a' OR 'b'))
Instead of:
if ($type == 'a' OR $type == 'b'))
Let me know if it's possible
-
How can I detect if the window (or tab of the window) is unfocused (or not being viewed by the user)
?
Thanks!
-
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
-
hmm I coulda swore I saw a question mark in there, hence the statement. My bad. But for argument sake, for #1, I meant it in a more generic sense. As in, if you're going to take the time to put it in one place, why not just put it in another place, click the proverbial run button and see what happens?
10-4. I wasn't offended
Wes
-
Instead of c/p'ing it here and asking if it will work, you could always c/p it to a test.php and run it and find out.
1. I didn't copy, I wrote it real quick.
2. I didn't ask if it would work, I just made a statement before marking the topic as solved.
Wes
-
Ok, so this simple script should output "test"
<?php session_start(); $_SESSION['test'] = 'test'; function show(){ return $_SESSION['test']; } echo show(); ?>
Wes
-
Thanks for the reply
I have a global header in which I call session_start(). Should I call this again in a function (later down the page) or no?
Wes
-
If in a function I'm going to be working with sessions, does session_start() need to be called in the function? Or global $_SESSION?
Please let me know
Wes
-
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--; } }
-
That's a jQuery function I'm needing just javascript
Wes
-
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
-
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
-
If it were only that easy!!
That doesn't work for me.. Any other ideas as to why? Or ideas as to what to do?
Wes
-
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
-
<?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
-
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
-
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
Whats wrong with this?
in Apache HTTP Server
Posted
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
It all works EXCEPT for the subdomain part...
Wes