OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 12 Mar 2004 18:08:56 -0000 Issue 2642

php-general-digest-helplists.php.net
Date: Fri Mar 12 2004 - 12:08:56 CST


php-general Digest 12 Mar 2004 18:08:56 -0000 Issue 2642

Topics (messages 180234 through 180272):

Re: Help with arrays
        180234 by: Raditha Dissanayake
        180235 by: Elliot J. Balanza
        180236 by: Raditha Dissanayake
        180237 by: Jason Davidson
        180238 by: Jason Davidson
        180241 by: Michael Nolan
        180245 by: memoimyself.yahoo.com.br
        180247 by: Elliot J. Balanza

Error message: "No input file specified"
        180239 by: Thorsten Müller

Re: Get "nice" variables from POST
        180240 by: Richard Davey
        180254 by: trlists.clayst.com
        180256 by: trlists.clayst.com
        180259 by: Hans Juergen von Lengerke
        180261 by: Tom Meinlschmidt

Re: DOM XML and php
        180242 by: Tassos T
        180244 by: Lucian COZMA
        180258 by: Tassos T

Türkçe php mail grup...
        180243 by: EMIN GONAL

Windows and easyphp
        180246 by: Tassos T

Re: R: [PHP] Get "nice" variables from POST
        180248 by: Mike Mapsnac
        180251 by: Tassos T
        180252 by: Tom Meinlschmidt

Re: PHP || Create File (not upload) with ftp()?
        180249 by: CF High

Enabling exif using the Ports branch on OpenBSD
        180250 by: Teren

windows 2003 server configuration
        180253 by: Schmidt, Jeffrey

Static vs. Dynamic Build of PHP4
        180255 by: trlists.clayst.com

R: R: [PHP] Get "nice" variables from POST
        180257 by: Alessandro Vitale

Re: Loosing redirect in if...else
        180260 by: Alex Hogan

Re: More php Questions about PHP 4.3.4 (cli)
        180262 by: Martin McCormick

XSS Vulnerabilities and strip_tags
        180263 by: trlists.clayst.com

load a URL and trap output
        180264 by: Roger Spears
        180265 by: Tom Meinlschmidt
        180266 by: Chris Boget
        180268 by: Roger Spears
        180269 by: Red Wingate
        180271 by: Roger Spears

building a statically linked php cli
        180267 by: Hugh Beaumont

Re: Dumb
        180270 by: PHP

STrange Problem
        180272 by: PHP

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Elliot J. Balanza wrote:

>
>Then I need to store the values i receive in an array in the form of:
>
>$variable['name'] = value;
>
>

$value.

--
Raditha Dissanayake.
---------------------------------------------------------------
http://www.radinks.com/upload/
Drag and Drop Upload thousands of files and folders in a single
transfer. (HTTP or FTP)

attached mail follows:


Yes ok but how do I store it?

with array() how?

vamp

"Raditha Dissanayake" <jabberraditha.com> escribió en el mensaje
news:40515667.1090203raditha.com...
> Elliot J. Balanza wrote:
>
> >
> >Then I need to store the values i receive in an array in the form of:
> >
> >$variable['name'] = value;
> >
> >
>
> $value.
>
>
> --
> Raditha Dissanayake.
> ---------------------------------------------------------------
> http://www.radinks.com/upload/
> Drag and Drop Upload thousands of files and folders in a single
> transfer. (HTTP or FTP)

attached mail follows:


Elliot J. Balanza wrote:

>Yes ok but how do I store it?
>
>with array() how?
>
>
Whole business of reading from a db and storing into an array is
probably redundant. You should try to directly process the contents of
the db. This saves you memory and CPU.

$variable['name'] = $value;

is good.

--
Raditha Dissanayake.
---------------------------------------------------------------
http://www.radinks.com/upload/
Drag and Drop Upload thousands of files and folders in a single
transfer. (HTTP or FTP)

attached mail follows:


read about phps mysql_fetch_assoc in the manual.. this will explain what
your looking for.
http://ca.php.net/manual/en/function.mysql-fetch-array.php

Jason

"Elliot J. Balanza" <elliot.balanzambtradingco.com> wrote:
>
> Yes ok but how do I store it?
>
> with array() how?
>
> vamp
>
> "Raditha Dissanayake" <jabberraditha.com> escribió en el mensaje
> news:40515667.1090203raditha.com...
> > Elliot J. Balanza wrote:
> >
> > >
> > >Then I need to store the values i receive in an array in the form of:
> > >
> > >$variable['name'] = value;
> > >
> > >
> >
> > $value.
> >
> >
> > --
> > Raditha Dissanayake.
> > ---------------------------------------------------------------
> > http://www.radinks.com/upload/
> > Drag and Drop Upload thousands of files and folders in a single
> > transfer. (HTTP or FTP)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


i supplied the wrong link, sorry.. this is the right one..
http://ca.php.net/manual/en/function.mysql-fetch-assoc.php

Jason

"Jason Davidson" <jdavidsonzworg.com> wrote:
>
> read about phps mysql_fetch_assoc in the manual.. this will explain what
> your looking for.
> http://ca.php.net/manual/en/function.mysql-fetch-array.php
>
> Jason
>
>
>
>
>
> "Elliot J. Balanza" <elliot.balanzambtradingco.com> wrote:
> >
> > Yes ok but how do I store it?
> >
> > with array() how?
> >
> > vamp
> >
> > "Raditha Dissanayake" <jabberraditha.com> escribió en el mensaje
> > news:40515667.1090203raditha.com...
> > > Elliot J. Balanza wrote:
> > >
> > > >
> > > >Then I need to store the values i receive in an array in the form of:
> > > >
> > > >$variable['name'] = value;
> > > >
> > > >
> > >
> > > $value.
> > >
> > >
> > > --
> > > Raditha Dissanayake.
> > > ---------------------------------------------------------------
> > > http://www.radinks.com/upload/
> > > Drag and Drop Upload thousands of files and folders in a single
> > > transfer. (HTTP or FTP)
> >
> > --
> > 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
>
>

attached mail follows:


Elliot J. Balanza wrote:
> I need to make a query to a MySQL database that only has two fields, name &
> value. That I can do.
>
> Then I need to store the values i receive in an array in the form of:
>
> $variable['name'] = value;
>
> But haven't been able to do it neither with a foreach nor with a do while...
> Can anyone please assist me?
>

If you mean how do you store all the returned results in an array of
name/value pairs, this is how I'd do it:

<?php

