php-general Digest 9 Aug 2012 07:23:24 -0000 Issue 7915

Topics (messages 318650 through 318656):

Re: PHP session variables
        318650 by: Jen Rasmussen
        318651 by: Jim Giner

XML/PHP web service
        318652 by: Phillip Baker
        318653 by: Ashley Sheridan
        318654 by: Phillip Baker
        318655 by: Robert Cummings

Re: using phar and compression
        318656 by: Hajo Locke

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
-----Original Message-----
From: David Harkness [mailto:davi...@highgearmedia.com] 
Sent: Wednesday, August 08, 2012 11:53 AM
To: Ansry User 01
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] PHP session variables

On Wed, Aug 8, 2012 at 8:24 AM, Ansry User 01 <yrsna.res...@gmail.com>wrote:

> I am setting the _SESSION variables in one of my file, but whenever I 
> leave the php page session variables are not accessible.


As always, post some code demonstrating what you're doing. Help us help you!
:)

David

You have to set session_start also on the page where you are trying to
retrieve the session variables.

Jen



--- End Message ---
--- Begin Message ---
On 8/8/2012 11:24 AM, Ansry User 01 wrote:
I am setting the _SESSION variables in one of my file, but whenever I leave the 
php page session variables are not accessible. Not sure what I need to do 
additionally other then defining _SESSION[].
Any pointer.



You must make it a habit to start each script with

session_start();

so that any thing you did in the last script is returned for use in the new script.
--- End Message ---
--- Begin Message ---
Greetings all,

I am looking for some options here.

I am in need of creating a service on our web server that will always be
available and automated.
It will accept an XML file.

I will be checking to see if the XML file is valid and then passing it on
to another server.
But I need to accept this file without using a submit form.
I have never done anything like this and looking for ideas.

I am using a lamp environment and looking for suggestions.

I am looking to set this up so that our vendors can set up scripts to
automatically post XML files to our servers.

Blessed Be

Phillip

"In the Jim Crow South, for example, government failed and indeed refused
to protect blacks from extra-legal violence. Given our history, it's
stunning we fail to question those who would force upon us a total reliance
on the state for defense."
-- Robert J. Cottrol

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

Phillip Baker <phil...@freewolf.net> wrote:

>Greetings all,
>
>I am looking for some options here.
>
>I am in need of creating a service on our web server that will always
>be
>available and automated.
>It will accept an XML file.
>
>I will be checking to see if the XML file is valid and then passing it
>on
>to another server.
>But I need to accept this file without using a submit form.
>I have never done anything like this and looking for ideas.
>
>I am using a lamp environment and looking for suggestions.
>
>I am looking to set this up so that our vendors can set up scripts to
>automatically post XML files to our servers.
>
>Blessed Be
>
>Phillip
>
>"In the Jim Crow South, for example, government failed and indeed
>refused
>to protect blacks from extra-legal violence. Given our history, it's
>stunning we fail to question those who would force upon us a total
>reliance
>on the state for defense."
>-- Robert J. Cottrol

Just set up your php script as if it were accepting input from a form 
submission. All you're doing is not showing the form. Imagine it like a form 
set up on someone else's server with the action attribute pointing to your 
script.

Ashley  Sheridan
http://www.ashleysheridan.co.uk

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

--- End Message ---
--- Begin Message ---
I was wondering how that would work and if it might be that simple.
How would I inform the client to hit the page (script)?

Blessed Be

Phillip

"In the Jim Crow South, for example, government failed and indeed refused
to protect blacks from extra-legal violence. Given our history, it's
stunning we fail to question those who would force upon us a total reliance
on the state for defense."
-- Robert J. Cottrol



On Wed, Aug 8, 2012 at 4:27 PM, Ashley Sheridan 
<a...@ashleysheridan.co.uk>wrote:

>
>
> Phillip Baker <phil...@freewolf.net> wrote:
>
> >Greetings all,
> >
> >I am looking for some options here.
> >
> >I am in need of creating a service on our web server that will always
> >be
> >available and automated.
> >It will accept an XML file.
> >
> >I will be checking to see if the XML file is valid and then passing it
> >on
> >to another server.
> >But I need to accept this file without using a submit form.
> >I have never done anything like this and looking for ideas.
> >
> >I am using a lamp environment and looking for suggestions.
> >
> >I am looking to set this up so that our vendors can set up scripts to
> >automatically post XML files to our servers.
> >
> >Blessed Be
> >
> >Phillip
> >
> >"In the Jim Crow South, for example, government failed and indeed
> >refused
> >to protect blacks from extra-legal violence. Given our history, it's
> >stunning we fail to question those who would force upon us a total
> >reliance
> >on the state for defense."
> >-- Robert J. Cottrol
>
> Just set up your php script as if it were accepting input from a form
> submission. All you're doing is not showing the form. Imagine it like a
> form set up on someone else's server with the action attribute pointing to
> your script.
>
> Ashley  Sheridan
> http://www.ashleysheridan.co.uk
>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>

