Re: [PHP] Encoding for W3C Validation
That is definitely calling out for a loop. When I scan down the lines of code, the only part I see changing is the x after $pic_x. You could make an array with all of the picture details and then replace all of that repeated code with a loop like so: $pics = array('my_first_picture.jpg', 'my_second_picture.jpg', 'etcetera.jpg'); foreach ($pics as $pic) { if (trim($pic) <> "") { echo " "; } } For the next step, you can just replace all those single quotes in your HTML with escaped double quotes like so: if (trim($pic) <> "") { echo " "; } As others have pointed out, you might want to use single quotes for the PHP value being passed to echo. That would save you from having to escape the HTML double quotes, but then you can't include $variables inside of single quoted strings (you have to concatenate them separately). Pick your poison. The PHP documentation on strings is pretty good, and it couldn't hurt to have a look: http://php.net/manual/en/language.types.string.php Carlton Whitehead On Tue, Aug 3, 2010 at 3:44 PM, Rick Dwyer wrote: > > On Aug 3, 2010, at 3:36 PM, Ashley Sheridan wrote: > > > On Tue, 2010-08-03 at 15:32 -0400, Rick Dwyer wrote: > >> > >> On Aug 3, 2010, at 3:15 PM, Sebastian Ewert wrote: > >> > >> > Ashley Sheridan wrote: > >> >> On Tue, 2010-08-03 at 15:00 -0400, Rick Dwyer wrote: > >> >> > >> >>> On Aug 3, 2010, at 2:47 PM, Sebastian Ewert wrote: > >> >>> > >> >>>> Rick Dwyer wrote: > >> >>>>> Hello List. > >> >>>>> > >> >>>>> In the Alt section of the IMG tag below, the variable $myitem has > a value of "Who's There". > >> >>>>> > >> >>>>> echo " src='/itemimages/$mypic' alt='$myitem' width='60' > >> >>>>> > >> >>>>> When running through W3C validator, the line errors out because of > the " ' " in "Who's". > >> >>>>> I tried: > >> >>>>> $myitem=(htmlentities($myitem)); > >> >>>>> > >> >>>>> But this has no affect on "Who's". > >> >>>>> > >> >>>>> What's the best way to code this portion so the apostrophe is > handled correctly? > >> >>>>> > >> >>>>> > >> >>>>> TIA, > >> >>>>> > >> >>>>> --Rick > >> >>>>> > >> >>>>> > >> >>>>> > >> >>>>> > >> >>>> Use it > >> >>>> > >> >>>> > >> >>>> echo ' >> >>>> src="/itemimages/'.$mypic.'" alt="'.$myitem.'" width="60" ...' > >> >>> > >> >>> Thanks Sebastian. > >> >>> > >> >>> In the above, what is the function of the period in front of > $myitem? > >> >>> > >> >>> --Rick > >> >>> > >> >>> > >> >> > >> >> > >> >> It is a string concatenation in PHP. But, as my last email on this > >> >> thread shows, you only need to add ENT_QUOTES to your htmlentities() > >> >> call and everything will work. > >> >> > >> >> Thanks, > >> >> Ash > >> >> http://www.ashleysheridan.co.uk > >> >> > >> >> > >> >> > >> > > >> > > >> > If you use single quotes you can't use variables inside the string. > You > >> > have to combine strings and variables or two strings with a dot. > >> > > >> > echo 'foo'.$bar; > >> > > >> > http://www.php.net/manual/de/language.types.string.php > >> > > >> > I'm not shure but I think to validate xhtml you need the double > quotes. > >> > >> Problem I'm having is I've inherited a PHP page that contains sections > of PHP/Javascript/HTML/CSS all inside of a PHP echo tag. My PHP and JS > skill are rudimentary at best so when it comes to a block of code 40 to 50 > lines in length, it becomes daunting to reverse the ' with ". Each echo > block starts with a " and the html inside uses a
[PHP] PDOStatement execute memory issue?
Hi everyone, I'm working on a script that downloads archived fax images (TIFFs and PDFs) from a MS SQL Server using the PDO ODBC driver. I get the below error regardless of which fax I try to get from the database. Each fax is a different size, and both of the memory allocation numbers are always the same: Fatal error: Out of memory (allocated 262144) (tried to allocate 4294967295 bytes) in C:\Inetpub\wwwroot\FMarchive\library\faxInbound.php on line 81 The above error happened when querying a fax with a size of 17723 bytes. According to my phpinfo(); page, the memory_limit is 128MB. My machine has the below specs: Windows Server 2003 SP2 IIS 6 2GB RAM Microsoft SQL Server 2005 SP2 PHP 5.2.4 Here is the excerpt from my code: public function downloadFax($id, $attid, $attsize) { try { $stmt = 'SELECT filename, attdata FROM fm_faxin_att WHERE id = :id AND attid = :attid'; $pstmt = $this->db->prepare($stmt); $pstmt->bindValue(':id', $id); $pstmt->bindValue(':attid', $attid); $pstmt->execute(); // this is the Line 81 referenced by the error message $pstmt->bindColumn('filename', $filename, PDO::PARAM_STR); $pstmt->bindColumn('attdata', $data, PDO::PARAM_LOB); $pstmt->fetch(PDO::FETCH_BOUND); return array('attdata' => $data, 'filename' => $filename); } catch (PDOException $e) { die($e->getMessage()); } } Any ideas? Regards, Carlton Whitehead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDOStatement execute memory issue?
No, the faxes aren't 4GB. Most of the faxes are less than 50KB, although they can be as large as a few MB. 4GB is a ridiculous amount of memory to try to allocate for this. 4GB is the max that 32bit versions of Windows can see. Is something causing the memory allocation to loop until it reaches this maximum value? When I execute the same SQL in the MS SQL management studio interface, I get the expected resultset. When I change the where clause portion in the prepared statement from "WHERE id = :id AND attid = :attid" to contain "WHERE id = 119085977300014 AND attid = 0" and comment out my bindValue() lines, I get the exact same memory allocation error in my PHP script. I have isolated the problem to the query against the attdata column. If I remove the attdata column from the query, the query executes just fine. It may be worth noting this is an 'image' type column. Could this be some bug in the way PHP, PDO, ODBC, and/or MS SQL are communicating? Maybe 'image' columns aren't being handled correctly? I'm fairly certain my code is correct. I appreciate all of your comments. Has anyone even tried querying an 'image' type column out of MS SQL 2005 using PDO ODBC? Regards, Carlton Whitehead Jeffery Fernandez wrote: On Thursday 27 September 2007 04:21, Carlton Whitehead wrote: Hi everyone, I'm working on a script that downloads archived fax images (TIFFs and PDFs) from a MS SQL Server using the PDO ODBC driver. I get the below error regardless of which fax I try to get from the database. Each fax is a different size, and both of the memory allocation numbers are always the same: Fatal error: Out of memory (allocated 262144) (tried to allocate 4294967295 bytes) in C:\Inetpub\wwwroot\FMarchive\library\faxInbound.php on line 81 Ho big are those faxes? 4294967295 bytes = 4GB have you tried executing that SQL directly into the database? Does it return the right results? The above error happened when querying a fax with a size of 17723 bytes. According to my phpinfo(); page, the memory_limit is 128MB. My machine has the below specs: Windows Server 2003 SP2 IIS 6 2GB RAM Microsoft SQL Server 2005 SP2 PHP 5.2.4 Here is the excerpt from my code: public function downloadFax($id, $attid, $attsize) { try { $stmt = 'SELECT filename, attdata FROM fm_faxin_att WHERE id = :id AND attid = :attid'; $pstmt = $this->db->prepare($stmt); $pstmt->bindValue(':id', $id); $pstmt->bindValue(':attid', $attid); $pstmt->execute(); // this is the Line 81 referenced by the error message $pstmt->bindColumn('filename', $filename, PDO::PARAM_STR); $pstmt->bindColumn('attdata', $data, PDO::PARAM_LOB); $pstmt->fetch(PDO::FETCH_BOUND); return array('attdata' => $data, 'filename' => $filename); } catch (PDOException $e) { die($e->getMessage()); } } Any ideas? Regards, Carlton Whitehead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDOStatement execute memory issue?
The problem is isolated to PDO ODBC -- old school ODBC works fine. Below are my test cases. Plain old ODBC: $stp = 'SELECT attdata FROM fm_faxin_att WHERE id = 11908591344 AND attid = 0'; // statement to prepare $ps = odbc_prepare($res, $stp); if (!$res) { die ('failed to prepare statement'); } $execResult = odbc_execute($ps); echo var_export($execResult, true); ?> The output from the plain old ODBC test case is: true (indicating that odbc_execute succeeded, see http://www.php.net/manual/en/function.odbc-execute.php). Next up, PDO ODBC: $stp = 'SELECT attdata FROM fm_faxin_att WHERE id = 11908591344 AND attid = 0'; // statement to prepare $ps = $db->prepare($stp); $execResult = $ps->execute(); var_export($execResult, true); } catch (PDOException $e) { die($e->getMessage()); } ?> When running lobtestPdoOdbc.php, I get the same old error: *Fatal error*: Out of memory (allocated 262144) (tried to allocate 4294967295 bytes) in *C:\Inetpub\wwwroot\FMarchive\lobtestPdoOdbc.php* on line *9* I tried removing the try-catch blocks with no change in output (still gets the exact same Fatal Error) -- not like that would be an acceptable solution anyway. It appears this is a problem with PDO. I'm starting to really get out of my league now. How can I go about fixing this? Regards, Carlton Whitehead Larry Garfield wrote: On Wednesday 26 September 2007, Carlton Whitehead wrote: Could this be some bug in the way PHP, PDO, ODBC, and/or MS SQL are communicating? Maybe 'image' columns aren't being handled correctly? I'm fairly certain my code is correct. I appreciate all of your comments. Has anyone even tried querying an 'image' type column out of MS SQL 2005 using PDO ODBC? Regards, Carlton Whitehead Try isolating the problem. If you have a literal query through PDO that fails, in isolation, try the same query using the old-skool odbc routines; just a trivial test script. If that works but the same test script converted to minimal PDO fails, you've found a bug. If it fails in both cases, I'd start blaming something else. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PDOStatement execute memory issue?
Hi Colin, The MS documentation says the image type can hold up to 2GB: http://technet.microsoft.com/en-us/library/ms187993.aspx It appears someone beat me to filing a bug report about this: http://bugs.php.net/bug.php?id=42765 I guess that's that for now until this gets fixed. Regards, Carlton Whitehead - Original Message - From: "Colin Guthrie" <[EMAIL PROTECTED]> To: php-general@lists.php.net Sent: Thursday, September 27, 2007 4:04:53 AM (GMT-0500) America/New_York Subject: [PHP] Re: PDOStatement execute memory issue? Carlton Whitehead wrote: > Is something causing the memory allocation > to loop until it reaches this maximum value? I don't think so as the 4GB value is mentioned in the error message. Usually when memory is exhausted in a loop it will say "(tried to allocate 100 bytes)" - e.g. a little amount. This appears to do it in one chunk. I wonder if this is trying to allocate memory for the maximum potential size of your field in the DB? Perhaps read up on PDO/ODBC/MSSQL and how they treat BLOBs (I don't know myself). Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strpos error (I'm missing something obvious)
Kevin, Try this instead: $site = "http://www.wnc.edu";; $referer = $_SERVER["HTTP_REFERER"]; echo $referer;// the output is correct at: http://www.wnc.edu/test/ if (is_int(strpos($referer, $site))) { echo "yes"; } Why did I make this change? strpos returns an integer representing the position of the needle ($site) in the haystack ($referrer). For more info, see http://us.php.net/manual/en/function.strpos.php. Regards, Carlton Whitehead Kevin Murphy wrote: Overly simplified version of my code. $site = "http://www.wnc.edu";; $referer = $_SERVER["HTTP_REFERER"]; echo $referer;// the output is correct at: http://www.wnc.edu/test/ if (strpos($referer,$site) === TRUE) { echo "yes"; } Why doesn't it echo out "yes"? I know I am doing something stupid here, but it doesn't seem to work :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strpos error (I'm missing something obvious)
Kevin, I think I addressed that in my last message, if a bit indirectly. strpos will never return a boolean true. It will only ever return either the integer where the needle is found in the haystack, or false if said needle is not found in said haystack. Check the Return Values section at http://us.php.net/manual/en/function.strpos.php Regards, Carlton Whitehead Kevin Murphy wrote: I fixed this by changing === TRUE to !== FALSE, so I think I am good to go now. But would still like to know why TRUE doesn't work. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Context of 0
This should be a lesson about how important it is to keep in mind the *type* of data when writing comparisons, even in a dynamic/weakly-typed language like PHP. For example, consider this test case: The == operator performs a very loose comparison of "equality" between the supplied values, converting the types before performing the comparison. When false is converted to an integer, it converts as 0, which happens to be the same as 0, therefore the code block executes. The === operator performs a stricter comparison of equality between the supplied values, taking into account the type. Because an integer and a boolean are being compared, it will always evaluate as false. The code in the second if-statement will never be executed because of this. Also keep in mind the != and !== operators differ from each other in much the same way as == and === differ. Refer to http://www.php.net/manual/en/language.operators.comparison.php for more details about this. Regards, Carlton Whitehead - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: php-general@lists.php.net Sent: Tuesday, October 2, 2007 1:14:42 PM (GMT-0500) America/New_York Subject: [PHP] The Context of 0 [small rant] This morning's thread on strpos() brings up an interesting point, zero has a context. In certain cases 0 is the equivalent of FALSE and in other cases a 0 is just a 0. In the context of strpos() 0 indicates that the needle is in the first position of the haystack. If the needle is not found in the haystack a Boolean FALSE is returned. In this case 0 is not the equivalent of FALSE. There are other cases, most of them specific to strings, in which 0 is not the equivalent of FALSE. Newbies to PHP or certain functions will no doubt encounter these cases at some point. Exercise care when using 0 to determine if something is FALSE and understand that 0 has context. [/small rant] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Performing Multiple Prepared Queries
Hi Nathaniel, When your query starts its second loop, the resultset from the first one is still defined as the resultset in your prepared statement object. Before you can get another resultset, you need to clear the first one using the mysqli_stmt_free_result function. It would probably be best to place the free_result call after each call to fetch. Check http://www.php.net/manual/en/function.mysqli-free-result.php for more details about it. Regards, Carlton Whitehead - Original Message - From: "Nathaniel Hall" <[EMAIL PROTECTED]> To: php-general@lists.php.net Sent: Wednesday, October 3, 2007 10:47:22 AM (GMT-0500) America/New_York Subject: [PHP] Performing Multiple Prepared Queries All, I am attempting to perform multiple prepared queries using mysqli. I want to pull information out of one table based on the information in another. I do not receive any errors and the rest of the page seems to load correctly. Below is my code: foreach ($uniqueids as $entryid) { $getentrybyid->bind_param("i", $entryid); $getentrybyid->execute(); $getentrybyid->bind_result($level, $published, $updated, $title, $body, $resources, $signature, $comments); $getentrybyid->fetch(); $getentrybyid->close(); $getsignaturebyid->bind_param("i", $signature); $getsignaturebyid->execute(); $getsignaturebyid->bind_result($fname, $lname); $getsignaturebyid->fetch(); $getsignaturebyid->close(); printEntry($title, $level, $published, $updated, "$fname $lname", $body, $resources); if ($comments == 'y') { echo "View Comments...\n"; } } What ends up happening is the first query (getentrybyid) works just fine and displays when told. The second query (getsignaturebyid) does not get the information that it is supposed to, thus the variable is empty. NOTE: I have moved the close() functions outside of the foreach loop and it partially works. It starts displaying the information it is supposed ($fname $lname) but it repeats the rest of the information. Any thoughts? -- Nathaniel Hall, GSEC GCFW GCIA GCIH GCFA Spider Security -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 under IIS6
Hi Alberto, Try using the php5isapi.dll instead of CGI. Make sure you have an entry for PHP5 in your Web Service Extensions list, and that it is marked as Allowed. Also, open the properties of your Web Sites folder in IIS Manager, go to the Home Directory Tab, click Configuration, and make sure the php5isapi.dll is mapped to the .php extension. Regards, Carlton Whitehead - Original Message - From: "Alberto García Gómez" <[EMAIL PROTECTED]> To: php-general@lists.php.net Sent: Monday, October 8, 2007 9:57:42 AM (GMT-0500) America/New_York Subject: [PHP] PHP5 under IIS6 Hi fellows: I'm trying to mount PHP5 ( the last stable version from php.net) under a IIS6 (win2k3 SP2), and when I run the .msi and it finish it said that is not possible the configure httpd.conf, which is a very big mistake 'cause I'm specify that I use IIS6. After that I try making a manual configuration and I recive a CGI error. I need help ASAP. Este correo ha sido enviado desde el Politécnico de Informática "Carlos Marx" de Matanzas. "La gran batalla se librará en el campo de las ideas" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with autoload
Jonathan Mast wrote: I have a project the someone else wrote and that I can't get to work. It uses a rather large library of classes that are not apparently getting loaded by the provided __autoload() function. I'm not very well versed in PHP and one of the first things I did was see if in fact the __autoload function was being called. I place some print statements in it and got no result. But I don't know if that is because it is not really calling that function or perhaps the print outs are out of scope and won't be catched by the browser, I don't know. thanks, PHP: 5.1 TOMCAT: 5.5 Windows XP Hi Jonathan, Almost certainly the __autoload function is not being called by the parent script. Make sure the parent script that is being run (based on the URL in your browser) did an "include" or "require" against the script containing the autoload function definition. Also make sure the path used for it is correct. It's really hard to say without looking at the code and filesystem. Just for kicks I made a test case to see if print works from inside the __autoload function, and it did. Regards, Carlton Whitehead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] page called from form "action=post" not appearing on screen
milt wrote: I have a form statement with: action=http://www.caamuseum.org/mem_test_review.php method="post"> when I click the submit button, the web address appears in the firefox address box, but no page appears on the screen. and when I try to view the page source code from the firefox "view" drop-down menu there is no source code. the page is in the correct directory and I can open the source in IE or in dreamweaver. I don't receive any error message or missing input file message. I'm at a lost as to what might be the matter. does anyone have an approach to solving this problem or know what the cause might be? thanks - Milton Check the php.ini on the server that hosts caamesuem.org (is it your server?) and see if display_errors is enabled. You generally shouldn't enable this on a production server, but it could be very helpful right now. If it's disabled, it might be suppressing a helpful error message. Remember to restart your web server if you change the php.ini. Regards, Carlton Whitehead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need insights on encrypting and uploading ASCII file using PHP
Easiest? If you have IIS (like my test environment), you can use the SelfSSL tool to make a self-signed SSL certificate. Generally these aren't so great for a production environment, but you said *easiest*. SelfSSL is part of the IIS 6.0 Resource Kit: http://www.microsoft.com/downloads/details.aspx?FamilyID=56FC92EE-A71A-4C73-B628-ADE629C89499&displaylang=en I imagine there's a similar utility for Apache... To get a "real" SSL certificate, you probably need to buy one from a reputable Certificate Authority. Regards, Carlton Whitehead - Original Message - From: "John A DAVIS" <[EMAIL PROTECTED]> To: "PHP General List" Sent: Friday, July 27, 2007 4:52:55 PM (GMT-0500) America/New_York Subject: Re: [PHP] need insights on encrypting and uploading ASCII file using PHP So, what is the easiest way to get and install an SSL certificate? >>> "Richard Lynch" <[EMAIL PROTECTED]> 7/27/2007 1:46 PM >>> On Fri, July 27, 2007 3:21 pm, John A DAVIS wrote: > We have various labs that submit coliform sample results in an ASCII > file, quoted/comma delimited. > > We are being asked to encrypt this file for internet transfer. We are > also being asked to create a secure process by which to transfer this > file across the interent. > > Currently: > the lab pushes and button and generates the ASCII file (12 columns) > the lab logs in to a PHP webpage and uses the file upload input to > submit the file. > If data is valid, file is saved on our server in a folder where we can > pull it into the respective tables. > > > Be nice to have some insights on how to encrypt this file at the > source and how to transfer the file securely. We keep hearing the > words, "digital signature". If the concern is about during the TRANSFER of the data, SSL should be enough to satisfy virtually any requirement. The data is encrypted during the transfer. Where they get "digital signature" from, I dunno... Encrypting it at the source and decrypting it at the destination before you transfer it encrypted via SSL is kinda pointless... Unless there is an untrusted individual handling it somewhere between Lab and upload, or between your receipt and stuffing it into your tables? -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?
Re: [PHP] Re: Pirate PHP books online?
So, when a person travels to some unfamiliar place, and said person wants to have a car for private transportation purposes and does not have one nearby, said person must: a) go without; b) BUY it; c) STEAL it. What I'm trying to say here is: "Kindly stop polluting my mailbox with this ridiculous, unhelpful, off-topic nonsense." Regards, Carlton Whitehead - Original Message - From: "tedd" <[EMAIL PROTECTED]> To: "Crayon Shin Chan" <[EMAIL PROTECTED]>, php-general@lists.php.net Sent: Monday, July 30, 2007 2:08:51 PM (GMT-0500) America/New_York Subject: Re: [PHP] Re: Pirate PHP books online? At 12:50 AM +0800 7/31/07, Crayon Shin Chan wrote: >On Monday 30 July 2007 23:49, tedd wrote: > >> The opposite of BUYING is STEALING > >I think you meant SELLING. > >-- >Crayon Crayon: No, if you want something that you don't have -- you have three choices: a) go without; b) BUY it; c) STEAL it. Cheers, tedd PS: In this, BUY means to preform to the expectations of the owner for purchase. -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array difficulty
Hi all, I have an array like this: $chance = array("lowercase" => 27, "uppercase" => 62, "integer" => 46); The values for each of the keys are randomly generated. I want to find the key name of the one which has the highest value. Currently, I'm doing this as follows: arsort($chance); foreach ($chance as $type => $value) { $result = $type; break; } At this point, $result would be equal to "uppercase". I feel like this is a really kludgey way to accomplish this. Is there a better way? Regards, Carlton Whitehead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array difficulty
I tried that earlier, but the problem is: count( $chance ) - 1 ); returns an integer, so I would be asking for something like $chance[1] or $chance[0], neither of which exist in the array. Keep in mind $chance only has keys with string names: The array looks like this: $chance = array("lowercase" => 27, "uppercase" => 62, "integer" => 46); The values assigned to each key are randomly generated. Regards, Carlton Whitehead - Original Message - From: "Chris Boget" <[EMAIL PROTECTED]> To: "Carlton Whitehead" <[EMAIL PROTECTED]>, php-general@lists.php.net Sent: Tuesday, July 31, 2007 9:43:00 AM (GMT-0500) America/New_York Subject: RE: [PHP] Array difficulty > At this point, $result would be equal to "uppercase". I feel > like this is a really kludgey way to accomplish this. Is there > a better way? Couldn't you just do arsort($chance); $lastItem = chance[( count( $chance ) - 1 )]; ? Why iterate through the array when all you need is the last value? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with php mail
Jason, There's a chance your domain link is listed on a spam URL realtime blocklist. Try using http://www.rulesemporium.com/cgi-bin/uribl.cgi to find out. This might also be totally wrong, just throwing that around as a possibility since you mentioned the problem happens with URLs. Does the problem also happen when you send an html email without any links? It would be really helpful to find out what part of gmail's antispam solution doesn't like your message. Does the message header information provide any clues? (it probably isn't PHP's fault the message is getting blocked) Regards, Carlton Whitehead - Original Message - From: "Tijnema" <[EMAIL PROTECTED]> To: "Jason Sia" <[EMAIL PROTECTED]> Cc: php-general@lists.php.net Sent: Sunday, August 5, 2007 11:22:13 AM (GMT-0500) America/New_York Subject: Re: [PHP] Problem with php mail On 8/5/07, Jason Sia <[EMAIL PROTECTED]> wrote: > Hi Everyone, >I'm having problem with php mail. When I try to create an html message > with only mydomain, gmail is registering it as a > spam while yahoo is not. Can you suggest solutions to my problem. > > Thanks, > Jason > There are a lot of things that can make emails go to spam, as already noted the headers and the size of the message, but also a wrong title, or wrong From: address (domain email != domain mail server) can make the message go to spam Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not quite OT but maybe close... Help with MySQL
Someone posted this in an Excel -> Postgre SQL thread recently: http://sourceforge.net/projects/phpexcelreader I haven't used it, just reposting the link. Regards, Carlton Whitehead - Original Message - From: "Jason Pruim" <[EMAIL PROTECTED]> To: "PHP List" Sent: Wednesday, August 8, 2007 1:56:50 PM (GMT-0500) America/New_York Subject: [PHP] Not quite OT but maybe close... Help with MySQL Hey everyone, I tried asking this question on the MySQL list but haven't gotten very many helpful responses... Does anyone know how to successfully import a excel file into MySQL (To make it on topic) Using PHP? I have tried using LOAD FILE in mysql and it just imports the first row of my excel file with no errors... Any ideas? -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php