Re: [PHP] /tmp/directory

2013-07-22 Thread Matijn Woudt
On Mon, Jul 22, 2013 at 5:20 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:

 I should know this, but I don't.

 Where is the /tmp/ directory?

 You see, I have a client where his host has apparently changed the /tmp/
 directory permissions such that old php/mysql scripts cannot write to the
 /tmp/ directory anymore -- they did at one time.

 So, how do I fix it?

 Cheers,

 tedd


Switch host? /tmp is required by the FHS and POSIX standards (writable for
any user), any host changing that should have no customers.

- Matijn


Re: [PHP] How to extract php source code from joomla

2013-07-22 Thread Ashley Sheridan
On Mon, 2013-07-22 at 13:10 -0700, elk dolk wrote:

 I am allowed to use tools or code by hand , it does not matter ,the professor 
 wants to have the source code.
 
 
 
 


You say tools, but would he consider a full-blown complex CMS as merely
a tool, or not? At this point, I agree, your best option is probably a
CMS with plugins, because 20 days is not much time to build that sort of
thing, and that's coming from someone who develops in PHP for a living.

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




Re: [PHP] /tmp/directory

2013-07-22 Thread Tedd Sperling
On Jul 22, 2013, at 4:10 PM, Matijn Woudt tijn...@gmail.com wrote:

 On Mon, Jul 22, 2013 at 5:20 PM, Tedd Sperling t...@sperling.com wrote:
 
 Hi gang:
 
 I should know this, but I don't.
 
 Where is the /tmp/ directory?
 
 You see, I have a client where his host has apparently changed the /tmp/
 directory permissions such that old php/mysql scripts cannot write to the
 /tmp/ directory anymore -- they did at one time.
 
 So, how do I fix it?
 
 Cheers,
 
 tedd
 
 
 Switch host? /tmp is required by the FHS and POSIX standards (writable for
 any user), any host changing that should have no customers.
 
 - Matijn


Good point -- we will add that reason to the many other reasons why we are 
changing host.

Keep in mind, the installed software worked for nearly a decade and now the 
host has changed something that caused this error, but the current host doesn't 
seem to know what happened.

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

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



Re: [PHP] How to extract php source code from joomla

2013-07-22 Thread Tedd Sperling
On Jul 22, 2013, at 3:49 PM, elk dolk elkd...@yahoo.com wrote:
 Thank you for the quick response ! What I am trying to do : I have to 
 complete two university projects for
 
  my professor !
 
 project One  : Make an online shop and must use the following components in 
 it 
 
 
 Shopping cart, Catalog of products, payment gateway , user login and user 
 activity log .
 
 
 project Two : Implementing of a B2B sell-side portal with negotiation 
 mechanism.
 
 As I am familiar with php and My.SQL and I have only 20 days to complete 
 those projects !  I thought it's 
 
 better to use Joomla I'll be grateful if you can give me an advice 
 
 
 thank you
 

Sounds more like a client than someone who teaches php.

I couldn't do that from scratch in 20 days and I teach php at college level. 
That's more than my entire 16 weeks course of introductory php. Are you in an 
advanced class?

tedd

_
tedd.sperl...@gmail.com
http://sperling.com

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



[PHP] How to extract php source code from joomla

2013-07-22 Thread elk dolk


I study for MSc degree at university.




 Are you in an advanced class?

php-general Digest 21 Jul 2013 19:46:44 -0000 Issue 8305

2013-07-21 Thread php-general-digest-help

php-general Digest 21 Jul 2013 19:46:44 - Issue 8305

Topics (messages 321665 through 321665):

Re: strip_tags
321665 by: Matijn Woudt

Administrivia:

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

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

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


--
---BeginMessage---
Op 21 jul. 2013 02:53 schreef Tedd Sperling t...@sperling.com het
volgende:


 On Jul 20, 2013, at 5:34 PM, Frank Arensmeier farensme...@gmail.com
wrote:

  20 jul 2013 kl. 18:25 skrev Tedd Sperling t...@sperling.com:
 
  Hi gang:
 
  I've been using
 
$str = strip_tags($str, $allowable)
 
  as it is described via the manuals:
 
  http://php.net/manual/en/function.strip-tags.php
 
  The problem I've found is the tags br and br / are not
stripped.
 
  How do you strip all tags, but leave some tags (such as b, i, and
u -- I know these are depreciated, but my client wants them anyway).
 
  From the manual:
  allowable_tags
  You can use the optional second parameter to specify tags which should
not be stripped.
 
  Note:
  HTML comments and PHP tags are also stripped. This is hardcoded and can
not be changed with allowable_tags.
 
  Note:
  This parameter should not contain whitespace. strip_tags() sees a tag
as a case-insensitive string between  and the first whitespace or . It
means that strip_tags(br/, br) returns an empty string.
 
  It's all there… ;-)
 
  Cheers,
  /frank
 

 Yeah, but that wasn't the problem -- it was my mistake in coding.

 In any event, I figured it out.

 tedd


Could you perhaps post what the problem was so that when someone searches
for it they will have the answer right here?

- Matijn
---End Message---


Re: [PHP] query order issue

2013-07-21 Thread Jim Lucas

On 7/20/2013 9:21 AM, dealTek wrote:

Hi all,


I have a page that starts with several mysql sql query searches and displays 
data below...

then I added a form (with hidden line do-update value UPDATE) on the same 
page with action to same page...


then above other sql queries - I put...

if ((isset($_POST[do-update]))  ($_POST[do-update] == update)) {

---do update query---

echo 'meta http-equiv=refresh content=0; url=gohere.php';


By your description of what you think should be happening in the line 
above, my suggestion to would be to look at the header() function in 
PHP.  It can send a header to the browser that will cause the browser to 
stop loading the current page and redirect it to another URL.


http://php.net/header

if ( ... ) {

  Do some work...

  header('Location: someotherpage.php');
  exit();

}

You want to make sure you always call exit(); after issuing a call to 
header('Location: ...');





}

but it shows error that happens AFTER the meta http-equiv=refresh has happened

Catchable fatal error: xxx on line 226

BTW - the meta http-equiv=refresh does work but the error flashes 1st for a 
second...

Q: I would have thought that it would not go past the line - meta 
http-equiv=refresh - but it does any insight on this

--
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] strip_tags

2013-07-21 Thread Matijn Woudt
Op 21 jul. 2013 02:53 schreef Tedd Sperling t...@sperling.com het
volgende:


 On Jul 20, 2013, at 5:34 PM, Frank Arensmeier farensme...@gmail.com
wrote:

  20 jul 2013 kl. 18:25 skrev Tedd Sperling t...@sperling.com:
 
  Hi gang:
 
  I've been using
 
$str = strip_tags($str, $allowable)
 
  as it is described via the manuals:
 
  http://php.net/manual/en/function.strip-tags.php
 
  The problem I've found is the tags br and br / are not
stripped.
 
  How do you strip all tags, but leave some tags (such as b, i, and
u -- I know these are depreciated, but my client wants them anyway).
 
  From the manual:
  allowable_tags
  You can use the optional second parameter to specify tags which should
not be stripped.
 
  Note:
  HTML comments and PHP tags are also stripped. This is hardcoded and can
not be changed with allowable_tags.
 
  Note:
  This parameter should not contain whitespace. strip_tags() sees a tag
as a case-insensitive string between  and the first whitespace or . It
means that strip_tags(br/, br) returns an empty string.
 
  It's all there… ;-)
 
  Cheers,
  /frank
 

 Yeah, but that wasn't the problem -- it was my mistake in coding.

 In any event, I figured it out.

 tedd


Could you perhaps post what the problem was so that when someone searches
for it they will have the answer right here?

- Matijn


php-general Digest 20 Jul 2013 16:21:53 -0000 Issue 8303

2013-07-20 Thread php-general-digest-help

php-general Digest 20 Jul 2013 16:21:53 - Issue 8303

Topics (messages 321651 through 321658):

Re: PHP and Powershell
321651 by: Alan Loos
321653 by: Serge Fonville
321654 by: Alan Loos
321655 by: Serge Fonville
321656 by: Tedd Sperling
321657 by: Alan Loos

Stripe Connect in the UK + PHP Integration.
321652 by: Richard Quadling

query order issue
321658 by: dealTek

Administrivia:

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

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

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


--
---BeginMessage---
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.commailto: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-gene...@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 alan.l...@genco.commailto: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:
?php


###
## Variables ##
###

$TargetName = Target1;
$login = \$cred = New-Object System.Management.Automation.PSCredential 
-ArgumentList 
@('administra...@widget.commailto: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\ NUL;



## Variable Checking (For Debug Mode) ##


#echo \$psCMD = $psCMD;



## Run Script ##


exec($psCMD,$out);



## Output ##


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


###
## 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

[PHP] query order issue

2013-07-20 Thread dealTek
Hi all,


I have a page that starts with several mysql sql query searches and displays 
data below...

then I added a form (with hidden line do-update value UPDATE) on the same 
page with action to same page...


then above other sql queries - I put...

if ((isset($_POST[do-update]))  ($_POST[do-update] == update)) {

---do update query---

echo 'meta http-equiv=refresh content=0; url=gohere.php';

}

but it shows error that happens AFTER the meta http-equiv=refresh has happened


Catchable fatal error: xxx on line 226



BTW - the meta http-equiv=refresh does work but the error flashes 1st for a 
second...

Q: I would have thought that it would not go past the line - meta 
http-equiv=refresh - but it does any insight on this






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



[PHP] strip_tags

2013-07-20 Thread Tedd Sperling
Hi gang:

I've been using

$str = strip_tags($str, $allowable)

as it is described via the manuals:

http://php.net/manual/en/function.strip-tags.php

The problem I've found is the tags br and br / are not stripped.

How do you strip all tags, but leave some tags (such as b, i, and u -- I 
know these are depreciated, but my client wants them anyway).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com


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



[PHP] Re: query order issue

2013-07-20 Thread Jim Giner

On 7/20/2013 12:21 PM, dealTek wrote:

Hi all,


I have a page that starts with several mysql sql query searches and displays 
data below...

then I added a form (with hidden line do-update value UPDATE) on the same 
page with action to same page...


then above other sql queries - I put...

if ((isset($_POST[do-update]))  ($_POST[do-update] == update)) {

---do update query---

echo 'meta http-equiv=refresh content=0; url=gohere.php';

}

but it shows error that happens AFTER the meta http-equiv=refresh has happened


Catchable fatal error: xxx on line 226



BTW - the meta http-equiv=refresh does work but the error flashes 1st for a 
second...

Q: I would have thought that it would not go past the line - meta 
http-equiv=refresh - but it does any insight on this






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


YOu are checking for a value of 'update' but you stated that the value 
clause was 'UPDATE'



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



[PHP] Re: query order issue

2013-07-20 Thread Jim Giner

On 7/20/2013 12:21 PM, dealTek wrote:

Hi all,


I have a page that starts with several mysql sql query searches and displays 
data below...

then I added a form (with hidden line do-update value UPDATE) on the same 
page with action to same page...


then above other sql queries - I put...

if ((isset($_POST[do-update]))  ($_POST[do-update] == update)) {

---do update query---

echo 'meta http-equiv=refresh content=0; url=gohere.php';

}

but it shows error that happens AFTER the meta http-equiv=refresh has happened


Catchable fatal error: xxx on line 226



BTW - the meta http-equiv=refresh does work but the error flashes 1st for a 
second...

Q: I would have thought that it would not go past the line - meta 
http-equiv=refresh - but it does any insight on this






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


YOu are checking for a value of 'update' but you stated that the value 
clause was 'UPDATE'



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



Re: [PHP] strip_tags

2013-07-20 Thread Frank Arensmeier
20 jul 2013 kl. 18:25 skrev Tedd Sperling t...@sperling.com:

 Hi gang:
 
 I've been using
 
$str = strip_tags($str, $allowable)
 
 as it is described via the manuals:
 
 http://php.net/manual/en/function.strip-tags.php
 
 The problem I've found is the tags br and br / are not stripped.
 
 How do you strip all tags, but leave some tags (such as b, i, and u -- 
 I know these are depreciated, but my client wants them anyway).
 
From the manual:
allowable_tags
You can use the optional second parameter to specify tags which should not be 
stripped.

Note:
HTML comments and PHP tags are also stripped. This is hardcoded and can not be 
changed with allowable_tags.

Note:
This parameter should not contain whitespace. strip_tags() sees a tag as a 
case-insensitive string between  and the first whitespace or . It means that 
strip_tags(br/, br) returns an empty string.

It's all there… ;-)

Cheers,
/frank


 Cheers,
 
 tedd
 
 _
 t...@sperling.com
 http://sperling.com
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] strip_tags

2013-07-20 Thread Tedd Sperling

On Jul 20, 2013, at 5:34 PM, Frank Arensmeier farensme...@gmail.com wrote:

 20 jul 2013 kl. 18:25 skrev Tedd Sperling t...@sperling.com:
 
 Hi gang:
 
 I've been using
 
   $str = strip_tags($str, $allowable)
 
 as it is described via the manuals:
 
 http://php.net/manual/en/function.strip-tags.php
 
 The problem I've found is the tags br and br / are not stripped.
 
 How do you strip all tags, but leave some tags (such as b, i, and u -- 
 I know these are depreciated, but my client wants them anyway).
 
 From the manual:
 allowable_tags
 You can use the optional second parameter to specify tags which should not be 
 stripped.
 
 Note:
 HTML comments and PHP tags are also stripped. This is hardcoded and can not 
 be changed with allowable_tags.
 
 Note:
 This parameter should not contain whitespace. strip_tags() sees a tag as a 
 case-insensitive string between  and the first whitespace or . It means 
 that strip_tags(br/, br) returns an empty string.
 
 It's all there… ;-)
 
 Cheers,
 /frank
 

Yeah, but that wasn't the problem -- it was my mistake in coding.

In any event, I figured it out.

tedd


_
t...@sperling.com
http://sperling.com

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



Re: [PHP] I am completely lost and need an advice (beginner)

2013-07-19 Thread Tamara Temple

On Jul 18, 2013, at 12:28 PM, Daniel Brown danbr...@php.net wrote:

 On Thu, Jul 18, 2013 at 3:08 PM, php colos phpco...@gmail.com wrote:
 Hello world!
 
 I'm trying to learn PHP ( first programming language that I learn) and
 I feel kinda lost. I've read PHP programming 3rd edition( O'reilly),
 'getting good with PHP' by Andrew Burgees and some tutorials on the
 internet but can't code something more complex than 'hello world'.
 
 
 I do understand functions/values/operators/control structures, etc but
 as I said, I feel that I can't use the language.
 Am I reading the wrong books for a beginner?
 
 Any advices?
 
 
 
 *Apologies if this email might seem confusing. :)
 
Perhaps I'm biased, but I think other folks will agree --- the
 official documentation is your best source of learning second only to
 your own experiences with the language.  Check through the user notes
 as well, as they often provide very valuable insight and other
 developers' personal experiences.
 
 --


