SCook
-
Posts
73 -
Joined
-
Last visited
Never
Posts posted by SCook
-
-
Hello,
I need a quick tip. When I use array_unique() to remove duplicate values, it does not re-index. Is there a way to do this, or an addional function? Thanks.
-
Hi all,
What's the php variable that gives you the currne tpage url? I can't remember it for the life of me :-) Thanks.
-
Hi everyone,
I was wondering, is there a countdown script out there? What I need is this: I need to plug in two time integers, and determine how many days, hours, minutes and seconds there are between.
Then I'll use JavaScript to count down in real time. But I first need the four variables when a apge is loaded. I could write this myself, but I was wondering if something might not already exist. Thanks.
-
Hi everyone,
I am using the mail() function on a client's server, php is enabled, but it keeps telling me that the mail is failing. Of course, it's just my message. Does the mail() function throw any exceptions? Like mysql_error()? Something like that? Thanks.
-
Hi all,
What is the function that I can plug a file path into and get an array of info on the file, such as size, date, etc? I know there is one, I just can't remember it. Thanks.
-
function sendVideoEmail($mID, $id) { global $access; // Get the member's email and name $query = "select first_name,email from members where id = $mID;"; $result = mysql_query($query, $access); $mem = mysql_fetch_row($result); // Get the email data $query = "select * from adv_mail where id = $id;"; $result = mysql_query($query, $access); $mail = mysql_fetch_array($result); // Get the advetisers contact info $query = "select * from advertisers where id = " . $mail["aID"] . ";"; $result = mysql_query($query, $access); $adv = mysql_fetch_array($result); // Compose the email $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: $mem[1]\n"; $headers .= "From: www.stirfrytv.com\n"; $body = " <html> <head> <title>Stir Fry TV Message,/title> </head> <body> <table width = 100% border = 0> <tr> <td>Hello, $mem[0]</td> </tr> <tr><td height = 20></td></tr> "; if ($mail["image_placement"] == "t") { $body .= " <tr> <td align = 'center'> <img src = 'http//65.254.38.55/~river/emails/$id.jpg' border = 0> </td> </tr> <tr><td height = 10></td></tr> <tr> <td>" . $mail["msg"] . "</td> </tr> "; } elseif ($mail["image_placement"] == "b") { $body .= " <tr> <td>" . $mail["msg"] . "</td> </tr> <tr><td height = 10></td></tr> <tr> <td align = 'center'> <img src = 'http//65.254.38.55/~river/emails/$id.jpg' border = 0> </td> </tr> "; } $body .= " <tr><td height = 20></td></tr> <tr> <td> "; $body .= "<b>" . $adv["company"] . "</b><br>"; $body .= $adv["street_address"] . "<br>"; if ($adv["address_line_2"] != "") { $body .= $adv["address_line_2"] . "<br>"; } $body .= $adv["city"] . ", " . $adv["state"] . " " . $adv["zip"] . "<p>"; $body .= "Phone: <b>" . $adv["phone"] . "</b><br>"; $body .= "E-mail address: <b><a href = 'mailto:" . $adv["email"] . "'>" . $adv["email"] . "</a></b>"; $body .= " </td> </tr> </table> </body> </html> "; if (!mail($mem[1], $mail["subject"], $body, $headers)) { return true; } }
-
Hi all,
I would like to send an html email with a pic inside. I've set it up with tables and etc. I've included the mime version and content-type: text/html in the header. It's not working. Can anyone give me a quick example or some help on it? Thanks
-
The cookie is set by whatever broswer the person logging into this site is using, and then they download the gadget. The problem is, the gadget itself does not seem to even recognize the $_COOKIE array. I think it might be a security issue or something, but I'm not sure. I'm new to these gadgets.
-
Hi all,
This is kind of an odd question, and I'm just hoping for a small possibility that someone here knows the answer.
I have a windows sidebar gadget that is essentially an iframe which loads a PHP document. In this document, I am trying to access a login cookie. It does not work. Does anyone have any clue on this? Thanks.
-
Well, I suppose I can use the date function, I've thought of that. What I suppose I can do is split the number string and apply the date to the final digit, as this is the only thing that matters. However, ou run into a weierd problem with the teens. They're all "th" So I guess I'll have to figure something out. Maybe the is_mumeric can help
-
Hi all,
Got another tone :-) Is there a built in function to format a number to it's appropirate suffix? I'm sure there is, and it'd save me time to write my own function, like:
1 = 1st
3 = 3rd
51 = 51st
and etc. Thanks
-
I can do it looping through the array, I was just wondering iif there was a built in function to do that task
-
Hi gang,
Quick question here: I want to retrieve a specific value in a multi-dimensional array. array_search does not seem to work. The array will have two keys for each index val1 and val2
After sorting the array, I want to retrieve the poistion in the array of val1 based on a specific value. Any help? Thanks.
-
Hi all,
Here is my problem: I have a list of people who've taken a quiz, they have the number right, and their time. I want to sort them all so that they're organized.
I was thinking of an array like:
my_array[0][0] = id;
my_array[0][1] = number_right;
my_array[0][1] = time;
Is there a way to sort the array by a specific key? Seems like I should know this, but I'm blocked. Any help would be great, thanks
-
Hi all,
Does anyone have a good method for filtering out duplicate values in an array? Some quick method, or API function? Something other than cycling through it and doing comparison, etc? Thanks.
-
Well, if they aren't in any order, then why do they show up wirth print_r in the order they were created from a form?
The reason is that I'm creating dynamic mysql entries using the post array submitted from a form. What I'm doing is coming a month, day, year field into one date variable. So what I do is unser the month, day, and year variables and create a $_POST["date"] variable. Now, when I do this, query creation, the date variable is at the end of the array, not in the space it should be. There fore, I need to move it forward.
-
No one has anything huh? :-)
-
Hi all,
Is there a way to move a post variable to another index in the post array?
For example:
$_POST["one"], $_POST["two"], $_POST["three"]
to make it:v
$_POST["three"], $_POST["one"], $_POST["two"]
-
I am in the US, and that worked great. I didn't even realize strtotime would do that. Thanks.
-
Hi all,
It's possible to get the number of seconds since the unix epoch with gettimeodday(). Is it also possible to convert a date to tyhe number of seconds? like 1/4/2008 0:00 am and get the seconds?
-
Yeah, str_replace would work, exept the special characters will be anyting from |s1|...|s11|. Now, I can loop through and do it, but I was just hoping there'd be a better way
-
Hi all,
I want to parse a string, for example:
This is |x| my string.
Where |x| needs to change to something else. And there may be more than one instance of this speial character. What would be the best way to go abot it?
-
I assume adodb.inc.php is a standard include? I'm not familiar with it. What I use to connect is the following:
access = mysql_connect(host, user, pw);]
mysql_select_db(db, access);
So along that vane, is there a way to have two connections at once?
-
Hi all,
Is there a good way to be able to open a connection to more than one db at a time? I'm doing something that will need it's own db, but I also need a connection to the first one which contains member info, etc.
Any suggestions would be great, thanks.
PHP Email formatting
in PHP Coding Help
Posted
Hi everyone,
I am having some odd issues with sending php generated emails. Essentially, what I'd like to know is how can I ensure they go into the inbox, and not get shunted to the junk mail folder. I assume this is s formatting issue, and it only happens sometimes. I am creating html emails. I have included my headers below:
$headers = "From: <Real Money Help>\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
Any help would be appreciated. Thanks.