Re: [PHP] PHP and curl

2013-09-26 Thread Shawn McKenzie
Unfortunately this isn't anything to do with PHP.  I don't have any info on
the app, what it's supposed to return or what the parameter passed should
be.  The PHP soap call is working, but the app isn't returning what you
want or expect I guess.


On Thu, Sep 26, 2013 at 8:36 AM, Alf Stockton  wrote:

>  Shawn, that was silly of me. I have now removed the echo but I still do
> not get the expected result from the server.
> var_dump of $result returns:-
>
> object(stdClass)#2 (1) {
>   ["GetSequenceNoResult"]=>
>   object(stdClass)#3 (6) {
> ["iServerNo"]=>
> int(0)
> ["iClientNo"]=>
> int(0)
> ["bNoLimitDownload"]=>
> bool(false)
> ["dtStartDate"]=>
> string(19) "0001-01-01T00:00:00"
> ["dtEndDate"]=>
> string(19) "0001-01-01T00:00:00"
> ["dtServerTime"]=>
> string(19) "0001-01-01T00:00:00"
>   }
> }
>
> whereas the expected result is to have each of those fields containing
> data.
> My code now looks like
>
>  $strTerminalname = "CIS";
> $version = "1.2";
> $client = new SoapClient(
> "http://192.168.0.10/CISWebService/Mediamanager.asmx?WSDL";
> );
> $result = $client->GetSequenceNo($strTerminalname);
> print_r($result);
> var_dump($result);
> ?>
>
>
> On 25/09/13 17:23, Shawn McKenzie wrote:
>
> $result = $client->GetSequenceNo( "CIS" ); shouldn't be throwing that
> error.  Maybe you are trying to do something with $result afterwards?  Try
> var_dump($result);
>
>
> On Wed, Sep 25, 2013 at 10:12 AM, Alf Stockton  wrote:
>
>>
>> On 25/09/13 16:52, Shawn McKenzie wrote:
>>
>> $client->GetSequenceNo( $parameters );
>>
>> That unfortunately returns
>>
>> alf@alf-ThinkPad-T500:~/Development/PHP/DevIt$ php
>> php-soap-web-service.php > test.txt
>> PHP Catchable fatal error:  Object of class stdClass could not be
>> converted to string in
>> /home/alf/Development/PHP/DevIt/php-soap-web-service.php on line 7
>>
>> No matter if I use
>> $result = $client->GetSequenceNo( "CIS" );
>> or
>> $result = $client->GetSequenceNo($strTerminalname);
>>
>>
>>
>>
>> --
>>
>> Regards,
>> Alf Stockton  www.stockton.co.za
>>
>>
>
>
>  --
>  --
> Thanks!
> -Shawn
> --
>
>
> --
>
> Regards,
> Alf Stockton  www.stockton.co.za
>
>


-- 
Thanks!
-Shawn


Re: [PHP] PHP and curl

2013-09-25 Thread Shawn McKenzie
Keep on list.

$result = $client->GetSequenceNo( "CIS" ); shouldn't be throwing that
error.  Maybe you are trying to do something with $result afterwards?  Try
var_dump($result);


On Wed, Sep 25, 2013 at 10:12 AM, Alf Stockton  wrote:

>
> On 25/09/13 16:52, Shawn McKenzie wrote:
>
> $client->GetSequenceNo( $parameters );
>
> That unfortunately returns
>
> alf@alf-ThinkPad-T500:~/Development/PHP/DevIt$ php
> php-soap-web-service.php > test.txt
> PHP Catchable fatal error:  Object of class stdClass could not be
> converted to string in
> /home/alf/Development/PHP/DevIt/php-soap-web-service.php on line 7
>
> No matter if I use
> $result = $client->GetSequenceNo( "CIS" );
> or
> $result = $client->GetSequenceNo($strTerminalname);
>
>
>
>
> --
>
> Regards,
> Alf Stockton  www.stockton.co.za
>
>


-- 
--
Thanks!
-Shawn
--


Re: [PHP] PHP and curl

2013-09-25 Thread Shawn McKenzie
SOAP functions can be called as methods of the SoapClient object.  Maybe:

$client->GetSequenceNo( $parameters );

-Shawn


On Wed, Sep 25, 2013 at 9:17 AM, Alf Stockton  wrote:

> In an attempt to interface with a webservice on a Windows 7 server I have
> started writing the following:-
> [code]
>  $strTerminalname = "CIS";
> $version = "1.2";
> $client = new SoapClient("http://192.168.0.**
> 10/CISWebService/Mediamanager.**asmx?WSDL
> ");
> var_dump($client->__**getFunctions());
> $result = 
> $client->__doRequest("**GetSequenceNo",$**strTerminalname,$version,
> $one_way = 0);
> ?>
> [/code]
> and I execute it via
> php php-soap-web-service.php > test.txt
> on my Ubuntu 13.04 laptop using php version Zend Engine v2.4.0
> in return I get
> array(20) {
>   [0]=>
>   string(59) "GetMediaListResponse GetMediaList(GetMediaList $parameters)"
>   [1]=>
>   string(68) "GetMediaListAllResponse GetMediaListAll(**GetMediaListAll
> $parameters)"
>   [2]=>
>   string(59) "GetSoundListResponse GetSoundList(GetSoundList $parameters)"
>   [3]=>
>   string(77) "GetTerminalDataXMLResponse 
> GetTerminalDataXML(**GetTerminalDataXML
> $parameters)"
>   [4]=>
>   string(59) "GetRouterXmlResponse GetRouterXml(GetRouterXml $parameters)"
>   [5]=>
>   string(80) "GetTerminalSoundXMLResponse 
> GetTerminalSoundXML(**GetTerminalSoundXML
> $parameters)"
>   [6]=>
>   string(62) "SetSequenceNoResponse SetSequenceNo(SetSequenceNo
> $parameters)"
>   [7]=>
>   string(50) "GetConfigResponse GetConfig(GetConfig $parameters)"
>   [8]=>
>   string(62) "GetSequenceNoResponse GetSequenceNo(GetSequenceNo
> $parameters)"
>   [9]=>
>   string(95) "**UpdateClientMediaLogTimeRespon**se
> UpdateClientMediaLogTime(**UpdateClientMediaLogTime $parameters)"
>   [10]=>
>   string(59) "GetMediaListResponse GetMediaList(GetMediaList $parameters)"
>   [11]=>
>   string(68) "GetMediaListAllResponse GetMediaListAll(**GetMediaListAll
> $parameters)"
>   [12]=>
>   string(59) "GetSoundListResponse GetSoundList(GetSoundList $parameters)"
>   [13]=>
>   string(77) "GetTerminalDataXMLResponse 
> GetTerminalDataXML(**GetTerminalDataXML
> $parameters)"
>   [14]=>
>   string(59) "GetRouterXmlResponse GetRouterXml(GetRouterXml $parameters)"
>   [15]=>
>   string(80) "GetTerminalSoundXMLResponse 
> GetTerminalSoundXML(**GetTerminalSoundXML
> $parameters)"
>   [16]=>
>   string(62) "SetSequenceNoResponse SetSequenceNo(SetSequenceNo
> $parameters)"
>   [17]=>
>   string(50) "GetConfigResponse GetConfig(GetConfig $parameters)"
>   [18]=>
>   string(62) "GetSequenceNoResponse GetSequenceNo(GetSequenceNo
> $parameters)"
>   [19]=>
>   string(95) "**UpdateClientMediaLogTimeRespon**se
> UpdateClientMediaLogTime(**UpdateClientMediaLogTime $parameters)"
> }
>
> now this is all great but my question is how do I call each of these
> functions with parameters.
> The call I immediately need to make is to GetSequenceNo() which requires a
> parameter of "CIS" in my current configuration.
> How do I do this ? Obviously $client->__doRequest is not the way to go.
>
> --
>
> Regards,
> Alf Stockton  www.stockton.co.za
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] PHP and curl

2013-09-25 Thread Alf Stockton
In an attempt to interface with a webservice on a Windows 7 server I 
have started writing the following:-

[code]
$client = new 
SoapClient("http://192.168.0.10/CISWebService/Mediamanager.asmx?WSDL";);

var_dump($client->__getFunctions());
$result = 
$client->__doRequest("GetSequenceNo",$strTerminalname,$version, $one_way 
= 0);

?>
[/code]
and I execute it via
php php-soap-web-service.php > test.txt
on my Ubuntu 13.04 laptop using php version Zend Engine v2.4.0
in return I get
array(20) {
  [0]=>
  string(59) "GetMediaListResponse GetMediaList(GetMediaList $parameters)"
  [1]=>
  string(68) "GetMediaListAllResponse GetMediaListAll(GetMediaListAll 
$parameters)"

  [2]=>
  string(59) "GetSoundListResponse GetSoundList(GetSoundList $parameters)"
  [3]=>
  string(77) "GetTerminalDataXMLResponse 
GetTerminalDataXML(GetTerminalDataXML $parameters)"

  [4]=>
  string(59) "GetRouterXmlResponse GetRouterXml(GetRouterXml $parameters)"
  [5]=>
  string(80) "GetTerminalSoundXMLResponse 
GetTerminalSoundXML(GetTerminalSoundXML $parameters)"

  [6]=>
  string(62) "SetSequenceNoResponse SetSequenceNo(SetSequenceNo 
$parameters)"

  [7]=>
  string(50) "GetConfigResponse GetConfig(GetConfig $parameters)"
  [8]=>
  string(62) "GetSequenceNoResponse GetSequenceNo(GetSequenceNo 
$parameters)"

  [9]=>
  string(95) "UpdateClientMediaLogTimeResponse 
UpdateClientMediaLogTime(UpdateClientMediaLogTime $parameters)"

  [10]=>
  string(59) "GetMediaListResponse GetMediaList(GetMediaList $parameters)"
  [11]=>
  string(68) "GetMediaListAllResponse GetMediaListAll(GetMediaListAll 
$parameters)"

  [12]=>
  string(59) "GetSoundListResponse GetSoundList(GetSoundList $parameters)"
  [13]=>
  string(77) "GetTerminalDataXMLResponse 
GetTerminalDataXML(GetTerminalDataXML $parameters)"

  [14]=>
  string(59) "GetRouterXmlResponse GetRouterXml(GetRouterXml $parameters)"
  [15]=>
  string(80) "GetTerminalSoundXMLResponse 
GetTerminalSoundXML(GetTerminalSoundXML $parameters)"

  [16]=>
  string(62) "SetSequenceNoResponse SetSequenceNo(SetSequenceNo 
$parameters)"

  [17]=>
  string(50) "GetConfigResponse GetConfig(GetConfig $parameters)"
  [18]=>
  string(62) "GetSequenceNoResponse GetSequenceNo(GetSequenceNo 
$parameters)"

  [19]=>
  string(95) "UpdateClientMediaLogTimeResponse 
UpdateClientMediaLogTime(UpdateClientMediaLogTime $parameters)"

}

now this is all great but my question is how do I call each of these 
functions with parameters.
The call I immediately need to make is to GetSequenceNo() which requires 
a parameter of "CIS" in my current configuration.

How do I do this ? Obviously $client->__doRequest is not the way to go.

--

Regards,
Alf Stockton  www.stockton.co.za


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



RE: [PHP] PHP and Powershell

2013-07-22 Thread Alan Loos
Serge,

  Won't lie, read this from my phone this morning and thought 'No it can't be 
that easy'.
Now that I'm at work in front of a computer I've updated the command to the 
following:

GetTarget.ps1

###
## Variables ##
###

$cred = New-Object System.Management.Automation.PSCredential -ArgumentList 
@('administra...@widget.com',(ConvertTo-SecureString -String 'MyPassword' 
-AsPlainText -Force))
$command = Invoke-Command -computername localhost -credential $cred 
-scriptblock {& Get-IscsiServerTarget -TargetName Target1 | select-object 
TargetIqn,Status | Format-List} -SessionOption (New-PSSessionOption 
-SkipCACheck -SkipCNCheck -SkipRevocationCheck)


#
## Execute Scriptblock ##
#

$command



And it returns:

Array
(
[0] =>
[1] =>
[2] => TargetIqn : iqn.2013-04.com.widget:Target1
[3] => Status: NotConnected
[4] =>
[5] =>
[6] =>
)
0

End Of Scene

In effect, you're a genius!

Thank you for all your help I should be able to tackle it from here!

Alan Loos

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you are not an intended recipient, you are hereby 
notified that any disclosure, copying, distribution or use of this e-mail 
and/or the accompanying attachment(s) is strictly prohibited. If you have 
received this e-mail in error, please immediately notify the sender by return 
e-mail.

From: Serge Fonville [mailto:serge.fonvi...@gmail.com]
Sent: Monday, July 22, 2013 4:09 AM
To: Alan Loos
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP and Powershell

Hi,

Thanks for your change.

I understand what has happend, from MSDN forums
http://social.technet.microsoft.com/Forums/windowsserver/en-US/4b841530-9d8c-4d09-a77c-b89c6e0bafab/how-do-i-capture-data-from-invokecommand

http://technet.microsoft.com/en-us/library/jj612804.aspx describes that
Get-IscsiServerTarget returns an instance of 
Microsoft.Iscsi.Target.Commands.IscsiServerTarget. De output also includes the 
runspaceid and pscomputername. Invoke-Command also returns a runspaceid (when 
executed with -computername).

You need to use Select-Object to output only the relevant fields instead.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table

--Snip--
--Big Snip--


Please make note of my new email address: alan.l...@genco.com.


Re: [PHP] PHP and Powershell

2013-07-22 Thread Serge Fonville
Hi,

Thanks for your change.

I understand what has happend, from MSDN forums
http://social.technet.microsoft.com/Forums/windowsserver/en-US/4b841530-9d8c-4d09-a77c-b89c6e0bafab/how-do-i-capture-data-from-invokecommand

http://technet.microsoft.com/en-us/library/jj612804.aspx describes that
Get-IscsiServerTarget returns an instance of
Microsoft.Iscsi.Target.Commands.IscsiServerTarget. De output also includes
the runspaceid and pscomputername. Invoke-Command also returns a runspaceid
(when executed with -computername).

You need to use Select-Object to output only the relevant fields instead.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table


2013/7/19 Alan Loos 