I completely agree with Daniel that the online PHP documentation is the best 
way to understand the language. However, It seems our OP does not understand 
how to program. The php docs don't help with that.

If you really don't understand what programming is useful for, perhaps this is 
the wrong thing to be learning.

That said, what programming is for is to solve problems, provide tools, and 
provide means for people to communicate with each other and get work done via 
the computer and the internet. So, key, #1 thing: have a problem to solve.

While saying you understand various aspects of the language, I would say you 
cannot understand them until you actually put them to use, break things, learn 
how to fix them, and finally, teach someone else how to use them.

Almost every text, learning site, and documentation discusses how to write a 
program or application in the language or using the framework. Very, very few 
teach the essence of solving problems. Even the classics, such as Knuth's, 
Djyktra's, Wurth's, and so on, describe ways to solve particular problems. 
Patterns books describe how to structure solutions, but not actually how to 
solve problems in a general sense.



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



Re: [PHP] pass parameter from client to server

2013-07-19 Thread Tamara Temple

On Jul 18, 2013, at 6:53 PM, Joshua Kehn j...@kehn.us wrote:

 Could also use jquery instead 

True, but it's good to see the bare javascript as well in a demo.

 
 Best,
 
 -Josh
 ___
 http://byjakt.com
 Currently mobile
 
 On Jul 19, 2013, at 4:08, Tedd Sperling t...@sperling.com wrote:
 
 
 One additional comment.
 
 Please change the javascript onclick to onchange -- that way the demo will 
 work for Chrome as well as other Browsers.
 
 Cheers,
 
 tedd
 
 _
 t...@sperling.com
 http://sperling.com
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP 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
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 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:
 ?php


 ###
 ## 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\ NUL;


 
 ## Variable Checking (For Debug Mode) ##
 

 #echo \$psCMD = $psCMD;


 
 ## Run Script ##
 

 exec($psCMD,$out);


 
 ## Output ##
 

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


 ###
 ## 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 5.5.1 is now available

2013-07-19 Thread Julien Pauli
Hello,

The PHP Development team would like to inform you the immediate
availability of PHP 5.5.1. All users are encouraged to upgrade their
version.
This release includes bug fixes as well as a security fix (Bug #65236).
For changes in PHP 5.5.1, please consult the PHP 5 ChangeLog.


Release Announcement:
http://www.php.net/release_5_5_1.phphttp://www.php.net/release_5_5_0.php
Downloads:http://www.php.net/downloads.php#v5.5
Changelog:
http://www.php.net/ChangeLog-5.php#5.5.http://www.php.net/ChangeLog-5.php#5.5.0
1

regards,

Julien Pauli  David Soria Parra


[PHP] Re: zend framework getIdentity

2013-07-19 Thread Dan Joseph
On Wed, Jul 17, 2013 at 5:54 PM, Dan Joseph dmjos...@gmail.com wrote:

 Fatal error: Uncaught exception 'Zend_Session_Exception' with message
 'Zend_Session::start() -
 /product/Messenger-dev/Messenger/library/Zend/Session.php(Line:480): Error
 #2 Class __PHP_Incomplete_Class has no unserializer Array' in
 /product/Messenger-dev/Messenger/library/Zend/Session.php:493


I see I've stumped everyone here, so I wanted to post a reply on what I
found is the root cause of this.

Somewhere in all the code, there's a session_start happening.  Then
elsewhere that our other developer is working, there was another
introduced.  This appears to be the trigger for this error.

Hope this helps someone in the future!

-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ


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.commailto: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 alan.l...@genco.commailto: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:
?php


###
## Variables ##
###

$TargetName = Target1;
$login = \$cred = New-Object System.Management.Automation.PSCredential 
-ArgumentList 
@('administra...@widget.commailto: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\ NUL;



## Variable Checking (For Debug Mode) ##


#echo \$psCMD = $psCMD;



## Run Script ##


exec($psCMD,$out);



## Output ##


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


###
## 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

[PHP] Stripe Connect in the UK + PHP Integration.

2013-07-19 Thread Richard Quadling
Hi.

Simple question.

Has anyone got Stripe Connect, Stripe.js and Stripe PHP SDK operational in
the UK.

I'm struggling getting the UK Beta to accept a new account/customer set for
a UK business or individual, accepting GBP.

And I'm in the UK Beta!

Any help would be appreciated. Off list if preferred.

Regards,

Richard Quadling.


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 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… 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 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:
 ?php


 ###
 ## 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\ NUL;


 
 ## Variable Checking (For Debug Mode) ##
 

 #echo \$psCMD = $psCMD;


 
 ## Run Script ##
 

 exec($psCMD,$out);


 
 ## Output ##
 

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


 ###
 ## 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

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 alan.l...@genco.commailto: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.commailto:serge.fonvi...@gmail.com]
Sent: Friday, July 19, 2013 3:05 AM
To: Alan Loos
Cc: php-general@lists.php.netmailto: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 alan.l...@genco.commailto: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

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 alan.l...@genco.com

  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 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… 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) 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

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 serge.fonvi...@gmail.com 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 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

?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 ('pre');
print_r($out);
echo ('/pre');


###
## 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.


php-general Digest 18 Jul 2013 13:43:07 -0000 Issue 8300

2013-07-18 Thread php-general-digest-help

php-general Digest 18 Jul 2013 13:43:07 - Issue 8300

Topics (messages 321624 through 321632):

Re: Premature end of script
321624 by: Daniel Brown
321625 by: Jim Giner

Error checking ON
321626 by: Tedd Sperling
321627 by: Jim Giner
321628 by: Daniel Brown
321629 by: Tedd Sperling
321630 by: Jim Lucas

zend framework  getIdentity
321631 by: Dan Joseph

Split/Group date together.
321632 by: Karl-Arne Gjersøyen

Administrivia:

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

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

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


--
---BeginMessage---
On Wed, Jul 17, 2013 at 11:22 AM, R B rbp...@gmail.com wrote:
 Hello,

 5 years ago, y developed a php system and was working fine. But 20 days
 ago, when y try to access to some pages (not all the pages), in the log
 appears this message and the page is not displayed:

 == /usr/local/apache/logs/error_log ==
 [Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
 script
 headers: /home/capitale/public_html/miembros/myscript.php

 Can you help me please with this error?

It's the vaguest of all errors and the bane of the existence of
any developer who comes across it (at least it's rarer in PHP than it
was in Perl years ago).  Essentially, it would require a lot more
information that what's been provided for us to help you debug.

What things have changed in the last month?  Have you upgraded
PHP?  Made any changes to the code or any of the dependencies?  Is the
server out of available disk space?  Is something causing it to run
out of memory?  What happens when you run the same script from the
CLI?  What do you see when you enable all errors and error reporting?


--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/
---End Message---
---BeginMessage---

On 7/17/2013 11:22 AM, R B wrote:

Hello,

5 years ago, y developed a php system and was working fine. But 20 days
ago, when y try to access to some pages (not all the pages), in the log
appears this message and the page is not displayed:

== /usr/local/apache/logs/error_log ==
[Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
script
headers: /home/capitale/public_html/miembros/myscript.php

Can you help me please with this error?

Thank you.

Since you state that you haven't made any changes to the system (in 
general), I'm going to guess that you modified an 'included' file and it 
has an error in it, such as an unmatched curly brace.  As Dan said, turn 
on all error checking and reporting and see what message you get.
---End Message---
---BeginMessage---
Hi gang:

Considering:

On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since you state that you haven't made any changes to the system (in general), 
 I'm going to guess that you modified an 'included' file and it has an error 
 in it, such as an unmatched curly brace.  As Dan said, turn on all error 
 checking and reporting and see what message you get.

This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');  

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

---End Message---
---BeginMessage---

On 7/17/2013 11:49 AM, Tedd Sperling wrote:

Hi gang:

Considering:

On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:


Since you state that you haven't made any changes to the system (in general), 
I'm going to guess that you modified an 'included' file and it has an error in 
it, such as an unmatched curly brace.  As Dan said, turn on all error checking 
and reporting and see what message you get.


This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');  

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

When I'm in development mode, I leave out the last two settings and take 
my error messages from the screen.  Simpler, quicker.  I use an include 
file that is based upon a switch.  When it's on, I set my devl settings, 
when not, I set my prod settings.
---End Message---
---BeginMessage---
On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 Considering:

 On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since

php-general Digest 19 Jul 2013 01:53:46 -0000 Issue 8301

2013-07-18 Thread php-general-digest-help

php-general Digest 19 Jul 2013 01:53:46 - Issue 8301

Topics (messages 321633 through 321645):

Re: Split/Group date together.
321633 by: Bastien Koert
321634 by: Larry Garfield

PHP and Powershell
321635 by: Alan Loos

I am completely lost and need an advice (beginner)
321636 by: php colos
321637 by: shiplu
321638 by: Daniel Brown
321639 by: Carsten Jensen
321640 by: Sebastian Krebs

pass parameter from client to server
321641 by: iccsi
321642 by: Daniel Brown
321643 by: Tedd Sperling
321644 by: Tedd Sperling
321645 by: Joshua Kehn

Administrivia:

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

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

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


--
---BeginMessage---
Normally, what I do here is handle that in the loop to display the records
... so start by adding an order by clause to keep the dates together

SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013' order by dato

$prior_date = ;

$sHTML = table;

while($rows = mysql_fetch_array($result)){

if ($prior_date != $rows['dato']){
if($open_table){
   $sHTML .= /tabletable;
   $prior_date = $rows['dato'];
 }
}
$sHTML .= tr;
$sHTML .= td. $rows['dato'] . /td;
$sHTML .= td. $rows['some_field'] . /td;
$sHTML .= td. $rows['another_field'] . /td;
$sHTML .= td. $rows['third_field'] . /td;
$sHTML .= /tr;
}

$sHTML .= /table;


On Thu, Jul 18, 2013 at 9:43 AM, Karl-Arne Gjersøyen karlar...@gmail.comwrote:

 Hello again.
 In my program I have this:

 mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
 = '18/7/2013';

 This list all reccrds for 3 days. I need a way to split it up for every day
 even when the requst is as above and don't know in what way I can do it.

 I like to have all records for day 16 in one table in PHP/HTML and all
 records for day 17 in another table.
 i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

 I hope for your help and advice to do also this correct.

 Thank you for your time and effort!

 Karl




-- 

Bastien

Cat, the other other white meat
---End Message---
---BeginMessage---
If I understand you correctly, I call what you're trying to do PHP 
group by, and did a write up on it a few years back:


http://www.garfieldtech.com/blog/php-group-by-with-arrays

--Larry Garfield

On 7/18/13 8:43 AM, Karl-Arne Gjersøyen wrote:

Hello again.
In my program I have this:

mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013';

This list all reccrds for 3 days. I need a way to split it up for every day
even when the requst is as above and don't know in what way I can do it.

I like to have all records for day 16 in one table in PHP/HTML and all
records for day 17 in another table.
i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

I hope for your help and advice to do also this correct.

Thank you for your time and effort!

Karl

---End Message---
---BeginMessage---
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:
?php


###
## 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\ NUL;



## Variable Checking (For Debug Mode) ##


#echo \$psCMD = $psCMD;



## Run Script ##


exec($psCMD,$out);



## Output ##


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


###
## 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

[PHP] Split/Group date together.

2013-07-18 Thread Karl-Arne Gjersøyen
Hello again.
In my program I have this:

mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013';

This list all reccrds for 3 days. I need a way to split it up for every day
even when the requst is as above and don't know in what way I can do it.

I like to have all records for day 16 in one table in PHP/HTML and all
records for day 17 in another table.
i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

I hope for your help and advice to do also this correct.

Thank you for your time and effort!

Karl


Re: [PHP] Split/Group date together.

2013-07-18 Thread Bastien Koert
Normally, what I do here is handle that in the loop to display the records
... so start by adding an order by clause to keep the dates together

SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013' order by dato

$prior_date = ;

$sHTML = table;

while($rows = mysql_fetch_array($result)){

if ($prior_date != $rows['dato']){
if($open_table){
   $sHTML .= /tabletable;
   $prior_date = $rows['dato'];
 }
}
$sHTML .= tr;
$sHTML .= td. $rows['dato'] . /td;
$sHTML .= td. $rows['some_field'] . /td;
$sHTML .= td. $rows['another_field'] . /td;
$sHTML .= td. $rows['third_field'] . /td;
$sHTML .= /tr;
}

$sHTML .= /table;


On Thu, Jul 18, 2013 at 9:43 AM, Karl-Arne Gjersøyen karlar...@gmail.comwrote:

 Hello again.
 In my program I have this:

 mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
 = '18/7/2013';

 This list all reccrds for 3 days. I need a way to split it up for every day
 even when the requst is as above and don't know in what way I can do it.

 I like to have all records for day 16 in one table in PHP/HTML and all
 records for day 17 in another table.
 i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

 I hope for your help and advice to do also this correct.

 Thank you for your time and effort!

 Karl




-- 

Bastien

Cat, the other other white meat


Re: [PHP] Split/Group date together.

2013-07-18 Thread Larry Garfield
If I understand you correctly, I call what you're trying to do PHP 
group by, and did a write up on it a few years back:


http://www.garfieldtech.com/blog/php-group-by-with-arrays

--Larry Garfield

On 7/18/13 8:43 AM, Karl-Arne Gjersøyen wrote:

Hello again.
In my program I have this:

mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013';

This list all reccrds for 3 days. I need a way to split it up for every day
even when the requst is as above and don't know in what way I can do it.

I like to have all records for day 16 in one table in PHP/HTML and all
records for day 17 in another table.
i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

I hope for your help and advice to do also this correct.

Thank you for your time and effort!

Karl



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



[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:
?php


###
## 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\ NUL;



## Variable Checking (For Debug Mode) ##


#echo \$psCMD = $psCMD;



## Run Script ##


exec($psCMD,$out);



## Output ##


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


###
## 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] I am completely lost and need an advice (beginner)

2013-07-18 Thread php colos
Hello world!

I'm trying to learn PHP ( first programming language that I learn) and
I feel kinda lost. I've read PHP programming 3rd edition( O'reilly),
'getting good with PHP' by Andrew Burgees and some tutorials on the
internet but can't code something more complex than 'hello world'.


I do understand functions/values/operators/control structures, etc but
as I said, I feel that I can't use the language.
Am I reading the wrong books for a beginner?

Any advices?



*Apologies if this email might seem confusing. :)

Richard

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



Re: [PHP] I am completely lost and need an advice (beginner)

2013-07-18 Thread shiplu
On Fri, Jul 19, 2013 at 1:08 AM, php colos phpco...@gmail.com wrote:

 Am I reading the wrong books for a beginner?




Do you just read the book or also do what it says to do? If you just read
but dont code along with it, you may not learn anything. After reading a
lot of book you'll feel you have understand a lot of things. But thats true
when you read. Not when you code.