while ($result = mysql_fetch_assoc($query)) {
     $variable[$result['name']] = $result['value'];
}

?>

Don't know what 'value' represents, but it will give you an array
something like this:

print_r($variable);

Array
(
     [michael] => nolan
     [joe] => bloggs
     [john] => smith
)

HTH,

Mike

attached mail follows:


Hello Elliot,

On 11 Mar 2004 at 23:55, Elliot J. Balanza wrote:

> I need to make a query to a MySQL database that only has two fields, name &
> value. That I can do.
>
> Then I need to store the values i receive in an array in the form of:
>
> $variable['name'] = value;
>
> But haven't been able to do it neither with a foreach nor with a do while...
> Can anyone please assist me?
 
Assuming you've read the introductory sections of the PHP manual and are not trying to
get other people to spend their time on your project so that you won't need to spend
yours, please show us your code so that we can help you spot the problem.

Erik

attached mail follows:


I have tried several combinations, including foreach, do whiles. This works
when i submit the values one by one, but when i try to automatize it it wont
work. Thanks

mysql_select_db($database_MBTTIENDA, $MBTTIENDA);
$query_prefsname = "SELECT Pref_name FROM mtmbt_prefs";
$prefsname = mysql_query($query_prefsname, $MBTTIENDA) or
die(mysql_error());
$row_prefsname = mysql_fetch_assoc($prefsname);

mysql_select_db($database_MBTTIENDA, $MBTTIENDA);
$query_prefsvalue = "SELECT Pref_value FROM mtmbt_prefs";
$prefsvalue = mysql_query($query_prefsvalue, $MBTTIENDA) or
die(mysql_error());
$row_prefsvalue = mysql_fetch_assoc($prefsvalue);

// merging them into the new array $MTMBT
foreach($row_prefsvalue as $i => $v)
{
     $MTMBT[$row_prefsname[$i]] = $v;
}

// printing result
foreach($MTMBT as $k => $v)
{
     echo "\$MTMBT[$k] => $v.<br>";
}

echo "the end lets see the results";
print_r($MTMBT);
echo "<br>";
echo $MTMBT['Titulo'];

<snip - snip>
<memoimyselfyahoo.com.br> escribió en el mensaje
news:40517AC2.11794.1B7033localhost...
> Hello Elliot,
>
> On 11 Mar 2004 at 23:55, Elliot J. Balanza wrote:
>
> > I need to make a query to a MySQL database that only has two fields,
name &
> > value. That I can do.
> >
> > Then I need to store the values i receive in an array in the form of:
> >
> > $variable['name'] = value;
> >
> > But haven't been able to do it neither with a foreach nor with a do
while...
> > Can anyone please assist me?
>
> Assuming you've read the introductory sections of the PHP manual and are
not trying to
> get other people to spend their time on your project so that you won't
need to spend
> yours, please show us your code so that we can help you spot the problem.
>
> Erik

attached mail follows:


Hi

I'm using the thttpd webserver and php as cgi. Up to php version 4.3.1
everything is fine. When i try to upgrade to 4.3.2 or 4.3.5RC3 the only
thing i can see is the message "No input file specified". Is this a bug in
php, or an incorrect configuration of my php?
Sorry if this question is not new, i found some similar questions in the
archive, but no helpful answer.

Thanks,
Thorsten

attached mail follows:


Hello trlists,

Friday, March 12, 2004, 3:56:23 AM, you wrote:

tcc> It seems to me that for security one wants both things -- first, to
tcc> move only what you need from _POST into the global symbol table, and
tcc> second, validate it thoroughly.

Indeed.. roll-on input filters in PHP5 :)

--
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

attached mail follows:


On 12 Mar 2004 Mike Mapsnac wrote:

> I try to use quotes in the query and this doesn't work.
> $query = "SELECT * FROM user WHERE user_id = '$_POST['user_id']}'";
> But you use brackets and it works.. Why do you use brackets ?
> $query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";

See http://us3.php.net/manual/en/language.types.string.php, scroll to
the section called "Complex (curly) syntax".

--
Tom

attached mail follows:


On 12 Mar 2004 Richard Davey wrote:

> Indeed.. roll-on input filters in PHP5 :)

Hmmm, can't find the docs on those online.

--
Tom

attached mail follows:


I know this isn't what you want, but nevertheless, this
"does not look ugly":

<pre>

  # Get variables from the form
  #
  $username = $_POST['username'];
  $password = $_POST['password'];
  $password2 = $_POST['password2'];
  $email = $_POST['email'];
  $email2 = $_POST['email2'];
  $nickname = $_POST['name'];
  $city = $POST['city'];
  $state = $_POST['state'];
  $country = $_POST['country'];
  $misc = $_POST['misc'];
  $country = $_POST['country'];

</pre>

and there you go, you can now easily spot a typo too :-)

Hans

PS: If you read this with variable-width font
    you might think I am an idiot. never mind.

> Date: Thu, 11 Mar 2004 14:51:25 +0000
> From: Mike Mapsnac <mikerh9hotmail.com>
> To: php-generallists.php.net
> Subject: [PHP] Get "nice" variables from POST
>
> I have about 10 fields in the form. And I get the fields through POST:
> //Get Variable from the form
> $username = $_POST['username'];
> $password = $_POST['password'];
> $password2 = $_POST['password2'];
> $email = $_POST['email'];
> $email2 = $_POST['email2'];
> $nickname = $_POST['name'];
> $city = $POST['city'];
> $state = $_POST['state'];
> $country = $_POST['country'];
> $misc = $_POST['misc'];
> $country = $_POST['country'];
>
> It works but it looks ugly. For each variable I have statemet. Is there a
> way to get the variables in the loop?
>
> I'm looking for "nice" way to get variables from POST?
>
> Thanks

attached mail follows:


 if (is_array($_POST)) {
  foreach($_POST as $name=>$value) {
   ${$name} = $value;
 }
}

/tom

On Fri, 12 Mar 2004 15:59:00 +0100 (CET)
Hans Juergen von Lengerke <lengerkehsixt.de> wrote:

> I know this isn't what you want, but nevertheless, this
> "does not look ugly":
>
> <pre>
>
> # Get variables from the form
> #
> $username = $_POST['username'];
> $password = $_POST['password'];
> $password2 = $_POST['password2'];
> $email = $_POST['email'];
> $email2 = $_POST['email2'];
> $nickname = $_POST['name'];
> $city = $POST['city'];
> $state = $_POST['state'];
> $country = $_POST['country'];
> $misc = $_POST['misc'];
> $country = $_POST['country'];
>
> </pre>
>
> and there you go, you can now easily spot a typo too :-)
>
> Hans
>
>
> PS: If you read this with variable-width font
> you might think I am an idiot. never mind.
>
>
> > Date: Thu, 11 Mar 2004 14:51:25 +0000
> > From: Mike Mapsnac <mikerh9hotmail.com>
> > To: php-generallists.php.net
> > Subject: [PHP] Get "nice" variables from POST
> >
> > I have about 10 fields in the form. And I get the fields through POST:
> > //Get Variable from the form
> > $username = $_POST['username'];
> > $password = $_POST['password'];
> > $password2 = $_POST['password2'];
> > $email = $_POST['email'];
> > $email2 = $_POST['email2'];
> > $nickname = $_POST['name'];
> > $city = $POST['city'];
> > $state = $_POST['state'];
> > $country = $_POST['country'];
> > $misc = $_POST['misc'];
> > $country = $_POST['country'];
> >
> > It works but it looks ugly. For each variable I have statemet. Is there a
> > way to get the variables in the loop?
> >
> > I'm looking for "nice" way to get variables from POST?
> >
> > Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--

attached mail follows:


Sory for delay

I use sablotron because I take xml data via curl from windows server. I need
only a way to transform xml data with xslt and I want to present data to web
pages. I think DOMXML provide functions to create XML docs from the
beginning and manipulate xml data like add or remove xml elements.

I hope to help you.

tassos

-----Original Message-----
From: Lucian COZMA [mailto:lcozmainterakt.ro]
Sent: Thursday, March 11, 2004 5:31 PM
To: php-generallists.php.net
Subject: Re: [PHP] Re: DOM XML and php

