[PHP] Stored Proc - Date not inserting into the Record

2010-02-25 Thread Don Wieland

I nave 2 stored procedures:

DROP PROCEDURE IF EXISTS `Insert_OHC_Sun`;
DELIMITER $$
CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Sun`(theDate  
DATE,theDateRaw INT)

BEGIN
  INSERT INTO Office_Hours_Cuttoff  
(ohc_Date,ohc_Date_Raw,Office_Status)

  VALUES (theDate,theDateRaw,"Closed");
END
$$

DROP PROCEDURE IF EXISTS `Insert_OHC_Day`;
DELIMITER $$
CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Day`(theDate  
DATE,theDateRaw INT)

BEGIN
  INSERT INTO Office_Hours_Cuttoff (ohc_Date,ohc_Date_Raw)
  VALUES (theDate,theDateRaw);
END
$$

Then I have PHP Code to insert a YEAR of days in a table:

if($_POST['new_year'])  {
//New Year
if(in_array($_POST['pick_year'], $ExistingYears))  {
$Message = "The year ".$_POST['pick_year']." is already  
existing.Please use the DELETE YEAR feature first. Then ADD the  
year again.";

} else {

//Add Year
$first_day = mktime(0,0,0,1, 1, $_POST['pick_year']);
$last_day = mktime(0,0,0,12, 31, $_POST['pick_year']);

$cDate = $first_day;
$num = 1;


while($cDate <= $last_day) {

$nDate = Date('Y-m-d', $cDate);

$db->next_result();
if(date('D', $cDate) == "Sun") {
$db->query("CALL Insert_OHC_Sun({$nDate},{$cDate})");
}else{
$db->query("CALL Insert_OHC_Day({$nDate},{$cDate})");
}

$cDate+=86400;
$num++;

}
}
}



The records are inserting into the table BUT the field "och_Dates" is  
not getting the proper value. It gets "-00-00".


Frustrating. My code looks right and I echoed the value on the page  
and it is formatted properly. The field in mySQL is formatted as a  
DATE type.


Little help please :-)


Don Wieland
D W   D a t a   C o n c e p t s
~
d...@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our  
Developer Support Plan at:

http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro  
9 or higher

http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html


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



Re: [PHP] Stored Proc - Date not inserting into the Record

2010-02-25 Thread Peter

Change the input argument type as a varchar instead of date

Ex:
CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Sun`(theDate 
VARCHAR(50),theDateRaw INT)


surly it will work

- Peter


Don Wieland wrote:

I nave 2 stored procedures:

DROP PROCEDURE IF EXISTS `Insert_OHC_Sun`;
DELIMITER $$
CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Sun`(theDate 
DATE,theDateRaw INT)

BEGIN
  INSERT INTO Office_Hours_Cuttoff 
(ohc_Date,ohc_Date_Raw,Office_Status)

  VALUES (theDate,theDateRaw,"Closed");
END
$$

DROP PROCEDURE IF EXISTS `Insert_OHC_Day`;
DELIMITER $$
CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Day`(theDate 
DATE,theDateRaw INT)

BEGIN
  INSERT INTO Office_Hours_Cuttoff (ohc_Date,ohc_Date_Raw)
  VALUES (theDate,theDateRaw);
END
$$

Then I have PHP Code to insert a YEAR of days in a table:

if($_POST['new_year'])  {
//New Year
if(in_array($_POST['pick_year'], $ExistingYears))  {
$Message = "The year ".$_POST['pick_year']." is already 
existing.Please use the DELETE YEAR feature first. Then ADD the 
year again.";

} else {

//Add Year
$first_day = mktime(0,0,0,1, 1, $_POST['pick_year']);
$last_day = mktime(0,0,0,12, 31, $_POST['pick_year']);

$cDate = $first_day;
$num = 1;


while($cDate <= $last_day) {
  
$nDate = Date('Y-m-d', $cDate);


$db->next_result();
if(date('D', $cDate) == "Sun") {
$db->query("CALL Insert_OHC_Sun({$nDate},{$cDate})");
}else{
   $db->query("CALL Insert_OHC_Day({$nDate},{$cDate})");
}

$cDate+=86400;
$num++;

}
}
}



The records are inserting into the table BUT the field "och_Dates" is 
not getting the proper value. It gets "-00-00".


Frustrating. My code looks right and I echoed the value on the page 
and it is formatted properly. The field in mySQL is formatted as a 
DATE type.


Little help please :-)


Don Wieland
D W   D a t a   C o n c e p t s
~
d...@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our 
Developer Support Plan at:

http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 
9 or higher

http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html




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



Re: [PHP] Stored Proc - Date not inserting into the Record

2010-02-25 Thread Peter

FYI

Please Pass your input within  quotes
$db->query("CALL Insert_OHC_Sun(*'*{$nDate}*'*,{$cDate})");

surly it will work

- Peter


Don Wieland wrote:

I nave 2 stored procedures:

DROP PROCEDURE IF EXISTS `Insert_OHC_Sun`;
DELIMITER $$
CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Sun`(theDate 
DATE,theDateRaw INT)

BEGIN
  INSERT INTO Office_Hours_Cuttoff 
(ohc_Date,ohc_Date_Raw,Office_Status)

  VALUES (theDate,theDateRaw,"Closed");
END
$$