Just follow the instructions on the book. I hope you'll be able to write a
lot of code.

-- 
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader


Re: [PHP] I am completely lost and need an advice (beginner)

2013-07-18 Thread Daniel Brown
On Thu, Jul 18, 2013 at 3:08 PM, php colos phpco...@gmail.com wrote:
 Hello world!

 I'm trying to learn PHP ( first programming language that I learn) and
 I feel kinda lost. I've read PHP programming 3rd edition( O'reilly),
 'getting good with PHP' by Andrew Burgees and some tutorials on the
 internet but can't code something more complex than 'hello world'.


 I do understand functions/values/operators/control structures, etc but
 as I said, I feel that I can't use the language.
 Am I reading the wrong books for a beginner?

 Any advices?



 *Apologies if this email might seem confusing. :)

Perhaps I'm biased, but I think other folks will agree --- the
official documentation is your best source of learning second only to
your own experiences with the language.  Check through the user notes
as well, as they often provide very valuable insight and other
developers' personal experiences.

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] I am completely lost and need an advice (beginner)

2013-07-18 Thread Carsten Jensen
On 07/18/2013 09:08 PM, php colos wrote:
 Hello world!
 
 I'm trying to learn PHP ( first programming language that I learn) and
 I feel kinda lost. I've read PHP programming 3rd edition( O'reilly),
 'getting good with PHP' by Andrew Burgees and some tutorials on the
 internet but can't code something more complex than 'hello world'.
 
 
 I do understand functions/values/operators/control structures, etc but
 as I said, I feel that I can't use the language.
 Am I reading the wrong books for a beginner?
 
 Any advices?
 
 
 
 *Apologies if this email might seem confusing. :)
 
 Richard
 

As others have mentioned, reading only isn't a good thing. You'll need
to code alongside reading.

You also might need to have a goal/project to motivate you to code.
Starting small is a good thing. Or you could help out some of the
smaller php projects that have only a few coders. Fixing bugs in a
project can be a great help, and you'll learn a lot.

If you don't have any project in mind, you can go to codecademy.com
or some of the other interactive learning sites to start coding.
I just checked, they've implemented PHP now, I haven't tried this. But
the javascript course is great.

cheers
Carsten







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



Re: [PHP] I am completely lost and need an advice (beginner)

2013-07-18 Thread Sebastian Krebs
2013/7/18 Carsten Jensen to...@tomse.dk

 On 07/18/2013 09:08 PM, php colos wrote:
  Hello world!
 
  I'm trying to learn PHP ( first programming language that I learn) and
  I feel kinda lost. I've read PHP programming 3rd edition( O'reilly),
  'getting good with PHP' by Andrew Burgees and some tutorials on the
  internet but can't code something more complex than 'hello world'.
 
 
  I do understand functions/values/operators/control structures, etc but
  as I said, I feel that I can't use the language.
  Am I reading the wrong books for a beginner?
 
  Any advices?
 
 
 
  *Apologies if this email might seem confusing. :)
 
  Richard
 

 As others have mentioned, reading only isn't a good thing. You'll need
 to code alongside reading.

 You also might need to have a goal/project to motivate you to code.
 Starting small is a good thing. Or you could help out some of the
 smaller php projects that have only a few coders. Fixing bugs in a
 project can be a great help, and you'll learn a lot.

 If you don't have any project in mind, you can go to codecademy.com
 or some of the other interactive learning sites to start coding.
 I just checked, they've implemented PHP now, I haven't tried this. But
 the javascript course is great.

 cheers
 Carsten



Same here: Just reading doesn't help you very much.

You should also consider reading books about programming in general, or
even better get in contact with more (or less ;)) experienced programmers,
because in my experience learning the syntax and writing code is just a
very minor part. Its more important to know how to solve the problems (in a
way, that works tomorrow too ;)) is more important. And as a side effect
getting help can prevent frustration, if you are stuck in a problem ;)

Regards,
Sebastian







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




-- 
github.com/KingCrunch


[PHP] pass parameter from client to server

2013-07-18 Thread iccsi
I have a select control on the form and need to pass value user select to my 
query parameter.
I just realized that user entry value is client side and query parameter is 
server side.

Are there any way to read client parameter to pass to server?

You information and help is great appreciated,

Regards,

Iccsi, 



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



Re: [PHP] pass parameter from client to server

2013-07-18 Thread Daniel Brown
On Thu, Jul 18, 2013 at 6:04 PM, iccsi inu...@gmail.com wrote:
 I have a select control on the form and need to pass value user select to my
 query parameter.
 I just realized that user entry value is client side and query parameter is
 server side.
 Are there any way to read client parameter to pass to server?

 You information and help is great appreciated,

Not from PHP unless you pass it via GET or POST, or as a cookie.
You may want to look into JavaScript, jQuery, and AJAX for your
specific needs, but that all gets beyond the scope of this list.

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] pass parameter from client to server

2013-07-18 Thread Tedd Sperling




On Jul 18, 2013, at 6:07 PM, Daniel Brown danbr...@php.net wrote:

 On Thu, Jul 18, 2013 at 6:04 PM, iccsi inu...@gmail.com wrote:
 I have a select control on the form and need to pass value user select to my
 query parameter.
 I just realized that user entry value is client side and query parameter is
 server side.
 Are there any way to read client parameter to pass to server?
 
 You information and help is great appreciated,
 
Not from PHP unless you pass it via GET or POST, or as a cookie.
 You may want to look into JavaScript, jQuery, and AJAX for your
 specific needs, but that all gets beyond the scope of this list.

Daniel is right.

Here's my way to do what you are asking:

http://php1.net/a/ajax/

Please examine the javascript that accompanies the demo.

It simply sends GET values to a php script that changes the values in the GET 
Array without a refresh.

However, I would not provide such access to a db query without a great deal of 
cleaning.

Cheers,

tedd


_
tedd.sperl...@gmail.com
http://sperling.com


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



Re: [PHP] pass parameter from client to server

2013-07-18 Thread Tedd Sperling

One additional comment.

Please change the javascript onclick to onchange -- that way the demo will work 
for Chrome as well as other Browsers.

Cheers,

tedd

_
t...@sperling.com
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] pass parameter from client to server

2013-07-18 Thread Joshua Kehn
Could also use jquery instead 

Best,

-Josh
___
http://byjakt.com
Currently mobile

On Jul 19, 2013, at 4:08, Tedd Sperling t...@sperling.com wrote:

 
 One additional comment.
 
 Please change the javascript onclick to onchange -- that way the demo will 
 work for Chrome as well as other Browsers.
 
 Cheers,
 
 tedd
 
 _
 t...@sperling.com
 http://sperling.com
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



php-general Digest 17 Jul 2013 15:23:04 -0000 Issue 8299

2013-07-17 Thread php-general-digest-help

php-general Digest 17 Jul 2013 15:23:04 - Issue 8299

Topics (messages 321621 through 321623):

Re: How to read PHP-FPM config values using phpinfo
321621 by: Daniel
321622 by: Amiya Maji

Premature end of script
321623 by: R B

Administrivia:

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

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

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


--
---BeginMessage---
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

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

---End Message---
---BeginMessage---
Daniel, thanks for asking. 
I do have Apache correctly configured to use fpm, in fact, phpinfo shows 
php-fpm as the cgi module. Only problem is to read (or dump) the Fpm configs 
from phpinfo.

Regards,
Amiya.




 Original message 
From: Daniel danielx...@gmail.com 
Date: 07/16/2013  9:48 PM  (GMT-05:00) 
To: Amiya Maji am...@purdue.edu 
Cc: php-gene...@lists.php.net 
Subject: Re: [PHP] How to read PHP-FPM config values using phpinfo 
 
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

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

---End Message---
---BeginMessage---
Hello,

5 years ago, y developed a php system and was working fine. But 20 days
ago, when y try to access to some pages (not all the pages), in the log
appears this message and the page is not displayed:

== /usr/local/apache/logs/error_log ==
[Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
script
headers: /home/capitale/public_html/miembros/myscript.php

Can you help me please with this error?

Thank you.
---End Message---


[PHP] Premature end of script

2013-07-17 Thread R B
Hello,

5 years ago, y developed a php system and was working fine. But 20 days
ago, when y try to access to some pages (not all the pages), in the log
appears this message and the page is not displayed:

== /usr/local/apache/logs/error_log ==
[Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
script
headers: /home/capitale/public_html/miembros/myscript.php

Can you help me please with this error?

Thank you.


Re: [PHP] Premature end of script

2013-07-17 Thread Daniel Brown
On Wed, Jul 17, 2013 at 11:22 AM, R B rbp...@gmail.com wrote:
 Hello,

 5 years ago, y developed a php system and was working fine. But 20 days
 ago, when y try to access to some pages (not all the pages), in the log
 appears this message and the page is not displayed:

 == /usr/local/apache/logs/error_log ==
 [Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
 script
 headers: /home/capitale/public_html/miembros/myscript.php

 Can you help me please with this error?

It's the vaguest of all errors and the bane of the existence of
any developer who comes across it (at least it's rarer in PHP than it
was in Perl years ago).  Essentially, it would require a lot more
information that what's been provided for us to help you debug.

What things have changed in the last month?  Have you upgraded
PHP?  Made any changes to the code or any of the dependencies?  Is the
server out of available disk space?  Is something causing it to run
out of memory?  What happens when you run the same script from the
CLI?  What do you see when you enable all errors and error reporting?


--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



[PHP] Re: Premature end of script

2013-07-17 Thread Jim Giner

On 7/17/2013 11:22 AM, R B wrote:

Hello,

5 years ago, y developed a php system and was working fine. But 20 days
ago, when y try to access to some pages (not all the pages), in the log
appears this message and the page is not displayed:

== /usr/local/apache/logs/error_log ==
[Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
script
headers: /home/capitale/public_html/miembros/myscript.php

Can you help me please with this error?

Thank you.

Since you state that you haven't made any changes to the system (in 
general), I'm going to guess that you modified an 'included' file and it 
has an error in it, such as an unmatched curly brace.  As Dan said, turn 
on all error checking and reporting and see what message you get.


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



[PHP] Error checking ON

2013-07-17 Thread Tedd Sperling
Hi gang:

Considering:

On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since you state that you haven't made any changes to the system (in general), 
 I'm going to guess that you modified an 'included' file and it has an error 
 in it, such as an unmatched curly brace.  As Dan said, turn on all error 
 checking and reporting and see what message you get.

This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');  

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com


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



[PHP] Re: Error checking ON

2013-07-17 Thread Jim Giner

On 7/17/2013 11:49 AM, Tedd Sperling wrote:

Hi gang:

Considering:

On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:


Since you state that you haven't made any changes to the system (in general), 
I'm going to guess that you modified an 'included' file and it has an error in 
it, such as an unmatched curly brace.  As Dan said, turn on all error checking 
and reporting and see what message you get.


This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');  

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

When I'm in development mode, I leave out the last two settings and take 
my error messages from the screen.  Simpler, quicker.  I use an include 
file that is based upon a switch.  When it's on, I set my devl settings, 
when not, I set my prod settings.


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



Re: [PHP] Error checking ON

2013-07-17 Thread Daniel Brown
On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 Considering:

 On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since you state that you haven't made any changes to the system (in 
 general), I'm going to guess that you modified an 'included' file and it has 
 an error in it, such as an unmatched curly brace.  As Dan said, turn on all 
 error checking and reporting and see what message you get.

 This is what I do for error checking:

 ini_set('error_reporting', E_ALL | E_STRICT);
 ini_set('display_errors', 'On');
 ini_set('log_errors', 'On');
 ini_set('error_log', 'error_log');

 Is this:

 1. Sufficient?

 2. An overkill?

 3. OK?

 4. OR, better served with this (and provide an example).

That's standard practice.  Sometimes, though, it isn't enough, and
we find ourselves using Derick's Xdebug, mod_top, or performing an
strace on either the execution or attached to a process.  For nearly
all cases, though, that's sufficient without being overkill (except
for production cases).

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] Error checking ON

2013-07-17 Thread Tedd Sperling
On Jul 17, 2013, at 11:55 AM, Daniel Brown danbr...@php.net wrote:
 On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:
 This is what I do for error checking:
 
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');
 
 Is this:
 
 1. Sufficient?
 
 2. An overkill?
 
 3. OK?
 
 4. OR, better served with this (and provide an example).
 
That's standard practice.  Sometimes, though, it isn't enough, and
 we find ourselves using Derick's Xdebug, mod_top, or performing an
 strace on either the execution or attached to a process.  For nearly
 all cases, though, that's sufficient without being overkill (except
 for production cases).
 

Daniel:

Thanks -- I always wondered about that.

Cheers,

tedd

PS: Of course, turned OFF for production. :-)

_
t...@sperling.com
http://sperling.com

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



Re: [PHP] Error checking ON

2013-07-17 Thread Jim Lucas

On 07/17/2013 09:28 AM, Tedd Sperling wrote:

On Jul 17, 2013, at 11:55 AM, Daniel Brown danbr...@php.net wrote:

On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:

This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).


That's standard practice.  Sometimes, though, it isn't enough, and
we find ourselves using Derick's Xdebug, mod_top, or performing an
strace on either the execution or attached to a process.  For nearly
all cases, though, that's sufficient without being overkill (except
for production cases).



Daniel:

Thanks -- I always wondered about that.

Cheers,

tedd

PS: Of course, turned OFF for production. :-)

_
t...@sperling.com
http://sperling.com



But...  It won't work in all cases.  I find it best to set these 
settings in the server itself.  Not in code.  Sometimes, if you have 
broken code that cannot be parsed, your commands listed above will never 
be executed.  Therefor they will never do any good.


--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/

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



[PHP] zend framework getIdentity

2013-07-17 Thread Dan Joseph
Hey Folks,

Getting a weird error...

Fatal error: Uncaught exception 'Zend_Session_Exception' with message
'Zend_Session::start() -
/product/Messenger-dev/Messenger/library/Zend/Session.php(Line:480): Error
#2 Class __PHP_Incomplete_Class has no unserializer Array' in
/product/Messenger-dev/Messenger/library/Zend/Session.php:493
Stack trace:
#0
/product/Messenger-dev/Messenger/library/Zend/Session/Namespace.php(143):
Zend_Session::start(true)
#1
/product/Messenger-dev/Messenger/library/Zend/Auth/Storage/Session.php(87):
Zend_Session_Namespace-__construct('Zend_Auth')
#2 /product/Messenger-dev/Messenger/library/Zend/Auth.php(91):
Zend_Auth_Storage_Session-__construct()
#3 /product/Messenger-dev/Messenger/library/Zend/Auth.php(151):
Zend_Auth-getStorage()
#4
/product/Messenger-dev/Messenger/library/Messenger/Core/Db/Profiler/Log.php(53):
Zend_Auth-getIdentity()
#5
/product/Messenger-dev/Messenger/library/Lm/Application/Resource/Config.php(18):
Messenger_Core_Db_Profiler_Log-__construct()
#6 /product/Messenger-dev/Messenger/library/Zend/Application/Bootstr in
/product/Messenger-dev/Messenger/library/Zend/Session.php on line 493