>  Serge,
>
>   I have, the script itself allows for easy transition into a .ps1, what I
> have done is removed the # from the debug section to get the full command
> that is then easily ‘copy and paste’-able into a Powershell prompt and I
> get the same response in Powershell directly.
>
>   Also in response to the lastest post to the thread I will snip off some
> content here. (Sorry first time at this)
>
>
>
> The ultimate goal is to pull the two variables so I can pass them forward
> via a PHP script to a MySQL Database.
>
> (ie iqn.2013-04.com.widget:Target1 and NotConnected in this case)
>
>
>
> I believe that the command in Powershell is trying to gather the $Status
> on both the Invoke-Command and Get-iSCSIServerTarget commands. Which is why
> I am getting a table in the Powershell Console and browser.
>
>
>
> Per your request I have rewritten the scripts:
>
> (Included inline)
>
> TestGetServerTarget.php
>  --
>
> 
>
>
>
>
> ###
>
> ## Variables ##
>
> ###
>
>
>
> $psCMD = "powershell.exe -ExecutionPolicy Unrestricted";
>
> $psFILE = "C:\\Arc\\scripts\\TestGetTarget.ps1";
>
> $runCMD = $psCMD." ".$psFILE;
>
>
>
> 
>
> ## Variable Checking (For Debug Mode) ##
>
> 
>
>
>
> #echo "\$psCMD = $psCMD";
>
>
>
>
>
> 
>
> ## Run Script ##
>
> 
>
>
>
> exec($runCMD, $out);
>
>
>
>
>
> 
>
> ## Output ##
>
> 
>
>
>
> echo ('');
>
> print_r($out);
>
> echo ('');
>
>
>
>
>
> ###
>
> ## End Of Script ##
>
> ###
>
>
>
> echo "End Of Scene";
>
>
>
>
>
> ?>
>  --
>
>
>
>
>
> TestGetTarget.ps1
>  --
>
> ###
>
> ## Variables ##
>
> ###
>
>
>
> $cred = New-Object System.Management.Automation.PSCredential -ArgumentList
> @('administra...@widget.com',(ConvertTo-SecureString -String 'MyPassword'
> -AsPlainText -Force))
>
> $command = Invoke-Command -computername localhost -credential $cred
> -scriptblock {& Get-IscsiServerTarget -TargetName Target1 | % {
> $_.TargetIqn, $_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck
> -SkipCNCheck -SkipRevocationCheck)
>
>
>
>
>
> #
>
> ## Execute Scriptblock ##
>
> #
>
>
>
> $command
>  --
>
>
>
> Powershell output of TestGetTarget.ps1:
>  --
>
> PS C:\Arc\Scripts> .\TestGetTarget.ps1
>
> iqn.2013-04.com.widget:Target1
>
>
>
> PSComputerName  RunspaceId
>  Value
>
> --
> --  -
>
> localhost
> f3c5063a-85df-49a3-a5ed-7df04a930684NotConnected
>  --
>
>
>
> PHP output webbrowser (Much in the same):
>  --
>
> Array
>
> (
>
> [0] => iqn.2013-04.com.widget:Target1
>
> [1] =>
>
> [2] => PSComputerName RunspaceId Value
>
> [3] => -- -- -
>
> [4] => localhost  f46c9f15-70b4-496c-a9d6...
> NotConnected
>
> [5] =>
>
> [6] =>
>
> )
>
>
>
> End Of Scene
>  --
>
>
>
>
>

RE: [PHP] PHP and Powershell

2013-07-19 Thread Alan Loos
Serge,
  I have, the script itself allows for easy transition into a .ps1, what I have 
done is removed the # from the debug section to get the full command that is 
then easily 'copy and paste'-able into a Powershell prompt and I get the same 
response in Powershell directly.
  Also in response to the lastest post to the thread I will snip off some 
content here. (Sorry first time at this)

The ultimate goal is to pull the two variables so I can pass them forward via a 
PHP script to a MySQL Database.
(ie iqn.2013-04.com.widget:Target1 and NotConnected in this case)

I believe that the command in Powershell is trying to gather the $Status on 
both the Invoke-Command and Get-iSCSIServerTarget commands. Which is why I am 
getting a table in the Powershell Console and browser.

Per your request I have rewritten the scripts:
(Included inline)
TestGetServerTarget.php

');
print_r($out);
echo ('');


###
## End Of Script ##
###

echo "End Of Scene";


?>



TestGetTarget.ps1

###
## Variables ##
###

$cred = New-Object System.Management.Automation.PSCredential -ArgumentList 
@('administra...@widget.com',(ConvertTo-SecureString -String 'MyPassword' 
-AsPlainText -Force))
$command = Invoke-Command -computername localhost -credential $cred 
-scriptblock {& Get-IscsiServerTarget -TargetName Target1 | % { $_.TargetIqn, 
$_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck 
-SkipRevocationCheck)


#
## Execute Scriptblock ##
#

$command


Powershell output of TestGetTarget.ps1:

PS C:\Arc\Scripts> .\TestGetTarget.ps1
iqn.2013-04.com.widget:Target1

PSComputerName  RunspaceId  
Value
--  --  
-
localhost   f3c5063a-85df-49a3-a5ed-7df04a930684
NotConnected


PHP output webbrowser (Much in the same):

Array
(
[0] => iqn.2013-04.com.widget:Target1
[1] =>
[2] => PSComputerName RunspaceId Value
[3] => -- -- -
[4] => localhost  f46c9f15-70b4-496c-a9d6... NotConnected
[5] =>
[6] =>
)

End Of Scene



Alan Loos

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you are not an intended recipient, you are hereby 
notified that any disclosure, copying, distribution or use of this e-mail 
and/or the accompanying attachment(s) is strictly prohibited. If you have 
received this e-mail in error, please immediately notify the sender by return 
e-mail.

From: Serge Fonville [mailto:serge.fonvi...@gmail.com]
Sent: Friday, July 19, 2013 12:16 PM
To: Alan Loos
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP and Powershell

Thank you for your clarification.

Have you considered placing the whole powershell -command parameter in a .ps1 
script and executing that instead?

The benefit would be that it is easier to read and test accordingly.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table

--Big Snip--

Please make note of my new email address: alan.l...@genco.com.


Re: [PHP] PHP and Powershell

2013-07-19 Thread Tedd Sperling
To all:

Sorry for top posting and sorry for sounding like the list-police, but you need 
to trim the excess from your post. Hitting reply without considering that other 
have to read through a bunch of old add-on email is not good.

So, please just trim your post to what is important.

Cheers,

tedd

On Jul 19, 2013, at 1:16 PM, Serge Fonville  wrote:

> Thank you for your clarification.
> 
> Have you considered placing the whole powershell -command parameter in a
> .ps1 script and executing that instead?
> 
> The benefit would be that it is easier to read and test accordingly.
> 
> HTH
> 
> Kind regards/met vriendelijke groet,
> 
> Serge Fonville

> --- BIG SNIP ---


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



Re: [PHP] PHP and Powershell

2013-07-19 Thread Serge Fonville
Thank you for your clarification.

Have you considered placing the whole powershell -command parameter in a
.ps1 script and executing that instead?

The benefit would be that it is easier to read and test accordingly.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table


2013/7/19 Alan Loos 

>  According to Technet it is not required (
> http://technet.microsoft.com/en-us/library/hh849719.aspx) as the default
> would be ‘localhost’ which is the same as 127.0.0.1.
>
> ** **
>
> So you are correct it is not required. However when I take away
> ‘-computername 127.0.0.1’ I get a return of:
>
> Array
>
> (
>
> [0] => Invoke-Command : Parameter set cannot be resolved using the
> specified named
>
> [1] => parameters.
>
> [2] => At line:1 char:172
>
> [3] => + $cred = New-Object System.Management.Automation.PSCredential
> -ArgumentList
>
> [4] => @('ad ...
>
> [5] => +
> ~
> 
>
> [6] => ~~~
>
> [7] => + CategoryInfo  : InvalidArgument: (:)
> [Invoke-Command], Parameter
>
> [8] =>BindingException
>
> [9] => + FullyQualifiedErrorId :
> AmbiguousParameterSet,Microsoft.PowerShell.Comma
>
> [10] =>nds.InvokeCommandCommand
>
> [11] => 
>
> )
>
> ** **
>
> End Of Scene
>
> ** **
>
> For whatever reason, the powershell command does not want to execute
> properly without that variable being defined explicitly.
>
> ** **
>
> (Not sure if that is what you are asking exactly but I think that was
> answering the question, if not let me know and I’ll try to answer the best
> I can)
>
> ** **
>
> Thanks in advance!
>
> ** **
>
> *Alan Loos* 
>
> ** **
>
> CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any)
> contain confidential information that is privileged and intended only for
> the addressee(s) hereof. If you are not an intended recipient, you are
> hereby notified that any disclosure, copying, distribution or use of this
> e-mail and/or the accompanying attachment(s) is strictly prohibited. If you
> have received this e-mail in error, please immediately notify the sender by
> return e-mail.
>
> ** **
>
> *From:* Serge Fonville [mailto:serge.fonvi...@gmail.com]
> *Sent:* Friday, July 19, 2013 11:13 AM
>
> *To:* Alan Loos
> *Cc:* php-general@lists.php.net
> *Subject:* Re: [PHP] PHP and Powershell
>
> ** **
>
> How have you determined that invoke-command requires -computername?
>
> 
>
> Kind regards/met vriendelijke groet,
>
> ** **
>
> Serge Fonville
>
> ** **
>
> http://www.sergefonville.nl
>
> Convince Microsoft!
>
> They need to add TRUNCATE PARTITION in SQL Server
>
>
> https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table
> 
>
> ** **
>
> 2013/7/19 Alan Loos 
>
> Thank you for your response Serge!
>
>   The computer name  is for the invoke-command, ComputerName has to be
> specified to tell the computer where the command is to be routed. Since I
> want this to run locally over PHP I figured that it would be a good way to
> avoid running a script as I have read online that when it can be avoided
> it’s a good practice (I also couldn’t get this to work properly… J But
> that is a side note). The piece that outputs the extra RunSpaceID and the
> PSComputerName is the $_.Status portion of everything.
>
>  
>
> If someone knows how to cut it out that would be fine but really I just
> need to pull the Target Name and the Value from result. For the attached
> example it would be $IQNTarget = iqn.2013-04.com.widget:Target1 and $Value
> = NotConnected (Which there are two options for this which is Connected or
> NotConnected).
>
>  
>
> To use Select Object here would I do Select-Object $Value?
>
>  
>
> *Alan Loos*
>
>  
>
> CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any)
> contain confidential information that is privileged and intended only for
> the addressee(s) hereof. If you are not an intended recipient, you are
> hereby notified that any disclosure, copying, distribution or use of this
> e-mail and/or the accompanying attachment(s)

RE: [PHP] PHP and Powershell

2013-07-19 Thread Alan Loos
According to Technet it is not required 
(http://technet.microsoft.com/en-us/library/hh849719.aspx) as the default would 
be 'localhost' which is the same as 127.0.0.1.

So you are correct it is not required. However when I take away '-computername 
127.0.0.1' I get a return of:
Array
(
[0] => Invoke-Command : Parameter set cannot be resolved using the 
specified named
[1] => parameters.
[2] => At line:1 char:172
[3] => + $cred = New-Object System.Management.Automation.PSCredential 
-ArgumentList
[4] => @('ad ...
[5] => + 
~
[6] => ~~~
[7] => + CategoryInfo  : InvalidArgument: (:) [Invoke-Command], 
Parameter
[8] =>BindingException
[9] => + FullyQualifiedErrorId : 
AmbiguousParameterSet,Microsoft.PowerShell.Comma
[10] =>nds.InvokeCommandCommand
[11] =>
)

End Of Scene

For whatever reason, the powershell command does not want to execute properly 
without that variable being defined explicitly.

(Not sure if that is what you are asking exactly but I think that was answering 
the question, if not let me know and I'll try to answer the best I can)

Thanks in advance!

Alan Loos

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you are not an intended recipient, you are hereby 
notified that any disclosure, copying, distribution or use of this e-mail 
and/or the accompanying attachment(s) is strictly prohibited. If you have 
received this e-mail in error, please immediately notify the sender by return 
e-mail.

From: Serge Fonville [mailto:serge.fonvi...@gmail.com]
Sent: Friday, July 19, 2013 11:13 AM
To: Alan Loos
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP and Powershell

How have you determined that invoke-command requires -computername?

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table

2013/7/19 Alan Loos mailto:alan.l...@genco.com>>
Thank you for your response Serge!
  The computer name  is for the invoke-command, ComputerName has to be 
specified to tell the computer where the command is to be routed. Since I want 
this to run locally over PHP I figured that it would be a good way to avoid 
running a script as I have read online that when it can be avoided it's a good 
practice (I also couldn't get this to work properly... :) But that is a side 
note). The piece that outputs the extra RunSpaceID and the PSComputerName is 
the $_.Status portion of everything.

If someone knows how to cut it out that would be fine but really I just need to 
pull the Target Name and the Value from result. For the attached example it 
would be $IQNTarget = iqn.2013-04.com.widget:Target1 and $Value = NotConnected 
(Which there are two options for this which is Connected or NotConnected).

To use Select Object here would I do Select-Object $Value?

Alan Loos

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you are not an intended recipient, you are hereby 
notified that any disclosure, copying, distribution or use of this e-mail 
and/or the accompanying attachment(s) is strictly prohibited. If you have 
received this e-mail in error, please immediately notify the sender by return 
e-mail.

From: Serge Fonville 
[mailto:serge.fonvi...@gmail.com<mailto:serge.fonvi...@gmail.com>]
Sent: Friday, July 19, 2013 3:05 AM
To: Alan Loos
Cc: php-general@lists.php.net<mailto:php-general@lists.php.net>
Subject: Re: [PHP] PHP and Powershell

Hi,

Although this is more powershell related than PHP...

When Powershell returns an object, you can pipe the output through 
Select-Object to get only certain object properties.

To better answer your question:
First, why do you specify ComputerName as 127.0.0.1 if the credential is 
already specified?
Also, perhaps it is easier to create a .ps1 file that you run, especially for 
readability.

HTH

Wh

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table

2013/7/18 Alan Loos mailto:alan.l...@genco.com>>
Good morning everyone,
  First time posting in here, although I've been listening in for a few weeks 
now.
So this one has got me stumped, I am fairly new to PHP but I cannot seem to 
Google through this one.
I cannot figure out how to 'exclude' PSComputerName and RunspaceId,

Re: [PHP] PHP and Powershell

2013-07-19 Thread Serge Fonville
How have you determined that invoke-command requires -computername?

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table


2013/7/19 Alan Loos 

>  Thank you for your response Serge!
>
>   The computer name  is for the invoke-command, ComputerName has to be
> specified to tell the computer where the command is to be routed. Since I
> want this to run locally over PHP I figured that it would be a good way to
> avoid running a script as I have read online that when it can be avoided
> it’s a good practice (I also couldn’t get this to work properly… J But
> that is a side note). The piece that outputs the extra RunSpaceID and the
> PSComputerName is the $_.Status portion of everything.
>
> ** **
>
> If someone knows how to cut it out that would be fine but really I just
> need to pull the Target Name and the Value from result. For the attached
> example it would be $IQNTarget = iqn.2013-04.com.widget:Target1 and $Value
> = NotConnected (Which there are two options for this which is Connected or
> NotConnected).
>
> ** **
>
> To use Select Object here would I do Select-Object $Value?
>
> ** **
>
> *Alan Loos* | *Flash Anywhere Project*
>
> T 925-640-2977 | alan.l...@genco.com
>
> ** **
>
> CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any)
> contain confidential information that is privileged and intended only for
> the addressee(s) hereof. If you are not an intended recipient, you are
> hereby notified that any disclosure, copying, distribution or use of this
> e-mail and/or the accompanying attachment(s) is strictly prohibited. If you
> have received this e-mail in error, please immediately notify the sender by
> return e-mail.
>
> ** **
>
> *From:* Serge Fonville [mailto:serge.fonvi...@gmail.com]
> *Sent:* Friday, July 19, 2013 3:05 AM
> *To:* Alan Loos
> *Cc:* php-general@lists.php.net
> *Subject:* Re: [PHP] PHP and Powershell
>
> ** **
>
> Hi,
>
> Although this is more powershell related than PHP...
>
> When Powershell returns an object, you can pipe the output through
> Select-Object to get only certain object properties.
>
> To better answer your question:
> First, why do you specify ComputerName as 127.0.0.1 if the credential is
> already specified?
> Also, perhaps it is easier to create a .ps1 file that you run, especially
> for readability.
>
> HTH
>
> Wh
>
> 
>
> Kind regards/met vriendelijke groet,
>
> ** **
>
> Serge Fonville
>
> ** **
>
> http://www.sergefonville.nl
>
> Convince Microsoft!
>
> They need to add TRUNCATE PARTITION in SQL Server
>
>
> https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table
> 
>
> ** **
>
> 2013/7/18 Alan Loos 
>
> Good morning everyone,
>   First time posting in here, although I've been listening in for a few
> weeks now.
> So this one has got me stumped, I am fairly new to PHP but I cannot seem
> to Google through this one.
> I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which
> is ultimately what I'm struggling with. Please see below for script snips
> and explanations.
>
> Also if there are any best practices you would recommend I'm open to it
> being that I am fairly new and self-taught to PHP scripting.
>
>
> I have a bit of code I've put together (as ugly as it is) as follows in
> line:
> 
>
> ###
> ## Variables ##
> ###
>
> $TargetName = "Target1";
> $login = "\$cred = New-Object System.Management.Automation.PSCredential
> -ArgumentList @('administra...@widget.com',(ConvertTo-SecureString
> -String 'MyPassword' -AsPlainText -Force))";
> $command = "Invoke-Command -computername 127.0.0.1 -credential \$cred
> -scriptblock {& Get-IscsiServerTarget -TargetName " . $TargetName . " | % {
> \$_.TargetIqn, \$_.Status}} -SessionOption (New-PSSessionOption
> -SkipCACheck -SkipCNCheck -SkipRevocationCheck)";
> $psCMD = "powershell -ExecutionPolicy Unrestricted -command \"$login;
> $command\" 
>
> 
> ## Variable Checking (For Debug Mode) ##
> 
>
> #echo "\$psCMD = $psCMD";
>
>
> 
> ## Run Script ##
> 
>
> exec($psCMD,$out);
>
>
> 
> ## Output

RE: [PHP] PHP and Powershell

2013-07-19 Thread Alan Loos
Thank you for your response Serge!
  The computer name  is for the invoke-command, ComputerName has to be 
specified to tell the computer where the command is to be routed. Since I want 
this to run locally over PHP I figured that it would be a good way to avoid 
running a script as I have read online that when it can be avoided it's a good 
practice (I also couldn't get this to work properly... :) But that is a side 
note). The piece that outputs the extra RunSpaceID and the PSComputerName is 
the $_.Status portion of everything.

If someone knows how to cut it out that would be fine but really I just need to 
pull the Target Name and the Value from result. For the attached example it 
would be $IQNTarget = iqn.2013-04.com.widget:Target1 and $Value = NotConnected 
(Which there are two options for this which is Connected or NotConnected).

To use Select Object here would I do Select-Object $Value?

Alan Loos | Flash Anywhere Project
T 925-640-2977 | alan.l...@genco.com<mailto:alan.l...@genco.com>

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you are not an intended recipient, you are hereby 
notified that any disclosure, copying, distribution or use of this e-mail 
and/or the accompanying attachment(s) is strictly prohibited. If you have 
received this e-mail in error, please immediately notify the sender by return 
e-mail.

From: Serge Fonville [mailto:serge.fonvi...@gmail.com]
Sent: Friday, July 19, 2013 3:05 AM
To: Alan Loos
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP and Powershell

Hi,

Although this is more powershell related than PHP...

When Powershell returns an object, you can pipe the output through 
Select-Object to get only certain object properties.

To better answer your question:
First, why do you specify ComputerName as 127.0.0.1 if the credential is 
already specified?
Also, perhaps it is easier to create a .ps1 file that you run, especially for 
readability.

HTH

Wh

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table

2013/7/18 Alan Loos mailto:alan.l...@genco.com>>
Good morning everyone,
  First time posting in here, although I've been listening in for a few weeks 
now.
So this one has got me stumped, I am fairly new to PHP but I cannot seem to 
Google through this one.
I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which is 
ultimately what I'm struggling with. Please see below for script snips and 
explanations.

Also if there are any best practices you would recommend I'm open to it being 
that I am fairly new and self-taught to PHP scripting.


I have a bit of code I've put together (as ugly as it is) as follows in line:
mailto:administra...@widget.com>',(ConvertTo-SecureString
 -String 'MyPassword' -AsPlainText -Force))";
$command = "Invoke-Command -computername 127.0.0.1 -credential \$cred 
-scriptblock {& Get-IscsiServerTarget -TargetName " . $TargetName . " | % { 
\$_.TargetIqn, \$_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck 
-SkipCNCheck -SkipRevocationCheck)";
$psCMD = "powershell -ExecutionPolicy Unrestricted -command \"$login; 
$command\" ');
print_r($out);
echo ('');


###
## End Of Script ##
###

echo "End Of Scene";

?>

The issue I have is that it feeds back:

Array
(
[0] => iqn.2013-04.com.widget:Target1
[1] =>
[2] => PSComputerName RunspaceId Value
[3] => -- -- -
[4] => 127.0.0.1  52fb8b1b-8d8b-4eec-9419... NotConnected
[5] =>
[6] =>
)

End Of Scene

What I should see so I can then turn it into variables is what I run when I run 
the command straight through the local Powershell command prompt which would 
return:
PS C:\Users\administrator.WIDGET.000> Get-IscsiServerTarget | % { $_.TargetIqn, 
$_.Status}
iqn.2013-04.com.widget:Target1
NotConnected
iqn.2013-04.com.widget:Target2
NotConnected
iqn.2013-04.com.widget:Target3
NotConnected
iqn.2013-04.com.widget:Target4
Connected
iqn.2013-04.com.widget:Target5
NotConnected
iqn.2013-04.com.widget:Target6
NotConnected

I cannot figure out how to 'exclude' PSComputerName and RunspaceId

Sorry in advance for the wordy explanation.

Cheers!

Alan


Please make note of my new email address: 
alan.l...@genco.com<mailto:alan.l...@genco.com>.

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you 

Re: [PHP] PHP and Powershell

2013-07-19 Thread Serge Fonville
Hi,

Although this is more powershell related than PHP...

When Powershell returns an object, you can pipe the output through
Select-Object to get only certain object properties.

To better answer your question:
First, why do you specify ComputerName as 127.0.0.1 if the credential is
already specified?
Also, perhaps it is easier to create a .ps1 file that you run, especially
for readability.

HTH

Wh

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table


2013/7/18 Alan Loos 

> Good morning everyone,
>   First time posting in here, although I've been listening in for a few
> weeks now.
> So this one has got me stumped, I am fairly new to PHP but I cannot seem
> to Google through this one.
> I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which
> is ultimately what I'm struggling with. Please see below for script snips
> and explanations.
>
> Also if there are any best practices you would recommend I'm open to it
> being that I am fairly new and self-taught to PHP scripting.
>
>
> I have a bit of code I've put together (as ugly as it is) as follows in
> line:
> 
>
> ###
> ## Variables ##
> ###
>
> $TargetName = "Target1";
> $login = "\$cred = New-Object System.Management.Automation.PSCredential
> -ArgumentList @('administra...@widget.com',(ConvertTo-SecureString
> -String 'MyPassword' -AsPlainText -Force))";
> $command = "Invoke-Command -computername 127.0.0.1 -credential \$cred
> -scriptblock {& Get-IscsiServerTarget -TargetName " . $TargetName . " | % {
> \$_.TargetIqn, \$_.Status}} -SessionOption (New-PSSessionOption
> -SkipCACheck -SkipCNCheck -SkipRevocationCheck)";
> $psCMD = "powershell -ExecutionPolicy Unrestricted -command \"$login;
> $command\" 
>
> 
> ## Variable Checking (For Debug Mode) ##
> 
>
> #echo "\$psCMD = $psCMD";
>
>
> 
> ## Run Script ##
> 
>
> exec($psCMD,$out);
>
>
> 
> ## Output ##
> 
>
> echo ('');
> print_r($out);
> echo ('');
>
>
> ###
> ## End Of Script ##
> ###
>
> echo "End Of Scene";
>
> ?>
>
> The issue I have is that it feeds back:
>
> Array
> (
> [0] => iqn.2013-04.com.widget:Target1
> [1] =>
> [2] => PSComputerName RunspaceId Value
> [3] => -- -- -
> [4] => 127.0.0.1  52fb8b1b-8d8b-4eec-9419...
> NotConnected
> [5] =>
> [6] =>
> )
>
> End Of Scene
>
> What I should see so I can then turn it into variables is what I run when
> I run the command straight through the local Powershell command prompt
> which would return:
> PS C:\Users\administrator.WIDGET.000> Get-IscsiServerTarget | % {
> $_.TargetIqn, $_.Status}
> iqn.2013-04.com.widget:Target1
> NotConnected
> iqn.2013-04.com.widget:Target2
> NotConnected
> iqn.2013-04.com.widget:Target3
> NotConnected
> iqn.2013-04.com.widget:Target4
> Connected
> iqn.2013-04.com.widget:Target5
> NotConnected
> iqn.2013-04.com.widget:Target6
> NotConnected
>
> I cannot figure out how to 'exclude' PSComputerName and RunspaceId
>
> Sorry in advance for the wordy explanation.
>
> Cheers!
>
> Alan
>
>
> Please make note of my new email address: alan.l...@genco.com.
>
> CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any)
> contain confidential information that is privileged and intended only for
> the addressee(s) hereof. If you are not an intended recipient, you are
> hereby notified that any disclosure, copying, distribution or use of this
> e-mail and/or the accompanying attachment(s) is strictly prohibited. If you
> have received this e-mail in error, please immediately notify the sender by
> return e-mail.
>


[PHP] PHP and Powershell

2013-07-18 Thread Alan Loos
Good morning everyone,
  First time posting in here, although I've been listening in for a few weeks 
now.
So this one has got me stumped, I am fairly new to PHP but I cannot seem to 
Google through this one.
I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which is 
ultimately what I'm struggling with. Please see below for script snips and 
explanations.

Also if there are any best practices you would recommend I'm open to it being 
that I am fairly new and self-taught to PHP scripting.


I have a bit of code I've put together (as ugly as it is) as follows in line:
');
print_r($out);
echo ('');


###
## End Of Script ##
###

echo "End Of Scene";

?>

The issue I have is that it feeds back:

Array
(
[0] => iqn.2013-04.com.widget:Target1
[1] =>
[2] => PSComputerName RunspaceId Value
[3] => -- -- -
[4] => 127.0.0.1  52fb8b1b-8d8b-4eec-9419... NotConnected
[5] =>
[6] =>
)

End Of Scene

What I should see so I can then turn it into variables is what I run when I run 
the command straight through the local Powershell command prompt which would 
return:
PS C:\Users\administrator.WIDGET.000> Get-IscsiServerTarget | % { $_.TargetIqn, 
$_.Status}
iqn.2013-04.com.widget:Target1
NotConnected
iqn.2013-04.com.widget:Target2
NotConnected
iqn.2013-04.com.widget:Target3
NotConnected
iqn.2013-04.com.widget:Target4
Connected
iqn.2013-04.com.widget:Target5
NotConnected
iqn.2013-04.com.widget:Target6
NotConnected

I cannot figure out how to 'exclude' PSComputerName and RunspaceId

Sorry in advance for the wordy explanation.

Cheers!

Alan


Please make note of my new email address: alan.l...@genco.com.

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you are not an intended recipient, you are hereby 
notified that any disclosure, copying, distribution or use of this e-mail 
and/or the accompanying attachment(s) is strictly prohibited. If you have 
received this e-mail in error, please immediately notify the sender by return 
e-mail.


[PHP] Re: Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-15 Thread David Robley
dealTek wrote:

> 
> Thanks for all the help folks,
> 
> 
> PHP-light-PDO-Class
> 
> ok well I found this...
> 
> https://github.com/poplax/PHP-light-PDO-Class
> 
> But it does not seem to recognize the port - I put the port as 8889 but
> keeps saying can't connect port 3306
> 
> Warning: PDO::__construct() [pdo.--construct]: [2002] Connection refused
> (trying to connect via tcp://127.0.0.1:3306) in
> /Users/revdave/Sites/php-fool/pdo3/PHP-light-PDO-Class-
master/class.lpdo.php
> on line 33 Connection failed: SQLSTATE[HY000] [2002] Connection refused
> 
> BTW: I tried to add the port a few places but it didn't work..
> 
> 
> How do we fix this?
> 
> 
> 
> -- config.php
> 
>  $config = array();
> $config['Database'] = array();
> $config['Database']['dbtype'] = 'mysql';
> $config['Database']['dbname'] = 'tester';
> $config['Database']['host'] = '127.0.0.1';
> $config['Database']['port'] = 8889;
> $config['Database']['username'] = 'root';
> $config['Database']['password'] = 'root';
> $config['Database']['charset'] = 'utf8';
> ?>

Change host to localhost - your mysql may be configured not to accept 
requests via tcp.

> 
> ===  class.lpdo.php

> 
> 
> --
> Thanks,
> Dave - DealTek
> deal...@gmail.com
> [db-3]

-- 
Cheers
David Robley

My karma ran over my dogma


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



[PHP] Re: Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-15 Thread dealTek

Thanks for all the help folks,


PHP-light-PDO-Class

ok well I found this...

https://github.com/poplax/PHP-light-PDO-Class

But it does not seem to recognize the port - I put the port as 8889 but keeps 
saying can't connect port 3306

Warning: PDO::__construct() [pdo.--construct]: [2002] Connection refused 
(trying to connect via tcp://127.0.0.1:3306) in 
/Users/revdave/Sites/php-fool/pdo3/PHP-light-PDO-Class-master/class.lpdo.php on 
line 33
Connection failed: SQLSTATE[HY000] [2002] Connection refused

BTW: I tried to add the port a few places but it didn't work..


How do we fix this?



-- config.php



===  class.lpdo.php


options = $options;
$dsn = $this->createdsn($options);
$attrs = empty($options['charset']) ? 
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES " . $this->charset) : 
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES " . $options['charset']);
try
{
parent::__construct($dsn, $options['username'], 
$options['password'], $attrs);
}
catch (PDOException $e)
{
echo 'Connection failed: ' . $e->getMessage();
}
}

/**
 * 
 * @Function : createdsn;
 * @Param  $ : $options Array;
 * @Return String ;
 */
private function createdsn($options)
{
return $options['dbtype'] . ':host=' . $options['host'] . 
';dbname=' . $options['dbname'];
}

/**
 * 
 * @Function : get_fields;
 * @Param  $ : $data Array;
 * @Return String ;
 */
private function get_fields($data)
{
$fields = array();
if (is_int(key($data)))
{
$fields = implode(',', $data);
}
else if (!empty($data))
{
$fields = implode(',', array_keys($data));
}
else
{
$fields = '*';
}
return $fields;
}

/**
 * 
 * @Function : get_condition;
 * @Param  $ : $condition Array, $oper String, $logc String;
 * @Return String ;
 */
private function get_condition($condition, $oper = '=', $logc = 'AND')
{
$cdts = '';
if (empty($condition))
{
return $cdts = '';
}
else if (is_array($condition))
{
$_cdta = array();
foreach($condition as $k => $v)
{
if (!is_array($v))
{
if (strtolower($oper) == 'like')
{
$v = '\'%' . $v . '%\'';
}
else if (is_string($v))
{
$v = '\'' . $v . '\'';
}
$_cdta[] = ' ' . $k . ' ' . $oper . ' ' 
. $v . ' ' ;
}
else if (is_array($v))
{
$_cdta[] = $this->split_condition($k, 
$v);
}
}
$cdts .= implode($logc, $_cdta);
}
return $cdts;
}

/**
 * 
 * @Function : split_condition;
 * @Param  $ : $field String, $cdt Array;
 * @Return String ;
 */
private function split_condition($field, $cdt)
{
$cdts = array();
$oper = empty($cdt[1]) ? '=' : $cdt[1];
$logc = empty($cdt[2]) ? 'AND' : $cdt[2];
if (!is_array($cdt[0]))
{
$cdt[0] = is_string($cdt[0]) ? "'$cdt[0]'" : $cdt[0];
}
else if (is_array($cdt[0]) || strtoupper(trim($cdt[1])) == 'IN')
{
$cdt[0] = '(' . implode(',', $cdt[0]) . ')';
}

$cdta[] = " $field $oper {$cdt[0]} ";
if (!empty($cdt[3]))
{
$cdta[] = $this->get_condition($cdt[3]);
}
$cdts = ' ( ' . implode($logc, $cdta) . ' ) ';
return $cdts;
}

/**
 * 
 * @Function : get_fields_datas;
 * @Param  $ : $data Array;
 * @Return Array ;
 */
private function get_fields_datas($data)

Re: [PHP] Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-15 Thread dealTek

On Feb 14, 2013, at 11:46 AM, Bastien Koert  wrote:

> 
> 
> The DreamInCode one is good. MySQLi is the recommended option over
> MySQL since the mysql one is deprecated. PDO is also a great option
> since you can prepare your queries to help sanitize the data
> 
> -- 
> 
> Bastien



Thanks Bastien,

I imagine this is what you were referring to?

http://www.dreamincode.net/forums/topic/54239-introduction-to-mysqli-and-prepared-statements/

--
Thanks,
Dave - DealTek
deal...@gmail.com
[db-3]



Re: [PHP] Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-14 Thread Bastien Koert
On Thu, Feb 14, 2013 at 1:24 PM, Haluk Karamete  wrote:
> I recommend a third option, that is PDO.
>
> Start here please. http://net.tutsplus.com/?s=pdo
>
> On Thu, Feb 14, 2013 at 9:49 AM, dealTek  wrote:
>> Hi everybody,
>>
>> Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class 
>> (using CRUD)
>>
>> Simple story: creating this class database by myself is way over my head. So 
>> it be best for me to find something on the Internet that has already been 
>> created and working to pro specs (using CRUD with good security etc).
>>
>> In my studying, it seems that there is a difference between MySQL and MySQLi 
>> - MySQLi  being the preferred choice if I understand correctly.
>>
>> There are lots of examples on the Internet however I don't know enough about 
>> it to know a good starting example from a bad starting example, so I would 
>> much appreciate any assistance pointing me towards a good starting point
>>
>> This seems a good start to me untrained eye, but it seems to be for mysql - 
>> not mysqli...
>>
>> http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/
>>
>> http://www.dreamincode.net/forums/topic/223360-connect-to-your-database-using-oop-php5-with-mysql-and-mysqli/
>>
>> http://snipplr.com/view/8417/
>>
>> http://snipplr.com/view/12535/
>>
>> any assistance is appreciated!
>>
>> --
>> Thanks,
>> Dave - DealTek
>> deal...@gmail.com
>> [db-3]
>>
>>
>> --
>> 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
>

The DreamInCode one is good. MySQLi is the recommended option over
MySQL since the mysql one is deprecated. PDO is also a great option
since you can prepare your queries to help sanitize the data

-- 

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] Re: Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-14 Thread Haluk Karamete
Also worth checking http://justinvincent.com/ezsql
Which is the class behind the WordPress' wpdb class.

This is a great read too ->
http://www.devarticles.com/c/a/MySQL/PHP-and-Databases-for-the-Lazy-Sod/

On Thu, Feb 14, 2013 at 10:30 AM, dealTek  wrote:
>
>
> On Feb 14, 2013, at 9:49 AM, dealTek  wrote:
>
>> Hi everybody,
>>
>> Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class 
>> (using CRUD)
>>
>> Simple story: creating this class database by myself is way over my head. So 
>> it be best for me to find something on the Internet that has already been 
>> created and working to pro specs (using CRUD with good security etc).
>>
>> In my studying, it seems that there is a difference between MySQL and MySQLi 
>> - MySQLi  being the preferred choice if I understand correctly.
>>
>> There are lots of examples on the Internet however I don't know enough about 
>> it to know a good starting example from a bad starting example, so I would 
>> much appreciate any assistance pointing me towards a good starting point
>>
>> This seems a good start to me untrained eye, but it seems to be for mysql - 
>> not mysqli...
>>
>> http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/
>>
>> http://www.dreamincode.net/forums/topic/223360-connect-to-your-database-using-oop-php5-with-mysql-and-mysqli/
>>
>> http://snipplr.com/view/8417/
>>
>> http://snipplr.com/view/12535/
>>
>> any assistance is appreciated!
>
>
>
> An Here Jeffry Way discusses the PDO API
>
> http://net.tutsplus.com/tutorials/php/php-database-access-are-you-doing-it-correctly/
>
>
>
>
>
>
>>
>> --
>> Thanks,
>> Dave - DealTek
>> deal...@gmail.com
>> [db-3]
>>
>
>
> --
> Thanks,
> Dave - DealTek
> deal...@gmail.com
> [db-3]
>
>
> --
> 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] Re: Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-14 Thread dealTek


On Feb 14, 2013, at 9:49 AM, dealTek  wrote:

> Hi everybody,
> 
> Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class 
> (using CRUD)
> 
> Simple story: creating this class database by myself is way over my head. So 
> it be best for me to find something on the Internet that has already been 
> created and working to pro specs (using CRUD with good security etc).
> 
> In my studying, it seems that there is a difference between MySQL and MySQLi 
> - MySQLi  being the preferred choice if I understand correctly.
> 
> There are lots of examples on the Internet however I don't know enough about 
> it to know a good starting example from a bad starting example, so I would 
> much appreciate any assistance pointing me towards a good starting point
> 
> This seems a good start to me untrained eye, but it seems to be for mysql - 
> not mysqli...
> 
> http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/
> 
> http://www.dreamincode.net/forums/topic/223360-connect-to-your-database-using-oop-php5-with-mysql-and-mysqli/
> 
> http://snipplr.com/view/8417/
> 
> http://snipplr.com/view/12535/
> 
> any assistance is appreciated!



An Here Jeffry Way discusses the PDO API

http://net.tutsplus.com/tutorials/php/php-database-access-are-you-doing-it-correctly/






> 
> --
> Thanks,
> Dave - DealTek
> deal...@gmail.com
> [db-3]
> 


--
Thanks,
Dave - DealTek
deal...@gmail.com
[db-3]


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



Re: [PHP] Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-14 Thread Haluk Karamete
I recommend a third option, that is PDO.

Start here please. http://net.tutsplus.com/?s=pdo

On Thu, Feb 14, 2013 at 9:49 AM, dealTek  wrote:
> Hi everybody,
>
> Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class 
> (using CRUD)
>
> Simple story: creating this class database by myself is way over my head. So 
> it be best for me to find something on the Internet that has already been 
> created and working to pro specs (using CRUD with good security etc).
>
> In my studying, it seems that there is a difference between MySQL and MySQLi 
> - MySQLi  being the preferred choice if I understand correctly.
>
> There are lots of examples on the Internet however I don't know enough about 
> it to know a good starting example from a bad starting example, so I would 
> much appreciate any assistance pointing me towards a good starting point
>
> This seems a good start to me untrained eye, but it seems to be for mysql - 
> not mysqli...
>
> http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/
>
> http://www.dreamincode.net/forums/topic/223360-connect-to-your-database-using-oop-php5-with-mysql-and-mysqli/
>
> http://snipplr.com/view/8417/
>
> http://snipplr.com/view/12535/
>
> any assistance is appreciated!
>
> --
> Thanks,
> Dave - DealTek
> deal...@gmail.com
> [db-3]
>
>
> --
> 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] Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-14 Thread dealTek
Hi everybody,

Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class 
(using CRUD)