DROP PROCEDURE IF EXISTS `Insert_OHC_Day`;
DELIMITER $$
CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Day`(theDate 
DATE,theDateRaw INT)

BEGIN
  INSERT INTO Office_Hours_Cuttoff (ohc_Date,ohc_Date_Raw)
  VALUES (theDate,theDateRaw);
END
$$

Then I have PHP Code to insert a YEAR of days in a table:

if($_POST['new_year'])  {
//New Year
if(in_array($_POST['pick_year'], $ExistingYears))  {
$Message = "The year ".$_POST['pick_year']." is already 
existing.Please use the DELETE YEAR feature first. Then ADD the 
year again.";

} else {

//Add Year
$first_day = mktime(0,0,0,1, 1, $_POST['pick_year']);
$last_day = mktime(0,0,0,12, 31, $_POST['pick_year']);

$cDate = $first_day;
$num = 1;


while($cDate <= $last_day) {
  
$nDate = Date('Y-m-d', $cDate);


$db->next_result();
if(date('D', $cDate) == "Sun") {
$db->query("CALL Insert_OHC_Sun({$nDate},{$cDate})");
}else{
   $db->query("CALL Insert_OHC_Day({$nDate},{$cDate})");
}

$cDate+=86400;
$num++;

}
}
}



The records are inserting into the table BUT the field "och_Dates" is 
not getting the proper value. It gets "-00-00".


Frustrating. My code looks right and I echoed the value on the page 
and it is formatted properly. The field in mySQL is formatted as a 
DATE type.


Little help please :-)


Don Wieland
D W   D a t a   C o n c e p t s
~
d...@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our 
Developer Support Plan at:

http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 
9 or higher

http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html




[PHP] Accessing Windows File Comments

2010-02-25 Thread Floyd Resler
One of my users has asked if I can display comments with a file list on their 
site.  So I thought I might be able to use the comments from the properties of 
the file.  Is there any way I can access this from PHP?  The files are actually 
stored on a Linux box.

Thanks!
Floyd


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



Re: [PHP] Accessing Windows File Comments

2010-02-25 Thread Bastien Koert
On Thu, Feb 25, 2010 at 9:59 AM, Floyd Resler  wrote:
> One of my users has asked if I can display comments with a file list on their 
> site.  So I thought I might be able to use the comments from the properties 
> of the file.  Is there any way I can access this from PHP?  The files are 
> actually stored on a Linux box.
>
> Thanks!
> Floyd
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


If you have access to read the files and the comments are clearly
delineated, then its shouldn't be hard to open each file and then pull
out the contents with regex or str parsing.

You might want to store the data somehow, so that in the future you
only have to read in the changed files.


-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Accessing Windows File Comments

2010-02-25 Thread Richard Quadling
On 25 February 2010 14:59, Floyd Resler  wrote:
> One of my users has asked if I can display comments with a file list on their 
> site.  So I thought I might be able to use the comments from the properties 
> of the file.  Is there any way I can access this from PHP?  The files are 
> actually stored on a Linux box.
>
> Thanks!
> Floyd
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

The comments on a windows file (on the NTFS file system) are held in
Alternative Datastreams
(http://en.wikipedia.org/wiki/Fork_(filesystem)). As far as I know PHP
cannot natively access them, though externals tools exist ...

"LADS - Freeware version 4.10
(C) Copyright 1998-2007 Frank Heyne Software (http://www.heysoft.de)
This program lists files with alternate data streams (ADS)
Use LADS on your own risk!"



Or are you talking about a file whose content is a list of comments?



-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP] Accessing Windows File Comments

2010-02-25 Thread Richard Quadling
On 25 February 2010 15:16, Richard Quadling  wrote:
> On 25 February 2010 14:59, Floyd Resler  wrote:
>> One of my users has asked if I can display comments with a file list on 
>> their site.  So I thought I might be able to use the comments from the 
>> properties of the file.  Is there any way I can access this from PHP?  The 
>> files are actually stored on a Linux box.
>>
>> Thanks!
>> Floyd

Using LADS on a file I just added a title and summary to ...

LADS - Freeware version 4.10
(C) Copyright 1998-2007 Frank Heyne Software (http://www.heysoft.de)
This program lists files with alternate data streams (ADS)
Use LADS on your own risk!

Scanning directory D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\

 size  ADS in file
--  -
   88  D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\php_browscap.ini:♣DocumentSummaryInformation
  204  D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\php_browscap.ini:♣SummaryInformation
0  D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\php_browscap.ini:{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}

  292 bytes in 3 ADS listed


The funny looking symbol can is character #5 which can be entered as
^E. So,  ...

more < php_browscap.ini:^ESummaryInformation > lad.log

The file lad.log now contains the content of the SummaryInformation
alternative data stream.

The format of the content of the streams I don't know, sorry.


-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



[PHP] RE: PHP "GET" Error?

2010-02-25 Thread Alice Wei

Hi, 

  I forgot to mention that the url is formed from Actionscript, I am just using 
PHP to do the "I/O" because Actionscript does not have this option. 

  So, I guess I cannot do the serialize here like you suggested. I have changed 
# to 0x for now, and that does not seem to help yet. 
  BTW, below is the complete code, would this help with my choices?

 $line2) { 

$style_line_num = $line_num+3;
$line2 = trim($line2);

  if(preg_match("/^style/",$line2)) {

   $rest = substr($line2,0,-1);  

   for ($j=$line_num;$j<=$style_line_num;$j++){
 if(preg_match("/inkscape:label/",$lines2[$j])) {  
$location = explode("=",$lines2[$j]);
$location2 = substr($location[1],1,-6);  
   
if(in_array($patient_location2, $patient_from)) {
   
 $key= array_search($location2,$from); //Find out the position of 
the index in the array
 $colors_style = ";fill:" . $state_colors[$key];  //Use the index 
from array_search to apply to the color index
 $rest2 = substr($line2,0,-1). $colors_style . "\"";
 echo $rest2 . "\n";
}
else echo $line2 . "\n"; 

 } //end preg_match inkscape
 } //end for loop
   }  //If preg_match style

 else echo $line2 . "\n"; //else if preg_match style 
 } //end for each

fclose($fh);
?>

Thanks for your help. 

Alice

> Date: Thu, 25 Feb 2010 13:03:57 -0600
> From: nos...@mckenzies.net
> CC: aj...@alumni.iu.edu; php-general@lists.php.net
> Subject: Re: PHP "GET" Error?
> 
> Shawn McKenzie wrote:
> > Alice Wei wrote:
> >> Hi, 
> >>
> >> I have done something wrong here, because when I have my variables 
> >> declared in my PHP:
> >>
> >>$people_from = $_GET['people_from'];
> >>$state_colors= $_GET['state_colors'];
> >>
> >>   I get this url: http://localhost/generic.php?people_from=Adair, 
> >> OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, OK-Blaine, OK-Bryan, 
> >> OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, OK-Choctaw, OK-Cimarron, 
> >> OK-Cleveland, OK-Coal, 
> >> OK&state_colors=#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF
> >>
> >>  The result? I don't get any colors on the screen as I have here in the 
> >> url. 
> >> However, if I do:
> >>
> >> $people_from = "Adair, OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, 
> >> OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, 
> >> OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, OK";
> >> $state_colors= 
> >> "#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF";
> >>
> >> I get the correct result. In total, there are 77 entries (I only put 15 
> >> here). Is there a length limit for what I pass to the url? If not, how 
> >> come there are no colors showing up in my image as I desired according to 
> >> my url?
> >>
> >> Thanks for your help.
> >>
> >> Alice
> >>  
> >> _
> >> Hotmail: Free, trusted and rich email service.
> >> http://clk.atdmt.com/GBL/go/201469228/direct/01/
> > 
> > There are characters in the URL that have a meaning within a URL itself
> > (such as #).  Use urlencode() before putting the data in the URL.
> > 
> 
> FWIW, how I would probably handle this is to have an array of
> $people_from and an array of $state_colors and then serialize() them and
> run through urlencode().  Then you have an array on the next page.  Much
> easier to work with:
> 
> $people_from = array('K-Alfalfa', 'OK-Atoka'); //etc...
> $state_colors = array('#CC', '#CC'); //etc...
> 
> Then the link would be:
> 
> $url =
> 'generic.php?people_from='.urlencode(serialize($people_from)).'&state_colors'.urlencode(serialize($state_colors));
> 
> You then have a $_GET['people_from'] and $_GET['state_colors'] array on
> the next page.
> 
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com
  
_
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/201469230/direct/01/

[PHP] RE: PHP "GET" Error?

2010-02-25 Thread Alice Wei


> Date: Thu, 25 Feb 2010 13:03:57 -0600
> From: nos...@mckenzies.net
> CC: aj...@alumni.iu.edu; php-general@lists.php.net
> Subject: Re: PHP "GET" Error?
> 
> Shawn McKenzie wrote:
> > Alice Wei wrote:
> >> Hi, 
> >>
> >> I have done something wrong here, because when I have my variables 
> >> declared in my PHP:
> >>
> >>$people_from = $_GET['people_from'];
> >>$state_colors= $_GET['state_colors'];
> >>
> >>   I get this url: http://localhost/generic.php?people_from=Adair, 
> >> OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, OK-Blaine, OK-Bryan, 
> >> OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, OK-Choctaw, OK-Cimarron, 
> >> OK-Cleveland, OK-Coal, 
> >> OK&state_colors=#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF
> >>
> >>  The result? I don't get any colors on the screen as I have here in the 
> >> url. 
> >> However, if I do:
> >>
> >> $people_from = "Adair, OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, 
> >> OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, 
> >> OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, OK";
> >> $state_colors= 
> >> "#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF";
> >>
> >> I get the correct result. In total, there are 77 entries (I only put 15 
> >> here). Is there a length limit for what I pass to the url? If not, how 
> >> come there are no colors showing up in my image as I desired according to 
> >> my url?
> >>
> >> Thanks for your help.
> >>
> >> Alice
> >>  
> >> _
> >> Hotmail: Free, trusted and rich email service.
> >> http://clk.atdmt.com/GBL/go/201469228/direct/01/
> > 
> > There are characters in the URL that have a meaning within a URL itself
> > (such as #).  Use urlencode() before putting the data in the URL.
> > 
> 
> FWIW, how I would probably handle this is to have an array of
> $people_from and an array of $state_colors and then serialize() them and
> run through urlencode().  Then you have an array on the next page.  Much
> easier to work with:
> 
> $people_from = array('K-Alfalfa', 'OK-Atoka'); //etc...
> $state_colors = array('#CC', '#CC'); //etc...
> 
> Then the link would be:
> 
> $url =
> 'generic.php?people_from='.urlencode(serialize($people_from)).'&state_colors'.urlencode(serialize($state_colors));
> 
> You then have a $_GET['people_from'] and $_GET['state_colors'] array on
> the next page.

  On another note, would this be different if I used POST instead of GET? 
(considering there are some limitation on the length of my url) I tried to look 
into that, but I don't see anything. 

Alice

> -- 
> Thanks!
> -Shawn
> http://www.spidean.com
  
_
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/201469230/direct/01/

[PHP] Re: PHP "GET" Error?

2010-02-25 Thread Shawn McKenzie
Alice Wei wrote:
> Hi, 
> 
> I have done something wrong here, because when I have my variables 
> declared in my PHP:
> 
>$people_from = $_GET['people_from'];
>$state_colors= $_GET['state_colors'];
> 
>   I get this url: http://localhost/generic.php?people_from=Adair, OK-Alfalfa, 
> OK-Atoka, OK-Beaver, OK-Beckham, OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, 
> OK-Carter, OK-Cherokee, OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, 
> OK&state_colors=#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF
> 
>  The result? I don't get any colors on the screen as I have here in the url. 
> However, if I do:
>
> $people_from = "Adair, OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, 
> OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, 
> OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, OK";
> $state_colors= 
> "#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF";
> 
> I get the correct result. In total, there are 77 entries (I only put 15 
> here). Is there a length limit for what I pass to the url? If not, how come 
> there are no colors showing up in my image as I desired according to my url?
> 
> Thanks for your help.
> 
> Alice
> 
> _
> Hotmail: Free, trusted and rich email service.
> http://clk.atdmt.com/GBL/go/201469228/direct/01/

There are characters in the URL that have a meaning within a URL itself
(such as #).  Use urlencode() before putting the data in the URL.

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

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



[PHP] Magento & SOAP2

2010-02-25 Thread Kim Madsen

Hi

Does anyone on the list have experience with the above?

The documentation is only on SOAP1.x, but not on SOAP2 and the calls are 
completely different:


SOAP1.x:
http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product_attribute#example_1._getting_product_attribute_s_sets_list_and_get_attributes

$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

// make a call in SOAP1.x
$attributeSets = $proxy->call($sessionId, 'product_attribute_set.list');
var_dump($attributeSets);

// make a call in SOAP2:
$attributeSets = $proxy->catalogProductAttributeSetList($sessionId2);
var_dump($attributeSets);

This I figured out, but when I wanna create a product (for import from a 
different webshop) I get lost, have no idea now, how to solve this since 
the documentation still is for 1.x only :-/


Documentation
http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product#catalog_product.create

Any ideas will be welcome :-)

--
Kind regards
Kim Emax - masterminds.dk

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



[PHP] Re: PHP "GET" Error?

2010-02-25 Thread Shawn McKenzie
Alice Wei wrote:
> Hi, 
> 
>   I forgot to mention that the url is formed from Actionscript, I am just 
> using PHP to do the "I/O" because Actionscript does not have this option. 
> 
>   So, I guess I cannot do the serialize here like you suggested. I have 
> changed # to 0x for now, and that does not seem to help yet. 
>   BTW, below is the complete code, would this help with my choices?
> 

I haven't used actionscript, but it's javascript basically yes?

Use encodeURI() or encodeURIComponent() on the data.


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

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



[PHP] Re: PHP "GET" Error?

2010-02-25 Thread Shawn McKenzie
Shawn McKenzie wrote:
> Alice Wei wrote:
>> Hi, 
>>
>> I have done something wrong here, because when I have my variables 
>> declared in my PHP:
>>
>>$people_from = $_GET['people_from'];
>>$state_colors= $_GET['state_colors'];
>>
>>   I get this url: http://localhost/generic.php?people_from=Adair, 
>> OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, OK-Blaine, OK-Bryan, OK-Caddo, 
>> OK-Canadian, OK-Carter, OK-Cherokee, OK-Choctaw, OK-Cimarron, OK-Cleveland, 
>> OK-Coal, 
>> OK&state_colors=#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF
>>
>>  The result? I don't get any colors on the screen as I have here in the url. 
>> However, if I do:
>>
>> $people_from = "Adair, OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, 
>> OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, 
>> OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, OK";
>> $state_colors= 
>> "#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF";
>>
>> I get the correct result. In total, there are 77 entries (I only put 15 
>> here). Is there a length limit for what I pass to the url? If not, how come 
>> there are no colors showing up in my image as I desired according to my url?
>>
>> Thanks for your help.
>>
>> Alice
>>
>> _
>> Hotmail: Free, trusted and rich email service.
>> http://clk.atdmt.com/GBL/go/201469228/direct/01/
> 
> There are characters in the URL that have a meaning within a URL itself
> (such as #).  Use urlencode() before putting the data in the URL.
> 

FWIW, how I would probably handle this is to have an array of
$people_from and an array of $state_colors and then serialize() them and
run through urlencode().  Then you have an array on the next page.  Much
easier to work with:

$people_from = array('K-Alfalfa', 'OK-Atoka'); //etc...
$state_colors = array('#CC', '#CC'); //etc...

Then the link would be:

$url =
'generic.php?people_from='.urlencode(serialize($people_from)).'&state_colors'.urlencode(serialize($state_colors));

You then have a $_GET['people_from'] and $_GET['state_colors'] array on
the next page.

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

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



[PHP] RE: PHP "GET" Error?

2010-02-25 Thread Alice Wei


> Date: Thu, 25 Feb 2010 13:50:16 -0600
> From: nos...@mckenzies.net
> To: aj...@alumni.iu.edu
> CC: php-general@lists.php.net
> Subject: Re: PHP "GET" Error?
> 
> Alice Wei wrote:
> > Hi, 
> > 
> >   I forgot to mention that the url is formed from Actionscript, I am just 
> > using PHP to do the "I/O" because Actionscript does not have this option. 
> > 
> >   So, I guess I cannot do the serialize here like you suggested. I have 
> > changed # to 0x for now, and that does not seem to help yet. 
> >   BTW, below is the complete code, would this help with my choices?
> > 
> 
> I haven't used actionscript, but it's javascript basically yes?
> 
> Use encodeURI() or encodeURIComponent() on the data.
> 
> 
   Yes, and no. But, I did find the function in the Actionscript library, and I 
used the new url to pass through to PHP. Looks like it still didn't work, could 
the length be an issue? 

   BTW, these two variables start off from Actionscript as "arrays", but would 
knowing this here help? It would be nice that I can just pass them on as arrays 
(I had to "turn them into strings" before I passed to PHP). 

Thanks for your help. 

Alice

> -- 
> Thanks!
> -Shawn
> http://www.spidean.com
  
_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/201469229/direct/01/

[PHP] PHP "GET" Error?

2010-02-25 Thread Alice Wei

Hi, 

I have done something wrong here, because when I have my variables declared 
in my PHP:

   $people_from = $_GET['people_from'];
   $state_colors= $_GET['state_colors'];

  I get this url: http://localhost/generic.php?people_from=Adair, OK-Alfalfa, 
OK-Atoka, OK-Beaver, OK-Beckham, OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, 
OK-Carter, OK-Cherokee, OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, 
OK&state_colors=#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF

 The result? I don't get any colors on the screen as I have here in the url. 
However, if I do:
   
$people_from = "Adair, OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, OK-Blaine, 
OK-Bryan, OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, OK-Choctaw, 
OK-Cimarron, OK-Cleveland, OK-Coal, OK";
$state_colors= 
"#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF";

I get the correct result. In total, there are 77 entries (I only put 15 here). 
Is there a length limit for what I pass to the url? If not, how come there are 
no colors showing up in my image as I desired according to my url?

Thanks for your help.

Alice
  
_
Hotmail: Free, trusted and rich email service.
http://clk.atdmt.com/GBL/go/201469228/direct/01/

Re: [PHP] RE: PHP "GET" Error?

2010-02-25 Thread Ashley Sheridan
On Thu, 2010-02-25 at 15:01 -0500, Alice Wei wrote:

> 
> > Date: Thu, 25 Feb 2010 13:50:16 -0600
> > From: nos...@mckenzies.net
> > To: aj...@alumni.iu.edu
> > CC: php-general@lists.php.net
> > Subject: Re: PHP "GET" Error?
> > 
> > Alice Wei wrote:
> > > Hi, 
> > > 
> > >   I forgot to mention that the url is formed from Actionscript, I am just 
> > > using PHP to do the "I/O" because Actionscript does not have this option. 
> > > 
> > >   So, I guess I cannot do the serialize here like you suggested. I have 
> > > changed # to 0x for now, and that does not seem to help yet. 
> > >   BTW, below is the complete code, would this help with my choices?
> > > 
> > 
> > I haven't used actionscript, but it's javascript basically yes?
> > 
> > Use encodeURI() or encodeURIComponent() on the data.
> > 
> > 
>Yes, and no. But, I did find the function in the Actionscript library, and 
> I used the new url to pass through to PHP. Looks like it still didn't work, 
> could the length be an issue? 
> 
>BTW, these two variables start off from Actionscript as "arrays", but 
> would knowing this here help? It would be nice that I can just pass them on 
> as arrays (I had to "turn them into strings" before I passed to PHP). 
> 
> Thanks for your help. 
> 
> Alice
> 
> > -- 
> > Thanks!
> > -Shawn
> > http://www.spidean.com
> 
> _
> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
> http://clk.atdmt.com/GBL/go/201469229/direct/01/


Have you tried outputting the URL string to see if it's properly formed?
AS3 can still trace() can't it?

This link should give you an idea of the string limits of different
browsers and servers:

http://www.boutell.com/newfaq/misc/urllength.html

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] PHP "GET" Error?

2010-02-25 Thread Ashley Sheridan
On Thu, 2010-02-25 at 13:32 -0500, Alice Wei wrote:

> Hi, 
> 
> I have done something wrong here, because when I have my variables 
> declared in my PHP:
> 
>$people_from = $_GET['people_from'];
>$state_colors= $_GET['state_colors'];
> 
>   I get this url: http://localhost/generic.php?people_from=Adair, OK-Alfalfa, 
> OK-Atoka, OK-Beaver, OK-Beckham, OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, 
> OK-Carter, OK-Cherokee, OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, 
> OK&state_colors=#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF
> 
>  The result? I don't get any colors on the screen as I have here in the url. 
> However, if I do:
>
> $people_from = "Adair, OK-Alfalfa, OK-Atoka, OK-Beaver, OK-Beckham, 
> OK-Blaine, OK-Bryan, OK-Caddo, OK-Canadian, OK-Carter, OK-Cherokee, 
> OK-Choctaw, OK-Cimarron, OK-Cleveland, OK-Coal, OK";
> $state_colors= 
> "#CC-#CC-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF-#FF";
> 
> I get the correct result. In total, there are 77 entries (I only put 15 
> here). Is there a length limit for what I pass to the url? If not, how come 
> there are no colors showing up in my image as I desired according to my url?
> 
> Thanks for your help.
> 
> Alice
> 
> _
> Hotmail: Free, trusted and rich email service.
> http://clk.atdmt.com/GBL/go/201469228/direct/01/


OK, a few things wrong with your URL here. URL's cant contain spaces,
they have to be escaped as %20. Also, the # is a special character in a
URL, as it marks an anchor in a page.

Lastly, yes, there is a limit to data sent in a URL. It varies slightly
from browser to browser, but I would try not to go over a couple of
hundred characters.

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] RE: PHP "GET" Error?

2010-02-25 Thread Alice Wei

Subject: Re: [PHP] RE: PHP "GET" Error?
From: a...@ashleysheridan.co.uk
To: aj...@alumni.iu.edu
CC: nos...@mckenzies.net; php-general@lists.php.net
Date: Thu, 25 Feb 2010 20:03:28 +






  
  


On Thu, 2010-02-25 at 15:01 -0500, Alice Wei wrote:


> Date: Thu, 25 Feb 2010 13:50:16 -0600
> From: nos...@mckenzies.net
> To: aj...@alumni.iu.edu
> CC: php-general@lists.php.net
> Subject: Re: PHP "GET" Error?
> 
> Alice Wei wrote:
> > Hi, 
> > 
> >   I forgot to mention that the url is formed from Actionscript, I am just 
> > using PHP to do the "I/O" because Actionscript does not have this option. 
> > 
> >   So, I guess I cannot do the serialize here like you suggested. I have 
> > changed # to 0x for now, and that does not seem to help yet. 
> >   BTW, below is the complete code, would this help with my choices?
> > 
> 
> I haven't used actionscript, but it's javascript basically yes?
> 
> Use encodeURI() or encodeURIComponent() on the data.
> 
> 
   Yes, and no. But, I did find the function in the Actionscript library, and I 
used the new url to pass through to PHP. Looks like it still didn't work, could 
the length be an issue? 

   BTW, these two variables start off from Actionscript as "arrays", but would 
knowing this here help? It would be nice that I can just pass them on as arrays 
(I had to "turn them into strings" before I passed to PHP). 

Thanks for your help. 

Alice

> -- 
> Thanks!
> -Shawn
> http://www.spidean.com
  
_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/201469229/direct/01/




Have you tried outputting the URL string to see if it's properly formed? AS3 
can still trace() can't it?



This link should give you an idea of the string limits of different browsers 
and servers:



http://www.boutell.com/newfaq/misc/urllength.html

I have just done that, and here is the pathetically long url:

http://tdc-queuing/test/generic.php?from=Adair,%20OK-Alfalfa,%20OK-Atoka,%20OK-Beaver,%20OK-Beckham,%20OK-Blaine,%20OK-Bryan,%20OK-Caddo,%20OK-Canadian,%20OK-Carter,%20OK-Cherokee,%20OK-Choctaw,%20OK-Cimarron,%20OK-Cleveland,%20OK-Coal,%20OK-Comanche,%20OK-Cotton,%20OK-Craig,%20OK-Creek,%20OK-Custer,%20OK-Delaware,%20OK-Dewey,%20OK-Ellis,%20OK-Garfield,%20OK-Garvin,%20OK-Grady,%20OK-Grant,%20OK-Greer,%20OK-Harmon,%20OK-Harper,%20OK-Haskell,%20OK-Hughes,%20OK-Jackson,%20OK-Jefferson,%20OK-Johnston,%20OK-Kay,%20OK-Kingfisher,%20OK-Kiowa,%20OK-Latimer,%20OK-Le%20Flore,%20OK-Lincoln,%20OK-Logan,%20OK-Love,%20OK-Major,%20OK-Marshall,%20OK-Mayes,%20OK-McClain,%20OK-McCurtain,%20OK-McIntosh,%20OK-Murray,%20OK-Muskogee,%20OK-Noble,%20OK-Nowata,%20OK-Okfuskee,%20OK-Oklahoma,%20OK-Okmulgee,%20OK-Osage,%20OK-Ottawa,%20OK-Pawnee,%20OK-Payne,%20OK-Pittsburg,%20OK-Pontotoc,%20OK-Pottawatomie,%20OK-Pushmataha,%20OK-Roger%20Mills,%20OK-Rogers,%20OK-Seminole,%20OK-Sequoyah,%20OK-Stephens,%20OK-Texas,%20OK-Tillman,%20OK-Tulsa,%20OK-Wagoner,%20OK-Washington,%20OK-Washita,%20OK-Woods,%20OK-Woodward,%20OK&state_colors=0xCC-0xCC-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF

This is generated from the encodeURI() Shawn was talking about. Does this seem 
"well-formed" to you?

Thanks.

Alice




  
_
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469227/direct/01/

[PHP] Re: PHP "GET" Error?

2010-02-25 Thread Shawn McKenzie
Alice Wei wrote:
> 
>> Date: Thu, 25 Feb 2010 13:50:16 -0600
>> From: nos...@mckenzies.net
>> To: aj...@alumni.iu.edu
>> CC: php-general@lists.php.net
>> Subject: Re: PHP "GET" Error?
>>
>> Alice Wei wrote:
>>> Hi, 
>>>
>>>   I forgot to mention that the url is formed from Actionscript, I am just 
>>> using PHP to do the "I/O" because Actionscript does not have this option. 
>>>
>>>   So, I guess I cannot do the serialize here like you suggested. I have 
>>> changed # to 0x for now, and that does not seem to help yet. 
>>>   BTW, below is the complete code, would this help with my choices?
>>>
>> I haven't used actionscript, but it's javascript basically yes?
>>
>> Use encodeURI() or encodeURIComponent() on the data.
>>
>>
>Yes, and no. But, I did find the function in the Actionscript library, and 
> I used the new url to pass through to PHP. Looks like it still didn't work, 
> could the length be an issue? 
> 
>BTW, these two variables start off from Actionscript as "arrays", but 
> would knowing this here help? It would be nice that I can just pass them on 
> as arrays (I had to "turn them into strings" before I passed to PHP). 
> 
> Thanks for your help. 

Those functions will work if you do it properly.  As for arrays, the
only way I know of in js is to json encode them and then you can use the
PHP json_decode() to get them back.  There is no native js function to
do this, however there may be one in the actionscript library or there
are some functions on the web that people have written.

Wait, I found this:  http://code.google.com/p/as3corelib/

Functionality may already be in As, but may be of use.


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

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



RE: [PHP] RE: PHP "GET" Error?

2010-02-25 Thread Ashley Sheridan
On Thu, 2010-02-25 at 15:11 -0500, Alice Wei wrote:

> Subject: Re: [PHP] RE: PHP "GET" Error?
> From: a...@ashleysheridan.co.uk
> To: aj...@alumni.iu.edu
> CC: nos...@mckenzies.net; php-general@lists.php.net
> Date: Thu, 25 Feb 2010 20:03:28 +
> 
> 
> 
> 
> 
> 
>   
>   
> 
> 
> On Thu, 2010-02-25 at 15:01 -0500, Alice Wei wrote:
> 
> 
> > Date: Thu, 25 Feb 2010 13:50:16 -0600
> > From: nos...@mckenzies.net
> > To: aj...@alumni.iu.edu
> > CC: php-general@lists.php.net
> > Subject: Re: PHP "GET" Error?
> > 
> > Alice Wei wrote:
> > > Hi, 
> > > 
> > >   I forgot to mention that the url is formed from Actionscript, I am just 
> > > using PHP to do the "I/O" because Actionscript does not have this option. 
> > > 
> > >   So, I guess I cannot do the serialize here like you suggested. I have 
> > > changed # to 0x for now, and that does not seem to help yet. 
> > >   BTW, below is the complete code, would this help with my choices?
> > > 
> > 
> > I haven't used actionscript, but it's javascript basically yes?
> > 
> > Use encodeURI() or encodeURIComponent() on the data.
> > 
> > 
>Yes, and no. But, I did find the function in the Actionscript library, and 
> I used the new url to pass through to PHP. Looks like it still didn't work, 
> could the length be an issue? 
> 
>BTW, these two variables start off from Actionscript as "arrays", but 
> would knowing this here help? It would be nice that I can just pass them on 
> as arrays (I had to "turn them into strings" before I passed to PHP). 
> 
> Thanks for your help. 
> 
> Alice
> 
> > -- 
> > Thanks!
> > -Shawn
> > http://www.spidean.com
> 
> _
> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
> http://clk.atdmt.com/GBL/go/201469229/direct/01/
> 
> 
> 
> 
> Have you tried outputting the URL string to see if it's properly formed? AS3 
> can still trace() can't it?
> 
> 
> 
> This link should give you an idea of the string limits of different browsers 
> and servers:
> 
> 
> 
> http://www.boutell.com/newfaq/misc/urllength.html
> 
> I have just done that, and here is the pathetically long url:
> 
> http://tdc-queuing/test/generic.php?from=Adair,%20OK-Alfalfa,%20OK-Atoka,%20OK-Beaver,%20OK-Beckham,%20OK-Blaine,%20OK-Bryan,%20OK-Caddo,%20OK-Canadian,%20OK-Carter,%20OK-Cherokee,%20OK-Choctaw,%20OK-Cimarron,%20OK-Cleveland,%20OK-Coal,%20OK-Comanche,%20OK-Cotton,%20OK-Craig,%20OK-Creek,%20OK-Custer,%20OK-Delaware,%20OK-Dewey,%20OK-Ellis,%20OK-Garfield,%20OK-Garvin,%20OK-Grady,%20OK-Grant,%20OK-Greer,%20OK-Harmon,%20OK-Harper,%20OK-Haskell,%20OK-Hughes,%20OK-Jackson,%20OK-Jefferson,%20OK-Johnston,%20OK-Kay,%20OK-Kingfisher,%20OK-Kiowa,%20OK-Latimer,%20OK-Le%20Flore,%20OK-Lincoln,%20OK-Logan,%20OK-Love,%20OK-Major,%20OK-Marshall,%20OK-Mayes,%20OK-McClain,%20OK-McCurtain,%20OK-McIntosh,%20OK-Murray,%20OK-Muskogee,%20OK-Noble,%20OK-Nowata,%20OK-Okfuskee,%20OK-Oklahoma,%20OK-Okmulgee,%20OK-Osage,%20OK-Ottawa,%20OK-Pawnee,%20OK-Payne,%20OK-Pittsburg,%20OK-Pontotoc,%20OK-Pottawatomie,%20OK-Pushmataha,%20OK-Roger%20Mills,%20OK-Rogers,%20OK-Seminole,%20OK-Sequoyah,%20OK-Stephens,%20OK-Texas,%20OK-Tillman,%20OK-Tulsa,%20OK-Wagoner,%20OK-Washington,%20OK-Washita,%20OK-Woods,%20OK-Woodward,%20OK&state_colors=0xCC-0xCC-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF
> 
> This is generated from the encodeURI() Shawn was talking about. Does this 
> seem "well-formed" to you?
> 
> Thanks.
> 
> Alice
> 
> 
> 
> 
> 
> _
> Hotmail: Trusted email with powerful SPAM protection.
> http://clk.atdmt.com/GBL/go/201469227/direct/01/


I can't see anything obviously wrong with the URL really. Is there no
way instead to send the data as post data from Flash? I know Flash can
make post requests, but I'm not sure how much more difficult it is.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] RE: PHP "GET" Error?

2010-02-25 Thread Alice Wei

> 
> Alice Wei wrote:
> > 
> >> Date: Thu, 25 Feb 2010 13:50:16 -0600
> >> From: nos...@mckenzies.net
> >> To: aj...@alumni.iu.edu
> >> CC: php-general@lists.php.net
> >> Subject: Re: PHP "GET" Error?
> >>
> >> Alice Wei wrote:
> >>> Hi, 
> >>>
> >>>   I forgot to mention that the url is formed from Actionscript, I am just 
> >>> using PHP to do the "I/O" because Actionscript does not have this option. 
> >>>
> >>>   So, I guess I cannot do the serialize here like you suggested. I have 
> >>> changed # to 0x for now, and that does not seem to help yet. 
> >>>   BTW, below is the complete code, would this help with my choices?
> >>>
> >> I haven't used actionscript, but it's javascript basically yes?
> >>
> >> Use encodeURI() or encodeURIComponent() on the data.
> >>
> >>
> >Yes, and no. But, I did find the function in the Actionscript library, 
> > and I used the new url to pass through to PHP. Looks like it still didn't 
> > work, could the length be an issue? 
> > 
> >BTW, these two variables start off from Actionscript as "arrays", but 
> > would knowing this here help? It would be nice that I can just pass them on 
> > as arrays (I had to "turn them into strings" before I passed to PHP). 
> > 
> > Thanks for your help. 
> 
> Those functions will work if you do it properly.  As for arrays, the
> only way I know of in js is to json encode them and then you can use the
> PHP json_decode() to get them back.  There is no native js function to
> do this, however there may be one in the actionscript library or there
> are some functions on the web that people have written.
> 
> Wait, I found this:  http://code.google.com/p/as3corelib/
> 
> Functionality may already be in As, but may be of use.
> 
> 
When you meant function, do you mean the function from my PHP end to turn it 
into array, or Actionscript? 
Based on the url I sent Ashley, do you think that is something that would work? 

Thanks. 
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com
  
_
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469227/direct/01/

Re: [PHP] RE: PHP "GET" Error?

2010-02-25 Thread Shawn McKenzie
Alice Wei wrote:
> Subject: Re: [PHP] RE: PHP "GET" Error?
> From: a...@ashleysheridan.co.uk
> To: aj...@alumni.iu.edu
> CC: nos...@mckenzies.net; php-general@lists.php.net
> Date: Thu, 25 Feb 2010 20:03:28 +
> 
> 
> 
> 
> 
> 
>   
>   
> 
> 
> On Thu, 2010-02-25 at 15:01 -0500, Alice Wei wrote:
> 
> 
>> Date: Thu, 25 Feb 2010 13:50:16 -0600
>> From: nos...@mckenzies.net
>> To: aj...@alumni.iu.edu
>> CC: php-general@lists.php.net
>> Subject: Re: PHP "GET" Error?
>>
>> Alice Wei wrote:
>>> Hi, 
>>>
>>>   I forgot to mention that the url is formed from Actionscript, I am just 
>>> using PHP to do the "I/O" because Actionscript does not have this option. 
>>>
>>>   So, I guess I cannot do the serialize here like you suggested. I have 
>>> changed # to 0x for now, and that does not seem to help yet. 
>>>   BTW, below is the complete code, would this help with my choices?
>>>
>> I haven't used actionscript, but it's javascript basically yes?
>>
>> Use encodeURI() or encodeURIComponent() on the data.
>>
>>
>Yes, and no. But, I did find the function in the Actionscript library, and 
> I used the new url to pass through to PHP. Looks like it still didn't work, 
> could the length be an issue? 
> 
>BTW, these two variables start off from Actionscript as "arrays", but 
> would knowing this here help? It would be nice that I can just pass them on 
> as arrays (I had to "turn them into strings" before I passed to PHP). 
> 
> Thanks for your help. 
> 
> Alice
> 
>> -- 
>> Thanks!
>> -Shawn
>> http://www.spidean.com
> 
> _
> Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
> http://clk.atdmt.com/GBL/go/201469229/direct/01/
> 
> 
> 
> 
> Have you tried outputting the URL string to see if it's properly formed? AS3 
> can still trace() can't it?
> 
> 
> 
> This link should give you an idea of the string limits of different browsers 
> and servers:
> 
> 
> 
> http://www.boutell.com/newfaq/misc/urllength.html
> 
> I have just done that, and here is the pathetically long url:
> 
> http://tdc-queuing/test/generic.php?from=Adair,%20OK-Alfalfa,%20OK-Atoka,%20OK-Beaver,%20OK-Beckham,%20OK-Blaine,%20OK-Bryan,%20OK-Caddo,%20OK-Canadian,%20OK-Carter,%20OK-Cherokee,%20OK-Choctaw,%20OK-Cimarron,%20OK-Cleveland,%20OK-Coal,%20OK-Comanche,%20OK-Cotton,%20OK-Craig,%20OK-Creek,%20OK-Custer,%20OK-Delaware,%20OK-Dewey,%20OK-Ellis,%20OK-Garfield,%20OK-Garvin,%20OK-Grady,%20OK-Grant,%20OK-Greer,%20OK-Harmon,%20OK-Harper,%20OK-Haskell,%20OK-Hughes,%20OK-Jackson,%20OK-Jefferson,%20OK-Johnston,%20OK-Kay,%20OK-Kingfisher,%20OK-Kiowa,%20OK-Latimer,%20OK-Le%20Flore,%20OK-Lincoln,%20OK-Logan,%20OK-Love,%20OK-Major,%20OK-Marshall,%20OK-Mayes,%20OK-McClain,%20OK-McCurtain,%20OK-McIntosh,%20OK-Murray,%20OK-Muskogee,%20OK-Noble,%20OK-Nowata,%20OK-Okfuskee,%20OK-Oklahoma,%20OK-Okmulgee,%20OK-Osage,%20OK-Ottawa,%20OK-Pawnee,%20OK-Payne,%20OK-Pittsburg,%20OK-Pontotoc,%20OK-Pottawatomie,%20OK-Pushmataha,%20OK-Roger%20Mills,%20OK-Rogers,%20OK-Seminole,%20OK-Sequoyah,%20OK-Stephens,%2
0OK-Texas,%20OK-Tillman,%20OK-Tulsa,%20OK-Wagoner,%20OK-Washington,%20OK-Washita,%20OK-Woods,%20OK-Woodward,%20OK&state_colors=0xCC-0xCC-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF
> 
> This is generated from the encodeURI() Shawn was talking about. Does this 
> seem "well-formed" to you?
> 
> Thanks.
> 
> Alice
> 

That URL works for me, however, why the 0x in the colors?  # is URL
encoded as %23, so the color #FF would be %23FF.
-- 
Thanks!
-Shawn
http://www.spidean.com

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



RE: [PHP] RE: PHP "GET" Error?

2010-02-25 Thread Alice Wei

> Alice Wei wrote:
> > Hi, 
> > 
> >   I forgot to mention that the url is formed from Actionscript, I am just 
> > using PHP to do the "I/O" because Actionscript does not have this option. 
> > 
> >   So, I guess I cannot do the serialize here like you suggested. I have 
> > changed # to 0x for now, and that does not seem to help yet. 
> >   BTW, below is the complete code, would this help with my choices?
> > 
> 
> I haven't used actionscript, but it's javascript basically yes?
> 
> Use encodeURI() or encodeURIComponent() on the data.
> 
> 
   Yes, and no. But, I did find the function in the Actionscript library, and I 
used the new url to pass through to PHP. Looks like it still didn't work, could 
the length be an issue? 

   BTW, these two variables start off from Actionscript as "arrays", but would 
knowing this here help? It would be nice that I can just pass them on as arrays 
(I had to "turn them into strings" before I passed to PHP). 

Thanks for your help. 

Alice

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


Have you tried outputting the URL string to see if it's properly formed? AS3 
can still trace() can't it?
This link should give you an idea of the string limits of different browsers 
and servers:


http://www.boutell.com/newfaq/misc/urllength.html

I have just done that, and here is the pathetically long url:

http://tdc-queuing/test/generic.php?from=Adair,%20OK-Alfalfa,%20OK-Atoka,%20OK-Beaver,%20OK-Beckham,%20OK-Blaine,%20OK-Bryan,%20OK-Caddo,%20OK-Canadian,%20OK-Carter,%20OK-Cherokee,%20OK-Choctaw,%20OK-Cimarron,%20OK-Cleveland,%20OK-Coal,%20OK-Comanche,%20OK-Cotton,%20OK-Craig,%20OK-Creek,%20OK-Custer,%20OK-Delaware,%20OK-Dewey,%20OK-Ellis,%20OK-Garfield,%20OK-Garvin,%20OK-Grady,%20OK-Grant,%20OK-Greer,%20OK-Harmon,%20OK-Harper,%20OK-Haskell,%20OK-Hughes,%20OK-Jackson,%20OK-Jefferson,%20OK-Johnston,%20OK-Kay,%20OK-Kingfisher,%20OK-Kiowa,%20OK-Latimer,%20OK-Le%20Flore,%20OK-Lincoln,%20OK-Logan,%20OK-Love,%20OK-Major,%20OK-Marshall,%20OK-Mayes,%20OK-McClain,%20OK-McCurtain,%20OK-McIntosh,%20OK-Murray,%20OK-Muskogee,%20OK-Noble,%20OK-Nowata,%20OK-Okfuskee,%20OK-Oklahoma,%20OK-Okmulgee,%20OK-Osage,%20OK-Ottawa,%20OK-Pawnee,%20OK-Payne,%20OK-Pittsburg,%20OK-Pontotoc,%20OK-Pottawatomie,%20OK-Pushmataha,%20OK-Roger%20Mills,%20OK-Rogers,%20OK-Seminole,%20OK-Sequoyah,%20OK-Stephens,%20OK-Texas,%20OK-Tillman,%20OK-Tulsa,%20OK-Wagoner,%20OK-Washington,%20OK-Washita,%20OK-Woods,%20OK-Woodward,%20OK&state_colors=0xCC-0xCC-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0x0DCCFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF-0xFF

This is generated from the encodeURI() Shawn was talking about. Does this seem 
"well-formed" to you?

Thanks.

Alice
  
_
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469227/direct/01/


I can't see anything obviously wrong with the URL really. Is there no way 
instead to send the data as post data from Flash? I know Flash can make post 
requests, but I'm not sure how much more difficult it is.

 I had it using POST before, but from the PHP point of view, it does not matter 
how I make the request, does it? I mean, if the variables are problematic, 
would it matter if I use POST or GET?

Thanks. 





  
_
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469226/direct/01/

Re: [PHP] RE: PHP "GET" Error?

2010-02-25 Thread Shawn McKenzie
Alice Wei wrote:
> I can't see anything obviously wrong with the URL really. Is there no
> way instead to send the data as post data from Flash? I know Flash
> can make post requests, but I'm not sure how much more difficult it
> is.
>
> I had it using POST before, but from the PHP point of view, it does
> not matter how I make the request, does it? I mean, if the variables
> are problematic, would it matter if I use POST or GET?
>

All seems fine to me.  You can use post, but what's not working?  Try
trimming back to just 2 from and colors and test it.  What does
var_dump($_GET) show on the PHP page?

-Shawn


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



RE: [PHP] RE: PHP "GET" Error?

2010-02-25 Thread Alice Wei


> Date: Thu, 25 Feb 2010 15:04:46 -0600
> From: nos...@mckenzies.net
> To: aj...@alumni.iu.edu
> CC: a...@ashleysheridan.co.uk; php-general@lists.php.net
> Subject: Re: [PHP] RE: PHP "GET" Error?
> 
> Alice Wei wrote:
> > I can't see anything obviously wrong with the URL really. Is there no
> > way instead to send the data as post data from Flash? I know Flash
> > can make post requests, but I'm not sure how much more difficult it
> > is.
> >
> > I had it using POST before, but from the PHP point of view, it does
> > not matter how I make the request, does it? I mean, if the variables
> > are problematic, would it matter if I use POST or GET?
> >
> 
> All seems fine to me.  You can use post, but what's not working?  Try
> trimming back to just 2 from and colors and test it.  What does
> var_dump($_GET) show on the PHP page?
> 
> -Shawn
> 
Too bad that Actionscript does not encode special characters, I had to use 
string replacement to replace it. 
However, now it looks like my PHP is now fine, and my image does display 
correctly. 

Thanks for your help!

Alice
  
_
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469227/direct/01/

Re: [PHP] $_POST vs $_REQUEST

2010-02-25 Thread Jochem Maas
Op 2/24/10 11:18 AM, Ashley Sheridan schreef:
> On Wed, 2010-02-24 at 07:55 +, Jochem Maas wrote:
> 
>> Op 2/22/10 10:49 PM, John Black schreef:
>>> On 02/22/2010 11:42 PM, Michael Shadle wrote:
 The difference here is you can at least have some control over the data
 and expect it in a certain fashion. Also the behavior of cookies vs. get
 vs. post are different (cookies have length and expiration limits, get
 has length limits, post has server confgured limits)
>>>
>>> The cookie and post/get part is all mixed up now :)
>>>
>>> I use $_COOKIE when I want cookie information but I know that the data
>>> is not to be trusted and is easily fabricated.
>>>
>>> When reading get or post I just use $_REQUEST nowadays because I don't
>>> have to care how the submitting form is written. This makes my form
>>> handling data more portable.
>>
>> a. if your updating/inserting/storing data for the user you should require
>> POST in order to mitigate CSRF et al - not to mention using a nonce in your 
>> forms.
>>
>> b. when you use $_REQUEST like you do you assume it's either GET or POST 
>> data, but
>> it might be COOKIE data ... which will overwrite what is sent via GET or 
>> POST in the
>> $_REQUEST array .. which creates a potential for a denial-of-service attack 
>> on the
>> users of a site:
>>
>> imagine an 'id' parameter for displaying articles, then imagine a
>> user was tricked into loading a cookie onto his machine for your domain with 
>> the
>> name of 'id' and a value of 1 ... said user would only ever be able to see 
>> the
>> article referred to be id=1 if you wrote code that took the 'id' parameter 
>> from the
>> $_REQUEST var.
>>
>> ... I advocate not trusting any data *and* being explicit about the input 
>> vectors
>> on which any particular piece of data is accepted in a given context. (GET, 
>> POST and COOKIE
>> are 3 different vectors)
>>
>>
>>
> 
> 
> Which becomes a moot point if you use the request_order ini setting to
> specify the ordering of the overriding of variables in $_REQUEST.

which I think is another bit of magic I can do without. besides you don't
always have control of the ini file (and you obviously can't change this value
during the running of the script as $_REQUEST is already defined)

> I do see what you're getting at, and yes there are concerns to be had
> with one global array overriding another if you don't know to look out
> for such a caveat. The thing is, there are many times where $_REQUEST is
> just perfect. Imagine a stylesheet picker, that remembers the visitors
> choice in a cookie. You can utilise $_REQUEST to handle the whole thing
> very easily, and in a way that makes sense.

which would require a request_order of CPG - the opposite of what it normally 
is,
which is a complete WTF for any new developer of the code base, all so you can
save a couple of lines of very simple code. I don't think it's worth it.

BUT given that you do know what all the ramification are and can control the
request_order in your environment then it's true to say that in your case there
is no actual problem.

> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> 
> 


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



[PHP] Re: Database design

2010-02-25 Thread Manuel Lemos
Hello,

on 02/25/2010 02:37 AM Angus Mann said the following:
> Hi all. I know this is not strictly a PHP question but the code will be 
> written in PHP, and I figure the folks here will be well versed in the 
> questions I raise. Please feel free to contact me off the list if appropriate.
> 
> I need some assistance with database design for a project I'm coding in PHP. 
> I'm willing to pay for the advice, since I think it will be a bit complex. I 
> plan to use MySQLi
> 
> If anybody feels they can assist, or can point elsewhere please feel free to 
> contact me off list, or reply to the list if you think appropriate.

Have you tried the PHP specialists forums?

It is a place for asking non-trivial questions about PHP development.

http://www.phpclasses.org/discuss/topic/specialists/forum/general/

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: Database design

2010-02-25 Thread sathyashrayan
On Thu, 2010-02-25 at 22:03 -0300, Manuel Lemos wrote:
> Hello,
> 
> on 02/25/2010 02:37 AM Angus Mann said the following:
> > Hi all. I know this is not strictly a PHP question but the code will be 
> > written in PHP, and I figure the folks here will be well versed in the 
> > questions I raise. Please feel free to contact me off the list if 
> > appropriate.
> > 
> > I need some assistance with database design for a project I'm coding in 
> > PHP. I'm willing to pay for the advice, since I think it will be a bit 
> > complex. I plan to use MySQLi
> > 
> > If anybody feels they can assist, or can point elsewhere please feel free 
> > to contact me off list, or reply to the list if you think appropriate.
> 

Hi Angus Mann.. 
  I have been updating database design with various e-books. I think
this might be a good time for me to try out some applications. I want to
join your project. No money terms needed. All i want is to get involved.
Thanks for any reply..


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



[PHP] ctype_print, the British Pound and other non-ASCII characters

2010-02-25 Thread Bob
I'm seeing mischief from ctype_print.

So far as I can tell, the British Pound symbol, '£' is considered a 
printable character according to the locale I use on my Ubuntu box. But 
even across two years, two boxes, several versions of Ubuntu (from 7.04 
to 9.10, one x86, one AMD64), and two major versions of PHP (PHP 4 and 
now PHP 5.2.11), I cannot get ctype_print to return true when a string 
given to it contains the British Pound symbol. (Or other non-ASCII 
characters such as ø or ß.)

The locale I'm using is en_GB.UTF-8 and when I call setlocale(LC_ALL, 
'en_GB.UTF-8') in PHP, it returns the name of this locale rather than 
FALSE, so that seems to be in order. (However, to be sure I have 
installed and reinstalled the language pack in Ubuntu as suggested by 
others.)

I've even read through the en_GB and i18n locale definition files to 
confirm that  (for the British Pound symbol) does appear within 
the print and graph sections, so both ctype_print and ctype_graph should 
consider it acceptable.

What's most maddening is that ctype_print does return true on my shared 
hosting server, so I know that it can be achieved. I'm just hoping that 
someone here can tell me what I'm doing wrong, or what my operating 
system is doing wrong.

For your information, I'm currently running the following:

Ubuntu 9.10 (AMD64)
Apache 2.2.14
PHP 5.2.11 running as a CGI (to mirror the config of my shared host)
Locale in use: en_GB.UTF-8
LANG=en_GB.UTF-8

Can anyone tell me how to get ctype_print to behave?

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



Re: [PHP] HipHop and other PHP compiler performance evaluation

2010-02-25 Thread Manuel Lemos
Hello Raymond,

on 02/25/2010 11:34 PM Raymond Irving said the following:
> 
> Very nice article. Thanks for sharing.
> 
> I wish PHP had a feature/extension to compile (to native code) and cache
> the scripts at runtime. This way we could get speeds that are very close
> to PHC and Hiphop. It would be very slow when loading the page for the
> first time but after then it should just blaze. Maybe we will one day
> see something like an NCC (Native Code Compiler) extension for php that
> will replace or complement APC.

Right but keep in mind that most of the time regular PHP scripts are
waiting for I/O operations, like accessing to the network, files or
database servers. So the speed of execution of pure CPU intensive code
like bench.php used in the tests, may not be what matters most to your
sites.

So, often investing in heavily caching your content in files (or
memcached servers for clustered servers) is a much more efficient
solution to handle the load of busy sites. That is mostly what the
PHPClasses sites uses to handle over 2 million page views a month with a
single server.

You may want to read more about that here for more details:

http://www.phpclasses.org/blog/post/66-More-defensive-programming-practices-to-survive-Web-site-traffic-peaks.html

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] header function query

2010-02-25 Thread Nick allan
Hi all

The situation is as follows

I've read some data in from a couple of files into a string variable, made
some changes to it and want to send the contents of the string out to the
browser as a word document.

My code currently looks like the following

header('Content-Type: application/msword');

header('Content-Disposition: attachment;
filename="preq.doc"');

ob_clean();

echo $allText;

 

 

The above code works fine, the client gets a file download dialogue and can
save or open the file.

How can I indicate end of file, then continue writing html to display a new
page. I want to be able to ask the user some additional questions after they
have downloaded the file.  My problem is that if I add any html code after
the above echo statement, it is included in the downloaded file.

There's probably a simple answer to this, but I haven't been able to find
anything using google.

 

Thanks in advance for any suggestions.

 

Regards Nick