This seems to be triggered by:

 $this-_identity = Zend_Auth::getInstance()-getIdentity();


Has anyone seen this error before?  Its throwing me for a loop

-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ


php-general Digest 16 Jul 2013 23:58:16 -0000 Issue 8298

2013-07-16 Thread php-general-digest-help

php-general Digest 16 Jul 2013 23:58:16 - Issue 8298

Topics (messages 321617 through 321620):

Kickstarter Project on Massive Log data Aggregation and Processing with Open 
Source Software
321617 by: Israel Ekpo
321618 by: Daniel Brown

Problem with dba_open() on db4 database
321619 by: Thorsten Göllner

How to read PHP-FPM config values using phpinfo
321620 by: Amiya Maji

Administrivia:

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

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

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


--
---BeginMessage---
Hi Everyone,

I just launched a Kickstarter project that will fund the creation of a
course on how to aggregate, process, search and visualize massive log data
using open source software.

I believe some of the folks on the user mailing list would find this
helpful.

Web applications do generate a lot of log data and I believe that knowing
how to deal with it could be very valuable.

Is it OK to send out an email with a summary of what the project is about?
---End Message---
---BeginMessage---
On Jul 15, 2013 11:29 PM, Israel Ekpo israele...@gmail.com wrote:

 Hi Everyone,

[snip!]

No.  Good luck with your endeavor, but please do not broadcast it to
this list.
---End Message---
---BeginMessage---

Hi,

I am using a db4 database to store some values (on the local 
filesystem). Here the sample code:


$handle = dba_open(/var/cache/mydb.db, cd, db4);
[...]
$result = dba_replace($key, serialize($data), $handle);
[...]
dba_close($handle);