Simple story: creating this class database by myself is way over my head. So it 
be best for me to find something on the Internet that has already been created 
and working to pro specs (using CRUD with good security etc).

In my studying, it seems that there is a difference between MySQL and MySQLi - 
MySQLi  being the preferred choice if I understand correctly.

There are lots of examples on the Internet however I don't know enough about it 
to know a good starting example from a bad starting example, so I would much 
appreciate any assistance pointing me towards a good starting point

This seems a good start to me untrained eye, but it seems to be for mysql - not 
mysqli...

http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/

http://www.dreamincode.net/forums/topic/223360-connect-to-your-database-using-oop-php5-with-mysql-and-mysqli/

http://snipplr.com/view/8417/

http://snipplr.com/view/12535/

any assistance is appreciated!

--
Thanks,
Dave - DealTek
deal...@gmail.com
[db-3]


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



Re: [PHP] Using named Pipes between PHP and ZIP

2012-07-09 Thread Matijn Woudt
On Mon, Jul 9, 2012 at 7:19 PM, Dennis Heck  wrote:
>
> Unfortunately it makes no difference if i use zip with 2 - or if I leave
> them ommited. The longer I guess about it, the more I think it might be a
> ZIP topic, namely how the stream to stdin needs to be like so zip will know
> the name of the file from it.
>
>
> Regards,
> Dennis