--- End Message ---
--- Begin Message ---
Hi Philip,

Tell them they can POST submissions to:

    https://www.acme.com/xml-submission

Then tell them what fields are supported. Presumably you will support the following POST fields as a minimum (as if they were on a form):

    username
    password
    xml

Your handler should also provide some feedback about whether the submission was successful of not. You can simply return output of a 1 for success, a 0 for failure, or if you want to go whole hog you can output an XML response for which you can have much greater granularity for the response.

Cheers,
Rob.

On 12-08-08 06:57 PM, Phillip Baker wrote:
I was wondering how that would work and if it might be that simple.
How would I inform the client to hit the page (script)?

Blessed Be

Phillip

"In the Jim Crow South, for example, government failed and indeed refused
to protect blacks from extra-legal violence. Given our history, it's
stunning we fail to question those who would force upon us a total reliance
on the state for defense."
-- Robert J. Cottrol



On Wed, Aug 8, 2012 at 4:27 PM, Ashley Sheridan 
<a...@ashleysheridan.co.uk>wrote:



Phillip Baker <phil...@freewolf.net> wrote:

Greetings all,

I am looking for some options here.

I am in need of creating a service on our web server that will always
be
available and automated.
It will accept an XML file.

I will be checking to see if the XML file is valid and then passing it
on
to another server.
But I need to accept this file without using a submit form.
I have never done anything like this and looking for ideas.

I am using a lamp environment and looking for suggestions.

I am looking to set this up so that our vendors can set up scripts to
automatically post XML files to our servers.

Blessed Be

Phillip

"In the Jim Crow South, for example, government failed and indeed
refused
to protect blacks from extra-legal violence. Given our history, it's
stunning we fail to question those who would force upon us a total
reliance
on the state for defense."
-- Robert J. Cottrol

Just set up your php script as if it were accepting input from a form
submission. All you're doing is not showing the form. Imagine it like a
form set up on someone else's server with the action attribute pointing to
your script.

Ashley  Sheridan
http://www.ashleysheridan.co.uk

--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.



--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
Hello,

thanks, but i cant do this.
its just this problem: Should line
$compressed = $phar->convertToExecutable(Phar::TAR,Phar::GZ, '.phar.tgz');
create a ready to run executable or not .Its not about creating phar archives in optional way.
It is a special problem i try to find...

Thanks,
Hajo

----- Original Message ----- From: "Alan Hoffmeister" <alanhoffmeis...@gmail.com>
To: "Hajo Locke" <hajo.lo...@gmx.de>
Sent: Wednesday, August 08, 2012 1:32 PM
Subject: Re: [PHP] using phar and compression


Why don't you use Phar::compress() instead of
Phar::convertToExecutable() and see what happens?
http://php.net/manual/en/phar.compress.php

--
Att,
Alan Hoffmeister


2012/8/8 Hajo Locke <hajo.lo...@gmx.de>:
Hello,

i do some tests with phar. I have following script which is just adding some
file and index.php is echoing "hello";

<?php
$phar = new Phar('project.phar', 0, 'project.phar');
$phar->buildFromDirectory(dirname(__FILE__) . '/web');
$phar->setStub($phar->createDefaultStub('index.php'));
$compressed = $phar->convertToExecutable(Phar::PHAR,Phar::GZ, '.phar.tgz');
?>

This is working and i can call resulting by: "php project.phar"
Now i change last line to:
$compressed = $phar->convertToExecutable(Phar::TAR,Phar::GZ, '.phar.tgz');

Now the final phar archive should be compressed with tar. Creating the
archive works without errors, but i cant run it.
Viewing file project.phar.tgz shows only binary-content, no php-header.
Running "php project.phar.tgz" shows no output.
As i understood i can run any phar archive, regardless of used
compressionmethod. Is this right? Am i using phar the correct way?

Thanks,
Hajo

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



--- End Message ---

Reply via email to