This Code is used in a CLI-Script (in an Asterisk-AGI-Script) and will 
be used by some processes in parallel. The online documentation 
(http://de1.php.net/manual/en/function.dba-open.php) shows, that the 
function should wait if more than a process has a lock on the 
database. This works fine if I use the script an execute it in differnt 
shells in parallel.


But SOMETIMES(!) I get (in the Asterisk-Environment) the following error 
message:
dba_open(/var/cache/mydb.db,cd): Driver initialization failed for 
handler: db4: Unable to establish lock (database file already open)


So it seems, that the function dba_open() returns immediatly without 
waiting for lock release. But I do not know why ... ?!


I am using the following versions:
Ubuntu 12.04. LTS (up to date) with PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch

Any idea?

Thank in advance
-Thorsten-





---End Message---
---BeginMessage---

Hi all,

I am using PHP-FPM with Apache 2.4. I periodically change my 
php-fpm.conf and reload it by sending USR2 signal to the FPM process. Is 
there a way to print the updated parameters in FPM using phpinfo().
At present I am not seeing any FPM specific parameters in phpinfo. Any 
suggestion is appreciated.


Thanks!
Amiya.
---End Message---


[PHP] Problem with dba_open() on db4 database

2013-07-16 Thread Thorsten Göllner

Hi,

I am using a db4 database to store some values (on the local 
filesystem). Here the sample code:


$handle = dba_open(/var/cache/mydb.db, cd, db4);
[...]
$result = dba_replace($key, serialize($data), $handle);
[...]
dba_close($handle);

This Code is used in a CLI-Script (in an Asterisk-AGI-Script) and will 
be used by some processes in parallel. The online documentation 
(http://de1.php.net/manual/en/function.dba-open.php) shows, that the 
function should wait if more than a process has a lock on the 
database. This works fine if I use the script an execute it in differnt 
shells in parallel.


But SOMETIMES(!) I get (in the Asterisk-Environment) the following error 
message:
dba_open(/var/cache/mydb.db,cd): Driver initialization failed for 
handler: db4: Unable to establish lock (database file already open)


So it seems, that the function dba_open() returns immediatly without 
waiting for lock release. But I do not know why ... ?!


I am using the following versions:
Ubuntu 12.04. LTS (up to date) with PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch

Any idea?

Thank in advance
-Thorsten-






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



[PHP] How to read PHP-FPM config values using phpinfo

2013-07-16 Thread Amiya Maji

Hi all,

I am using PHP-FPM with Apache 2.4. I periodically change my 
php-fpm.conf and reload it by sending USR2 signal to the FPM process. Is 
there a way to print the updated parameters in FPM using phpinfo().
At present I am not seeing any FPM specific parameters in phpinfo. Any 
suggestion is appreciated.


Thanks!
Amiya.

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



Re: [PHP] How to read PHP-FPM config values using phpinfo

2013-07-16 Thread Daniel
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

 --
 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] How to read PHP-FPM config values using phpinfo

2013-07-16 Thread Amiya Maji
Daniel, thanks for asking. 
I do have Apache correctly configured to use fpm, in fact, phpinfo shows 
php-fpm as the cgi module. Only problem is to read (or dump) the Fpm configs 
from phpinfo.

Regards,
Amiya.




 Original message 
From: Daniel danielx...@gmail.com 
Date: 07/16/2013  9:48 PM  (GMT-05:00) 
To: Amiya Maji am...@purdue.edu 
Cc: php-general@lists.php.net 
Subject: Re: [PHP] How to read PHP-FPM config values using phpinfo 
 
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

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



php-general Digest 15 Jul 2013 08:21:53 -0000 Issue 8296

2013-07-15 Thread php-general-digest-help

php-general Digest 15 Jul 2013 08:21:53 - Issue 8296

Topics (messages 321612 through 321613):

Re: COM - Assigning to method.
321612 by: Andrew Ballard
321613 by: Adam Nicholls

Administrivia:

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

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

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


--
---BeginMessage---
On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com wrote:

 Richard - I've tried that I get an error about it not being defined as
 property of the object.

 Andrew - do you mean try using the method Richard has shown?

 Cheers
 Adam.

 On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:
 
 
 
  On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:
 
  On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
  
   Hi Guys/Gals,
  
   I'm doing some integration work with a COM API and according to their
   documentation to save data in the API, you have to assign to the
   method.
  
   This is their example in Visual Basic:
  
  
 
  -
   Set oBank = New CBank
   oBank.Init Application.SessionContext
   With oBank
   .Fields(BANK_fld_ACCOUNT_NAME) = Test account
   .Fields(BANK_fld_ACCOUNT_NO) = 12345
   .Fields(BANK_fld_BANK) = Bank of the Nation
   .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
   End With
   oBank.Save
  
 
  -
  
   Obviously in PHP is isn't possible to assign to a method in this way
   (thats what parameters are for!) So I'm at a bit of a loose end. I'm
   wondering if anyone else has come across this? Or am I missing
   something obvious in PHP's implementation of the COM that allows me to
   work around this?
  
   My PHP Code is looks like this:
  
 
  -
   $API = new COM('API7.API');
   $API-Init($SerialNo, $Login, '', 1, '', 1);
   $API-SignOutOnTerminate = True;
  
   $Record = new COM(Data.Record);
   $Record-Init($API-SessionContext);
  
   $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
  
 
  -
  
   I've also tried (below) but the API says wrong number of parameters
   $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
  
   I've also tried something crazy like this (below) but that overwrites
   the $Record object.
   $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
   $_R = 'Test Account';
  
  
   Any ideas? Is it possible?
  
  
   Many Thanks
   Adam Nicholls
  
 
  That example isn't assigning values to method return value. Fields is a
  collection of ADO Field objects. The default property of a Field object is
  its Value property, so the shorthand is simply assigning the values of the
  variables to the value of each field in a record within a Recordset.
 
  Andrew
 
 
  So ..
 
  $oBank-BANK_fld_ACCOUNT_NAME = Test account;
 
  sort of thing.
 
  --
  Richard Quadling
  Twitter : @RQuadling



 --
 Adam Nicholls

Richard has the general idea correct, but as I recall it is a little
more involved because it's COM. I've never done that much with COM in
PHP because it was always such a pain. The example you posted probably
used to require com_set() in PHP 4, although it looks like that has
been deprecated in favor of a more typical OO syntax in PHP 5. Is
there any chance there is a PHP version of the library that you can
work with to avoid COM? If not, hopefully what follows will help start
you on the right direction.

A more explicit version of your original VBScript example looks like this:

Set oBank = New CBank
oBank.Init Application.SessionContext

Set oField = oBank.Fields(BANK_fld_ACCOUNT_NAME)
oField.Value = Test account
Set oField = oBank.Fields(BANK_fld_ACCOUNT_NO)
oField.Value = 12345
Set oField = oBank.Fields(BANK_fld_BANK)
oField.Value = Bank of the Nation
Set oField = oBank.Fields(BANK_fld_BRANCH_NAME)
oField.Value = State Street Branch

oBank.Save


I'm not familiar with your CBank COM class, but the rest of it looks
like it is similar to the COM('ADODB.Recordset'). If so, a rough
translation of your original example should resemble this:

?php
// I'm not familiar with this object, so I'm guessing on the call to
instantiate it here.
$oBank = new COM('CBank');

/**
Application.SessionContext in the original refers to an object that is
global to every request in an application. PHP does not have such a
global registry, so I'm not sure where you're $config needs to come
from.
*/
$oBank-Init($config);

/**
I am assuming that BANK_fld_ACCOUNT_NAME

php-general Digest 15 Jul 2013 21:26:50 -0000 Issue 8297

2013-07-15 Thread php-general-digest-help

php-general Digest 15 Jul 2013 21:26:50 - Issue 8297

Topics (messages 321614 through 321616):

Re: COM - Assigning to method.
321614 by: Pøemysl Fiala
321615 by: Andrew Ballard

Urgent Requirement - PHP Senior Developer / Seasoned Trainer
321616 by: Nitin Sathawane

Administrivia:

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

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

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


--
---BeginMessage---

Hello,

did you tried var_dump or print_r the $oBank object to see his structure ?

Also you can try:

 $BANK_fld_BRANCH_NAME = 22;
 $oBank-$BANK_fld_BRANCH_NAME  = 'something';


Premek.


On Mon, 15 Jul 2013 10:21:48 +0200, Adam Nicholls inkysp...@gmail.com  
wrote:



Hi Andrew

Thanks for this.

But I'm still getting errors. I think I need to explain a bit more.

Unfortunately there isn't a PHP API for this application I'm trying to
interact with, my goal really is to be able to expose the COM
functionality over a web-service such as SOAP so I can use it in a
CMS. The application I'm trying to integrate with is Blackbuad's
Raiser's Edge - API documentation here:
https://www.blackbaud.com/files/support/guides/re7ent/api.pdf

I think part of the problem is that the field names are also
represented by an integer. So to get data out I would do:

$oBank-Fields(22);   // which maps to BANK_fld_BRANCH_NAME.

When I do:

$oBank-22 = 'blah blah';

I get an error because a property can't be numeric, it has to start as
alpha character. If I use:

$oBank-BANK_fld_BRANCH_NAME = 'blah blah blah';

I get the following error:

Fatal error: Uncaught exception 'com_exception' with message 'Unable
to lookup `BANK_fld_BRANCH_NAME': Unknown name.

I've also tried using your Value property returned by Fields():

$oBank-Fields(22)-Value = 'Blah Blah blah blah';

Which I then get:
PHP Warning:  Creating default object from empty value in [C:\Users]
Fatal error: Call to undefined method variant::Save()

Soo seems nearly impossible to implement a safe way to write to the COM  
API.



At the moment, I'm still in the scoping/prototype stage of my project,
so I'm beginning to think that using this COM API for this project is
a no-go, which is unfortunate. I'm also guessing even if we did
implement this API, exposing it as a Web Service is going to be tricky
for performance sake (given that I've read that COM doesn't
multithread very well??)

Many Thanks
Adam.

On 14 July 2013 22:16, Andrew Ballard aball...@gmail.com wrote:
On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com  
wrote:


Richard - I've tried that I get an error about it not being defined as
property of the object.

Andrew - do you mean try using the method Richard has shown?

Cheers
Adam.

On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:



 On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com  
wrote:

 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to  
their

  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

  
-

  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

  
-

 
  Obviously in PHP is isn't possible to assign to a method in this  
way
  (thats what parameters are for!) So I'm at a bit of a loose end.  
I'm

  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows  
me to

  work around this?
 
  My PHP Code is looks like this:
 

  
-

  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test  
Account';//doesn't work

 

  
-

 
  I've also tried (below) but the API says wrong number of  
parameters

  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that  
overwrites

  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any

Re: [PHP] COM - Assigning to method.

2013-07-15 Thread Adam Nicholls
Hi Andrew

Thanks for this.

But I'm still getting errors. I think I need to explain a bit more.

Unfortunately there isn't a PHP API for this application I'm trying to
interact with, my goal really is to be able to expose the COM
functionality over a web-service such as SOAP so I can use it in a
CMS. The application I'm trying to integrate with is Blackbuad's
Raiser's Edge - API documentation here:
https://www.blackbaud.com/files/support/guides/re7ent/api.pdf

I think part of the problem is that the field names are also
represented by an integer. So to get data out I would do:

$oBank-Fields(22);   // which maps to BANK_fld_BRANCH_NAME.

When I do:

$oBank-22 = 'blah blah';

I get an error because a property can't be numeric, it has to start as
alpha character. If I use:

$oBank-BANK_fld_BRANCH_NAME = 'blah blah blah';

I get the following error:

Fatal error: Uncaught exception 'com_exception' with message 'Unable
to lookup `BANK_fld_BRANCH_NAME': Unknown name.

I've also tried using your Value property returned by Fields():

$oBank-Fields(22)-Value = 'Blah Blah blah blah';

Which I then get:
PHP Warning:  Creating default object from empty value in [C:\Users]
Fatal error: Call to undefined method variant::Save()

Soo seems nearly impossible to implement a safe way to write to the COM API.


At the moment, I'm still in the scoping/prototype stage of my project,
so I'm beginning to think that using this COM API for this project is
a no-go, which is unfortunate. I'm also guessing even if we did
implement this API, exposing it as a Web Service is going to be tricky
for performance sake (given that I've read that COM doesn't
multithread very well??)

Many Thanks
Adam.

On 14 July 2013 22:16, Andrew Ballard aball...@gmail.com wrote:
 On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com wrote:

 Richard - I've tried that I get an error about it not being defined as
 property of the object.

 Andrew - do you mean try using the method Richard has shown?

 Cheers
 Adam.

 On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:
 
 
 
  On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:
 
  On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
  
   Hi Guys/Gals,
  
   I'm doing some integration work with a COM API and according to their
   documentation to save data in the API, you have to assign to the
   method.
  
   This is their example in Visual Basic:
  
  
 
  -
   Set oBank = New CBank
   oBank.Init Application.SessionContext
   With oBank
   .Fields(BANK_fld_ACCOUNT_NAME) = Test account
   .Fields(BANK_fld_ACCOUNT_NO) = 12345
   .Fields(BANK_fld_BANK) = Bank of the Nation
   .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
   End With
   oBank.Save
  
 
  -
  
   Obviously in PHP is isn't possible to assign to a method in this way
   (thats what parameters are for!) So I'm at a bit of a loose end. I'm
   wondering if anyone else has come across this? Or am I missing
   something obvious in PHP's implementation of the COM that allows me to
   work around this?
  
   My PHP Code is looks like this:
  
 
  -
   $API = new COM('API7.API');
   $API-Init($SerialNo, $Login, '', 1, '', 1);
   $API-SignOutOnTerminate = True;
  
   $Record = new COM(Data.Record);
   $Record-Init($API-SessionContext);
  
   $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
  
 
  -
  
   I've also tried (below) but the API says wrong number of parameters
   $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
  
   I've also tried something crazy like this (below) but that overwrites
   the $Record object.
   $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
   $_R = 'Test Account';
  
  
   Any ideas? Is it possible?
  
  
   Many Thanks
   Adam Nicholls
  
 
  That example isn't assigning values to method return value. Fields is a
  collection of ADO Field objects. The default property of a Field object is
  its Value property, so the shorthand is simply assigning the values of the
  variables to the value of each field in a record within a Recordset.
 
  Andrew
 
 
  So ..
 
  $oBank-BANK_fld_ACCOUNT_NAME = Test account;
 
  sort of thing.
 
  --
  Richard Quadling
  Twitter : @RQuadling



 --
 Adam Nicholls

 Richard has the general idea correct, but as I recall it is a little
 more involved because it's COM. I've never done that much with COM in
 PHP because it was always such a pain. The example you posted probably
 used to require com_set() in PHP 4, although it looks like that has
 been deprecated in favor of a more typical OO syntax in PHP 5. Is
 there any

Re: [PHP] COM - Assigning to method.

2013-07-15 Thread Přemysl Fiala

Hello,

did you tried var_dump or print_r the $oBank object to see his structure ?

Also you can try:

 $BANK_fld_BRANCH_NAME = 22;
 $oBank-$BANK_fld_BRANCH_NAME  = 'something';


Premek.


On Mon, 15 Jul 2013 10:21:48 +0200, Adam Nicholls inkysp...@gmail.com  
wrote:



Hi Andrew

Thanks for this.

But I'm still getting errors. I think I need to explain a bit more.

Unfortunately there isn't a PHP API for this application I'm trying to
interact with, my goal really is to be able to expose the COM
functionality over a web-service such as SOAP so I can use it in a
CMS. The application I'm trying to integrate with is Blackbuad's
Raiser's Edge - API documentation here:
https://www.blackbaud.com/files/support/guides/re7ent/api.pdf

I think part of the problem is that the field names are also
represented by an integer. So to get data out I would do:

$oBank-Fields(22);   // which maps to BANK_fld_BRANCH_NAME.

When I do:

$oBank-22 = 'blah blah';

I get an error because a property can't be numeric, it has to start as
alpha character. If I use:

$oBank-BANK_fld_BRANCH_NAME = 'blah blah blah';

I get the following error:

Fatal error: Uncaught exception 'com_exception' with message 'Unable
to lookup `BANK_fld_BRANCH_NAME': Unknown name.

I've also tried using your Value property returned by Fields():

$oBank-Fields(22)-Value = 'Blah Blah blah blah';

Which I then get:
PHP Warning:  Creating default object from empty value in [C:\Users]
Fatal error: Call to undefined method variant::Save()

Soo seems nearly impossible to implement a safe way to write to the COM  
API.



At the moment, I'm still in the scoping/prototype stage of my project,
so I'm beginning to think that using this COM API for this project is
a no-go, which is unfortunate. I'm also guessing even if we did
implement this API, exposing it as a Web Service is going to be tricky
for performance sake (given that I've read that COM doesn't
multithread very well??)

Many Thanks
Adam.

On 14 July 2013 22:16, Andrew Ballard aball...@gmail.com wrote:
On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com  
wrote:


Richard - I've tried that I get an error about it not being defined as
property of the object.

Andrew - do you mean try using the method Richard has shown?

Cheers
Adam.

On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:



 On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com  
wrote:

 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to  
their

  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

  
-

  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

  
-

 
  Obviously in PHP is isn't possible to assign to a method in this  
way
  (thats what parameters are for!) So I'm at a bit of a loose end.  
I'm

  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows  
me to

  work around this?
 
  My PHP Code is looks like this:
 

  
-

  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test  
Account';//doesn't work

 

  
-

 
  I've also tried (below) but the API says wrong number of  
parameters

  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that  
overwrites

  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any ideas? Is it possible?
 
 
  Many Thanks
  Adam Nicholls
 

 That example isn't assigning values to method return value. Fields  
is a
 collection of ADO Field objects. The default property of a Field  
object is
 its Value property, so the shorthand is simply assigning the values  
of the

 variables to the value of each field in a record within a Recordset.

 Andrew


 So ..

 $oBank-BANK_fld_ACCOUNT_NAME = Test account;

 sort of thing.

 --
 Richard Quadling
 Twitter : @RQuadling



--
Adam Nicholls


Richard has the general idea correct, but as I recall it is a little
more involved because it's COM. I've never done that much with COM

Re: [PHP] COM - Assigning to method.

2013-07-15 Thread Andrew Ballard
On Mon, Jul 15, 2013 at 4:21 AM, Adam Nicholls inkysp...@gmail.com wrote:
 Hi Andrew

 Thanks for this.

 But I'm still getting errors. I think I need to explain a bit more.

 Unfortunately there isn't a PHP API for this application I'm trying to
 interact with, my goal really is to be able to expose the COM
 functionality over a web-service such as SOAP so I can use it in a
 CMS. The application I'm trying to integrate with is Blackbuad's
 Raiser's Edge - API documentation here:
 https://www.blackbaud.com/files/support/guides/re7ent/api.pdf

 I think part of the problem is that the field names are also
 represented by an integer. So to get data out I would do:

 $oBank-Fields(22);   // which maps to BANK_fld_BRANCH_NAME.

 When I do:

 $oBank-22 = 'blah blah';

 I get an error because a property can't be numeric, it has to start as
 alpha character. If I use:

 $oBank-BANK_fld_BRANCH_NAME = 'blah blah blah';

 I get the following error:

 Fatal error: Uncaught exception 'com_exception' with message 'Unable
 to lookup `BANK_fld_BRANCH_NAME': Unknown name.

 I've also tried using your Value property returned by Fields():

 $oBank-Fields(22)-Value = 'Blah Blah blah blah';

 Which I then get:
 PHP Warning:  Creating default object from empty value in [C:\Users]
 Fatal error: Call to undefined method variant::Save()

 Soo seems nearly impossible to implement a safe way to write to the COM API.


 At the moment, I'm still in the scoping/prototype stage of my project,
 so I'm beginning to think that using this COM API for this project is
 a no-go, which is unfortunate. I'm also guessing even if we did
 implement this API, exposing it as a Web Service is going to be tricky
 for performance sake (given that I've read that COM doesn't
 multithread very well??)

 Many Thanks
 Adam.

It's definitely possible to do, once you figure out the syntax you
need for this object.

I'm guessing you must have gotten past the $oBank-Init() method call
without issues.

What happens if you just use this for the value assignment?

$oBank-Fields(BANK_fld_ACCOUNT_NAME) = Test account;
$oBank-Fields(BANK_fld_ACCOUNT_NO) = 12345;
$oBank-Fields(BANK_fld_BANK) = Bank of the Nation;
$oBank-Fields(BANK_fld_BRANCH_NAME) = State Street Branch;

It also looks like you're getting errors from the call to
$oBank-Save() saying that the method is not defined.

Andrew

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



[PHP] Urgent Requirement - PHP Senior Developer / Seasoned Trainer

2013-07-15 Thread Nitin Sathawane
Dear All,

AIT Learning (American Institute of Technology) is passionate about
imparting hands on training (2 months boot camp) on PHP. We are expanding
and looking for brilliant and self driven PHP developers / trainers who are
passionate about teaching as us and have hunger to make an impact.

Compensation - 50-75 % increment on your current pay stub plus bonus. Our
philosophy is to reward deserving employees.

Role - Based on your experience and interview panel feedback you will be
hired as Principal Trainer or Associate Trainer.

Responsibilities -  In short - need to ensure that candidates who are
enrolled for training can develop website of their own after the training
is complete. We will be placing them with our Clients on Day 1.

If interested, please contact Sach at 240 672 7654 or reply back to this
email.

Regards
Nitin


[PHP] Kickstarter Project on Massive Log data Aggregation and Processing with Open Source Software

2013-07-15 Thread Israel Ekpo
Hi Everyone,

I just launched a Kickstarter project that will fund the creation of a
course on how to aggregate, process, search and visualize massive log data
using open source software.

I believe some of the folks on the user mailing list would find this
helpful.

Web applications do generate a lot of log data and I believe that knowing
how to deal with it could be very valuable.

Is it OK to send out an email with a summary of what the project is about?


Re: [PHP] Kickstarter Project on Massive Log data Aggregation and Processing with Open Source Software

2013-07-15 Thread Daniel Brown
On Jul 15, 2013 11:29 PM, Israel Ekpo israele...@gmail.com wrote:

 Hi Everyone,

[snip!]

No.  Good luck with your endeavor, but please do not broadcast it to
this list.


php-general Digest 14 Jul 2013 19:18:53 -0000 Issue 8295

2013-07-14 Thread php-general-digest-help

php-general Digest 14 Jul 2013 19:18:53 - Issue 8295

Topics (messages 321611 through 321611):

Re: COM - Assigning to method.
321611 by: Adam Nicholls

Administrivia:

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

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

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


--
---BeginMessage---
Richard - I've tried that I get an error about it not being defined as
property of the object.

Andrew - do you mean try using the method Richard has shown?

Cheers
Adam.

On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:



 On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to their
  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

 -
  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

 -
 
  Obviously in PHP is isn't possible to assign to a method in this way
  (thats what parameters are for!) So I'm at a bit of a loose end. I'm
  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows me to
  work around this?
 
  My PHP Code is looks like this:
 

 -
  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
 

 -
 
  I've also tried (below) but the API says wrong number of parameters
  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that overwrites
  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any ideas? Is it possible?
 
 
  Many Thanks
  Adam Nicholls
 

 That example isn't assigning values to method return value. Fields is a
 collection of ADO Field objects. The default property of a Field object is
 its Value property, so the shorthand is simply assigning the values of the
 variables to the value of each field in a record within a Recordset.

 Andrew


 So ..

 $oBank-BANK_fld_ACCOUNT_NAME = Test account;

 sort of thing.

 --
 Richard Quadling
 Twitter : @RQuadling



-- 
Adam Nicholls
---End Message---


Re: [PHP] COM - Assigning to method.

2013-07-14 Thread Adam Nicholls
Richard - I've tried that I get an error about it not being defined as
property of the object.

Andrew - do you mean try using the method Richard has shown?

Cheers
Adam.

On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:



 On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to their
  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

 -
  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

 -
 
  Obviously in PHP is isn't possible to assign to a method in this way
  (thats what parameters are for!) So I'm at a bit of a loose end. I'm
  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows me to
  work around this?
 
  My PHP Code is looks like this:
 

 -
  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
 

 -
 
  I've also tried (below) but the API says wrong number of parameters
  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that overwrites
  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any ideas? Is it possible?
 
 
  Many Thanks
  Adam Nicholls
 

 That example isn't assigning values to method return value. Fields is a
 collection of ADO Field objects. The default property of a Field object is
 its Value property, so the shorthand is simply assigning the values of the
 variables to the value of each field in a record within a Recordset.

 Andrew


 So ..

 $oBank-BANK_fld_ACCOUNT_NAME = Test account;

 sort of thing.

 --
 Richard Quadling
 Twitter : @RQuadling



-- 
Adam Nicholls

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



Re: [PHP] COM - Assigning to method.

2013-07-14 Thread Andrew Ballard
On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com wrote:

 Richard - I've tried that I get an error about it not being defined as
 property of the object.

 Andrew - do you mean try using the method Richard has shown?

 Cheers
 Adam.

 On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:
 
 
 
  On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:
 
  On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
  
   Hi Guys/Gals,
  
   I'm doing some integration work with a COM API and according to their
   documentation to save data in the API, you have to assign to the
   method.
  
   This is their example in Visual Basic:
  
  
 
  -
   Set oBank = New CBank
   oBank.Init Application.SessionContext
   With oBank
   .Fields(BANK_fld_ACCOUNT_NAME) = Test account
   .Fields(BANK_fld_ACCOUNT_NO) = 12345
   .Fields(BANK_fld_BANK) = Bank of the Nation
   .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
   End With
   oBank.Save
  
 
  -
  
   Obviously in PHP is isn't possible to assign to a method in this way
   (thats what parameters are for!) So I'm at a bit of a loose end. I'm
   wondering if anyone else has come across this? Or am I missing
   something obvious in PHP's implementation of the COM that allows me to
   work around this?
  
   My PHP Code is looks like this:
  
 
  -
   $API = new COM('API7.API');
   $API-Init($SerialNo, $Login, '', 1, '', 1);
   $API-SignOutOnTerminate = True;
  
   $Record = new COM(Data.Record);
   $Record-Init($API-SessionContext);
  
   $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
  
 
  -
  
   I've also tried (below) but the API says wrong number of parameters
   $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
  
   I've also tried something crazy like this (below) but that overwrites
   the $Record object.
   $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
   $_R = 'Test Account';
  
  
   Any ideas? Is it possible?
  
  
   Many Thanks
   Adam Nicholls
  
 
  That example isn't assigning values to method return value. Fields is a
  collection of ADO Field objects. The default property of a Field object is
  its Value property, so the shorthand is simply assigning the values of the
  variables to the value of each field in a record within a Recordset.
 
  Andrew
 
 
  So ..
 
  $oBank-BANK_fld_ACCOUNT_NAME = Test account;
 
  sort of thing.
 
  --
  Richard Quadling
  Twitter : @RQuadling



 --
 Adam Nicholls

Richard has the general idea correct, but as I recall it is a little
more involved because it's COM. I've never done that much with COM in
PHP because it was always such a pain. The example you posted probably
used to require com_set() in PHP 4, although it looks like that has
been deprecated in favor of a more typical OO syntax in PHP 5. Is
there any chance there is a PHP version of the library that you can
work with to avoid COM? If not, hopefully what follows will help start
you on the right direction.

A more explicit version of your original VBScript example looks like this:

Set oBank = New CBank
oBank.Init Application.SessionContext

Set oField = oBank.Fields(BANK_fld_ACCOUNT_NAME)
oField.Value = Test account
Set oField = oBank.Fields(BANK_fld_ACCOUNT_NO)
oField.Value = 12345
Set oField = oBank.Fields(BANK_fld_BANK)
oField.Value = Bank of the Nation
Set oField = oBank.Fields(BANK_fld_BRANCH_NAME)
oField.Value = State Street Branch

oBank.Save


I'm not familiar with your CBank COM class, but the rest of it looks
like it is similar to the COM('ADODB.Recordset'). If so, a rough
translation of your original example should resemble this:

?php
// I'm not familiar with this object, so I'm guessing on the call to
instantiate it here.
$oBank = new COM('CBank');

/**
Application.SessionContext in the original refers to an object that is
global to every request in an application. PHP does not have such a
global registry, so I'm not sure where you're $config needs to come
from.
*/
$oBank-Init($config);

/**
I am assuming that BANK_fld_ACCOUNT_NAME and such are constant names
that were already defined with the names of the actual column names in
a recordset returned by $oBank.
*/
$oBank-Fields(BANK_fld_ACCOUNT_NAME)-Value = Test account;
$oBank-Fields(BANK_fld_ACCOUNT_NO)-Value = 12345;
$oBank-Fields(BANK_fld_BANK)-Value = Bank of the Nation;
$oBank-Fields(BANK_fld_BRANCH_NAME)-Value = State Street Branch;

$oBank-Save();

?

I don't know if you could leave out the -Value part of the syntax in
PHP like you can in the VBScript example you posted. If so, then
Richard's syntax would have been pretty

php-general Digest 13 Jul 2013 16:11:33 -0000 Issue 8294

2013-07-13 Thread php-general-digest-help

php-general Digest 13 Jul 2013 16:11:33 - Issue 8294

Topics (messages 321610 through 321610):

Re: COM - Assigning to method.
321610 by: Richard Quadling

Administrivia:

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

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

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


--
---BeginMessage---
On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to their
  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

 -
  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

 -
 
  Obviously in PHP is isn't possible to assign to a method in this way
  (thats what parameters are for!) So I'm at a bit of a loose end. I'm
  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows me to
  work around this?
 
  My PHP Code is looks like this:
 

 -
  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
 

 -
 
  I've also tried (below) but the API says wrong number of parameters
  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that overwrites
  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any ideas? Is it possible?
 
 
  Many Thanks
  Adam Nicholls
 

 That example isn't assigning values to method return value. Fields is a
 collection of ADO Field objects. The default property of a Field object is
 its Value property, so the shorthand is simply assigning the values of the
 variables to the value of each field in a record within a Recordset.

 Andrew


So ..

$oBank-BANK_fld_ACCOUNT_NAME = Test account;

sort of thing.

-- 
Richard Quadling
Twitter : @RQuadling
---End Message---


Re: [PHP] COM - Assigning to method.

2013-07-13 Thread Richard Quadling
On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to their
  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

 -
  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

 -
 
  Obviously in PHP is isn't possible to assign to a method in this way
  (thats what parameters are for!) So I'm at a bit of a loose end. I'm
  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows me to
  work around this?
 
  My PHP Code is looks like this:
 

 -
  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
 

 -
 
  I've also tried (below) but the API says wrong number of parameters
  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that overwrites
  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any ideas? Is it possible?
 
 
  Many Thanks
  Adam Nicholls
 

 That example isn't assigning values to method return value. Fields is a
 collection of ADO Field objects. The default property of a Field object is
 its Value property, so the shorthand is simply assigning the values of the
 variables to the value of each field in a record within a Recordset.

 Andrew


So ..

$oBank-BANK_fld_ACCOUNT_NAME = Test account;

sort of thing.

-- 
Richard Quadling
Twitter : @RQuadling


php-general Digest 12 Jul 2013 08:52:42 -0000 Issue 8292

2013-07-12 Thread php-general-digest-help

php-general Digest 12 Jul 2013 08:52:42 - Issue 8292

Topics (messages 321607 through 321608):

PHP 5.3.27 Released - PHP 5.3 Reaching End of Life
321607 by: Johannes Schlüter

COM - Assigning to method.
321608 by: Adam Nicholls

Administrivia:

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

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

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


--
---BeginMessage---
The PHP development team announces the immediate availability of PHP
5.3.27. About 10 bugs were fixed, including a security fix in the XML
parser (Bug #65236).

Please Note: This will be the last regular release of the PHP 5.3
series. All users of PHP are encouraged to upgrade to PHP 5.4 or PHP
5.5. The PHP 5.3 series will receive only security fixes for the next
year.

For source downloads of PHP 5.3.27 please visit our downloads page on
http://www.php.net/downloads.php, Windows binaries can be found on
http://windows.php.net/download/. The list of changes is recorded in
the ChangeLog on http://www.php.net/ChangeLog-5.php#5.3.27. 

Johannes Schlüter
PHP 5.3 Release Master


---End Message---
---BeginMessage---
Hi Guys/Gals,

I'm doing some integration work with a COM API and according to their
documentation to save data in the API, you have to assign to the
method.

This is their example in Visual Basic:

-
Set oBank = New CBank
oBank.Init Application.SessionContext
With oBank
.Fields(BANK_fld_ACCOUNT_NAME) = Test account
.Fields(BANK_fld_ACCOUNT_NO) = 12345
.Fields(BANK_fld_BANK) = Bank of the Nation
.Fields(BANK_fld_BRANCH_NAME) = State Street Branch
End With
oBank.Save
-

Obviously in PHP is isn't possible to assign to a method in this way
(thats what parameters are for!) So I'm at a bit of a loose end. I'm
wondering if anyone else has come across this? Or am I missing
something obvious in PHP's implementation of the COM that allows me to
work around this?

My PHP Code is looks like this:
-
$API = new COM('API7.API');
$API-Init($SerialNo, $Login, '', 1, '', 1);
$API-SignOutOnTerminate = True;

$Record = new COM(Data.Record);
$Record-Init($API-SessionContext);

$Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
-

I've also tried (below) but the API says wrong number of parameters
$Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');

I've also tried something crazy like this (below) but that overwrites
the $Record object.
$_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
$_R = 'Test Account';


Any ideas? Is it possible?


Many Thanks
Adam Nicholls
---End Message---


php-general Digest 13 Jul 2013 00:24:29 -0000 Issue 8293

2013-07-12 Thread php-general-digest-help

php-general Digest 13 Jul 2013 00:24:29 - Issue 8293

Topics (messages 321609 through 321609):

Re: COM - Assigning to method.
321609 by: Andrew Ballard

Administrivia:

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

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

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


--
---BeginMessage---
On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:

 Hi Guys/Gals,

 I'm doing some integration work with a COM API and according to their
 documentation to save data in the API, you have to assign to the
 method.

 This is their example in Visual Basic:


-
 Set oBank = New CBank
 oBank.Init Application.SessionContext
 With oBank
 .Fields(BANK_fld_ACCOUNT_NAME) = Test account
 .Fields(BANK_fld_ACCOUNT_NO) = 12345
 .Fields(BANK_fld_BANK) = Bank of the Nation
 .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
 End With
 oBank.Save

-

 Obviously in PHP is isn't possible to assign to a method in this way
 (thats what parameters are for!) So I'm at a bit of a loose end. I'm
 wondering if anyone else has come across this? Or am I missing
 something obvious in PHP's implementation of the COM that allows me to
 work around this?

 My PHP Code is looks like this:

-
 $API = new COM('API7.API');
 $API-Init($SerialNo, $Login, '', 1, '', 1);
 $API-SignOutOnTerminate = True;

 $Record = new COM(Data.Record);
 $Record-Init($API-SessionContext);

 $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work

-

 I've also tried (below) but the API says wrong number of parameters
 $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');

 I've also tried something crazy like this (below) but that overwrites
 the $Record object.
 $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
 $_R = 'Test Account';


 Any ideas? Is it possible?


 Many Thanks
 Adam Nicholls


That example isn't assigning values to method return value. Fields is a
collection of ADO Field objects. The default property of a Field object is
its Value property, so the shorthand is simply assigning the values of the
variables to the value of each field in a record within a Recordset.

Andrew
---End Message---


[PHP] COM - Assigning to method.

2013-07-12 Thread Adam Nicholls
Hi Guys/Gals,

I'm doing some integration work with a COM API and according to their
documentation to save data in the API, you have to assign to the
method.

This is their example in Visual Basic:

-
Set oBank = New CBank
oBank.Init Application.SessionContext
With oBank
.Fields(BANK_fld_ACCOUNT_NAME) = Test account
.Fields(BANK_fld_ACCOUNT_NO) = 12345
.Fields(BANK_fld_BANK) = Bank of the Nation
.Fields(BANK_fld_BRANCH_NAME) = State Street Branch
End With
oBank.Save
-

Obviously in PHP is isn't possible to assign to a method in this way
(thats what parameters are for!) So I'm at a bit of a loose end. I'm
wondering if anyone else has come across this? Or am I missing
something obvious in PHP's implementation of the COM that allows me to
work around this?

My PHP Code is looks like this:
-
$API = new COM('API7.API');
$API-Init($SerialNo, $Login, '', 1, '', 1);
$API-SignOutOnTerminate = True;

$Record = new COM(Data.Record);
$Record-Init($API-SessionContext);

$Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
-

I've also tried (below) but the API says wrong number of parameters
$Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');

I've also tried something crazy like this (below) but that overwrites
the $Record object.
$_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
$_R = 'Test Account';


Any ideas? Is it possible?


Many Thanks
Adam Nicholls

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



Re: [PHP] COM - Assigning to method.

2013-07-12 Thread Andrew Ballard
On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:

 Hi Guys/Gals,

 I'm doing some integration work with a COM API and according to their
 documentation to save data in the API, you have to assign to the
 method.

 This is their example in Visual Basic:


-
 Set oBank = New CBank
 oBank.Init Application.SessionContext
 With oBank
 .Fields(BANK_fld_ACCOUNT_NAME) = Test account
 .Fields(BANK_fld_ACCOUNT_NO) = 12345
 .Fields(BANK_fld_BANK) = Bank of the Nation
 .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
 End With
 oBank.Save

-

 Obviously in PHP is isn't possible to assign to a method in this way
 (thats what parameters are for!) So I'm at a bit of a loose end. I'm
 wondering if anyone else has come across this? Or am I missing
 something obvious in PHP's implementation of the COM that allows me to
 work around this?

 My PHP Code is looks like this:

-
 $API = new COM('API7.API');
 $API-Init($SerialNo, $Login, '', 1, '', 1);
 $API-SignOutOnTerminate = True;

 $Record = new COM(Data.Record);
 $Record-Init($API-SessionContext);

 $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work

-

 I've also tried (below) but the API says wrong number of parameters
 $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');

 I've also tried something crazy like this (below) but that overwrites
 the $Record object.
 $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
 $_R = 'Test Account';


 Any ideas? Is it possible?


 Many Thanks
 Adam Nicholls


That example isn't assigning values to method return value. Fields is a
collection of ADO Field objects. The default property of a Field object is
its Value property, so the shorthand is simply assigning the values of the
variables to the value of each field in a record within a Recordset.

Andrew


php-general Digest 11 Jul 2013 14:35:03 -0000 Issue 8291

2013-07-11 Thread php-general-digest-help

php-general Digest 11 Jul 2013 14:35:03 - Issue 8291

Topics (messages 321587 through 321606):

Re: syntax question
321587 by: Pøemysl Fiala
321588 by: Jim Giner

Hmmm.. I think I need your advice here to get in correct direction...
321589 by: Karl-Arne Gjersøyen
321590 by: Karl-Arne Gjersøyen
321591 by: Jim Giner
321592 by: Jim Giner
321593 by: Karl-Arne Gjersøyen
321594 by: Jim Giner
321595 by: Lester Caine
321596 by: Karl-Arne Gjersøyen

Query regarding temporarily-uploaded files
321597 by: Ajay Garg
321598 by: Jim Giner
321599 by: Matijn Woudt
321600 by: Ajay Garg
321601 by: Jim Giner
321602 by: Anthony Wlodarski
321603 by: Ajay Garg
321604 by: Jim Giner
321605 by: Bastien

Re: strlen ?
321606 by: Caio Tavares

Administrivia:

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

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

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


--
---BeginMessage---

Hello,

is an alternative syntax.

http://php.net/manual/en/control-structures.alternative-syntax.php

Premek.


On Wed, 10 Jul 2013 13:15:22 +0200, Jim Giner  
jim.gi...@albanyhandball.com wrote:


Can someone tell me what this syntax is?  I looked around but don't see  
any mention of it.


while(condition) : (statement);





---End Message---
---BeginMessage---

Thanks!
---End Message---
---BeginMessage---
I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10
---End Message---
---BeginMessage---
Sorry, the first mail in this subject run out for me. This is an updated
one.



I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10 - Weight 10kg

Then I like to 4+10 = 14
and 200+10 = 210.

It shall looks like this:
==
Dynamite |  4  | 200
Lunt | 10 |  10
--
TOTAL| 14 | 210

It is easy to register this product by product on their own row.
but in what way can I multiply them? ned products be stored in arrays?
I think it will be similar to shopping cart in online store but i have no
clue about how to do this.
If you have links to pages were i can learn am i Happy for it. If you can
help me here is even better.

Thanks for your time and effort to learn me programming.

Karl




-- 
Hjemmeside: http://www.karl-arne.name/
---End Message---
---BeginMessage---

On 7/10/2013 8:30 AM, Karl-Arne Gjersøyen wrote:

I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10


Show us your code?
---End Message---
---BeginMessage---

On 7/10/2013 8:37 AM, Karl-Arne Gjersøyen wrote:

Sorry, the first mail in this subject run out for me. This is an updated
one.



I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10 - Weight 10kg

Then I like to 4+10 = 14
and 200+10 = 210.

It shall looks like this:
==
Dynamite |  4  | 200
Lunt | 10 |  10
--
TOTAL| 14 | 210

It is easy to register this product by product on their own row.
but in what

Re: [PHP] strlen ?

2013-07-11 Thread Caio Tavares
Try with mb_strlen

see
http://www.php.net/manual/en/function.mb-strlen.php


2013/7/5 Jim Giner jim.gi...@albanyhandball.com

 Trying to manage line breaks in some output I'm generating and using
 strlen to measure the lengths of the strings I'm printing.  Discovered
 something strange (to me!) in that strlen is returning +1 more than it
 should.

 The strings are from a query of my database - simple name fields.  But
 everyone of them is coming back with a length that is one more than I see.

 Ex.

 Mike Hall  comes back as 10, not 9
 F.B. comes back as 5, not 4.

 I've looked at my data and counted the chars - there is no extra space at
 the beginning or end in my table.

 Anyone have an explanation?

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




[PHP] PHP 5.3.27 Released - PHP 5.3 Reaching End of Life

2013-07-11 Thread Johannes Schlüter
The PHP development team announces the immediate availability of PHP
5.3.27. About 10 bugs were fixed, including a security fix in the XML
parser (Bug #65236).

Please Note: This will be the last regular release of the PHP 5.3
series. All users of PHP are encouraged to upgrade to PHP 5.4 or PHP
5.5. The PHP 5.3 series will receive only security fixes for the next
year.

For source downloads of PHP 5.3.27 please visit our downloads page on
http://www.php.net/downloads.php, Windows binaries can be found on
http://windows.php.net/download/. The list of changes is recorded in
the ChangeLog on http://www.php.net/ChangeLog-5.php#5.3.27. 

Johannes Schlüter
PHP 5.3 Release Master



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



php-general Digest 10 Jul 2013 11:15:30 -0000 Issue 8290

2013-07-10 Thread php-general-digest-help

php-general Digest 10 Jul 2013 11:15:30 - Issue 8290

Topics (messages 321584 through 321586):

Re: Making a Timeout Expiration Length to Session Variables
321584 by: Karim Geiger

Re: htaccess
321585 by: Tim Streater

syntax question
321586 by: Jim Giner

Administrivia:

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

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

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


--
---BeginMessage---
Hi,

On 07/08/2013 05:10 AM, dealTek wrote:
 Hi all,
 
 I would like to make a timeout length to session variables, so that if a user 
 didn't use the browser page for let's say 5 minutes - the session variables 
 would expire and the user would need to login again.
 
 
 Q: What's the best way to implement this functionality?

You can either use cookies or do something like that:
http://stackoverflow.com/questions/3068744/php-session-timeout

In your case is would be
if ($_SESSION['timeout'] + 5 * 60  time()) {
// session timed out
} else {
// session ok
}

Karim

-- 
Karim Geiger
Auszubildender Fachinformatiker AE

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537



signature.asc
Description: OpenPGP digital signature
---End Message---
---BeginMessage---
On 07 Jul 2013 at 21:22, Tedd Sperling t...@sperling.com wrote: 

 Confirmed. Those two lines cause the problem.

 However, commenting out those lines causes other problems.

 Are there similar statements to these:

   AddType application/x-httpd-php .php .htm .html

This one tells apache to recognise .php, .htm, and .html as suffixes of files 
that need to be sent to PHP. You probably don't want to remove that [1].

   AddHandler x-httpd-php5-cgi .php .htm .html

Dunno what this one does.

[1] But, having said that, realise that *all* files with those suffixes will be 
sent to PHP by apache, whether they contain any PHP code or not. Is that what 
you want? If I have an html file that contains some PHP code, I tend to use 
.phtml as suffix and so my AddType looks like:

 AddType application/x-httpd-php .php .phtml

--
Cheers  --  Tim
---End Message---
---BeginMessage---
Can someone tell me what this syntax is?  I looked around but don't see 
any mention of it.


while(condition) : (statement);



---End Message---


[PHP] syntax question

2013-07-10 Thread Jim Giner
Can someone tell me what this syntax is?  I looked around but don't see 
any mention of it.


while(condition) : (statement);




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



Re: [PHP] syntax question

2013-07-10 Thread Přemysl Fiala

Hello,

is an alternative syntax.

http://php.net/manual/en/control-structures.alternative-syntax.php

Premek.


On Wed, 10 Jul 2013 13:15:22 +0200, Jim Giner  
jim.gi...@albanyhandball.com wrote:


Can someone tell me what this syntax is?  I looked around but don't see  
any mention of it.


while(condition) : (statement);






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



Re: [PHP] syntax question

2013-07-10 Thread Jim Giner

Thanks!

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



[PHP] Hmmm.. I think I need your advice here to get in correct direction...

2013-07-10 Thread Karl-Arne Gjersøyen
I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10


[PHP] Fwd: Hmmm.. I think I need your advice here to get in correct direction...

2013-07-10 Thread Karl-Arne Gjersøyen
Sorry, the first mail in this subject run out for me. This is an updated
one.



I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10 - Weight 10kg

Then I like to 4+10 = 14
and 200+10 = 210.

It shall looks like this:
==
Dynamite |  4  | 200
Lunt | 10 |  10
--
TOTAL| 14 | 210

It is easy to register this product by product on their own row.
but in what way can I multiply them? ned products be stored in arrays?
I think it will be similar to shopping cart in online store but i have no
clue about how to do this.
If you have links to pages were i can learn am i Happy for it. If you can
help me here is even better.

Thanks for your time and effort to learn me programming.

Karl




-- 
Hjemmeside: http://www.karl-arne.name/


[PHP] Re: Hmmm.. I think I need your advice here to get in correct direction...

2013-07-10 Thread Jim Giner

On 7/10/2013 8:30 AM, Karl-Arne Gjersøyen wrote:

I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10


Show us your code?

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



[PHP] Re: Fwd: Hmmm.. I think I need your advice here to get in correct direction...

2013-07-10 Thread Jim Giner

On 7/10/2013 8:37 AM, Karl-Arne Gjersøyen wrote:

Sorry, the first mail in this subject run out for me. This is an updated
one.



I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10 - Weight 10kg

Then I like to 4+10 = 14
and 200+10 = 210.

It shall looks like this:
==
Dynamite |  4  | 200
Lunt | 10 |  10
--
TOTAL| 14 | 210

It is easy to register this product by product on their own row.
but in what way can I multiply them? ned products be stored in arrays?
I think it will be similar to shopping cart in online store but i have no
clue about how to do this.
If you have links to pages were i can learn am i Happy for it. If you can
help me here is even better.

Thanks for your time and effort to learn me programming.

Karl





Ahhh.

So - you should run a query that selects the products and information 
that you want.  Then you start by creating an html table header and then 
loop through your query results and echo a table row for each result row.


// start the table
echo table border=1;
echo trthProduct/ththAmount/th/tr;

// loop thru each item found
while ($results = $qrslts-fetch(PDO::FETCH_ASSOC))
{
   echo 
trtd.$results['product_name']./tdtd.$results['product_amt']./td/tr;

}

// finish the table html
echo /table;




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



Re: [PHP] Re: Fwd: Hmmm.. I think I need your advice here to get in correct direction...

2013-07-10 Thread Karl-Arne Gjersøyen
2013/7/10 Jim Giner jim.gi...@albanyhandball.com

 On 7/10/2013 8:37 AM, Karl-Arne Gjersøyen wrote:

 Sorry, the first mail in this subject run out for me. This is an updated
 one.



 I am almost ready with my learning project in PHP/MySQL.
 I can register new product in stock.
 Add and increase the number and weight.
 I can move products between different storehouses
 I can also transfer products from store and onto a truck document but
 that's it and here I need some advice.

 I like to register new products and the amount in number (for example 4)
 and weight in kg.

 I like to write it in this way:
 Dynamite - package 4 - Weight 200 kg
 Lunt - Package 10 - Weight 10kg

 Then I like to 4+10 = 14
 and 200+10 = 210.

 It shall looks like this:
 ==**
 Dynamite |  4  | 200
 Lunt | 10 |  10
 --**--**--
 TOTAL| 14 | 210

 It is easy to register this product by product on their own row.
 but in what way can I multiply them? ned products be stored in arrays?
 I think it will be similar to shopping cart in online store but i have no
 clue about how to do this.
 If you have links to pages were i can learn am i Happy for it. If you can
 help me here is even better.

 Thanks for your time and effort to learn me programming.

 Karl




  Ahhh.

 So - you should run a query that selects the products and information that
 you want.  Then you start by creating an html table header and then loop
 through your query results and echo a table row for each result row.

 // start the table
 echo table border=1;
 echo trthProduct/thth**Amount/th/tr;

 // loop thru each item found
 while ($results = $qrslts-fetch(PDO::FETCH_**ASSOC))
 {
echo trtd.$results['product_**name']./tdtd.$results['**
 product_amt']./td/tr;
 }

 // finish the table html
 echo /table;


Yes that part is OK. I do have problem to add total weight and package at
bottom of the table like this:

Product_one   40kg
Product_two   60kg
-
Total: 100kg
===

Because sometimes it is only a few products and other times many products.
I then need to summing them at bottom. One timer only 3 rows, other times
20 rows. The program need a way to add every singel product and see if it's
a few or many,

Karl


Re: [PHP] Re: Fwd: Hmmm.. I think I need your advice here to get incorrect direction...

2013-07-10 Thread Jim Giner

On 7/10/2013 9:07 AM, Karl-Arne Gjersøyen wrote:

2013/7/10 Jim Giner jim.gi...@albanyhandball.com


On 7/10/2013 8:37 AM, Karl-Arne Gjersøyen wrote:


Sorry, the first mail in this subject run out for me. This is an updated
one.



I am almost ready with my learning project in PHP/MySQL.
I can register new product in stock.
Add and increase the number and weight.
I can move products between different storehouses
I can also transfer products from store and onto a truck document but
that's it and here I need some advice.

I like to register new products and the amount in number (for example 4)
and weight in kg.

I like to write it in this way:
Dynamite - package 4 - Weight 200 kg
Lunt - Package 10 - Weight 10kg

Then I like to 4+10 = 14
and 200+10 = 210.

It shall looks like this:
==**
Dynamite |  4  | 200
Lunt | 10 |  10
--**--**--
TOTAL| 14 | 210

It is easy to register this product by product on their own row.
but in what way can I multiply them? ned products be stored in arrays?
I think it will be similar to shopping cart in online store but i have no
clue about how to do this.
If you have links to pages were i can learn am i Happy for it. If you can
help me here is even better.

Thanks for your time and effort to learn me programming.

Karl




  Ahhh.


So - you should run a query that selects the products and information that
you want.  Then you start by creating an html table header and then loop
through your query results and echo a table row for each result row.

// start the table
echo table border=1;
echo trthProduct/thth**Amount/th/tr;

// loop thru each item found
while ($results = $qrslts-fetch(PDO::FETCH_**ASSOC))
{
echo trtd.$results['product_**name']./tdtd.$results['**
product_amt']./td/tr;
}

// finish the table html
echo /table;



Yes that part is OK. I do have problem to add total weight and package at
bottom of the table like this:

Product_one   40kg
Product_two   60kg
-
Total: 100kg
===

Because sometimes it is only a few products and other times many products.
I then need to summing them at bottom. One timer only 3 rows, other times
20 rows. The program need a way to add every singel product and see if it's
a few or many,

Karl

So - as you loop thru the results, accumulate your totals and then at 
the end before you close the table generate one last row with those 
amounts in it.  Simple!


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



Re: [PHP] Re: Fwd: Hmmm.. I think I need your advice here to get in correct direction...

2013-07-10 Thread Lester Caine

Karl-Arne Gjersøyen wrote:

// start the table


$total = 0;


echo table border=1;
echo trthProduct/thth**Amount/th/tr;

// loop thru each item found
while ($results = $qrslts-fetch(PDO::FETCH_**ASSOC))
{
echo trtd.$results['product_**name']./tdtd.$results['**
product_amt']./td/tr;

$total += $results['product_amt']

}



echo trtdTotal:/tdtd.$total./td/tr;


// finish the table html
echo /table;


Yes that part is OK. I do have problem to add total weight and package at
bottom of the table like this:

Product_one   40kg
Product_two   60kg
-
Total: 100kg
===



--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP] Re: Fwd: Hmmm.. I think I need your advice here to get in correct direction...

2013-07-10 Thread Karl-Arne Gjersøyen
2013/7/10 Lester Caine les...@lsces.co.uk

 Karl-Arne Gjersøyen wrote:

 // start the table


 $total = 0;

  echo table border=1;
 echo trthProduct/ththAmount/th/tr;

 
 // loop thru each item found
 while ($results = $qrslts-fetch(PDO::FETCH_ASSOC))
 {
 echo trtd.$results['product_name']./tdtd.$results['
 
 product_amt']./td/tr;

 $total += $results['product_amt']

 }
 


 echo trtdTotal:/tdtd.$**total./td/tr;


  // finish the table html
 echo /table;


 Yes that part is OK. I do have problem to add total weight and package at
 bottom of the table like this:

 Product_one   40kg
 Product_two   60kg
 -
 Total: 100kg
 ===



Thank you very Much, Both of you Jim and Lester!
You are amazing, folks!

Karl


[PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Ajay Garg
Hi all.

I have a requirement, wherein I need to allow vanilla uploads of files
to a HTTPD server.

Any client can upload any number of files (one at a time).
Also, there is just one directory, where the files get stored
finally (that is, after being copied from the temporary location,
via move_uploaded_file)

Also, I have been able to get the simple file uploading running via
PHP, by picking up one of the numerous Hello World examples
available :)



Now, I am facing the following use-case ::

1)
User 1 starts uploading a large file, say big_file.avi.

2)
Meanwhile, user 2 also starts uploading a (different) file, but with
the same name big_file.avi.


In an ideal scenario, user 2 should be prompted with a message, that a
file of the same name is already being uploaded by someone else
somewhere.
Is there a way to do this?

( Note that, had the user 2 started uploading AFTER user 1 had
finished with the upload, we could probably modify the PHP-script at
the sever-side, to let user-2 know that a file of the same name
already exits. But I am failing to find a solution, when the user 2
starts the upload WHILE the large file of user 1 is in the process of
completing uploading).


Any way the issue may be solved?

I will be grateful for any pointers :)



Regards,
Ajay

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



[PHP] Re: Query regarding temporarily-uploaded files

2013-07-10 Thread Jim Giner

On 7/10/2013 1:21 PM, Ajay Garg wrote:

Hi all.

I have a requirement, wherein I need to allow vanilla uploads of files
to a HTTPD server.

Any client can upload any number of files (one at a time).
Also, there is just one directory, where the files get stored
finally (that is, after being copied from the temporary location,
via move_uploaded_file)

Also, I have been able to get the simple file uploading running via
PHP, by picking up one of the numerous Hello World examples
available :)



Now, I am facing the following use-case ::

1)
User 1 starts uploading a large file, say big_file.avi.

2)
Meanwhile, user 2 also starts uploading a (different) file, but with
the same name big_file.avi.