This is a known problem with zip, it's just not possible. Either you
select files, or you pass something on stdin (which will have no
filename). You will have to do the same trick with mkfifo, but you can
use the php function posix_mkfifo[1] for that.

- Matijn

[1] php.net/posix_mkfifo

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



Re: [PHP] Using named Pipes between PHP and ZIP

2012-07-09 Thread Dennis Heck


Unfortunately it makes no difference if i use zip with 2 - or if I leave 
them ommited. The longer I guess about it, the more I think it might be a 
ZIP topic, namely how the stream to stdin needs to be like so zip will know 
the name of the file from it.


Regards,
Dennis 



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



Re: [PHP] Using named Pipes between PHP and ZIP

2012-07-08 Thread tamouse mailing lists
≈On Sun, Jul 8, 2012 at 11:30 AM, Dennis Heck  wrote:
> Hello everyone,
>
> I'm looking for a solution for the following:
> 1) collecting data from a simple html form and send them to a php script
> 2) take the data and place them in a php-generated excel sheet
> 3) zip the excel sheet and password protect the zip file (standard
> encription will be sufficent, no AES needed)
> 4) send the zip file as an email attachment
> This kind of output is fixed, changing the output is not an option.
>
> I'm ok with building the excel sheet and sending the mail, but I'm still
> trying and error with the zip. Since I need password protection in the zip,
> I cannot use the php build in zip extension. I guess I will need to call ZIP
> on the shell. I'm aware I could first save the generated excel sheet to the
> filesystem and afterwards call the zip process on the file, putting the zip
> file also to the file system. But I wonder if there's an option to stream
> the data till they finally can be put to the multipart mail - without saving
> anything to the filesystem.
>
> Here is my first try, just a little modification of the example on proc_open
> in the php docu. To keep the test simple, I load a sample xls from the
> filesystem instead of generating from the php class and output it directly
> to the browser. The script works well except one point: the file contained
> in the zip will have no name an no file extension.
>
>header ('Content-type: application/zip');
>header ('Content-Disposition: attachment; filename="download.zip"');
>
>$descriptorspec = array(
>0 => array("pipe", "r"),
>   1 => array("pipe", "w"),
>   2 => array("file", "error-output.txt", "a")
>);
>
>$dateiname = 'xyz.xls';
>$file = fread(fopen($dateiname, "r"), filesize($dateiname));
>
>$process = proc_open('zip -P 1234', $descriptorspec, $pipes);
>
>if (is_resource($process)) {
>
>fwrite($pipes[0], $file);
>fclose($pipes[0]);
>
>$zip = stream_get_contents($pipes[1]);
>fclose($pipes[1]);
>
>$return_value = proc_close($process);
>}
>
>echo $zip;
>?>
>
> So I look for an option to get the name and extension in the zipfile. Here I
> found named pipes as an option. Calling via shell, tested with a textfile in
> order to use less
>
>mkfifo xyz.txt
>less readme.txt > xyz.txt & zip output.zip -FI xyz.txt -P 1234
>rm xyz.txt
>
> Now I get a pw protected zip file containing xyz.txt. Now how can I combine
> both? How can I tell php to use the named pipe instead of stdin in
> proc_open? Or any other idea to get the file in the zip the correct name and
> extension.
>
> Thanks in advance,
> Regards,
> Dennis
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

I *think* all you need in the first paramter to proc_open is :

zip -P password - -

The first - is the zip file -- which will be send to stdout.
The second - is the input -- which you should pipe your spreadsheet into.

Good luck!

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



[PHP] Using named Pipes between PHP and ZIP

2012-07-08 Thread Dennis Heck

Hello everyone,

I'm looking for a solution for the following:
1) collecting data from a simple html form and send them to a php script
2) take the data and place them in a php-generated excel sheet
3) zip the excel sheet and password protect the zip file (standard 
encription will be sufficent, no AES needed)

4) send the zip file as an email attachment
This kind of output is fixed, changing the output is not an option.

I'm ok with building the excel sheet and sending the mail, but I'm still 
trying and error with the zip. Since I need password protection in the zip, 
I cannot use the php build in zip extension. I guess I will need to call ZIP 
on the shell. I'm aware I could first save the generated excel sheet to the 
filesystem and afterwards call the zip process on the file, putting the zip 
file also to the file system. But I wonder if there's an option to stream 
the data till they finally can be put to the multipart mail - without saving 
anything to the filesystem.


Here is my first try, just a little modification of the example on proc_open 
in the php docu. To keep the test simple, I load a sample xls from the 
filesystem instead of generating from the php class and output it directly 
to the browser. The script works well except one point: the file contained 
in the zip will have no name an no file extension.


array("pipe", "r"),
  1 => array("pipe", "w"),
  2 => array("file", "error-output.txt", "a")
   );

   $dateiname = 'xyz.xls';
   $file = fread(fopen($dateiname, "r"), filesize($dateiname));

   $process = proc_open('zip -P 1234', $descriptorspec, $pipes);

   if (is_resource($process)) {

   fwrite($pipes[0], $file);
   fclose($pipes[0]);

   $zip = stream_get_contents($pipes[1]);
   fclose($pipes[1]);

   $return_value = proc_close($process);
   }

   echo $zip;
   ?>

So I look for an option to get the name and extension in the zipfile. Here I 
found named pipes as an option. Calling via shell, tested with a textfile in 
order to use less


   mkfifo xyz.txt
   less readme.txt > xyz.txt & zip output.zip -FI xyz.txt -P 1234
   rm xyz.txt

Now I get a pw protected zip file containing xyz.txt. Now how can I combine 
both? How can I tell php to use the named pipe instead of stdin in 
proc_open? Or any other idea to get the file in the zip the correct name and 
extension.


Thanks in advance,
Regards,
Dennis



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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-23 Thread ma...@behnke.biz


rene7705  hat am 23. Mai 2012 um 14:55 geschrieben:

> And please explain what you mean by "no log is loaded". No graph? No
> $hits under "structure" tab, no $errors under same tab?

As I wrote the mail to the list no tab had anything to display.
Now it's working. No idea what changed.

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-23 Thread ma...@behnke.biz


rene7705  hat am 23. Mai 2012 um 14:46 geschrieben:

> you're right, and i'm putting it on the top of my todo list.
>
> i take it you were referring to project_hd_root, or anything else as
well?

Yes.


Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-23 Thread rene7705
On Wed, May 23, 2012 at 2:17 PM, ma...@behnke.biz  wrote:
>
>
> rene7705  hat am 23. Mai 2012 um 13:51 geschrieben:
>
>> I think I'll leave it untouched for a few days
>> (http://mediabeez.ws/stats/ and
>
>
> 404 on
> http://mediabeez.ws/stats/code/libraries_rv/rajmvServiceLog-1.0.0/ajax_makeLogEntry.php?rajmvServiceLog_initialID=212.48.107.10__1337775183&project_hd_root=/var/chroot/home/content/69/8082269/html/sites/mediabeez.ws/stats/
>
> Seen in firebug. No log is loaded.

That 404 is also on my todo list, and will get fixed together with
removal of project_hd_root from html or js output.

And please explain what you mean by "no log is loaded". No graph? No
$hits under "structure" tab, no $errors under same tab?

This morning I fixed an error in the tabs component that was causing
the entire app to fail sometimes. But you saw it after that update
probably..

>
> I know that you are not into optimizing bandwidth, but over 4 MB of image
> data is a killer.

It's entirely un-optimized at the moment, but I'll replace the tab
page buttons with 70k instead of 2.5mb worth of art soon.. Easier than
eating pie ;)

>
> Could you seperate you log api code from jquery? Currently it is delivered
> in one file. Makes it hard to read.

I thought putting many scripts in 1 call was the right thing to do.
But you can also call
.../get_rajmv_javascript.php?want=animatedJavascriptWidgets and
.../get_rajmv_javascript.php?want=rajmvServiceLog to get the log api
js code in a seperate file.
Or, you can just search for "rajmv.serviceLog =" in the
get_rajmv_javascript.php call that I use on the demos now.

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-23 Thread ma...@behnke.biz


rene7705  hat am 23. Mai 2012 um 13:51 geschrieben:

> I think I'll leave it untouched for a few days
> (http://mediabeez.ws/stats/ and


404 on
http://mediabeez.ws/stats/code/libraries_rv/rajmvServiceLog-1.0.0/ajax_makeLogEntry.php?rajmvServiceLog_initialID=212.48.107.10__1337775183&project_hd_root=/var/chroot/home/content/69/8082269/html/sites/mediabeez.ws/stats/

Seen in firebug. No log is loaded.

I know that you are not into optimizing bandwidth, but over 4 MB of image
data is a killer.

Could you seperate you log api code from jquery? Currently it is delivered
in one file. Makes it hard to read.

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-23 Thread rene7705
On Wed, May 23, 2012 at 10:17 AM, rene7705  wrote:
> On Wed, May 23, 2012 at 10:09 AM, ma...@behnke.biz  wrote:
>>
>>> my windowze dev box is completely frozen at startup now, before even
>>> mounting the drive that had the slow write rate today. booted into
>>> ubuntu which is still responsive, and ran disk utility to see that
>>> smart status and self-check for both system drive and the other drive
>>> that i noticed going slow today, is "good".
>>> I wonder what's gotten my dev box ill.. Hope it aint a virus, but
>>> can't start the virus scanner coz the thing is frozen... :S
>>
>>
>> I guess that is the reason why your dev system is slow ;)
>>
> Well it's very strange. My system unfroze itself yesterday night, the
> drive in question can copy a 100mb file at regular speedy speeds with
> windows explorer, but writing 45mb of html to a file using (thousands
> of) fwrite() calls takes about 10 minutes (bit slow to say the least).
> The same fwrite()ing code on my hosted server, with nearly as much
> html to write out, works comfortably fast as well.
>
> I'm very puzzled. Would appreciate any tips to test my home system further..

Forwarded to wampserver forums;
http://forum.wampserver.com/read.php?2,84673,84673#msg-84673
Could have been the wampserver going haywire somehow yesterday... not
a virus, coz virusses don't generally stop messing with you once
they've started to, hehe.

Anyways, I'd like to return to the point of my OP, which is to get
some end-user feature requests for my analytics code.

I think I'll leave it untouched for a few days
(http://mediabeez.ws/stats/ and
http://skatescene.biz/sites/mediabeez.ws/stats) to give ya'll a chance
to view it without me introducing errors during more dev of my own.

I've kinda run out of ideas, besides ofcourse serving slightly
different stats and graphs for non-developer viewers, and the error
details only to developers. That one's obvious.

And another obvious one, I also think that plugging in location
software by http://www.maxmind.com/app/geolitecity will be a good
idea, altho I'd probably opt to work with their data in a sql table
rather than the faster php mod that they offer, coz we can't use that
from shared hosting (I think, plz correct me if I'm wrong).

But maybe you can throw me some not so obvious ones to include in this
free analytics software ;)

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-23 Thread rene7705
On Wed, May 23, 2012 at 10:09 AM, ma...@behnke.biz  wrote:
>
>> my windowze dev box is completely frozen at startup now, before even
>> mounting the drive that had the slow write rate today. booted into
>> ubuntu which is still responsive, and ran disk utility to see that
>> smart status and self-check for both system drive and the other drive
>> that i noticed going slow today, is "good".
>> I wonder what's gotten my dev box ill.. Hope it aint a virus, but
>> can't start the virus scanner coz the thing is frozen... :S
>
>
> I guess that is the reason why your dev system is slow ;)
>
Well it's very strange. My system unfroze itself yesterday night, the
drive in question can copy a 100mb file at regular speedy speeds with
windows explorer, but writing 45mb of html to a file using (thousands
of) fwrite() calls takes about 10 minutes (bit slow to say the least).
The same fwrite()ing code on my hosted server, with nearly as much
html to write out, works comfortably fast as well.

I'm very puzzled. Would appreciate any tips to test my home system further..

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-23 Thread ma...@behnke.biz

> my windowze dev box is completely frozen at startup now, before even
> mounting the drive that had the slow write rate today. booted into
> ubuntu which is still responsive, and ran disk utility to see that
> smart status and self-check for both system drive and the other drive
> that i noticed going slow today, is "good".
> I wonder what's gotten my dev box ill.. Hope it aint a virus, but
> can't start the virus scanner coz the thing is frozen... :S


I guess that is the reason why your dev system is slow ;)

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-22 Thread rene7705
On Tue, May 22, 2012 at 3:31 PM, ma...@behnke.biz  wrote:
>
>
> rene7705  hat am 22. Mai 2012 um 15:23 geschrieben:
>
>> Seems to be the writing of the html+json data to a file that's causing
>> the delay on my dev server.
>>
>> Doing the totals calculation on my dev server for 3500 records takes
>> about 2.5 seconds, with the old code.
>> Will soon see how long it takes with the refactored code of today.
>>
>> Anyone got a clue about why a few ten thousand calls to fwrite() will
>> slow down a wampserver so much?...
>
> Maybe the hdd is not caching properly and is constantly writing and
> re-arranging the data?
> Is your hdd a bit to much fragmented?
>

my windowze dev box is completely frozen at startup now, before even
mounting the drive that had the slow write rate today. booted into
ubuntu which is still responsive, and ran disk utility to see that
smart status and self-check for both system drive and the other drive
that i noticed going slow today, is "good".
I wonder what's gotten my dev box ill.. Hope it aint a virus, but
can't start the virus scanner coz the thing is frozen... :S


> Just 2 guesses.
>
>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
> Marco Behnke
> Dipl. Informatiker (FH), SAE Audio Engineer Diploma
> Zend Certified Engineer PHP 5.3
>
> Tel.: 0174 / 9722336
> e-Mail: ma...@behnke.biz
>
> Softwaretechnik Behnke
> Heinrich-Heine-Str. 7D
> 21218 Seevetal
>
> http://www.behnke.biz
>
> --
> 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] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-22 Thread ma...@behnke.biz


rene7705  hat am 22. Mai 2012 um 15:23 geschrieben:

> Seems to be the writing of the html+json data to a file that's causing
> the delay on my dev server.
>
> Doing the totals calculation on my dev server for 3500 records takes
> about 2.5 seconds, with the old code.
> Will soon see how long it takes with the refactored code of today.
>
> Anyone got a clue about why a few ten thousand calls to fwrite() will
> slow down a wampserver so much?...

Maybe the hdd is not caching properly and is constantly writing and
re-arranging the data?
Is your hdd a bit to much fragmented?

Just 2 guesses.


>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-22 Thread rene7705
On Tue, May 22, 2012 at 2:54 PM, rene7705  wrote:
> On Tue, May 22, 2012 at 12:32 PM, rene7705  wrote:
>> On Tue, May 22, 2012 at 2:32 AM, tamouse mailing lists
>>  wrote:
>>> On Mon, May 21, 2012 at 7:31 AM, rene7705  wrote:
 On Mon, May 21, 2012 at 1:17 PM, Simon Schick
  wrote:
> Specially the function rajmvServiceLog_graphs_raphael_calculateData() 
> with a
> code of ca. 280 lines is quite long ...

 280 lines is long?! :)
>>>
>>> In general, yes. 280 lines is long. Too long, likely. Usually it
>>> indicates you aren't designing your code in a top-down fashion, and it
>>> is a high candidate for refactoring in order to break out into
>>> reusable functions. A rule of thumb is no more than 50 lines per
>>> function, most much less. Back in the day when we didn't have nifty
>>> gui screens and an 24 line terminals (yay green on black!), if a
>>> function exceeded one printed page, it was deemed too long and marked
>>> for refactoring.
>>
>> Well, I split up that long function into several new functions (using
>> pass-by-reference) this morning..
>> Problem is, now it won't work anymore due to memory consumption errors! :(
>>
>> I'd love to know what I'm doing wrong here.
>>
>> Demo at http://skatescene.biz/sites/mediabeez.ws/stats
>> Code is attached to this mail.
>
> hmm, this might actually be an issue with my dev webserver... it's
> taking 400mb of memory and over 10 minutes to process just 3500
> records.
> My live hosting does 2200 records in 64M of memory and significantly less 
> time..
>
> I'll keep digging.

Seems to be the writing of the html+json data to a file that's causing
the delay on my dev server.

Doing the totals calculation on my dev server for 3500 records takes
about 2.5 seconds, with the old code.
Will soon see how long it takes with the refactored code of today.

Anyone got a clue about why a few ten thousand calls to fwrite() will
slow down a wampserver so much?...

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-22 Thread rene7705
On Tue, May 22, 2012 at 12:32 PM, rene7705  wrote:
> On Tue, May 22, 2012 at 2:32 AM, tamouse mailing lists
>  wrote:
>> On Mon, May 21, 2012 at 7:31 AM, rene7705  wrote:
>>> On Mon, May 21, 2012 at 1:17 PM, Simon Schick
>>>  wrote:
 Specially the function rajmvServiceLog_graphs_raphael_calculateData() with 
 a
 code of ca. 280 lines is quite long ...
>>>
>>> 280 lines is long?! :)
>>
>> In general, yes. 280 lines is long. Too long, likely. Usually it
>> indicates you aren't designing your code in a top-down fashion, and it
>> is a high candidate for refactoring in order to break out into
>> reusable functions. A rule of thumb is no more than 50 lines per
>> function, most much less. Back in the day when we didn't have nifty
>> gui screens and an 24 line terminals (yay green on black!), if a
>> function exceeded one printed page, it was deemed too long and marked
>> for refactoring.
>
> Well, I split up that long function into several new functions (using
> pass-by-reference) this morning..
> Problem is, now it won't work anymore due to memory consumption errors! :(
>
> I'd love to know what I'm doing wrong here.
>
> Demo at http://skatescene.biz/sites/mediabeez.ws/stats
> Code is attached to this mail.

hmm, this might actually be an issue with my dev webserver... it's
taking 400mb of memory and over 10 minutes to process just 3500
records.
My live hosting does 2200 records in 64M of memory and significantly less time..