I have a question please (I'm trying to clarify something for me): Why do
you preffer Sablotron to DOMXML ? As I'm developping XML/XSLT framework
applications, I'm trying to understand why would our clients use it instead
of DOMXML and adapt to it if there is a good reason for it. I want to know
this because DOMXML is faster and more reliable than Sablotron (my opinion
after using extesively both of them), and both are extensions, that you have
to install, not something native that comes directly embeded into PHP.

Thanks,
Lucian COZMA

"Tassos T" <nereus0freemail.gr> wrote in message
news:003401c40777$f8193240$1900000aTRITON...
> Thanks I use this code and it works.
>
> tassos
>
>
> -----Original Message-----
> From: Lucian COZMA [mailto:lcozmainterakt.ro]
> Sent: Thursday, March 11, 2004 4:03 PM
> To: php-generallists.php.net
> Subject: Re: [PHP] Re: DOM XML and php
>
>
> It should look something like (pretty much extracted from manual):
> <?php
//
> $xml and $xsl contain the XML and XSL data ($xsl =
> file_get_contents('myxsl.xsl') and $xml
> ='<bla><bla1>lalala</bla1></bla> $arguments = array(
> '/_xml' => $xml,
> '/_xsl' => $xsl
> );
>
> // Allocate a new XSLT processor
> $xh = xslt_create();
>
> // Process the document
> $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL,
> $arguments);
if
> ($result) {
> //SUCCESS, sample.xml was transformed by sample.xsl into the $result
> print $result;
> } else {
> print "Sorry, sample.xml could not be transformed by sample.xsl into";
> print " the \$result variable the reason is that " .
> xslt_error($xh)
.
> print " and the error code is " . xslt_errno($xh);
> }
> xslt_free($xh);
> ?>Lucian COZMA
>
> "Lucian Cozma" <lcozmainterakt.ro> wrote in message
> news:20040311135945.75800.qmailpb1.pair.com...
> > If you really want to use Sablotron (although I tried it I not liked
> > it as much as DOMXML, gimme a sign, and I'll debug you.
> >
> > Regards,
> > Lucian COZMA InterAKT
> >
> >
> > "Tassos T" <nereus0freemail.gr> wrote in message
> > news:002701c4076d$c6f60c60$1900000aTRITON...
> > > Thanks for your reply but I have another problem
> > >
> > > I have an xml string if I use this code
> > >
> > > <?
> > > header("Content-Type: text/xml");
> > > echo $xml_string;
> > > ?>
> > > I can see the xml tree but I cannot transform with te xslt. Eg. <?
> > > $xp = xslt_create();
> > > $result_xsl = xslt_process($xp, $xml_string, 'myxsl.xsl');
> > > echo $result_xsl;
> > > xslt_free($xp);
> > >
> > > ?>
> > >
> > > Please advise
> > >
> > > Regards
> > >
> > > tassos
> > >
> > > -----Original Message-----
> > > From: Lucian COZMA [mailto:lcozmainterakt.ro]
> > > Sent: Thursday, March 11, 2004 3:20 PM
> > > To: php-generallists.php.net
> > > Subject: [PHP] Re: DOM XML and php
> > >
> > >
> > > <?php
> > > $xmlstr = '<bla><bla1>blabalabalab</bla1></bla>';
> > > if(!$dom = domxml_open_mem($xmlstr)) {
> > > echo "Error while parsing the document\n";
> > > exit;
> > > }
> > > // The root domdocument node
> > > $root = $dom->document_element();
> > > ///Dump the content back to string var_dump($dom->dump_mem()); ?>
> > >
> > > Read the manual in the DOM XML functions section. Regards,
> > > Lucian COZMA
> > > "Tassos T" <nereus0freemail.gr> wrote in message
> > > news:002501c40764$b9243b60$1900000aTRITON...
> > > > Hello,
> > > >
> > > > I face a problem. I have a php script and I send a xml request
> > > > to a
> > > server.
> > > > After I receive xml data but I have this data to an php string
> > > > variable.
> > > >
> > > > How to create a xml dom with out to write a xml file ?
> > > >
> > > > I want to use a xslt to tranform that xml data.
> > > >
> > > >
> > > > Any idea ?
> > > >
> > > > Thanks
> > > >
> > > > tassos
> > >
> > > --
> > > 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

attached mail follows:


True, but it does much more than that. It also provides xslt
transformations. It uses the powerfull libxslt library that provides far
more features, speed and reliablility than Sablot. I would rather do XSL
transformations with DOMXML than with Sablot just for these reasons.

Thanks for your response.
Lucian

"Tassos T" <nereus0freemail.gr> wrote in message
news:001a01c40822$2ab8a230$1900000aTRITON...
Sory for delay

I use sablotron because I take xml data via curl from windows server. I need
only a way to transform xml data with xslt and I want to present data to web
pages. I think DOMXML provide functions to create XML docs from the
beginning and manipulate xml data like add or remove xml elements.

I hope to help you.

tassos

-----Original Message-----
From: Lucian COZMA [mailto:lcozmainterakt.ro]
Sent: Thursday, March 11, 2004 5:31 PM
To: php-generallists.php.net
Subject: Re: [PHP] Re: DOM XML and php

I have a question please (I'm trying to clarify something for me): Why do
you preffer Sablotron to DOMXML ? As I'm developping XML/XSLT framework
applications, I'm trying to understand why would our clients use it instead
of DOMXML and adapt to it if there is a good reason for it. I want to know
this because DOMXML is faster and more reliable than Sablotron (my opinion
after using extesively both of them), and both are extensions, that you have
to install, not something native that comes directly embeded into PHP.

Thanks,
Lucian COZMA

"Tassos T" <nereus0freemail.gr> wrote in message
news:003401c40777$f8193240$1900000aTRITON...
> Thanks I use this code and it works.
>
> tassos
>
>
> -----Original Message-----
> From: Lucian COZMA [mailto:lcozmainterakt.ro]
> Sent: Thursday, March 11, 2004 4:03 PM
> To: php-generallists.php.net
> Subject: Re: [PHP] Re: DOM XML and php
>
>
> It should look something like (pretty much extracted from manual):
> <?php
//
> $xml and $xsl contain the XML and XSL data ($xsl =
> file_get_contents('myxsl.xsl') and $xml
> ='<bla><bla1>lalala</bla1></bla> $arguments = array(
> '/_xml' => $xml,
> '/_xsl' => $xsl
> );
>
> // Allocate a new XSLT processor
> $xh = xslt_create();
>
> // Process the document
> $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL,
> $arguments);
if
> ($result) {
> //SUCCESS, sample.xml was transformed by sample.xsl into the $result
> print $result;
> } else {
> print "Sorry, sample.xml could not be transformed by sample.xsl into";
> print " the \$result variable the reason is that " .
> xslt_error($xh)
.
> print " and the error code is " . xslt_errno($xh);
> }
> xslt_free($xh);
> ?>Lucian COZMA
>
> "Lucian Cozma" <lcozmainterakt.ro> wrote in message
> news:20040311135945.75800.qmailpb1.pair.com...
> > If you really want to use Sablotron (although I tried it I not liked
> > it as much as DOMXML, gimme a sign, and I'll debug you.
> >
> > Regards,
> > Lucian COZMA InterAKT
> >
> >
> > "Tassos T" <nereus0freemail.gr> wrote in message
> > news:002701c4076d$c6f60c60$1900000aTRITON...
> > > Thanks for your reply but I have another problem
> > >
> > > I have an xml string if I use this code
> > >
> > > <?
> > > header("Content-Type: text/xml");
> > > echo $xml_string;
> > > ?>
> > > I can see the xml tree but I cannot transform with te xslt. Eg. <?
> > > $xp = xslt_create();
> > > $result_xsl = xslt_process($xp, $xml_string, 'myxsl.xsl');
> > > echo $result_xsl;
> > > xslt_free($xp);
> > >
> > > ?>
> > >
> > > Please advise
> > >
> > > Regards
> > >
> > > tassos
> > >
> > > -----Original Message-----
> > > From: Lucian COZMA [mailto:lcozmainterakt.ro]
> > > Sent: Thursday, March 11, 2004 3:20 PM
> > > To: php-generallists.php.net
> > > Subject: [PHP] Re: DOM XML and php
> > >
> > >
> > > <?php
> > > $xmlstr = '<bla><bla1>blabalabalab</bla1></bla>';
> > > if(!$dom = domxml_open_mem($xmlstr)) {
> > > echo "Error while parsing the document\n";
> > > exit;
> > > }
> > > // The root domdocument node
> > > $root = $dom->document_element();
> > > ///Dump the content back to string var_dump($dom->dump_mem()); ?>
> > >
> > > Read the manual in the DOM XML functions section. Regards,
> > > Lucian COZMA
> > > "Tassos T" <nereus0freemail.gr> wrote in message
> > > news:002501c40764$b9243b60$1900000aTRITON...
> > > > Hello,
> > > >
> > > > I face a problem. I have a php script and I send a xml request
> > > > to a
> > > server.
> > > > After I receive xml data but I have this data to an php string
> > > > variable.
> > > >
> > > > How to create a xml dom with out to write a xml file ?
> > > >
> > > > I want to use a xslt to tranform that xml data.
> > > >
> > > >
> > > > Any idea ?
> > > >
> > > > Thanks
> > > >
> > > > tassos
> > >
> > > --
> > > 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

attached mail follows:


Hi,

I agree but I cannot find a way to transform xlm data from variable not open
xml file with using DOMXML.

tassos

-----Original Message-----
From: Lucian COZMA [mailto:lcozmainterakt.ro]
Sent: Friday, March 12, 2004 1:50 PM
To: php-generallists.php.net
Subject: Re: [PHP] Re: DOM XML and php

True, but it does much more than that. It also provides xslt
transformations. It uses the powerfull libxslt library that provides far
more features, speed and reliablility than Sablot. I would rather do XSL
transformations with DOMXML than with Sablot just for these reasons.

Thanks for your response.
Lucian

"Tassos T" <nereus0freemail.gr> wrote in message
news:001a01c40822$2ab8a230$1900000aTRITON...
Sory for delay

I use sablotron because I take xml data via curl from windows server. I need
only a way to transform xml data with xslt and I want to present data to web
pages. I think DOMXML provide functions to create XML docs from the
beginning and manipulate xml data like add or remove xml elements.

I hope to help you.

tassos

-----Original Message-----
From: Lucian COZMA [mailto:lcozmainterakt.ro]
Sent: Thursday, March 11, 2004 5:31 PM
To: php-generallists.php.net
Subject: Re: [PHP] Re: DOM XML and php

I have a question please (I'm trying to clarify something for me): Why do
you preffer Sablotron to DOMXML ? As I'm developping XML/XSLT framework
applications, I'm trying to understand why would our clients use it instead
of DOMXML and adapt to it if there is a good reason for it. I want to know
this because DOMXML is faster and more reliable than Sablotron (my opinion
after using extesively both of them), and both are extensions, that you have
to install, not something native that comes directly embeded into PHP.

Thanks,
Lucian COZMA

"Tassos T" <nereus0freemail.gr> wrote in message
news:003401c40777$f8193240$1900000aTRITON...
> Thanks I use this code and it works.
>
> tassos
>
>
> -----Original Message-----
> From: Lucian COZMA [mailto:lcozmainterakt.ro]
> Sent: Thursday, March 11, 2004 4:03 PM
> To: php-generallists.php.net
> Subject: Re: [PHP] Re: DOM XML and php
>
>
> It should look something like (pretty much extracted from manual):
> <?php
//
> $xml and $xsl contain the XML and XSL data ($xsl =
> file_get_contents('myxsl.xsl') and $xml
> ='<bla><bla1>lalala</bla1></bla> $arguments = array(
> '/_xml' => $xml,
> '/_xsl' => $xsl
> );
>
> // Allocate a new XSLT processor
> $xh = xslt_create();
>
> // Process the document
> $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL,
> $arguments);
if
> ($result) {
> //SUCCESS, sample.xml was transformed by sample.xsl into the $result
> print $result;
> } else {
> print "Sorry, sample.xml could not be transformed by sample.xsl into";
> print " the \$result variable the reason is that " .
> xslt_error($xh)
.
> print " and the error code is " . xslt_errno($xh);
> }
> xslt_free($xh);
> ?>Lucian COZMA
>
> "Lucian Cozma" <lcozmainterakt.ro> wrote in message
> news:20040311135945.75800.qmailpb1.pair.com...
> > If you really want to use Sablotron (although I tried it I not liked
> > it as much as DOMXML, gimme a sign, and I'll debug you.
> >
> > Regards,
> > Lucian COZMA InterAKT
> >
> >
> > "Tassos T" <nereus0freemail.gr> wrote in message
> > news:002701c4076d$c6f60c60$1900000aTRITON...
> > > Thanks for your reply but I have another problem
> > >
> > > I have an xml string if I use this code
> > >
> > > <?
> > > header("Content-Type: text/xml");
> > > echo $xml_string;
> > > ?>
> > > I can see the xml tree but I cannot transform with te xslt. Eg. <?
> > > $xp = xslt_create();
> > > $result_xsl = xslt_process($xp, $xml_string, 'myxsl.xsl');
> > > echo $result_xsl;
> > > xslt_free($xp);
> > >
> > > ?>
> > >
> > > Please advise
> > >
> > > Regards
> > >
> > > tassos
> > >
> > > -----Original Message-----
> > > From: Lucian COZMA [mailto:lcozmainterakt.ro]
> > > Sent: Thursday, March 11, 2004 3:20 PM
> > > To: php-generallists.php.net
> > > Subject: [PHP] Re: DOM XML and php
> > >
> > >
> > > <?php
> > > $xmlstr = '<bla><bla1>blabalabalab</bla1></bla>';
> > > if(!$dom = domxml_open_mem($xmlstr)) {
> > > echo "Error while parsing the document\n";
> > > exit;
> > > }
> > > // The root domdocument node
> > > $root = $dom->document_element();
> > > ///Dump the content back to string var_dump($dom->dump_mem()); ?>
> > >
> > > Read the manual in the DOM XML functions section. Regards, Lucian
> > > COZMA "Tassos T" <nereus0freemail.gr> wrote in message
> > > news:002501c40764$b9243b60$1900000aTRITON...
> > > > Hello,
> > > >
> > > > I face a problem. I have a php script and I send a xml request
> > > > to a
> > > server.
> > > > After I receive xml data but I have this data to an php string
> > > > variable.
> > > >
> > > > How to create a xml dom with out to write a xml file ?
> > > >
> > > > I want to use a xslt to tranform that xml data.
> > > >
> > > >
> > > > Any idea ?
> > > >
> > > > Thanks
> > > >
> > > > tassos
> > >
> > > --
> > > 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

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

attached mail follows:


SELAMLAR

Türkçe php mail grubumuza katılmak isteyen arkadaşlar aşağıdaki mail
adresine boş bir mail göndererek üye olabilirler, gelen confirm mesajını
hiçbir şey yazmadan direkt olarak reply ediniz...

turkphp-subscribeyahoogroups.com

veya

webden kayıt olmak isterseniz

http://groups.yahoo.com/group/turkphp/

adresine gelerek giriş yapabilirsiniz...

SEVGILER

attached mail follows:


Hi,

I use easyphp at windows to make test my php scripts and I face a problem
when I use the php function domxml_xmltree() "explode" apache.

I configure all extensions whitch required for using DOMXML.

Any idea ?

Thanks

tassos

attached mail follows:


I try to use quotes in the query and this doesn't work.
   $query = "SELECT * FROM user WHERE user_id = '$_POST['user_id']}'";
But you use brackets and it works.. Why do you use brackets ?
$query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";

>From: "Alessandro Vitale" <avitaletiscali.com>
>To: "Mike Mapsnac" <mikerh9hotmail.com>,<php-generallists.php.net>
>Subject: R: [PHP] Get "nice" variables from POST
>Date: Thu, 11 Mar 2004 17:30:57 +0100
>
>hi,
>
>why don't you simple use the $_POST vars? they are already available to
>you,
>so why you should copy them?
>
>example:
>
>function show_function()
>{
> $query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";
> ....
>}
>
>at the same time:
>- you save a lot of time ( you don't need to write code for copying vars )
>- you can always identify in your script the variable you are using is the
>one that comes from POST
>
>cheers,
>
>alessandro
>
>-----Messaggio originale-----
>Da: Mike Mapsnac [mailto:mikerh9hotmail.com]
>Inviato: giovedì 11 marzo 2004 15.51
>A: php-generallists.php.net
>Oggetto: [PHP] Get "nice" variables from POST
>
>
>I have about 10 fields in the form. And I get the fields through POST:
>//Get Variable from the form
>$username = $_POST['username'];
>$password = $_POST['password'];
>$password2 = $_POST['password2'];
>$email = $_POST['email'];
>$email2 = $_POST['email2'];
>$nickname = $_POST['name'];
>$city = $POST['city'];
>$state = $_POST['state'];
>$country = $_POST['country'];
>$misc = $_POST['misc'];
>$country = $_POST['country'];
>
>It works but it looks ugly. For each variable I have statemet. Is there a
>way to get the variables in the loop?
>
>I'm looking for "nice" way to get variables from POST?
>
>Thanks
>
>_________________________________________________________________
>Frustrated with dial-up? Lightning-fast Internet access for as low as
>$29.95/month. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

_________________________________________________________________
Get a FREE online computer virus scan from McAfee when you click here.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

attached mail follows:


Try to use
$query = "SELECT * FROM user WHERE user_id = $_POST['user_id']";

-----Original Message-----
From: Mike Mapsnac [mailto:mikerh9hotmail.com]
Sent: Friday, March 12, 2004 3:40 PM
To: avitaletiscali.com; php-generallists.php.net
Subject: [PHP] RE: R: [PHP] Get "nice" variables from POST

I try to use quotes in the query and this doesn't work.
   $query = "SELECT * FROM user WHERE user_id = '$_POST['user_id']}'"; But
you use brackets and it works.. Why do you use brackets ? $query = "SELECT *
FROM user WHERE user_id = ${_POST['user_id']}";

>From: "Alessandro Vitale" <avitaletiscali.com>
>To: "Mike Mapsnac" <mikerh9hotmail.com>,<php-generallists.php.net>
>Subject: R: [PHP] Get "nice" variables from POST
>Date: Thu, 11 Mar 2004 17:30:57 +0100
>
>hi,
>
>why don't you simple use the $_POST vars? they are already available to
>you,
>so why you should copy them?
>
>example:
>
>function show_function()
>{
> $query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";
> ....
>}
>
>at the same time:
>- you save a lot of time ( you don't need to write code for copying
>vars )
>- you can always identify in your script the variable you are using is the
>one that comes from POST
>
>cheers,
>
>alessandro
>
>-----Messaggio originale-----
>Da: Mike Mapsnac [mailto:mikerh9hotmail.com]
>Inviato: giovedì 11 marzo 2004 15.51
>A: php-generallists.php.net
>Oggetto: [PHP] Get "nice" variables from POST
>
>
>I have about 10 fields in the form. And I get the fields through POST:
>//Get Variable from the form $username = $_POST['username'];
>$password = $_POST['password'];
>$password2 = $_POST['password2'];
>$email = $_POST['email'];
>$email2 = $_POST['email2'];
>$nickname = $_POST['name'];
>$city = $POST['city'];
>$state = $_POST['state'];
>$country = $_POST['country'];
>$misc = $_POST['misc'];
>$country = $_POST['country'];
>
>It works but it looks ugly. For each variable I have statemet. Is there
>a way to get the variables in the loop?
>
>I'm looking for "nice" way to get variables from POST?
>
>Thanks
>
>_________________________________________________________________
>Frustrated with dial-up? Lightning-fast Internet access for as low as
>$29.95/month. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

_________________________________________________________________
Get a FREE online computer virus scan from McAfee when you click here.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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

attached mail follows:


oops. It's much better to use single quotes and entire variable in {}

eg
 .. where user_id = '{$_POST['user_id']}' ...

realize - POST variable user_id has no value, so in your code it will be as
"select * from users where user_id =";

as a result - you have wrong sql query.

/tom

On Fri, 12 Mar 2004 13:40:12 +0000
"Mike Mapsnac" <mikerh9hotmail.com> wrote:

> I try to use quotes in the query and this doesn't work.
> $query = "SELECT * FROM user WHERE user_id = '$_POST['user_id']}'";
> But you use brackets and it works.. Why do you use brackets ?
> $query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";
>
>
> >From: "Alessandro Vitale" <avitaletiscali.com>
> >To: "Mike Mapsnac" <mikerh9hotmail.com>,<php-generallists.php.net>
> >Subject: R: [PHP] Get "nice" variables from POST
> >Date: Thu, 11 Mar 2004 17:30:57 +0100
> >
> >hi,
> >
> >why don't you simple use the $_POST vars? they are already available to
> >you,
> >so why you should copy them?
> >
> >example:
> >
> >function show_function()
> >{
> > $query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";
> > ....
> >}
> >
> >at the same time:
> >- you save a lot of time ( you don't need to write code for copying vars )
> >- you can always identify in your script the variable you are using is the
> >one that comes from POST
> >
> >cheers,
> >
> >alessandro
> >
> >-----Messaggio originale-----
> >Da: Mike Mapsnac [mailto:mikerh9hotmail.com]
> >Inviato: giovedì 11 marzo 2004 15.51
> >A: php-generallists.php.net
> >Oggetto: [PHP] Get "nice" variables from POST
> >
> >
> >I have about 10 fields in the form. And I get the fields through POST:
> >//Get Variable from the form
> >$username = $_POST['username'];
> >$password = $_POST['password'];
> >$password2 = $_POST['password2'];
> >$email = $_POST['email'];
> >$email2 = $_POST['email2'];
> >$nickname = $_POST['name'];
> >$city = $POST['city'];
> >$state = $_POST['state'];
> >$country = $_POST['country'];
> >$misc = $_POST['misc'];
> >$country = $_POST['country'];
> >
> >It works but it looks ugly. For each variable I have statemet. Is there a
> >way to get the variables in the loop?
> >
> >I'm looking for "nice" way to get variables from POST?
> >
> >Thanks
> >
> >_________________________________________________________________
> >Frustrated with dial-up? Lightning-fast Internet access for as low as
> >$29.95/month. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> _________________________________________________________________
> Get a FREE online computer virus scan from McAfee when you click here.
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--

attached mail follows:


Hey all.

I've been having ownership issues when writing files with fwrite(); i.e.
file owner is "nobody" while ftp'd files are owned by the site owner.

In order to streamline file management, I'd like to be able to write files
on our webhost server using PHP's ftp functions; not using fwrite() and the
like.

So, for example, let's say I have the following data to be written to file:

$test = "I'm test data";

How would I use ftp() functions to write $test to file on the webserver?

Any help much appreciated.....

--Noah

--

attached mail follows:


Hi, I'm trying to enable exif on my OpenBSD box so I tried adding --enable-exif in core/Makefile under CONFIGURE_ARGS but that makes it so i can't make it. Does anyone know how to enable exif with ports? Thanks

Teren

attached mail follows:


I am running Windows 2003 server and am having trouble configuring. I
unzipped php 4.+ to c:\php. I renamed php.ini and put it in C;\windows
and configured the extension_dir = c:\php\extensions, doc_root =
c:\inetpub\wwwroot, and cgi.force_redirect = 0. I also moved php4ts.dll
to c:\windows\sytem32 and then created a ned webservice extension named
.php and set the path to c:\php\sapi\php4isapi.dll. Then on to
properties of and execute permissions added scripts and executables.
Configure tab added .php and set the path to c:\php\sapi\php4isapi.dll
and check mark out of verify file exist. Then I went to add content page
and added index.php and moved it to the top.
 
I am getting in my web browser with a test file "SERVICE UNAVAILABLE".
At other configurations I would get an "NO INPUT FILE SPECIFIED". Now
when I am trying to run my script a windows dialogue box is coming up
asking me for username and password and I am logged in as administrator.
 
I f you have any ideas where you can help PLEASE understand my pain.
 
Thank you,
Jeff Schmidt.

attached mail follows:


I am running on one Linux server which has PHP built statically; the
CLI and Apache modules are both over 5.5MB. On another where it is
built dynamically they are closer to 1.2MB.

Is there any data on the performance tradeoffs of static vs. dynamic
builds? I understand the factors (static eliminates the overhead to
load needed libraries, dynamic reduces memory footprint) but I wonder
if there is any real-world data on when one is better than the other.
We are using PHP primarily as an Apache module, not CGI or CLI.

Thanks,

--
Tom

attached mail follows:


hi,

curly braces are useful to specify in a double quoted string where is the
end of the variable name.

"$ciao" == "${ciao}"
in case of associative arrays is recommended to prevent the parser to mess
up.

see php manual at the following section for details

Main : Language Reference : Types : Strings

-----Messaggio originale-----
Da: Mike Mapsnac [mailto:mikerh9hotmail.com]
Inviato: venerdì 12 marzo 2004 14.40
A: avitaletiscali.com; php-generallists.php.net
Oggetto: RE: R: [PHP] Get "nice" variables from POST

I try to use quotes in the query and this doesn't work.
   $query = "SELECT * FROM user WHERE user_id = '$_POST['user_id']}'";
But you use brackets and it works.. Why do you use brackets ?
$query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";

>From: "Alessandro Vitale" <avitaletiscali.com>
>To: "Mike Mapsnac" <mikerh9hotmail.com>,<php-generallists.php.net>
>Subject: R: [PHP] Get "nice" variables from POST
>Date: Thu, 11 Mar 2004 17:30:57 +0100
>
>hi,
>
>why don't you simple use the $_POST vars? they are already available to
>you,
>so why you should copy them?
>
>example:
>
>function show_function()
>{
> $query = "SELECT * FROM user WHERE user_id = ${_POST['user_id']}";
> ....
>}
>
>at the same time:
>- you save a lot of time ( you don't need to write code for copying vars )
>- you can always identify in your script the variable you are using is the
>one that comes from POST
>
>cheers,
>
>alessandro
>
>-----Messaggio originale-----
>Da: Mike Mapsnac [mailto:mikerh9hotmail.com]
>Inviato: giovedì 11 marzo 2004 15.51
>A: php-generallists.php.net
>Oggetto: [PHP] Get "nice" variables from POST
>
>
>I have about 10 fields in the form. And I get the fields through POST:
>//Get Variable from the form
>$username = $_POST['username'];
>$password = $_POST['password'];
>$password2 = $_POST['password2'];
>$email = $_POST['email'];
>$email2 = $_POST['email2'];
>$nickname = $_POST['name'];
>$city = $POST['city'];
>$state = $_POST['state'];
>$country = $_POST['country'];
>$misc = $_POST['misc'];
>$country = $_POST['country'];
>
>It works but it looks ugly. For each variable I have statemet. Is there a
>way to get the variables in the loop?
>
>I'm looking for "nice" way to get variables from POST?
>
>Thanks
>
>_________________________________________________________________
>Frustrated with dial-up? Lightning-fast Internet access for as low as
>$29.95/month. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

_________________________________________________________________
Get a FREE online computer virus scan from McAfee when you click here.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

attached mail follows:


> (a) if you're using any values sent via the URL string (e.g.
> cf=0), you need to
> use $_GET, not $_POST;

Some of the information is coming from a form and the info from the url is
to call the different questions. They are all on one page in a switch
statement.

> (b) empty() will also evaluate to true if the value of the variable
> is zero.

That's right.... I forgot about that. Thanks.

alex

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


        My thanks to both of you. I am trying to find out now how to
compile in the oci8 functions because it is not obvious in the list of
configuration selections.

        When I do get those functions, I can probably use the
information from Marcelo so every bit helps.

Martin Towell writes:
>I don't think this is the problem...
>
>The problem is that oci* functions haven't been compiled.

>> From: Marcelo Pereira Fonseca da Silva

>> The ocilogon() function should have in third parameter
>> something like
>>
>> $db="(DESCRIPTION=
>> (ADDRESS_LIST=
>> (ADDRESS=(PROTOCOL=TCP)
>> (HOST=HOST_HERE)(PORT=PORT_HERE)
>> )
>> )

attached mail follows:


Is the general wisdom that using strip_tags on input is sufficient to
protect against XSS vulnerabilities from that input? I have been doing
some reading on it but haven't found anything that suggests a
vulnerability that removing the tags in this way would not cure.

Are there multi-level encodings that can get past strip_tags?

I probably should also be doing a urldecode before strip_tags to get
around any hex encodings, or does strip_tags handle that?

Thanks for any info,

--
Tom

attached mail follows:


Hello,

I have this application which is accessed via a web portal. The first
thing my application must do is make sure the visitor is logged in via
the portal. The only way to do this is by making a request to a
specific URL. This URL (which includes the log in cookie id) will
return XML to my application. Once I parse this XML, I will know if
visitors are logged in.

Simple enough.

How do I make my application load a URL and trap the returned data so
that it never creates any browser output?

My first reaction was header("Location: URL") but then I'd be handing
off control to the URL and the output would appear in the browser.....

I've done some research and found system(), exec(), and passthru(). But
I'm not sure if these functions are the proper way to do such a task
especially since I'm calling a URL and not a specific UNIX command.....

Thanks,
Roger

attached mail follows:


simple use fopen() or file()

as $fp = fopen("http://somedomain/some.url?blablah","r");

and read via fread()

/tom

On Fri, 12 Mar 2004 10:54:53 -0500
Roger Spears <rogerbgnet.bgsu.edu> wrote:

> Hello,
>
> I have this application which is accessed via a web portal. The first
> thing my application must do is make sure the visitor is logged in via
> the portal. The only way to do this is by making a request to a
> specific URL. This URL (which includes the log in cookie id) will
> return XML to my application. Once I parse this XML, I will know if
> visitors are logged in.
>
> Simple enough.
>
> How do I make my application load a URL and trap the returned data so
> that it never creates any browser output?
>
> My first reaction was header("Location: URL") but then I'd be handing
> off control to the URL and the output would appear in the browser.....
>
> I've done some research and found system(), exec(), and passthru(). But
> I'm not sure if these functions are the proper way to do such a task
> especially since I'm calling a URL and not a specific UNIX command.....
>
> Thanks,
> Roger
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--

attached mail follows:


> How do I make my application load a URL and trap the returned data so
> that it never creates any browser output?

Aside from the fopen() and fread() that was suggested by another person
you can also use the ob_* functions.

Chris

attached mail follows:


Tom Meinlschmidt wrote:

>simple use fopen() or file()
>
>as $fp = fopen("http://somedomain/some.url?blablah","r");
>
>and read via fread()
>
>
>
Perhaps I was mistaken, I thought:

$fp = fopen("http://somedomain/some.url?blablah","r");
fread();

Would just return the actual HTML code of the page and NOT the results
of running the page?.?.?.?.?

I will test it out and see. Thank you for your suggestion!

Roger

>Hello,
>
>I have this application which is accessed via a web portal. The first
>thing my application must do is make sure the visitor is logged in via
>the portal. The only way to do this is by making a request to a
>specific URL. This URL (which includes the log in cookie id) will
>return XML to my application. Once I parse this XML, I will know if
>visitors are logged in.
>
>Simple enough.
>
>How do I make my application load a URL and trap the returned data so
>that it never creates any browser output?
>
>My first reaction was header("Location: URL") but then I'd be handing
>off control to the URL and the output would appear in the browser.....
>
>I've done some research and found system(), exec(), and passthru(). But
>I'm not sure if these functions are the proper way to do such a task
>especially since I'm calling a URL and not a specific UNIX command.....
>
>Thanks,
>Roger
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>

--
...and I say unto you, the Geek shall inherit the earth.

attached mail follows:


Best way would be filegetcontents() and implode the content
with "\n".

eg:

<?php
     $temp = filegetcontents('http://www.somedomain.com');
     $temp = implode ( "\n" , $temp );

     echo $temp ;
?>

Chris Boget wrote:

>>How do I make my application load a URL and trap the returned data so
>>that it never creates any browser output?
>
>
> Aside from the fopen() and fread() that was suggested by another person
> you can also use the ob_* functions.
>
> Chris
>

attached mail follows:


Tom Meinlschmidt wrote:

>
>> simple use fopen() or file()
>>
>> as $fp = fopen("http://somedomain/some.url?blablah","r");
>>
>> and read via fread()
>>
>>
>>
Then I replied with:

> Perhaps I was mistaken, I thought:
>
> $fp = fopen("http://somedomain/some.url?blablah","r");
> fread();
>
>
> Would just return the actual HTML code of the page and NOT the results
> of running the page?.?.?.?.?
>
> I will test it out and see. Thank you for your suggestion!
>
Hello All,

It seems fopen() did not work. However, it did stop the FORBIDDEN
message I was receiving. So I think I'm on the right track. Here's
what I tried...

$filename = "actual URL";

$fd = fopen("$filename", "r");
$contents = fread($fd, $filename);
fclose($fd);

print strlen($contents);
print "<p>".$contents;

I can open the URL, that works ( fopen() ).
I've tested out the fread(), file(), fgets(), and file_get_contents
functions. Nothing works.
I can close the URL, that works ( fclose() ).

With each attempt, I get 0 for the strlen of $contents and nothing else
prints out.

I also tried adding this to the script right before fopen:
ini_set('allow_url_fopen','1');

That didn't work either...

Any idea(s) on what I'm doing wrong? I'm using php 4.3.3 and I believe
it's Apache 1.3

Thanks,
Roger

attached mail follows:


Hi List,

I am trying to build a statically linked php cli binary. I believe I am using the correct
terminology. What I want is a php cli binary that will work on (for the most part)
any server I need to copy it to even if the particular extra libs I compiled against
are not on that server.

I need a cli binary that I can copy to a Linux box and be sure it will work even if (for example,
mcrypt, or ming or whatever the case may be is not installed on that server.

For exampe, I want:

ldd php

to return nothing.

I have checked the archives but could not find anything. I tried --enable-static but I believe
this is just meant to have the compiler use both .a and .so libs when building.

What I want is a binary that has all the libs built into it (I realize this will result in a
larger binary and memory footprint).

Any advice?

Thanks in advance!

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

attached mail follows:


Thanks, that is what I figured.

I really don't get rpm's, it seems you are stuck with whatever the packager
felt like putting in the rpm.
Want to add a library? Like zlib for example? then you have to re-compile it
yourself anyways.
They seem completely useless to me for anything but a very basic program
with no real compile options.

----- Original Message -----
From: "Jason Davidson" <jdavidsonzworg.com>
To: "PHP" <php_listibcnetwork.net>
Sent: Thursday, March 11, 2004 11:44 AM
Subject: Re: [PHP] Dumb

> Not a dumb question at all. I suppose you could try forcefeeding the
> php rpm into the system again, but that is certainly not the 'nice'
> way. I think short of installing php or the php module again, Im not
> sure you can simply change a config setting or anything.
> My experience in the past, is that , the rpms of apache and php have
> been flakey, that was 3 years ago, and Im sure its improved a great
> deal, but nontheless, i prefer to compile apache and php, and rpm
> mysql. Seems to be easier.
> Good Luck
> Jason
>
> "PHP" <php_listibcnetwork.net> wrote:
> >
> > Hi,
> > I have a dum question.
> >
> > I recently picked up a new RH9 dedicated server. Apache 2, Mysql 3 and
php4 are
> > all installed , via rpm I am assuming.
> >
> > I upgraded mysql to version 4, however, php is still using the version 3
client.
> > (from php_info)
> >
> > How do I get php4 to use the mysql4 client?
> >
> > I would like to know if this is possible just using rpms. I could do it
> > re-compiling everything myself, but I kind of want to stick to the rpm
style
> > installation on this server if possible.
> >
> > Thanks for any help.
>

attached mail follows:


Hi,
I am using RH9, Mysql 3.23.58, PHP 4.2.2, apache2.0

 mysql_select_db("mydatabase",$connect_id)

allways fails.

I can use $connect_id = mysql_connect("localhost","apache"); (YES, I do have this line before the mysql_select_db);
just fine.
I can run querys against the database with no problems, but for some reason,

mysql_select_db("mydatabase",$connect_id)

will allways return false, and I don't see any errors anywhere in any log. Why can I not select the database with this, but have no problems using the database with every other mysql function?