In an ideal scenario, user 2 should be prompted with a message, that a
file of the same name is already being uploaded by someone else
somewhere.
Is there a way to do this?

( Note that, had the user 2 started uploading AFTER user 1 had
finished with the upload, we could probably modify the PHP-script at
the sever-side, to let user-2 know that a file of the same name
already exits. But I am failing to find a solution, when the user 2
starts the upload WHILE the large file of user 1 is in the process of
completing uploading).


Any way the issue may be solved?

I will be grateful for any pointers :)



Regards,
Ajay

The problem is not of PHP's making.  It is something that you have to 
program around.  Is the user determining the filename to be used?  If 
so, then you need to check for that name before doing you move.  If 
it's a duple, then create a temporary name in your final place, hide it 
in the user's page and send it back to him with a message to change his 
name.


If the user is NOT determining the name, then your normal process would 
be to pick an unused name I presume and send That back to the user 
anyway, so problem never happens.


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



Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Matijn Woudt
On Wed, Jul 10, 2013 at 7:21 PM, Ajay Garg ajaygargn...@gmail.com wrote:

 Hi all.

 I have a requirement, wherein I need to allow vanilla uploads of files
 to a HTTPD server.

 Any client can upload any number of files (one at a time).
 Also, there is just one directory, where the files get stored
 finally (that is, after being copied from the temporary location,
 via move_uploaded_file)

 Also, I have been able to get the simple file uploading running via
 PHP, by picking up one of the numerous Hello World examples
 available :)



 Now, I am facing the following use-case ::

 1)
 User 1 starts uploading a large file, say big_file.avi.

 2)
 Meanwhile, user 2 also starts uploading a (different) file, but with
 the same name big_file.avi.


 In an ideal scenario, user 2 should be prompted with a message, that a
 file of the same name is already being uploaded by someone else
 somewhere.
 Is there a way to do this?

 ( Note that, had the user 2 started uploading AFTER user 1 had
 finished with the upload, we could probably modify the PHP-script at
 the sever-side, to let user-2 know that a file of the same name
 already exits. But I am failing to find a solution, when the user 2
 starts the upload WHILE the large file of user 1 is in the process of
 completing uploading).


 Any way the issue may be solved?

 I will be grateful for any pointers :)



 Regards,
 Ajay