I'll keep digging.

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-22 Thread rene7705
On Mon, May 21, 2012 at 4:40 PM, Matijn Woudt  wrote:
> On Mon, May 21, 2012 at 2:31 PM, rene7705  wrote:
>> On Mon, May 21, 2012 at 1:17 PM, Simon Schick
>>  wrote:
>>> Hi, Rene
>>>
>>> I took a quick look over your code ...
>>>
>>> I kind-of like the idea having all logging at one place, but the code is a
>>> bit too messy if you ask me :)
>>> If you would have put it on github and I would fork it - the first thing I'd
>>> do is trying to get rid of the hm-lib and rewriting all in a bit more
>>> object-oriented style, but that's just personal taste ;)
>>> Specially the function rajmvServiceLog_graphs_raphael_calculateData() with a
>>> code of ca. 280 lines is quite long ...
>>
>> 280 lines is long?! :)
>
> I haven't had a good look at your code yet, but let me comment on this
> one anyway.
> 280 lines is long. Take any big project, Linux kernel
> (http://lxr.linux.no/linux), Wine (http://source.winehq.org), or an
> large PHP project, for example Drupal, and you'll probably only find a
> few functions that long.
>
>>
>>> Additionally I think that setting an error-handler who's just returning
>>> false is not a good way. Why not disable error-handling or write code that
>>> produces no errors?
>>
>> returning false in an error handler means "do the default error handler 
>> plz"..
>
> Why are you setting the error handler then? Are you trying to override
> an error handler set by other scripts?
>
Yea, I have an error catcher component
(http://mediabeez.ws/products/logAndHandler) that's used by all my
code by default, that was misbehaving during development of this
analytics code, so I bypassed it for now.

>>
>>>
>>> I think it would be good to mention that you're using the library adodb
>>> (http://adodb.sourceforge.net/) and sitewide_rv (is it
>>> that? http://mediabeez.ws/) or am I guessing wrong?
>>>
>>> You're talking about a sql-file ... has my anti-virus-program removed
>>> something here?
>>
>> Could have, I did include it as an attachment in my OP.
>
> The mailing list probably removed it. You should never send
> attachments to a mailing list, instead host them somewhere on the web
> and link to it.

I think there's a 2 attachments limit per mail sent to this list.

>
>>
>>>
>>> Please don't see that as destructive critic, but as hints what I would do if
>>> I get to do with this code.
>>
>> I don't think your words are destructive criticism ;)
>>
>>>
>>> Bye
>>> Simon
>>
>> Yes, this rajmvServiceLog is tied into other components of mine that
>> I've opensourced at http://mediabeez.ws
>> And I agree it's not perfect yet by any standard..
>>
>> hm.php is used for it's memory-efficient json encoding routines, to
>> write out the results without building up a large text string with
>> json_encode().
>>
>> I'm not inclined to make the PHP code object oriented at this time,
>> but once released I would allow anyone to OOP it.
>> I will OOP the javascripts though.
>
> Note that OOP is not always the best way to go. Haven't taken a close
> look at the source so can't comment.

I agree. Some OOP adds unnecessary complexity to code..
Other OOP is sweet :)

>
>>
>> I also don't think I'm going to host my opensourced code (including
>> this analytics code) on github, I put out a .zip on
>> http://mediabeez.ws instead, but you can still fork as far as I'm
>> concerned. I often develop new code that updates older components in
>> the package, and maintaining forks on github seems like a bit of a
>> headache to me.. But I'll gladly incorporate improvements made by
>> others back into my own code base, with credits of course.
>>
>
> Putting it on github makes it easier for people to have a look at your
> code before deciding on using it or not. If you're only putting it
> there, you don't have to worry about forks because they don't have
> anything to do with your repo, that's up to the people who fork it.
> Putting it on github will increase the popularity, and will probably
> also make developers want to 'upgrade'  your code. It's up to you.

Ok, I'll start putting it on github starting with the next release
then (may be a few weeks)..

>
> A few other comments:
> - Maybe you should think about another name? rajmv.. is not easy to remember.

It's my initials, I don't want to change it, and for the js rajmv.*
components you can do var easierName = rajmv;

> - You're formatting is confusing, for example function names. They
> start with lowerCamelCase, and then you go on underscore_formatting..

Yea, that's my coding style and I don't want to change it, sorry.


> - in json_encode_*, there's probably a better way to write
> if (
> $c == ' ' ||
> $c == '"' ||
> $c == "'" ||
> 
> you could use in_array with a predefined array for example.

> - Why do you have atleast 4 large encode functions? If you really need
> 4 different, then you might want to think about moving shared code to
> sub functions and call them instead of duplicating so much code
> (especially the large if statements look ugly being duplicated

Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-22 Thread rene7705
On Tue, May 22, 2012 at 2:32 AM, tamouse mailing lists
 wrote:
> On Mon, May 21, 2012 at 7:31 AM, rene7705  wrote:
>> On Mon, May 21, 2012 at 1:17 PM, Simon Schick
>>  wrote:
>>> Specially the function rajmvServiceLog_graphs_raphael_calculateData() with a
>>> code of ca. 280 lines is quite long ...
>>
>> 280 lines is long?! :)
>
> In general, yes. 280 lines is long. Too long, likely. Usually it
> indicates you aren't designing your code in a top-down fashion, and it
> is a high candidate for refactoring in order to break out into
> reusable functions. A rule of thumb is no more than 50 lines per
> function, most much less. Back in the day when we didn't have nifty
> gui screens and an 24 line terminals (yay green on black!), if a
> function exceeded one printed page, it was deemed too long and marked
> for refactoring.

Well, I split up that long function into several new functions (using
pass-by-reference) this morning..
Problem is, now it won't work anymore due to memory consumption errors! :(

I'd love to know what I'm doing wrong here.

Demo at http://skatescene.biz/sites/mediabeez.ws/stats
Code is attached to this mail.
<>
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-21 Thread tamouse mailing lists
On Mon, May 21, 2012 at 7:31 AM, rene7705  wrote:
> On Mon, May 21, 2012 at 1:17 PM, Simon Schick
>  wrote:
>> Specially the function rajmvServiceLog_graphs_raphael_calculateData() with a
>> code of ca. 280 lines is quite long ...
>
> 280 lines is long?! :)

In general, yes. 280 lines is long. Too long, likely. Usually it
indicates you aren't designing your code in a top-down fashion, and it
is a high candidate for refactoring in order to break out into
reusable functions. A rule of thumb is no more than 50 lines per
function, most much less. Back in the day when we didn't have nifty
gui screens and an 24 line terminals (yay green on black!), if a
function exceeded one printed page, it was deemed too long and marked
for refactoring.

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-21 Thread rene7705
I see that the sql file didn't come through to the web archive of this
list, so I'm posting it in-message here once more, for those
interested;

drop table if exists rajmvServiceLog;
create table rajmvServiceLog (
id integer not null AUTO_INCREMENT,
initial_id varchar(250),
php_remote_addr varchar(20),
php_time integer,
php_referrer longtext,
php_request_method varchar(10),
php_script_filename longtext,
php_script_name longtext,
php_self longtext,
php_request_uri longtext,
php_query_string longtext,
php_get_vars longtext,
php_post_vars longtext,
php_cookie_vars longtext,
php_http_host longtext,
php_http_connection varchar(250),
php_http_user_agent longtext,
php_http_accept varchar(250),
php_http_accept_encoding varchar(250),
php_http_accept_language varchar(250),
php_http_cache_control varchar(250),
php_http_accept_charset varchar(250),
php_server_name varchar(250),
php_server_addr varchar(20),
php_server_port varchar(10),
php_server_software varchar(250),

php_context_json longtext,
php_error_json longtext,

js_location_href longtext,
js_location_hash longtext,
js_time integer,
js_milliseconds_since_init_of_page integer,
js_date_time_txt varchar(250),
js_referrer longtext,
js_screen_width integer,
js_screen_height integer,
js_browser_width integer,
js_browser_height integer,
js_error_message longtext,
js_error_url longtext,
js_error_line integer,
primary key (id)
);

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-21 Thread Matijn Woudt
On Mon, May 21, 2012 at 2:31 PM, rene7705  wrote:
> On Mon, May 21, 2012 at 1:17 PM, Simon Schick
>  wrote:
>> Hi, Rene
>>
>> I took a quick look over your code ...
>>
>> I kind-of like the idea having all logging at one place, but the code is a
>> bit too messy if you ask me :)
>> If you would have put it on github and I would fork it - the first thing I'd
>> do is trying to get rid of the hm-lib and rewriting all in a bit more
>> object-oriented style, but that's just personal taste ;)
>> Specially the function rajmvServiceLog_graphs_raphael_calculateData() with a
>> code of ca. 280 lines is quite long ...
>
> 280 lines is long?! :)

