php-general Digest 29 Apr 2012 20:31:53 -0000 Issue 7793

Topics (messages 317715 through 317723):

Re: url string being split
        317715 by: Chris Stinemetz
        317716 by: Shawn McKenzie
        317717 by: Tim Streater
        317718 by: Chris Stinemetz

Array_diff problems
        317719 by: Rick Dwyer
        317720 by: Jim Giner
        317721 by: admin
        317722 by: Rick Dwyer

PHP Mailto() - Google now displaying HTML as Plain Text
        317723 by: Terry Ally (Gmail)

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Thu, Apr 26, 2012 at 12:58 PM, Stuart Dallas <stu...@3ft9.com> wrote:
> On 26 Apr 2012, at 18:37, Jim Giner wrote:
>
>> I"m no expert, but why would you expose a query to the world thru the use of
>> a GET?  Why not just collect the params and build the string in your code?
>> That is how people hack into your database - via a re-formed query.  You're
>> giving someone an open invitation.
>
> A "query string" has nothing to do with databases.
>
> -Stuart
>

I still haven't been able to find a solution. Is there anyone out
there that knows how to keep the query string intact?

Thank you,

Chris

--- End Message ---
--- Begin Message ---
On 04/27/2012 10:56 AM, Chris Stinemetz wrote:
> I still haven't been able to find a solution. Is there anyone out
> there that knows how to keep the query string intact?
> 
> Thank you,
> 
> Chris

urlencode($storerow['store_subject'])

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
On 27 Apr 2012 at 16:56, Chris Stinemetz <chrisstinem...@gmail.com> wrote: 

> On Thu, Apr 26, 2012 at 12:58 PM, Stuart Dallas <stu...@3ft9.com> wrote:
>> On 26 Apr 2012, at 18:37, Jim Giner wrote:
>>
>>> I"m no expert, but why would you expose a query to the world thru the use of
>>> a GET?  Why not just collect the params and build the string in your code?
>>> That is how people hack into your database - via a re-formed query.  You're
>>> giving someone an open invitation.
>>
>> A "query string" has nothing to do with databases.

> I still haven't been able to find a solution. Is there anyone out
> there that knows how to keep the query string intact?

As was posted previously, you need to encode the query string. If you have:

   http://westeng/forum/store.php?id=Wiser Communication, LLC -& - Sprague Ave

that is going to be split in two unless you encode the "Wiser Communication, 
LLC -& - Sprague Ave" portion. I would do that with JavaScript on the html page.

This is not a PHP question.

--
Cheers  --  Tim

--- End Message ---
--- Begin Message ---
On Fri, Apr 27, 2012 at 11:09 AM, Shawn McKenzie <nos...@mckenzies.net> wrote:
> On 04/27/2012 10:56 AM, Chris Stinemetz wrote:
>> I still haven't been able to find a solution. Is there anyone out
>> there that knows how to keep the query string intact?
>>
>> Thank you,
>>
>> Chris
>
> urlencode($storerow['store_subject'])
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com

Thank you. That is what I was looking for.

-Chris

--- End Message ---
--- Begin Message ---
Hello all.

I have two arrays and when compared against each other via array_diff, I do not 
get any output:

$myarray1 = Array ( 
[0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10 
[Frequency_Description] => Total [Other_Funding] => ) 
[1] => Array ( [id] => 2 [Funding_Type] => Trust [Amount] => 20 
[Frequency_Description] => Per Year [Other_Funding] => ) 
[2] => Array ( [id] => 3 [Funding_Type] => Other Funding [Amount] => 30 
[Frequency_Description] => Other [Other_Funding] => some )) 

$myarray2 = Array 
( 
[0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10 
[Frequency_Description] => Total [Other_Funding] => ) 
[1] => Array ( [id] => 2 [Funding_Type] => Trust [Amount] => 20 
[Frequency_Description] => Per Year [Other_Funding] => ) 
[2] => Array ( [id] => 3 [Funding_Type] => Other Funding [Amount] => 50 
[Frequency_Description] => Other [Other_Funding] => none )) 