Hi,

This is not possible with PHP, PHP will not know about the file until the
upload is completed. You can use HTML5 or flash(not recommended) for an
alternative way of uploading, and then you can check the file name in
advance.

- Matijn


Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Ajay Garg
Thanks Jim and Matijn for the quick replies.
I will try to have a workaround.



On Wed, Jul 10, 2013 at 11:09 PM, Matijn Woudt tijn...@gmail.com wrote:




 On Wed, Jul 10, 2013 at 7:21 PM, Ajay Garg ajaygargn...@gmail.com wrote:

 Hi all.

 I have a requirement, wherein I need to allow vanilla uploads of files
 to a HTTPD server.

 Any client can upload any number of files (one at a time).
 Also, there is just one directory, where the files get stored
 finally (that is, after being copied from the temporary location,
 via move_uploaded_file)

 Also, I have been able to get the simple file uploading running via
 PHP, by picking up one of the numerous Hello World examples
 available :)



 Now, I am facing the following use-case ::

 1)
 User 1 starts uploading a large file, say big_file.avi.

 2)
 Meanwhile, user 2 also starts uploading a (different) file, but with
 the same name big_file.avi.


 In an ideal scenario, user 2 should be prompted with a message, that a
 file of the same name is already being uploaded by someone else
 somewhere.
 Is there a way to do this?

 ( Note that, had the user 2 started uploading AFTER user 1 had
 finished with the upload, we could probably modify the PHP-script at
 the sever-side, to let user-2 know that a file of the same name
 already exits. But I am failing to find a solution, when the user 2
 starts the upload WHILE the large file of user 1 is in the process of
 completing uploading).


 Any way the issue may be solved?

 I will be grateful for any pointers :)



 Regards,
 Ajay



 Hi,

 This is not possible with PHP, PHP will not know about the file until the
 upload is completed. You can use HTML5 or flash(not recommended) for an
 alternative way of uploading, and then you can check the file name in
 advance.

 - Matijn