I haven't had a good look at your code yet, but let me comment on this
one anyway.
280 lines is long. Take any big project, Linux kernel
(http://lxr.linux.no/linux), Wine (http://source.winehq.org), or an
large PHP project, for example Drupal, and you'll probably only find a
few functions that long.

>
>> Additionally I think that setting an error-handler who's just returning
>> false is not a good way. Why not disable error-handling or write code that
>> produces no errors?
>
> returning false in an error handler means "do the default error handler plz"..

Why are you setting the error handler then? Are you trying to override
an error handler set by other scripts?

>
>>
>> I think it would be good to mention that you're using the library adodb
>> (http://adodb.sourceforge.net/) and sitewide_rv (is it
>> that? http://mediabeez.ws/) or am I guessing wrong?
>>
>> You're talking about a sql-file ... has my anti-virus-program removed
>> something here?
>
> Could have, I did include it as an attachment in my OP.

The mailing list probably removed it. You should never send
attachments to a mailing list, instead host them somewhere on the web
and link to it.

>
>>
>> Please don't see that as destructive critic, but as hints what I would do if
>> I get to do with this code.
>
> I don't think your words are destructive criticism ;)
>
>>
>> Bye
>> Simon
>
> Yes, this rajmvServiceLog is tied into other components of mine that
> I've opensourced at http://mediabeez.ws
> And I agree it's not perfect yet by any standard..
>
> hm.php is used for it's memory-efficient json encoding routines, to
> write out the results without building up a large text string with
> json_encode().
>
> I'm not inclined to make the PHP code object oriented at this time,
> but once released I would allow anyone to OOP it.
> I will OOP the javascripts though.

Note that OOP is not always the best way to go. Haven't taken a close
look at the source so can't comment.

>
> I also don't think I'm going to host my opensourced code (including
> this analytics code) on github, I put out a .zip on
> http://mediabeez.ws instead, but you can still fork as far as I'm
> concerned. I often develop new code that updates older components in
> the package, and maintaining forks on github seems like a bit of a
> headache to me.. But I'll gladly incorporate improvements made by
> others back into my own code base, with credits of course.
>

Putting it on github makes it easier for people to have a look at your
code before deciding on using it or not. If you're only putting it
there, you don't have to worry about forks because they don't have
anything to do with your repo, that's up to the people who fork it.
Putting it on github will increase the popularity, and will probably
also make developers want to 'upgrade'  your code. It's up to you.

A few other comments:
- Maybe you should think about another name? rajmv.. is not easy to remember.
- You're formatting is confusing, for example function names. They
start with lowerCamelCase, and then you go on underscore_formatting..
- in json_encode_*, there's probably a better way to write
if (
$c == ' ' ||
$c == '"' ||
$c == "'" ||

you could use in_array with a predefined array for example.
- Why do you have atleast 4 large encode functions? If you really need
4 different, then you might want to think about moving shared code to
sub functions and call them instead of duplicating so much code
(especially the large if statements look ugly being duplicated 4
times)
- If you want people to comment on code, please be so kind to remove
any unused commented code.

Hope this helps,

Matijn

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



Re: [PHP] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-21 Thread rene7705
On Mon, May 21, 2012 at 1:17 PM, Simon Schick
 wrote:
> Hi, Rene
>
> I took a quick look over your code ...
>
> I kind-of like the idea having all logging at one place, but the code is a
> bit too messy if you ask me :)
> If you would have put it on github and I would fork it - the first thing I'd
> do is trying to get rid of the hm-lib and rewriting all in a bit more
> object-oriented style, but that's just personal taste ;)
> Specially the function rajmvServiceLog_graphs_raphael_calculateData() with a
> code of ca. 280 lines is quite long ...

280 lines is long?! :)

> Additionally I think that setting an error-handler who's just returning
> false is not a good way. Why not disable error-handling or write code that
> produces no errors?

returning false in an error handler means "do the default error handler plz"..

>
> I think it would be good to mention that you're using the library adodb
> (http://adodb.sourceforge.net/) and sitewide_rv (is it
> that? http://mediabeez.ws/) or am I guessing wrong?
>
> You're talking about a sql-file ... has my anti-virus-program removed
> something here?

Could have, I did include it as an attachment in my OP.

>
> Please don't see that as destructive critic, but as hints what I would do if
> I get to do with this code.

I don't think your words are destructive criticism ;)

>
> Bye
> Simon

Yes, this rajmvServiceLog is tied into other components of mine that
I've opensourced at http://mediabeez.ws
And I agree it's not perfect yet by any standard..

hm.php is used for it's memory-efficient json encoding routines, to
write out the results without building up a large text string with
json_encode().

I'm not inclined to make the PHP code object oriented at this time,
but once released I would allow anyone to OOP it.
I will OOP the javascripts though.

I also don't think I'm going to host my opensourced code (including
this analytics code) on github, I put out a .zip on
http://mediabeez.ws instead, but you can still fork as far as I'm
concerned. I often develop new code that updates older components in
the package, and maintaining forks on github seems like a bit of a
headache to me.. But I'll gladly incorporate improvements made by
others back into my own code base, with credits of course.





>
> On Mon, May 21, 2012 at 12:46 PM, rene7705  wrote:
>>
>> Hi.
>>
>> I wasn't happy with the fact that Google Analytics doesn't record many
>> of the hits on my sites, so I decided to roll my own analytics
>> software, and opensource it.
>> It's now in a state where I can request early comments.
>> You can view a demo at http://mediabeez.ws/stats (under construction,
>> may fail at times) (browser compatibility may be an issue, I built it
>> with chrome, should work in firefox too, but won't (ever) in IE.)
>> If you click on the graph while the details for a given day are
>> visible, you will see the errors for that day in a DIV below the
>> graph.
>>
>> Normally you'd hide the error details and $hits for anyone's who's not
>> registred as a developer, of course. I've turned it on for all at the
>> moment, so you can comment on that feature and review my results array
>> $hits.
>>
>> I've opted, for simplicity of design, to store all settings I thought
>> could be remotely interesting in a mysql db (see attached sql init
>> file) (which is filled from PHP every time a page is delivered, and
>> again from JS when the page has initialized fully, or does a HTML5
>> History API location.href change), and then use PHP to retrieve all
>> rows for a given datetime-range, and do the totals calculations in a
>> php loop.
>> I'm only keeping 1 row from the db in memory at any given time, but
>> I'm building up a large deep array with the totals information in the
>> php loop that goes over the rows.
>> I'm wondering if this is a good approach, though. Maybe I should let
>> the totals be calculated by the mysql server instead.
>>
>> I was thinking to let the totals calculations stay in php, and be
>> executed from a cron job every hour. Only for the current month would
>> you need to re-calculate every hour.
>> I haven't figured out yet how to for instance only re-calculate the
>> last hour, store results per hour, and then calculate the day and
>> month totals from that "hourly cache" data when needed.
>> I don't have a clue about how big companies do their totals
>> calculations (for sites that get way more hits than mine, which is
>> something i'd like to be able to support with my own analytics code),
>> and would like to know how big companies do this.
>>
>> I've included the relevant draft code as attachment files to this
>> mail, for your review. Please let me know if I have forgotten to
>> include relevant code..
>>
>> As always, thanks for your time,
>>  Rene
>>
>> --
>> 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] requesting comments on rajmvServiceLog (access + error logging through PHP and JS to MySQL)

2012-05-21 Thread Simon Schick
Hi, Rene

I took a quick look over your code ...

I kind-of like the idea having all logging at one place, but the code is a
bit too messy if you ask me :)
If you would have put it on github and I would fork it - the first thing
I'd do is trying to get rid of the hm-lib and rewriting all in a bit more
object-oriented style, but that's just personal taste ;)
Specially the function rajmvServiceLog_graphs_raphael_calculateData() with
a code of ca. 280 lines is quite long ...
Additionally I think that setting an error-handler who's just returning
false is not a good way. Why not disable error-handling or write code that
produces no errors?

I think it would be good to mention that you're using the library adodb (
http://adodb.sourceforge.net/) and sitewide_rv (is it that?
http://mediabeez.ws/) or am I guessing wrong?

You're talking about a sql-file ... has my anti-virus-program removed
something here?

Please don't see that as destructive critic, but as hints what I would do
if I get to do with this code.

Bye
Simon

On Mon, May 21, 2012 at 12:46 PM, rene7705  wrote:

> Hi.
>
> I wasn't happy with the fact that Google Analytics doesn't record many
> of the hits on my sites, so I decided to roll my own analytics
> software, and opensource it.
> It's now in a state where I can request early comments.
> You can view a demo at http://mediabeez.ws/stats (under construction,
> may fail at times) (browser compatibility may be an issue, I built it
> with chrome, should work in firefox too, but won't (ever) in IE.)
> If you click on the graph while the details for a given day are
> visible, you will see the errors for that day in a DIV below the
> graph.
>
> Normally you'd hide the error details and $hits for anyone's who's not
> registred as a developer, of course. I've turned it on for all at the
> moment, so you can comment on that feature and review my results array
> $hits.
>
> I've opted, for simplicity of design, to store all settings I thought
> could be remotely interesting in a mysql db (see attached sql init
> file) (which is filled from PHP every time a page is delivered, and
> again from JS when the page has initialized fully, or does a HTML5
> History API location.href change), and then use PHP to retrieve all
> rows for a given datetime-range, and do the totals calculations in a
> php loop.
> I'm only keeping 1 row from the db in memory at any given time, but
> I'm building up a large deep array with the totals information in the
> php loop that goes over the rows.
> I'm wondering if this is a good approach, though. Maybe I should let
> the totals be calculated by the mysql server instead.
>
> I was thinking to let the totals calculations stay in php, and be
> executed from a cron job every hour. Only for the current month would
> you need to re-calculate every hour.
> I haven't figured out yet how to for instance only re-calculate the
> last hour, store results per hour, and then calculate the day and
> month totals from that "hourly cache" data when needed.
> I don't have a clue about how big companies do their totals
> calculations (for sites that get way more hits than mine, which is
> something i'd like to be able to support with my own analytics code),
> and would like to know how big companies do this.
>
> I've included the relevant draft code as attachment files to this
> mail, for your review. Please let me know if I have forgotten to
> include relevant code..
>
> As always, thanks for your time,
>  Rene
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


[PHP] PHP and webmaster tools

2011-11-02 Thread Rick Dwyer

Hello list.

I am looking for someone who knows PHP and has extensive
experience with webmaster tools.

I have a series of crawl errors I need resolved but cannot find the
bad URL's anywhere on the site.

Please contact me off list.

Thanks,

 --Rick



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



Re: [PHP] PHP and Windows 7 g6-bit (Solved)

2011-06-15 Thread Byron Como

On 6/15/2011 1:59 PM, Tim Thorburn wrote:

On 6/15/2011 11:37 AM, Byron Como wrote:

Does the precompiled windows binary work on win 7 64?

It does, however if you're using Apache as your webserver, for PHP 
5.3+ you won't be able to use the binaries from apache.org for 
Windows.  There is a link to Apache Lounge found here: 
http://windows.php.net/download/ which instructs you to download a VC9 
compiled version of Apache.


If you're using IIS, I think you can just download the version of PHP 
you're after and go.



The documentation on this page:

http://windows.php.net/download/

... is wrong/out of date and should be corrected. If I am mistaken I 
humbly apologize.


Sincerly,
Byron Como

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



Re: [PHP] PHP and Windows 7 g6-bit

2011-06-15 Thread Tim Thorburn

On 6/15/2011 11:37 AM, Byron Como wrote:

Does the precompiled windows binary work on win 7 64?

It does, however if you're using Apache as your webserver, for PHP 5.3+ 
you won't be able to use the binaries from apache.org for Windows.  
There is a link to Apache Lounge found here: 
http://windows.php.net/download/ which instructs you to download a VC9 
compiled version of Apache.


If you're using IIS, I think you can just download the version of PHP 
you're after and go.


[PHP] PHP and Windows 7 64-bit

2011-06-15 Thread Byron Como

Does the precompiled windows binary work on win 7 64?

I downloaded the apache installer, works with no problems.
I got the php5 VC6 x86 Thread Safe version. It says "x86" so I'm 
guessing that's the problem. I can't find a current 64-bit version.


Error message:

Faulting application name: httpd.exe, version: 2.2.19.0, time stamp: 
0x4dd6eda8

Faulting module name: php5ts.dll, version: 5.2.17.17, time stamp: 0x4d25fb49
Exception code: 0xc005
Fault offset: 0x000f424c
Faulting process id: 0xa7c
Faulting application start time: 0x01cc2b64b44cc59e
Faulting application path: C:\server\Apache2.2\bin\httpd.exe
Faulting module path: C:\server\PHP\php5ts.dll
Report Id: f2e941ea-9757-11e0-a2f1-005056c8

--
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] PHP and Windows 7 g6-bit

2011-06-15 Thread Byron Como

Does the precompiled windows binary work on win 7 64?

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



Re: [PHP] How to check if remote machines are running using PHP and Eclipse-Require Urgent Help

2011-04-02 Thread tedd

At 3:10 PM -0400 4/2/11, Bastien wrote:

On 2011-04-02, at 12:21 PM, tedd  wrote:


 At 11:30 PM +0100 4/1/11, Stuart Dallas wrote:
 Also, give your boss a slap. Why is he specifying what editor you 
use to write a PHP script? I really don't understand most 
management types!


 -Stuart



 Management rises to their level of competence++.

 Cheers,

 tedd

 --
 ---
 http://sperling.com/

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



Tedd,

I usually find that it's one level above their competence.

Bastien Koert
Sent from my iPhone


That's what the ++ meant.

Cheers,

tedd
--
---
http://sperling.com/

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



Re: [PHP] How to check if remote machines are running using PHP and Eclipse-Require Urgent Help

2011-04-02 Thread Bastien


On 2011-04-02, at 12:21 PM, tedd  wrote:

> At 11:30 PM +0100 4/1/11, Stuart Dallas wrote:
>> Also, give your boss a slap. Why is he specifying what editor you use to 
>> write a PHP script? I really don't understand most management types!
>> 
>> -Stuart
> 
> 
> Management rises to their level of competence++.
> 
> Cheers,
> 
> tedd
> 
> -- 
> ---
> http://sperling.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Tedd,

I usually find that it's one level above their competence. 

Bastien Koert
Sent from my iPhone
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to check if remote machines are running using PHP and Eclipse-Require Urgent Help

2011-04-02 Thread tedd

At 11:30 PM +0100 4/1/11, Stuart Dallas wrote:
Also, give your boss a slap. Why is he specifying what editor you 
use to write a PHP script? I really don't understand most management 
types!


-Stuart



Management rises to their level of competence++.

Cheers,

tedd

--
---
http://sperling.com/

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



Re: [PHP] How to check if remote machines are running using PHP and Eclipse-Require Urgent Help

2011-04-01 Thread Stuart Dallas
On Friday, 1 April 2011 at 17:07, Santosh gunat wrote:
Hi,
> 
> I am in a big problem,
> 
> My manager gave a task,
> He want a PHP scrip which will check if the remote machines are Powered on
> and are running.
> He want this to be done using eclipse.
> 
> He also want a log in a HTML or text file that which remote machine is
> running and which remote machine is down/powered off for each machine
> 
> Can you help me.
> 
> If there is another way ,to check automatically that will also be fine.But
> we want a automatic script checking and saving logs for the same.

Sounds like you want a service such as http://pingdom.com/ or one of the 
hundreds of other services out there that do this. IMO writing your own script 
to do this is a waste of resources.

Also, give your boss a slap. Why is he specifying what editor you use to write 
a PHP script? I really don't understand most management types!

-Stuart

-- 
Stuart Dallas
3ft9 Ltd

http://3ft9.com/




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



Re: [PHP] How to check if remote machines are running using PHP and Eclipse-Require Urgent Help

2011-04-01 Thread Jim Giner
your boss is asking you to write something in PHP, but it sounds to me like 
you are not very knowledgable in it, or even in creating a text file.  Why 
is he doing this? 



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



Re: [PHP] How to check if remote machines are running using PHP and Eclipse-Require Urgent Help

2011-04-01 Thread Louis Huppenbauer
You could just periodically ping those remote machines with a
system()-call, and then write the result to a file.

2011/4/1 Santosh gunat :
> Hi,
>
> I am in a big problem,
>
> My manager gave a task,
> He want a PHP scrip which will check if the remote machines are Powered on
> and are running.
> He want this to be done using eclipse.
>
> He also want a log in a HTML or text file that which remote machine is
> running and which remote machine is down/powered off for each machine
>
> Can you help me.
>
> If there is another way ,to check automatically that will also be fine.But
> we want a automatic script checking and saving logs for the same.
>
> Thanks in advance ,
>
> Santosh Gunat
>

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



[PHP] How to check if remote machines are running using PHP and Eclipse-Require Urgent Help

2011-04-01 Thread Santosh gunat
Hi,

I am in a big problem,

My manager gave a task,
He want a PHP scrip which will check if the remote machines are Powered on
and are running.
He want this to be done using eclipse.

He also want a log in a HTML or text file that which remote machine is
running and which remote machine is down/powered off for each machine

Can you help me.

If there is another way ,to check automatically that will also be fine.But
we want a automatic script checking and saving logs for the same.

Thanks in advance ,

Santosh Gunat


[PHP] Re: [Semi-OT] Request for help: Squirrelmail, PHP and RTL-Languages

2011-03-16 Thread Michelle Konzack
Again...

Here is a screenshoot (squirrelmail 1.4.21 from Debian/Squeeze): 

http://vserver04.tamay-dogan.net/squirrelmail/20110316221617_squirrelmail_prersian_error.jpg

which is set to Persian interface and even Firefox is  set  to  prefered
Language fa_IR and it does not work here (in 1.5.x persia is shown)

Also there are problems in the From: and latin text should  not  aligned
right, exspecialy if the entired mail is in latin characters

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsystems@tdnet France EURL   itsystems@tdnet UG (limited liability)
Owner Michelle KonzackOwner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France   77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

  
 

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: [PHP] [Semi-OT] Request for help: Squirrelmail, PHP and RTL-Languages

2011-03-16 Thread Michelle Konzack
Shalom Dotan,

thanks for your VERY fast answer.

Am 2011-03-16 22:39:43, hacktest Du folgendes herunter:
> What exactly is the problem? I have an associate using SquirrelMail in
> Hebrew, it even has a Hebrew interface. Are you getting directional
> display issues? Gibberish?

The locale on my workstation  is  set  to  de_DE.UTF8  and  the  default
charset in squirrelmail utf-8.

I can set the interface of squirrelmail to hebrew, farsi or  arabic  and
it is working RTL.

But if I have E-Mails from Al-Djasira, Jerusalem Post or Kaleme (I am on
there news lists), all text is aligned LEFT and not right.

Also it is not possibel to write E-Mails (Subject + Body) in RTL.

So what is needed, is to  get  the  Mail-View  corrected  and  then  the
"New Mail" input form.

And then, I need a solution if text is a mix of RTL and LTR.

Currently I am using the Squirelmail Version 1.4.21 from Debian/Squeeze
but I can update to any higher versions (>1.5) since it s my own server

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsystems@tdnet France EURL   itsystems@tdnet UG (limited liability)
Owner Michelle KonzackOwner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France   77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

  
 

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: [PHP] [Semi-OT] Request for help: Squirrelmail, PHP and RTL-Languages

2011-03-16 Thread Dotan Cohen
On Wed, Mar 16, 2011 at 21:59, Michelle Konzack
 wrote:
> Hello,
>
> I am wotking in an environent where it is required to  support  LTR  and
> RTL languages at once. My own website support this but with squirrelmail
> there is a problem.
>
> Is there an Iranien, Israelian or Arabic Programmer which can  help  out
> to get RTL support in the Squirrelmail interface including the New  Mail
> form?
>
> Thanks, Greetings and nice Day/Evening
>    Michelle Konzack
>

What exactly is the problem? I have an associate using SquirrelMail in
Hebrew, it even has a Hebrew interface. Are you getting directional
display issues? Gibberish?


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

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



[PHP] [Semi-OT] Request for help: Squirrelmail, PHP and RTL-Languages

2011-03-16 Thread Michelle Konzack
Hello,

I am wotking in an environent where it is required to  support  LTR  and
RTL languages at once. My own website support this but with squirrelmail
there is a problem.

Is there an Iranien, Israelian or Arabic Programmer which can  help  out
to get RTL support in the Squirrelmail interface including the New  Mail
form?

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsystems@tdnet France EURL   itsystems@tdnet UG (limited liability)
Owner Michelle KonzackOwner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France   77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

  
 

Jabber linux4miche...@jabber.ccc.de

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: [PHP] PHP and HBCI?

2010-10-08 Thread Per Jessen
Stephan Ebelt wrote:

> 
> common is probably XML via HTTPS transport (at least my bank seems to
> do it that way). I have no C code whatsoever.
> 
> Can PHP call arbitrary C functions? Then it might be possible to use
> AqHBCI/AqBanking somehow?

You (or someone) would need to write a PHP wrapper for the C functions,
but otherwise yes.



-- 
Per Jessen, Zürich (17.9°C)


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



Re: [PHP] PHP and HBCI?

2010-10-08 Thread Stephan Ebelt

common is probably XML via HTTPS transport (at least my bank seems to do it
that way). I have no C code whatsoever.

Can PHP call arbitrary C functions? Then it might be possible to use
AqHBCI/AqBanking somehow?

On Fri, Oct 08, 2010 at 03:39:04PM +0200, Sebastian Detert wrote:
> Do you have any specifications for HBCI interfaces? Socket connection,  
> XML Exchange, DB Access ? If you have C code for such things, it should  
> be possible to convert this to php code maybe
>
> Stephan Ebelt schrieb:
>> On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote:
>>   
>>> How do you mean? Did you want to process payments? Or wad it more of an
>>> actual banking thing you needed? I've not heard of hbci before, so can't
>>> offer much information back.
>>> 
>>
>> HBCI is the german Home Banking Computer Interface which is supported by most
>> banks over here. There are free implementations such as the one used in 
>> gnucash
>> and some other projects: http://www.aquamaniac.de/sites/aqbanking/index.php
>> (sorry, site is german but code is english). I could not find a way to use
>> something like that from PHP code, only C and Java so far.
>>
>> My goal for now would be to access bank account statements in order to show 
>> the
>> balances. I am not too eager to issue transactions.
>>
>> thanks,
>> stephan
>>
>>
>>
>>   
>>> Thanks,
>>> Ash
>>> http://www.ashleysheridan.co.uk
>>>
>>> - Reply message -
>>> From: "Stephan Ebelt" 
>>> Date: Fri, Oct 8, 2010 13:37
>>> Subject: [PHP] PHP and HBCI?
>>> To: "PHP" 
>>>
>>>
>>> Hello,
>>>
>>> is there a way to do HBCI banking with PHP?
>>>
>>> stephan
>>>
>>>
>>> -- 
>>> 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] PHP and HBCI?

2010-10-08 Thread Sebastian Detert
Do you have any specifications for HBCI interfaces? Socket connection, 
XML Exchange, DB Access ? If you have C code for such things, it should 
be possible to convert this to php code maybe


Stephan Ebelt schrieb:

On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote:
  

How do you mean? Did you want to process payments? Or wad it more of an
actual banking thing you needed? I've not heard of hbci before, so can't
offer much information back.



HBCI is the german Home Banking Computer Interface which is supported by most
banks over here. There are free implementations such as the one used in gnucash
and some other projects: http://www.aquamaniac.de/sites/aqbanking/index.php
(sorry, site is german but code is english). I could not find a way to use
something like that from PHP code, only C and Java so far.

My goal for now would be to access bank account statements in order to show the
balances. I am not too eager to issue transactions.

thanks,
stephan



  

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

- Reply message -
From: "Stephan Ebelt" 
Date: Fri, Oct 8, 2010 13:37
Subject: [PHP] PHP and HBCI?
To: "PHP" 


Hello,

is there a way to do HBCI banking with PHP?

stephan


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




  




Re: [PHP] PHP and HBCI?

2010-10-08 Thread Stephan Ebelt

wikipedia has a good summary: http://en.wikipedia.org/wiki/HBCI#FinTS_4.0

I just learned that its called "FinTS" now. Looking for that didnt bring me
closer yet.

stephan

On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote:
> How do you mean? Did you want to process payments? Or wad it more of an
> actual banking thing you needed? I've not heard of hbci before, so can't
> offer much information back.
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> - Reply message -
> From: "Stephan Ebelt" 
> Date: Fri, Oct 8, 2010 13:37
> Subject: [PHP] PHP and HBCI?
> To: "PHP" 
> 
> 
> Hello,
> 
> is there a way to do HBCI banking with PHP?
> 
> stephan
> 
> 
> -- 
> 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] PHP and HBCI?

2010-10-08 Thread Stephan Ebelt
On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote:
> How do you mean? Did you want to process payments? Or wad it more of an
> actual banking thing you needed? I've not heard of hbci before, so can't
> offer much information back.

HBCI is the german Home Banking Computer Interface which is supported by most
banks over here. There are free implementations such as the one used in gnucash
and some other projects: http://www.aquamaniac.de/sites/aqbanking/index.php
(sorry, site is german but code is english). I could not find a way to use
something like that from PHP code, only C and Java so far.

My goal for now would be to access bank account statements in order to show the
balances. I am not too eager to issue transactions.

thanks,
stephan



> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> - Reply message -
> From: "Stephan Ebelt" 
> Date: Fri, Oct 8, 2010 13:37
> Subject: [PHP] PHP and HBCI?
> To: "PHP" 
> 
> 
> Hello,
> 
> is there a way to do HBCI banking with PHP?
> 
> stephan
> 
> 
> -- 
> 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] PHP and HBCI?

2010-10-08 Thread Jay Blanchard
[snip]
is there a way to do HBCI banking with PHP?
[/snip]

yes.

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



Re: [PHP] PHP and HBCI?

2010-10-08 Thread a...@ashleysheridan.co.uk
How do you mean? Did you want to process payments? Or wad it more of an actual 
banking thing you needed? I've not heard of hbci before, so can't offer much 
information back.

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

- Reply message -
From: "Stephan Ebelt" 
Date: Fri, Oct 8, 2010 13:37
Subject: [PHP] PHP and HBCI?
To: "PHP" 


Hello,

is there a way to do HBCI banking with PHP?

stephan


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



[PHP] PHP and HBCI?

2010-10-08 Thread Stephan Ebelt

Hello,

is there a way to do HBCI banking with PHP?

stephan


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



[PHP] Re: New to PHP and struggling with the basics

2010-10-05 Thread Col Day

Thanks Gary!

Nice to know I'm not the only one who has struggled with the Basics. 
Hopefully I can get my brain around it sometime soon.


Cheers

Col.

"Gary"  wrote in message 
news:i8f1r9$j4...@dough.gmane.org...

Col Day wrote:

Yes I did install apache then php, however I tried to follow the
instructions in the Dummies book (what does it make me if I can't follow
the dummies book?) but to no avail.


Don't know what it makes you, but I remember trying to install Apache &
PHP separately a couple of years ago. The frustration of mismatching
versions (Apache only supporting PHP version something, PHP only playing
well with Apache version something-else) was... rather high. Head met
keyboard several times.




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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread Col Day
In addition, I think I may have got to the bottom of what I was doing wrong 
in the first place.


I recently swapped out my laptop for my wifes one (she upgraded, well I 
upgraded hers, and I got the old one) and I forgot that this one didn't 
automatically boot up into the Administrator profile.


Doh!

Cheers again all!


""Col Day""  wrote in message 
news:a2.70.25536.9a5f9...@pb1.pair.com...

Steve,

That's superb, many thanks for the link! I shall give it a go!

Yes I did install apache then php, however I tried to follow the 
instructions in the Dummies book (what does it make me if I can't follow 
the dummies book?) but to no avail.


I have just printed off the first 40 pages so that i can read it whilst 
looking at the screen ratrher than switching about, however I will give 
Xammp a go first and foremost seeing as I only want to test my own web 
page before I start to buy hosting elsewhere.


Seeing as you are so great :-) Any ideas of the best way to script an 
upload page that will deliver files to the server?


Family photo's and video clips mainly.

Thoughts?

Also, many thanks to everyone who has tried to help a muppet. But I guess 
we all gotta start somewhere!


Cheers again!

"Steve Staples"  wrote in message 
news:1286202653.4703.48.ca...@webdev01...

Col.