$arraydifferences = (array_diff($myarray1,$myarray2));

I need $arraydifferences to record the differences between the two.

Any help is appreciated.

Thanks,
 
 --Rick



--- End Message ---
--- Begin Message ---
"Rick Dwyer" <rpdw...@earthlink.net> wrote in message 
news:0c0e6cc9-089d-4938-8b50-c9e12dfb3...@earthlink.net...
Hello all.

I have two arrays and when compared against each other via array_diff, I do 
not get any output:

$myarray1 = Array (
[0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10 
[Frequency_Description] => Total [Other_Funding] => )
[1] => Array ( [id] => 2 [Funding_Type] => Trust [Amount] => 20 
[Frequency_Description] => Per Year [Other_Funding] => )
[2] => Array ( [id] => 3 [Funding_Type] => Other Funding [Amount] => 30 
[Frequency_Description] => Other [Other_Funding] => some ))

$myarray2 = Array
(
[0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10 
[Frequency_Description] => Total [Other_Funding] => )
[1] => Array ( [id] => 2 [Funding_Type] => Trust [Amount] => 20 
[Frequency_Description] => Per Year [Other_Funding] => )
[2] => Array ( [id] => 3 [Funding_Type] => Other Funding [Amount] => 50 
[Frequency_Description] => Other [Other_Funding] => none ))

$arraydifferences = (array_diff($myarray1,$myarray2));

I need $arraydifferences to record the differences between the two.

Any help is appreciated.

Thanks,

 --Rick

Are these arrays nested in an array?  In that case the manual says you have 
to do the compare differently. 



--- End Message ---
--- Begin Message ---

-----Original Message-----
From: Rick Dwyer [mailto:rpdw...@earthlink.net] 
Sent: Friday, April 27, 2012 3:37 PM
To: PHP-General
Subject: [PHP] Array_diff problems

Hello all.

I have two arrays and when compared against each other via array_diff, I do
not get any output:

$myarray1 = Array (
[0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10
[Frequency_Description] => Total [Other_Funding] => ) [1] => Array ( [id] =>
2 [Funding_Type] => Trust [Amount] => 20 [Frequency_Description] => Per Year
[Other_Funding] => ) [2] => Array ( [id] => 3 [Funding_Type] => Other
Funding [Amount] => 30 [Frequency_Description] => Other [Other_Funding] =>
some )) 

$myarray2 = Array
(
[0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10
[Frequency_Description] => Total [Other_Funding] => ) [1] => Array ( [id] =>
2 [Funding_Type] => Trust [Amount] => 20 [Frequency_Description] => Per Year
[Other_Funding] => ) [2] => Array ( [id] => 3 [Funding_Type] => Other
Funding [Amount] => 50 [Frequency_Description] => Other [Other_Funding] =>
none )) 

$arraydifferences = (array_diff($myarray1,$myarray2));

I need $arraydifferences to record the differences between the two.

Any help is appreciated.

Thanks,
 
 --Rick



--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php



I suggest you read Multidimensional array_diff for Nested Arrays and your
format is not correct on the array that you gave an example of.

http://www.php.net/manual/en/function.array-diff.php#98680





 


--- End Message ---
--- Begin Message ---
Thanks to both for the direction.


 
 --Rick
On Apr 27, 2012, at 4:13 PM, Jim Giner wrote:

> 
> 
> Are these arrays nested in an array?  In that case the manual says you have 
> to do the compare differently.


On Apr 27, 2012, at 4:19 PM, admin wrote:

> 
> 
> -----Original Message-----
> From: Rick Dwyer [mailto:rpdw...@earthlink.net] 
> Sent: Friday, April 27, 2012 3:37 PM
> To: PHP-General
> Subject: [PHP] Array_diff problems
> 
> Hello all.
> 
> I have two arrays and when compared against each other via array_diff, I do
> not get any output:
> 
> $myarray1 = Array (
> [0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10
> [Frequency_Description] => Total [Other_Funding] => ) [1] => Array ( [id] =>
> 2 [Funding_Type] => Trust [Amount] => 20 [Frequency_Description] => Per Year
> [Other_Funding] => ) [2] => Array ( [id] => 3 [Funding_Type] => Other
> Funding [Amount] => 30 [Frequency_Description] => Other [Other_Funding] =>
> some )) 
> 
> $myarray2 = Array
> (
> [0] => Array ( [id] => 1 [Funding_Type] => Federal [Amount] => 10
> [Frequency_Description] => Total [Other_Funding] => ) [1] => Array ( [id] =>
> 2 [Funding_Type] => Trust [Amount] => 20 [Frequency_Description] => Per Year
> [Other_Funding] => ) [2] => Array ( [id] => 3 [Funding_Type] => Other
> Funding [Amount] => 50 [Frequency_Description] => Other [Other_Funding] =>
> none )) 
> 
> $arraydifferences = (array_diff($myarray1,$myarray2));
> 
> I need $arraydifferences to record the differences between the two.
> 
> Any help is appreciated.
> 
> Thanks,
> 
> --Rick
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
> 
> 
> 
> I suggest you read Multidimensional array_diff for Nested Arrays and your
> format is not correct on the array that you gave an example of.
> 
> http://www.php.net/manual/en/function.array-diff.php#98680
> 
> 
> 
> 
> 
> 
> 


--- End Message ---
--- Begin Message ---
Hi all,

I have been using a mailto() script for the last three years and from April
25, 2012 incoming HTML email in Goggle mail is displaying as Plain Text.
 Something clearly changed with Google. Perhaps there is some change I need
to make with my script??

// First set up some variables for recipient, subject, and date/time received
$to = $sendto;  // Recipient
$subject = "Message received via XXXXXXXXXX website";  // Subject
$oh = (int) date ("Z") / 3600;  // time offset to GMT
$date = date("d M Y g:i:s a ", mktime (date ("H") - $oh)). " GMT"; //
Date and time in the form yyyy-mm-dd hh:mm:ss


// Set up conditionals for optional fields
$addr1 = $_POST['addr1'];
$addr2 = $_POST['addr2'];
$city = $_POST['city'];
$country = $_POST['country'];
$postalcode = $_POST['postalcode'];

// Compose body of email
$message = "<p>Following is a message received for ".$recipient. "
sent via XXXXXXXXXXXXXX website on ".$date."</p>";
$message .= "<p><b>From:</b> ".$n." (".$email.")</p>";

if (($addr1) && (! $addr2)) {
$message .=  "<p><b>Address:</b> ".$addr1."</p>";
} elseif (($addr1) && ($addr2)) {
$message .=  "<p><b>Address:</b> ".$addr1.", ".$addr2."</p>";
} else {
$message .=  "<p><b>Address:</b> None provided</p>";}

if ($city) {
$message .= "<p><b>City:</b> ".$city."</p>";
} else { }

if (($country) && (! $postalcode)) {
$message .= "<p><b>Country:</b> ".$country."</p>";
} elseif($country && $postalcode) {
$message .= "<p><b>Country:</b> ".$country." ".$postalcode."</p>";
} else { }

$message .= "<p><b>Message:</b><blockquote> ".$m."</blockquote></p>";

// To send HTML mail, the Content-type header must be set
$headers  = 'From: '.$n.'<'.$email . ">\r\n" ;
$headers .= 'Reply-To: '.$email . "\r\n";
$headers .= 'cc: XXXXXXX <xxxxxxxx>' . "\r\n";
$headers .= 'Bcc: XXXXXXX <xxxxxxxx>' . "\r\n";

// Additional headers
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();


// send email
mail($to, $subject, $message, $headers);


Thanks
-- 
*Terry Ally*

--- End Message ---

Reply via email to