-- 
Regards,
Ajay


Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Jim Giner

On 7/10/2013 2:15 PM, Ajay Garg wrote:

Thanks Jim and Matijn for the quick replies.
I will try to have a workaround.



On Wed, Jul 10, 2013 at 11:09 PM, Matijn Woudt tijn...@gmail.com wrote:





On Wed, Jul 10, 2013 at 7:21 PM, Ajay Garg ajaygargn...@gmail.com wrote:


Hi all.

I have a requirement, wherein I need to allow vanilla uploads of files
to a HTTPD server.

Any client can upload any number of files (one at a time).
Also, there is just one directory, where the files get stored
finally (that is, after being copied from the temporary location,
via move_uploaded_file)

Also, I have been able to get the simple file uploading running via
PHP, by picking up one of the numerous Hello World examples
available :)



Now, I am facing the following use-case ::

1)
User 1 starts uploading a large file, say big_file.avi.

2)
Meanwhile, user 2 also starts uploading a (different) file, but with
the same name big_file.avi.


In an ideal scenario, user 2 should be prompted with a message, that a
file of the same name is already being uploaded by someone else
somewhere.
Is there a way to do this?

( Note that, had the user 2 started uploading AFTER user 1 had
finished with the upload, we could probably modify the PHP-script at
the sever-side, to let user-2 know that a file of the same name
already exits. But I am failing to find a solution, when the user 2
starts the upload WHILE the large file of user 1 is in the process of
completing uploading).


Any way the issue may be solved?

I will be grateful for any pointers :)



Regards,
Ajay




Hi,

This is not possible with PHP, PHP will not know about the file until the
upload is completed. You can use HTML5 or flash(not recommended) for an
alternative way of uploading, and then you can check the file name in
advance.

- Matijn





As Matijn said, you don't know the name until your php processes the 
file that has been uploaded alreaday.  But my solution will work for you 
- you just have to save it under the temp name until the user responds 
to your message and request for a new title.  You may have to run a 
periodic script to clean up any files with your temp names that the user 
declined to re-name for you.  I'd make up a temp name with some special 
prefix so that you can find and delete them.


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



Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Ajay Garg
Thanks Jim and Anthony.

Jim,
You are right, your solution is doable.

But one thing I am a little skeptical about, is what would be the
percentage of the people willing to suggest a new name immediately,
versus the percentage of people who would like to cancel the current
upload, and come back later after walking and coming up with a new name.

Anyhow, let me sleep over it :)


Anthony,
your solution is really a special case of Jim's solution :)



Thanks guys for the quick replies; I am obliged, really.



On Thu, Jul 11, 2013 at 12:59 AM, Anthony Wlodarski ant92...@gmail.comwrote:

 Is there anything that would prevent you from somehow uniquely knowing who
 the user is uploading the file. For example you mentioned client'.  If
 you know
 who the client is you can append that to the filename or prepend it, for
 the
 destination string (second parameter to the function call).  That way it
 is unique
 to that client.

 -Anthony


 On Wed, Jul 10, 2013 at 2:15 PM, Ajay Garg ajaygargn...@gmail.com wrote:

 Thanks Jim and Matijn for the quick replies.
 I will try to have a workaround.



 On Wed, Jul 10, 2013 at 11:09 PM, Matijn Woudt tijn...@gmail.com wrote:

 
 
 
  On Wed, Jul 10, 2013 at 7:21 PM, Ajay Garg ajaygargn...@gmail.com
 wrote:
 
  Hi all.
 
  I have a requirement, wherein I need to allow vanilla uploads of files
  to a HTTPD server.
 
  Any client can upload any number of files (one at a time).
  Also, there is just one directory, where the files get stored
  finally (that is, after being copied from the temporary location,
  via move_uploaded_file)
 
  Also, I have been able to get the simple file uploading running via
  PHP, by picking up one of the numerous Hello World examples
  available :)
 
 
 
  Now, I am facing the following use-case ::
 
  1)
  User 1 starts uploading a large file, say big_file.avi.
 
  2)
  Meanwhile, user 2 also starts uploading a (different) file, but with
  the same name big_file.avi.
 
 
  In an ideal scenario, user 2 should be prompted with a message, that a
  file of the same name is already being uploaded by someone else
  somewhere.
  Is there a way to do this?
 
  ( Note that, had the user 2 started uploading AFTER user 1 had
  finished with the upload, we could probably modify the PHP-script at
  the sever-side, to let user-2 know that a file of the same name
  already exits. But I am failing to find a solution, when the user 2
  starts the upload WHILE the large file of user 1 is in the process of
  completing uploading).
 
 
  Any way the issue may be solved?
 
  I will be grateful for any pointers :)
 
 
 
  Regards,
  Ajay
 
 
 
  Hi,
 
  This is not possible with PHP, PHP will not know about the file until
 the
  upload is completed. You can use HTML5 or flash(not recommended) for an
  alternative way of uploading, and then you can check the file name in
  advance.
 
  - Matijn
 



 --
 Regards,
 Ajay




 --
 Anthony W.
 ant92...@gmail.com




-- 
Regards,
Ajay


Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Jim Giner

On 7/10/2013 3:37 PM, Ajay Garg wrote:

Thanks Jim and Anthony.

Jim,
You are right, your solution is doable.

But one thing I am a little skeptical about, is what would be the
percentage of the people willing to suggest a new name immediately,
versus the percentage of people who would like to cancel the current
upload, and come back later after walking and coming up with a new name.

Anyhow, let me sleep over it :)


Anthony,
your solution is really a special case of Jim's solution :)



Thanks guys for the quick replies; I am obliged, really.



On Thu, Jul 11, 2013 at 12:59 AM, Anthony Wlodarski ant92...@gmail.comwrote:


Is there anything that would prevent you from somehow uniquely knowing who
the user is uploading the file. For example you mentioned client'.  If
you know
who the client is you can append that to the filename or prepend it, for
the
destination string (second parameter to the function call).  That way it
is unique
to that client.

-Anthony


On Wed, Jul 10, 2013 at 2:15 PM, Ajay Garg ajaygargn...@gmail.com wrote:


Thanks Jim and Matijn for the quick replies.
I will try to have a workaround.



On Wed, Jul 10, 2013 at 11:09 PM, Matijn Woudt tijn...@gmail.com wrote:





On Wed, Jul 10, 2013 at 7:21 PM, Ajay Garg ajaygargn...@gmail.com

wrote:



Hi all.

I have a requirement, wherein I need to allow vanilla uploads of files
to a HTTPD server.

Any client can upload any number of files (one at a time).
Also, there is just one directory, where the files get stored
finally (that is, after being copied from the temporary location,
via move_uploaded_file)

Also, I have been able to get the simple file uploading running via
PHP, by picking up one of the numerous Hello World examples
available :)



Now, I am facing the following use-case ::

1)
User 1 starts uploading a large file, say big_file.avi.

2)
Meanwhile, user 2 also starts uploading a (different) file, but with
the same name big_file.avi.


In an ideal scenario, user 2 should be prompted with a message, that a
file of the same name is already being uploaded by someone else
somewhere.
Is there a way to do this?

( Note that, had the user 2 started uploading AFTER user 1 had
finished with the upload, we could probably modify the PHP-script at
the sever-side, to let user-2 know that a file of the same name
already exits. But I am failing to find a solution, when the user 2
starts the upload WHILE the large file of user 1 is in the process of
completing uploading).


Any way the issue may be solved?

I will be grateful for any pointers :)



Regards,
Ajay




Hi,

This is not possible with PHP, PHP will not know about the file until

the

upload is completed. You can use HTML5 or flash(not recommended) for an
alternative way of uploading, and then you can check the file name in
advance.

- Matijn





--
Regards,
Ajay





--
Anthony W.
ant92...@gmail.com





That's why I said you would have to do a cleanup periodically.  People 
who walk away could lose their session perhaps and the page wiht the 
hidden temp name buried in it, so they would have to do their upload 
from the beginning again.  If they didn't lose their session and 
therefore that screen, then they could still respond and things would 
flow smoothly.


so - who is scanning these files for viruses and what not?  It's one 
thing to host them but if you are going to let users view them on their 
clients you could be spreading things.


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



Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Anthony Wlodarski
Is there anything that would prevent you from somehow uniquely knowing who
the user is uploading the file. For example you mentioned client'.  If you
know
who the client is you can append that to the filename or prepend it, for the
destination string (second parameter to the function call).  That way it is
unique
to that client.

-Anthony


On Wed, Jul 10, 2013 at 2:15 PM, Ajay Garg ajaygargn...@gmail.com wrote:

 Thanks Jim and Matijn for the quick replies.
 I will try to have a workaround.



 On Wed, Jul 10, 2013 at 11:09 PM, Matijn Woudt tijn...@gmail.com wrote:

 
 
 
  On Wed, Jul 10, 2013 at 7:21 PM, Ajay Garg ajaygargn...@gmail.com
 wrote:
 
  Hi all.
 
  I have a requirement, wherein I need to allow vanilla uploads of files
  to a HTTPD server.
 
  Any client can upload any number of files (one at a time).
  Also, there is just one directory, where the files get stored
  finally (that is, after being copied from the temporary location,
  via move_uploaded_file)
 
  Also, I have been able to get the simple file uploading running via
  PHP, by picking up one of the numerous Hello World examples
  available :)
 
 
 
  Now, I am facing the following use-case ::
 
  1)
  User 1 starts uploading a large file, say big_file.avi.
 
  2)
  Meanwhile, user 2 also starts uploading a (different) file, but with
  the same name big_file.avi.
 
 
  In an ideal scenario, user 2 should be prompted with a message, that a
  file of the same name is already being uploaded by someone else
  somewhere.
  Is there a way to do this?
 
  ( Note that, had the user 2 started uploading AFTER user 1 had
  finished with the upload, we could probably modify the PHP-script at
  the sever-side, to let user-2 know that a file of the same name
  already exits. But I am failing to find a solution, when the user 2
  starts the upload WHILE the large file of user 1 is in the process of
  completing uploading).
 
 
  Any way the issue may be solved?
 
  I will be grateful for any pointers :)
 
 
 
  Regards,
  Ajay
 
 
 
  Hi,
 
  This is not possible with PHP, PHP will not know about the file until the
  upload is completed. You can use HTML5 or flash(not recommended) for an
  alternative way of uploading, and then you can check the file name in
  advance.
 
  - Matijn
 



 --
 Regards,
 Ajay




-- 
Anthony W.
ant92...@gmail.com


Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Bastien


Bastien Koert

On 2013-07-10, at 3:29 PM, Anthony Wlodarski ant92...@gmail.com wrote:

 Is there anything that would prevent you from somehow uniquely knowing who
 the user is uploading the file. For example you mentioned client'.  If you
 know
 who the client is you can append that to the filename or prepend it, for the
 destination string (second parameter to the function call).  That way it is
 unique
 to that client.
 
 -Anthony

Another option is that you name the files yourself. Numerically for example and 
then just switch it back to the uploaded file name when either displaying it or 
sending it back to the user. 

You should also place all files outside the web root so it's harder to execute 
bad files. And prolly filter for files types. Allow only images ( png jpg gif ) 
for example

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



Re: [PHP] Making a Timeout Expiration Length to Session Variables

2013-07-08 Thread Karim Geiger
Hi,

On 07/08/2013 05:10 AM, dealTek wrote:
 Hi all,
 
 I would like to make a timeout length to session variables, so that if a user 
 didn't use the browser page for let's say 5 minutes - the session variables 
 would expire and the user would need to login again.
 
 
 Q: What's the best way to implement this functionality?

You can either use cookies or do something like that:
http://stackoverflow.com/questions/3068744/php-session-timeout

In your case is would be
if ($_SESSION['timeout'] + 5 * 60  time()) {
// session timed out
} else {
// session ok
}

Karim

-- 
Karim Geiger
Auszubildender Fachinformatiker AE

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537



signature.asc
Description: OpenPGP digital signature


<    3   4   5   6   7   8   9   10   11   12   >