Since you're new to php, then an easy way to install apache, is using
XAMPP ( http://www.apachefriends.org/en/xampp.html )

I would suggest you remove the apache you have installed, and the php
you installed, and install the XAMPP package as it comes prebuilt with
mysql, ftp, apache and php, and it is simple to use/work with.

And if you install to defaults there, you will put your web files into
C:\xampp\htdocs\ and everythign should just work.

The way i read your initial post, is that you installed just apache, and
just php... if you did this, then you may not have integrated php into
apache properly, so then your php pages will not work.

just my $0.02 here, cuz if it doesn't work after you install XAMPP, then
there is something else wrong.

And the other thing, is that you're running on vista, and vista doesn't
like things running on localhost (or at least it didn't used to)

Steve


On Mon, 2010-10-04 at 13:51 +0100, Col Day wrote:

Hi Kranthi,

No, I just literally get the "HTML" line shown but absolutely nothing
beneath it.

"kranthi"  wrote in message
news:aanlktin2xnthqm-pp7qwtgo=sqtkctthtwz+08bbw...@mail.gmail.com...
> they should be something like error_log-[date] not sure about windows
> though
>
>>>However I have found that if I paste the html into my web page 
>>>created by

>>>Serif WebPlus 10 I get the "html" line but not the "php" line.
>
> are you saying that you are getting the php code in your browser ?
>  echo "This is a PHP line";
> phpinfo();
> ?>










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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread Col Day

Steve,

That's superb, many thanks for the link! I shall give it a go!

Yes I did install apache then php, however I tried to follow the 
instructions in the Dummies book (what does it make me if I can't follow the 
dummies book?) but to no avail.


I have just printed off the first 40 pages so that i can read it whilst 
looking at the screen ratrher than switching about, however I will give 
Xammp a go first and foremost seeing as I only want to test my own web page 
before I start to buy hosting elsewhere.


Seeing as you are so great :-) Any ideas of the best way to script an upload 
page that will deliver files to the server?


Family photo's and video clips mainly.

Thoughts?

Also, many thanks to everyone who has tried to help a muppet. But I guess we 
all gotta start somewhere!


Cheers again!

"Steve Staples"  wrote in message 
news:1286202653.4703.48.ca...@webdev01...

Col.

Since you're new to php, then an easy way to install apache, is using
XAMPP ( http://www.apachefriends.org/en/xampp.html )

I would suggest you remove the apache you have installed, and the php
you installed, and install the XAMPP package as it comes prebuilt with
mysql, ftp, apache and php, and it is simple to use/work with.

And if you install to defaults there, you will put your web files into
C:\xampp\htdocs\ and everythign should just work.

The way i read your initial post, is that you installed just apache, and
just php... if you did this, then you may not have integrated php into
apache properly, so then your php pages will not work.

just my $0.02 here, cuz if it doesn't work after you install XAMPP, then
there is something else wrong.

And the other thing, is that you're running on vista, and vista doesn't
like things running on localhost (or at least it didn't used to)

Steve


On Mon, 2010-10-04 at 13:51 +0100, Col Day wrote:

Hi Kranthi,

No, I just literally get the "HTML" line shown but absolutely nothing
beneath it.

"kranthi"  wrote in message
news:aanlktin2xnthqm-pp7qwtgo=sqtkctthtwz+08bbw...@mail.gmail.com...
> they should be something like error_log-[date] not sure about windows
> though
>
>>>However I have found that if I paste the html into my web page created 
>>>by

>>>Serif WebPlus 10 I get the "html" line but not the "php" line.
>
> are you saying that you are getting the php code in your browser ?
>  echo "This is a PHP line";
> phpinfo();
> ?>








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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread Abah Joseph
Your directory configuration should look like this


  Order Deny,Allow
  Allow from all

Options Indexes FollowSymLinks Includes ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
AllowOverride All



On Mon, Oct 4, 2010 at 10:53 AM, kranthi  wrote:
> apache error logs will be helpful in this case. Their location varies
> depending upon your installation. But in any case they'll be insde
> your server directory (IIRC it is c:/Program Files/Apache Software
> Foundation/Apache by default)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Share with free mind!
Join the world largest open forum for hackers and programmers.
http://www.tuwana.com

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



RES: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread Alejandro Michelin Salomon
Col Day :

Go to : "C:\Arquivos de programas\Apache Software Foundation\Apache2.2\conf"
or the folder in your machine.

Search for this file => httpd.conf 

Search for DocumentRoot "D:/webroot" put your work folder in my case
D:/webroot.

Search for this line and apply the same changes make in DocumentRoot
#
# This should be changed to whatever you set DocumentRoot to
#


Search for DirectoryIndex, and add index.php to the list

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#

DirectoryIndex index.html index.php


Add on the end of the file this lines :

My php installation folder is D:/PHP/, change D:/PHP/ to your installation
folder.

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "D:/PHP/" 

# Php as Apache module
LoadModule php5_module "D:/PHP/php5apache2_2.dll" 

Restart apache.

Browse to localhost

Alejandro M.S.

-Mensagem original-
De: Col Day [mailto:colind...@aol.com] 
Enviada em: segunda-feira, 4 de outubro de 2010 06:31
Para: php-general@lists.php.net
Assunto: [PHP] New to PHP and struggling with the basics

Hi all,

Working with the PHP5 for Dummies book (yup real noob, feel free to ridicule
(after telling me what I've done wrong)) and have installed Apache 2.2 and
PHP 5.3.3 onto a laptop running Vista. (yes I know!!!).

I've had Apache running fine with my basic web site created using Serif's
Webplus10 but wanted to experiment with PHP as I want an uploadable area on
my website for my friends and family to submit video/photos.

I've checked the install of PHP using php -v and I get the output that

PHP 5.3.3 (cli) (built: Jul 21 2010 20:10:20)

but when I try and go to the test.php file (below) I get an http 403 webiste
requires you to log in. Error message.



PHP Test


This is an HTML line
This is a PHP line";
 phpinfo();
?>



This is the text of the test.php file which I have plonked down in
/apache/htdocs

What have I missed?

the Dummies book is quoting PHP 5.0.0 as the latest release so not too far
away really.

Thanks for your help.

Cheers.

Col Day



-- 
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] New to PHP and struggling with the basics

2010-10-04 Thread Steve Staples
Col.

Since you're new to php, then an easy way to install apache, is using
XAMPP ( http://www.apachefriends.org/en/xampp.html )

I would suggest you remove the apache you have installed, and the php
you installed, and install the XAMPP package as it comes prebuilt with
mysql, ftp, apache and php, and it is simple to use/work with.

And if you install to defaults there, you will put your web files into
C:\xampp\htdocs\ and everythign should just work.

The way i read your initial post, is that you installed just apache, and
just php... if you did this, then you may not have integrated php into
apache properly, so then your php pages will not work.

just my $0.02 here, cuz if it doesn't work after you install XAMPP, then
there is something else wrong.

And the other thing, is that you're running on vista, and vista doesn't
like things running on localhost (or at least it didn't used to)

Steve


On Mon, 2010-10-04 at 13:51 +0100, Col Day wrote:
> Hi Kranthi,
> 
> No, I just literally get the "HTML" line shown but absolutely nothing 
> beneath it.
> 
> "kranthi"  wrote in message 
> news:aanlktin2xnthqm-pp7qwtgo=sqtkctthtwz+08bbw...@mail.gmail.com...
> > they should be something like error_log-[date] not sure about windows 
> > though
> >
> >>>However I have found that if I paste the html into my web page created by 
> >>>Serif WebPlus 10 I get the "html" line but not the "php" line.
> >
> > are you saying that you are getting the php code in your browser ?
> >  > echo "This is a PHP line";
> > phpinfo();
> > ?> 
> 
> 



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



[PHP] New to PHP and struggling with the basics

2010-10-04 Thread Col Day

Hi all,

Working with the PHP5 for Dummies book (yup real noob, feel free to ridicule
(after telling me what I've done wrong)) and have installed Apache 2.2 and
PHP 5.3.3 onto a laptop running Vista. (yes I know!!!).

I've had Apache running fine with my basic web site created using Serif's
Webplus10 but wanted to experiment with PHP as I want an uploadable area on
my website for my friends and family to submit video/photos.

I've checked the install of PHP using php -v and I get the output that

PHP 5.3.3 (cli) (built: Jul 21 2010 20:10:20)

but when I try and go to the test.php file (below) I get an http 403 webiste
requires you to log in. Error message.



PHP Test


This is an HTML line
This is a PHP line";
phpinfo();
?>



This is the text of the test.php file which I have plonked down in
/apache/htdocs

What have I missed?

the Dummies book is quoting PHP 5.0.0 as the latest release so not too far
away really.

Thanks for your help.

Cheers.

Col Day



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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread kranthi
apache error logs will be helpful in this case. Their location varies
depending upon your installation. But in any case they'll be insde
your server directory (IIRC it is c:/Program Files/Apache Software
Foundation/Apache by default)

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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread Peter Lind
On 4 October 2010 11:30, Col Day  wrote:
> Hi all,
>
> Working with the PHP5 for Dummies book (yup real noob, feel free to ridicule
> (after telling me what I've done wrong)) and have installed Apache 2.2 and
> PHP 5.3.3 onto a laptop running Vista. (yes I know!!!).
>
> I've had Apache running fine with my basic web site created using Serif's
> Webplus10 but wanted to experiment with PHP as I want an uploadable area on
> my website for my friends and family to submit video/photos.
>
> I've checked the install of PHP using php -v and I get the output that
>
> PHP 5.3.3 (cli) (built: Jul 21 2010 20:10:20)
>
> but when I try and go to the test.php file (below) I get an http 403 webiste
> requires you to log in. Error message.
>
> 
> 
> PHP Test
> 
> 
> This is an HTML line
>  echo "This is a PHP line";
> phpinfo();
> ?>
> 
> 
>
> This is the text of the test.php file which I have plonked down in
> /apache/htdocs
>
> What have I missed?
>
> the Dummies book is quoting PHP 5.0.0 as the latest release so not too far
> away really.
>

A) v5.0.0 is years old. B) your issue is with apache, not php - 403 is
a "you have no permission to see this".

Check permissions for the file you're trying to test, as well as for
the folder. Also, seeing as you're naming the file test.php, make sure
you're browsing for that file and not just / or index.php.

Regards
Peter

-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15


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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread Col Day

Hi Kranthi,

No, I just literally get the "HTML" line shown but absolutely nothing 
beneath it.


"kranthi"  wrote in message 
news:aanlktin2xnthqm-pp7qwtgo=sqtkctthtwz+08bbw...@mail.gmail.com...
they should be something like error_log-[date] not sure about windows 
though


However I have found that if I paste the html into my web page created by 
Serif WebPlus 10 I get the "html" line but not the "php" line.


are you saying that you are getting the php code in your browser ?
This is a PHP line";
phpinfo();
?> 



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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread kranthi
they should be something like error_log-[date] not sure about windows though

>>However I have found that if I paste the html into my web page created by 
>>Serif WebPlus 10 I get the "html" line but not the "php" line.

are you saying that you are getting the php code in your browser ?
This is a PHP line";
phpinfo();
?>

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



Re: [PHP] New to PHP and struggling with the basics

2010-10-04 Thread Col Day

Kranthi
Many thanks, any idea on the name of the error logs?

Peter,
Yes, browsing to the correct location but still getting the 403. this 
website requires you to log in.


Abah,

I've gone to the httpd-userdir.conf file and replaced it with your text (not 
including the directory tree), restarted apache (after each change) but am 
still getting the same error.


However I have found that if I paste the html into my web page created by 
Serif WebPlus 10 I get the "html" line but not the "php" line.


Any further thoughts?

It has to be something simple that I'vw not done!

Cheers all.



"kranthi"  wrote in message 
news:aanlktik6=68ho+hdfpvd3x2qmrudlz_ttco2oqk1b...@mail.gmail.com...

apache error logs will be helpful in this case. Their location varies
depending upon your installation. But in any case they'll be insde
your server directory (IIRC it is c:/Program Files/Apache Software
Foundation/Apache by default) 



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



[PHP] PHP and SpatiaLite

2010-10-01 Thread TR Shaw
Anyone succeeded in geting php and SpatiaLite to work together?





Re: [PHP] New to PHP and the list

2010-09-13 Thread kranthi
> Is MAX_FILE_SIZE passed to PHP as $MAX_FILE_SIZE?
only if register_golbals is set to ON in php.ini. This is a very bad
practice and should be avoided. Use $_POST['MAX_FILE_SIZE'] instead.
But in this case dont use the post variable also. define a constant in
your configuration file and use that constant. The only use of
MAX_FILE_SIZE  is to inform the browser that "dont allow the user to
upload files which are > MAX_FILE_SIZE".

> 
> $MAX_FILE_SIZE = 3;
>
> echo <<<_END
> 
>     
>     
>     
>     Send this file: 
>     
> 
> <<<_END
Nope, you cant. You have to mention the value attribute of a hidden field

> I'm also concerned that in the first instance, a malicious user can
> modify the value and I will be hosed. Am I correct?
A malicious user can ALWAYS modify the data. You will have to always
validate every input field.

> echo <<<_END
> 
>
>
>
>Send this file: 
>
> 
> <<<_END
i did not understand this echo <<<_END means that you are in php so
why do you need a  ?

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



Re: [PHP] New to PHP and the list

2010-09-12 Thread Paul M Foster
On Sat, Sep 11, 2010 at 06:37:41PM -0500, MikeB wrote:

> Hello, I'm new to PHP and also new to using newsgroups/mailing lists
> directly. So if I make a mistake, please forgive me this once and I'll
> try to do better in the future.
> 
> Please help me understand, my head is absolutely spinning and I can't
> get my mind around this.
> 
> In the php.net site there is an example on uploading a file via a
> form. http://www.php.net/manual/en/features.file-upload.post-method.php
> 
> This is the sample code for the form:
> 
> 
> 
> 
> 
> Send this file: 
> 
> 
> 
> Is MAX_FILE_SIZE passed to PHP as $MAX_FILE_SIZE?

No. It's passed as: $_POST['MAX_FILE_SIZE'], as are all variables in a
form which uses "post" as its method attribute.

> 
> Assuming I want to make it a variable in my PHP code, can I do this:
> 
>  
> $MAX_FILE_SIZE = 3;
> 
> echo <<<_END
> 
> 
> 
> 
> Send this file: 
> 
> 
> <<<_END
>  
> In other words, simply omitting the "value" clause in the form field?

No. Better is this:





Send this file: 


<<<_END

Remember that the data HTML/values you're sending are being sent back
when the form returns to the server for processing. So the
information must be contained in POST/GET variables, just the way I did
it above. (There are other ways to do the syntax, but the meaning is the
same.)


> 
> And can I make that value a global constant somehow so that I can
> later also test the actual size of the uploaded file in another
> function?
> 
> Or do I have to do this:
> 
>  
> $MAX_UPLOAD_SIZE = 3;
> 
> echo <<<_END
> 
> 
>  value="$MAX_UPLOAD_SIZE"/>
> 
> Send this file: 
> 
> 
> <<<_END
>  
> I'm also concerned that in the first instance, a malicious user can
> modify the value and I will be hosed. Am I correct?

Yes, a malicious user can do this. They can stand off somewhere and
submit a copy of your form with different values. Then they can upload a
file of larger size. However, if you keep that 3 value somewhere,
you can refuse to "process" files which exceed that size. When I say
"process", I mean store the file in a more permanent place and actually
*do* something with it. Uploading files puts them in a temporary
location controlled by the server and inaccessible to you using "normal"
methods. You probably know you have to go through a couple of extra
steps to get to that file someone uploaded. You can't just say, "Give me
the file at /tmp/phpuploads/uploadedfile.txt."

Paul

-- 
Paul M. Foster

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



Re: [PHP] New to PHP and the list

2010-09-11 Thread viraj
On Sun, Sep 12, 2010 at 5:07 AM, MikeB  wrote:
> Hello, I'm new to PHP and also new to using newsgroups/mailing lists
> directly. So if I make a mistake, please forgive me this once and I'll try
> to do better in the future.
>
> Please help me understand, my head is absolutely spinning and I can't
> get my mind around this.
>
> In the php.net site there is an example on uploading a file via a
> form. http://www.php.net/manual/en/features.file-upload.post-method.php
>
> This is the sample code for the form:
>
> 
>    
>    
>    
>    Send this file: 
>    
> 
>
> Is MAX_FILE_SIZE passed to PHP as $MAX_FILE_SIZE?

err! print_r and var_dump is your friend!

>
> Assuming I want to make it a variable in my PHP code, can I do this:
>
> 
> $MAX_FILE_SIZE = 3;
>
> echo <<<_END
> 
>    
>    
>    
>    Send this file: 
>    
> 
> <<<_END
> 
> In other words, simply omitting the "value" clause in the form field?
>
> And can I make that value a global constant somehow so that I can
> later also test the actual size of the uploaded file in another
> function?

if this is about getting the size of the uploaded file, you better try
print_r($_FILES) after the form submit. there you have size in bytes.

MAX_FILE_SIZE in html form will be used to early notify the up-loader,
in case of a bigger file which exceeds the server side limit imposed
through php.ini. (see http://www.php.net/manual/en/ini.core.php file
uploads section)

>
> Or do I have to do this:
>
> 
> $MAX_UPLOAD_SIZE = 3;
> <<<_END
> 
> I'm also concerned that in the first instance, a malicious user can
> modify the value and I will be hosed. Am I correct?

and yes, never trust client side.


~viraj

>
> Thanks.
>
> --
> 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] New to PHP and the list

2010-09-11 Thread MikeB

On 9/11/2010 6:51 PM, Tom Sparks wrote:

--- On Sun, 12/9/10, MikeB  wrote:


From: MikeB
Subject: [PHP] New to PHP and the list
To: php-general@lists.php.net
Received: Sunday, 12 September, 2010, 9:37 AM
Hello, I'm new to PHP and also new to
using newsgroups/mailing lists directly. So if I make a
mistake, please forgive me this once and I'll try to do
better in the future.

Please help me understand, my head is absolutely spinning
and I can't
get my mind around this.

In the php.net site there is an example on uploading a file
via a
form. http://www.php.net/manual/en/features.file-upload.post-method.php


start off simpler with this version 
http://www.w3schools.com/php/php_file_upload.asp



I think I have that much under my belt, I'm more or less trying to dig a 
little deeper.


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



Re: [PHP] New to PHP and the list

2010-09-11 Thread Tom Sparks
--- On Sun, 12/9/10, MikeB  wrote:

> From: MikeB 
> Subject: [PHP] New to PHP and the list
> To: php-general@lists.php.net
> Received: Sunday, 12 September, 2010, 9:37 AM
> Hello, I'm new to PHP and also new to
> using newsgroups/mailing lists directly. So if I make a
> mistake, please forgive me this once and I'll try to do
> better in the future.
> 
> Please help me understand, my head is absolutely spinning
> and I can't
> get my mind around this.
> 
> In the php.net site there is an example on uploading a file
> via a
> form. http://www.php.net/manual/en/features.file-upload.post-method.php
>
start off simpler with this version 
http://www.w3schools.com/php/php_file_upload.asp

tom





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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-10 Thread Dave M G

Peter, Bob,

Thank you for replying.

After a few days testing, I set up an error handler for when messages 
don't get sent. I started to see an error saying "Language String failed 
to load", which seems to be particular to the PHPmailer scripts I am using.


Long story short, after some searching on the web, it looks like the 
sending of mails will die if one mail on the list is invalid.


I tried sending a message out to the list, got back a response saying 
that the recipient did not exist. So I deleted that user, and then the 
mail went through fine on the next attempt.


I'm a little fuzzy on what exactly is happening.

Does the PHP mail() command (and by extension, classes built upon it) 
listen for responses from the server it is sending to?


--
Dave M G

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



RE: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-09 Thread Bob McConnell
From: Dave M G

>> There is one other possibility. According to the RFCs, the standard
line
>> ending for email is CRLF. Make sure your system is sending both
>> characters after each line. There is a slim chance the server is
cutting
>> you off after some number of bytes if you are only sending a LF.
> 
> This is actually a possiblity. I think I might be only using LF.
> 
> Some of the text being sent in the emails is entered via a form on a
web 
> page. Is it possible to enforce CRLF on that text?

You would have to scan the text when you process the form and replace
any bare LF you find with CRLF. The string sequence for that would be
"\r\n". It shouldn't be too difficult to come up with a regular
expression to find any LF not preceded by a CR and replace it.

Also, check your mail library to make sure it defines $EOL correctly as
well. I reported that as a bug in PHPMailer a while back. If it is
correct, it may actually fix the bare LF's for you.

Bob McConnell

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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Dave M G

Ash, Bob,

Thank you for replying.


There is one other possibility. According to the RFCs, the standard line
ending for email is CRLF. Make sure your system is sending both
characters after each line. There is a slim chance the server is cutting
you off after some number of bytes if you are only sending a LF.


This is actually a possiblity. I think I might be only using LF.

Some of the text being sent in the emails is entered via a form on a web 
page. Is it possible to enforce CRLF on that text?


--
Dave M G

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



RE: Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Bob McConnell
From: a...@ashleysheridan.co.uk

> Could it be that there are connection limits on the remote server?
> 
> Thanks,
> Ash

Only if you are opening a new connection for each message. Any decent
SMTP client should be able to send multiple messages over a single
connection.

You could capture the traffic with Wireshark. Set the capture filter to
only grab SMTP traffic to that server's IP address. Unless it is going
through SSL/TLS, you can read the handshake messages. They will look
something like this:

-8<
220 lists.php.net ESMTP Postfix
EHLO ashleysheridan.co.uk
250-mail.php.net
250-PIPELINING
250-SIZE 1024
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250 8BITMIME
MAIL FROM:
250 Ok
RCPT TO:
250 Ok
-8<

The lines beginning with numbers are the server's responses. All of them
should be ASCII/UTF-8 text.

There is one other possibility. According to the RFCs, the standard line
ending for email is CRLF. Make sure your system is sending both
characters after each line. There is a slim chance the server is cutting
you off after some number of bytes if you are only sending a LF.

Bob McConnell

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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread a...@ashleysheridan.co.uk
In order to help we really need to have a look at the code in question. You say 
the code is derived from another class you downloaded. Are you able to post the 
important bits of it in an email, or put it all on a pastebin?

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

- Reply message -
From: "Dave M G" 
Date: Wed, Sep 8, 2010 18:45
Subject: [PHP] Broken pipes, time outs, PHP, and mail
To: 

Bob,

Thank you for replying.

> Your code should be able to re-open the
> connection at this point and resend the message that triggered the
> error. Then resume working on the rest of your list.

Unfortunately, it seems that this is not happening. The loop that sends 
out individual mail dies, and the remaining mails stop being sent.

Is there perhaps some way I can force the PHP code to ignore the one 
mailing that failed and continue with the rest?

-- 
Dave M G

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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Dave M G

Bob,

Thank you for replying.


Your code should be able to re-open the
connection at this point and resend the message that triggered the
error. Then resume working on the rest of your list.


Unfortunately, it seems that this is not happening. The loop that sends 
out individual mail dies, and the remaining mails stop being sent.


Is there perhaps some way I can force the PHP code to ignore the one 
mailing that failed and continue with the rest?


--
Dave M G

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



Re: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread a...@ashleysheridan.co.uk
Could it be that there are connection limits on the remote server?

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

- Reply message -
From: "Bob McConnell" 
Date: Wed, Sep 8, 2010 18:24
Subject: [PHP] Broken pipes, time outs, PHP, and mail
To: 

From: Dave M G

> I have a set of scripts that sends out emails to a list of about 150 
> people. Sometimes it works fine.
> 
> Other times, it dies part way through the list, and in my error logs I

> get this output:
> 
> fputs() [function.fputs]: send of 22
bytes 
> failed with errno=32 Broken pipe /public_html/class.smtp.php 489
> 
> The code that sends the mail is derived from here:
> http://www.phpclasses.org/browse/file/920.html
> 
> It's mostly rock solid code, so far as I know, so I suspect the
problem 
> to more with my server settings or something.
> 
> That said, I don't know what differentiates a failed mailing and a 
> successful one.
> 
> After a Google search, it seems "broken pipes" are a matter of time 
> outs. That's about as far as I understand it, though.
> 
> Can anyone throw me a tip as to how I might diagnose this problem?

"Broken pipe" is a euphemism for "Network error". There are any number
of causes including the remote server closing the socket, a switch or
hub between here and there is bogged down by backup traffic, or a
segment your connection passes through became too busy with higher
priority video traffic. The actual details are difficult to determine
and none of the administrators involved will ever admit they had a
problem. In most cases the TCP/IP error will simply tell you it timed
out waiting for a response. Your code should be able to re-open the
connection at this point and resend the message that triggered the
error. Then resume working on the rest of your list.

Bob McConnell

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



RE: [PHP] Broken pipes, time outs, PHP, and mail

2010-09-08 Thread Bob McConnell
From: Dave M G

> I have a set of scripts that sends out emails to a list of about 150 
> people. Sometimes it works fine.
> 
> Other times, it dies part way through the list, and in my error logs I

> get this output:
> 
> fputs() [function.fputs]: send of 22
bytes 
> failed with errno=32 Broken pipe /public_html/class.smtp.php 489
> 
> The code that sends the mail is derived from here:
> http://www.phpclasses.org/browse/file/920.html
> 
> It's mostly rock solid code, so far as I know, so I suspect the
problem 
> to more with my server settings or something.
> 
> That said, I don't know what differentiates a failed mailing and a 
> successful one.
> 
> After a Google search, it seems "broken pipes" are a matter of time 
> outs. That's about as far as I understand it, though.
> 
> Can anyone throw me a tip as to how I might diagnose this problem?

"Broken pipe" is a euphemism for "Network error". There are any number
of causes including the remote server closing the socket, a switch or
hub between here and there is bogged down by backup traffic, or a
segment your connection passes through became too busy with higher
priority video traffic. The actual details are difficult to determine
and none of the administrators involved will ever admit they had a
problem. In most cases the TCP/IP error will simply tell you it timed
out waiting for a response. Your code should be able to re-open the
connection at this point and resend the message that triggered the
error. Then resume working on the rest of your list.

Bob McConnell

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



RE: [PHP] IIS, PHP and HTML

2010-06-23 Thread Ashley Sheridan
On Wed, 2010-06-23 at 17:34 -0700, Tommy Pham wrote:

> > -Original Message-
> > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> > Sent: Wednesday, June 23, 2010 4:47 PM
> > To: Phillip Baker
> > Cc: PHP General List
> > Subject: Re: [PHP] IIS, PHP and HTML
> > 
> > On Wed, 2010-06-23 at 16:26 -0600, Phillip Baker wrote:
> > 
> > > Greetings All,
> > >
> > > I am at a new Gig.
> > > So this is the existing setup so changing it at least in the short
> > > term is not an option.
> > >
> > > We are in an IIS shop.
> > > We have a bunch of files that are html, and in need of php
> functionality.
> > > And that would be a BUNCH of files.
> > >
> > > I am interested in setting if I can set up IIS to use the php
> > > interpreter on HTML files.
> > > And then just start using the html files as php.
> > >
> > > There are just so many html files I would prefer to not do 301
> > > redirects, not header redirects and blot the server with empty files
> (nearly
> > empty).
> > > My preference is to use the existing files.
> > >
> > > Is there a way to make this happen?
> > > Are there any pitfalls in making this happen that I will need to be
> > > aware of?
> > >
> > > Blessed Be
> > >
> > > Phillip
> > 
> > 
> > Yes, you just configure IIS to treat the .html extension the same as it
> > does .php.
> > 
> > Several things to note though. You can't control this on a site-by-site
> basis as
> > far as I remember, so if you set this, it's for the whole server. Any
> plain html
> > pages will be delivered more slowly.
> > 
> 
> Correction, IIS7.5 (Win08r2) and IIS7 (Win08) can set it at per
> path/site/server depending on your needs.  Set it via 'handler mappings'
> accordingly.  I don't remember IIS 6 and older since it's been a couple of
> years I've dealt with IIS 6.
> 
> Regards,
> Tommy
> 
> > Second, PHP code isn't inserted into HTML, rather it's the other way
> around.
> > This distinction is important when you are outputting content other than
> > HTML from PHP code, or when you are using the header() function.
> > 
> > Although IIS wouldn't be my server of choice, I think the one thing you
> may
> > find lacking is Apaches .htaccess files. IIS can emulate most of the
> behaviour
> > of this with plugins though, but I believe they tend to cost.
> > 
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> > 
> 
> 
> 


Ah, that's good for Phillip then. I've not used IIS for over a year now,
and the version I used was very old (cheap company didn't see the need
to update anything, ever!)

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




RE: [PHP] IIS, PHP and HTML

2010-06-23 Thread Tommy Pham
> -Original Message-
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> Sent: Wednesday, June 23, 2010 4:47 PM
> To: Phillip Baker
> Cc: PHP General List
> Subject: Re: [PHP] IIS, PHP and HTML
> 
> On Wed, 2010-06-23 at 16:26 -0600, Phillip Baker wrote:
> 
> > Greetings All,
> >
> > I am at a new Gig.
> > So this is the existing setup so changing it at least in the short
> > term is not an option.
> >
> > We are in an IIS shop.
> > We have a bunch of files that are html, and in need of php
functionality.
> > And that would be a BUNCH of files.
> >
> > I am interested in setting if I can set up IIS to use the php
> > interpreter on HTML files.
> > And then just start using the html files as php.
> >
> > There are just so many html files I would prefer to not do 301
> > redirects, not header redirects and blot the server with empty files
(nearly
> empty).
> > My preference is to use the existing files.
> >
> > Is there a way to make this happen?
> > Are there any pitfalls in making this happen that I will need to be
> > aware of?
> >
> > Blessed Be
> >
> > Phillip
> 
> 
> Yes, you just configure IIS to treat the .html extension the same as it
> does .php.
> 
> Several things to note though. You can't control this on a site-by-site
basis as
> far as I remember, so if you set this, it's for the whole server. Any
plain html
> pages will be delivered more slowly.
> 

Correction, IIS7.5 (Win08r2) and IIS7 (Win08) can set it at per
path/site/server depending on your needs.  Set it via 'handler mappings'
accordingly.  I don't remember IIS 6 and older since it's been a couple of
years I've dealt with IIS 6.

Regards,
Tommy

> Second, PHP code isn't inserted into HTML, rather it's the other way
around.
> This distinction is important when you are outputting content other than
> HTML from PHP code, or when you are using the header() function.
> 
> Although IIS wouldn't be my server of choice, I think the one thing you
may
> find lacking is Apaches .htaccess files. IIS can emulate most of the
behaviour
> of this with plugins though, but I believe they tend to cost.
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 



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



Re: [PHP] IIS, PHP and HTML

2010-06-23 Thread Ashley Sheridan
On Wed, 2010-06-23 at 16:26 -0600, Phillip Baker wrote:

> Greetings All,
> 
> I am at a new Gig.
> So this is the existing setup so changing it at least in the short term is
> not an option.
> 
> We are in an IIS shop.
> We have a bunch of files that are html, and in need of php functionality.
> And that would be a BUNCH of files.
> 
> I am interested in setting if I can set up IIS to use the php interpreter on
> HTML files.
> And then just start using the html files as php.
> 
> There are just so many html files I would prefer to not do 301 redirects,
> not header redirects and blot the server with empty files (nearly empty).
> My preference is to use the existing files.
> 
> Is there a way to make this happen?
> Are there any pitfalls in making this happen that I will need to be aware
> of?
> 
> Blessed Be
> 
> Phillip


Yes, you just configure IIS to treat the .html extension the same as it
does .php.

Several things to note though. You can't control this on a site-by-site
basis as far as I remember, so if you set this, it's for the whole
server. Any plain html pages will be delivered more slowly.

Second, PHP code isn't inserted into HTML, rather it's the other way
around. This distinction is important when you are outputting content
other than HTML from PHP code, or when you are using the header()
function.

Although IIS wouldn't be my server of choice, I think the one thing you
may find lacking is Apaches .htaccess files. IIS can emulate most of the
behaviour of this with plugins though, but I believe they tend to cost.

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




[PHP] IIS, PHP and HTML

2010-06-23 Thread Phillip Baker
Greetings All,

I am at a new Gig.
So this is the existing setup so changing it at least in the short term is
not an option.

We are in an IIS shop.
We have a bunch of files that are html, and in need of php functionality.
And that would be a BUNCH of files.

I am interested in setting if I can set up IIS to use the php interpreter on
HTML files.
And then just start using the html files as php.

There are just so many html files I would prefer to not do 301 redirects,
not header redirects and blot the server with empty files (nearly empty).
My preference is to use the existing files.

Is there a way to make this happen?
Are there any pitfalls in making this happen that I will need to be aware
of?

Blessed Be

Phillip


Re: [PHP] PHP and schedules tasks/events

2010-04-16 Thread Ryan Sun
you can setup a schedule table in db
and have a cron php script check the db every time
and send email if the current time is around the scheduled_at time
and close the schedule after you send the email

On Fri, Apr 16, 2010 at 5:35 PM, Adam Richardson  wrote:
> On Fri, Apr 16, 2010 at 5:15 PM, Don Wieland wrote:
>
>> On Apr 16, 2010, at 1:26 PM, Bastien Koert wrote:
>>
>>  Run a cronjob at midnight and send the email. Track who it got sent
>>> to, so you don't duplicate it. Easy peasy!
>>>
>>
>> This is fine if the email is to be sent at midnight.
>>
>> I am looking for more refinement.
>>
>> For example:
>>
>> A user signs up for an event - 4/16/2010 @ 10:45am
>>
>> There is an option:
>>
>> Send me a reminder email X minutes/hours/days/weeks/months/years prior to
>> the Event.
>>
>> so:
>>
>> 30 minute(s) = email sent at 4/16/2010 @ 10:15am
>> 2 hour(s) = email sent at 4/16/2010 @ 8:45am
>> 3 day(s) = email sent at 4/13/2010 @ 10:45am
>> 1 week(s) = email sent at 4/9/2010 @ 10:45am
>> 1 month(s) = email sent at 3/16/2010 @ 10:45am
>> 1 year(s) = email sent at 4/16/2009 @ 10:45am
>>
>> This is really what I need...
>>
>>
>> Don Wieland
>> D W   D a t a   C o n c e p t s
>> ~
>> d...@dwdataconcepts.com
>> Direct Line - (949) 305-2771
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> What about making ics files available for download?  Users could easily
> import the event into the calendar of choice, and they could also (using the
> calendar software they're already familiar with) set the alarm.  For
> instance, I can set the calendar on my cell to ring my phone to alert me to
> events (my preference over email reminders for important events because I
> sometimes get flooded with email.)
>
> Your scripts could generate the files containing event info and then
> automatically start the download.
>
> This allows the users to determine the mode of alarm that works best for
> them in their native calendar app, and you're still greatly facilitating the
> process by providing all of the info so they merely have to drag and drop
> for many apps.
>
> I realize you asked specifically for a server-side email alarm solution (I
> apologize for the tangent if your needs preclude this type of approach), but
> I thought I'd toss out the idea as this approach has proved more effective
> and efficient for websites I maintain.
>
> Adam
>
> --
> Nephtali:  PHP web framework that functions beautifully
> http://nephtaliproject.com
>

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



Re: [PHP] PHP and schedules tasks/events

2010-04-16 Thread Adam Richardson
On Fri, Apr 16, 2010 at 5:15 PM, Don Wieland wrote:

> On Apr 16, 2010, at 1:26 PM, Bastien Koert wrote:
>
>  Run a cronjob at midnight and send the email. Track who it got sent
>> to, so you don't duplicate it. Easy peasy!
>>
>
> This is fine if the email is to be sent at midnight.
>
> I am looking for more refinement.
>
> For example:
>
> A user signs up for an event - 4/16/2010 @ 10:45am
>
> There is an option:
>
> Send me a reminder email X minutes/hours/days/weeks/months/years prior to
> the Event.
>
> so:
>
> 30 minute(s) = email sent at 4/16/2010 @ 10:15am
> 2 hour(s) = email sent at 4/16/2010 @ 8:45am
> 3 day(s) = email sent at 4/13/2010 @ 10:45am
> 1 week(s) = email sent at 4/9/2010 @ 10:45am
> 1 month(s) = email sent at 3/16/2010 @ 10:45am
> 1 year(s) = email sent at 4/16/2009 @ 10:45am
>
> This is really what I need...
>
>
> Don Wieland
> D W   D a t a   C o n c e p t s
> ~
> d...@dwdataconcepts.com
> Direct Line - (949) 305-2771
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
What about making ics files available for download?  Users could easily
import the event into the calendar of choice, and they could also (using the
calendar software they're already familiar with) set the alarm.  For
instance, I can set the calendar on my cell to ring my phone to alert me to
events (my preference over email reminders for important events because I
sometimes get flooded with email.)

Your scripts could generate the files containing event info and then
automatically start the download.

This allows the users to determine the mode of alarm that works best for
them in their native calendar app, and you're still greatly facilitating the
process by providing all of the info so they merely have to drag and drop
for many apps.

I realize you asked specifically for a server-side email alarm solution (I
apologize for the tangent if your needs preclude this type of approach), but
I thought I'd toss out the idea as this approach has proved more effective
and efficient for websites I maintain.

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


  1   2   3   4   5   6   7   8   9   10   >