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 26 Apr 2006 18:08:49 -0000 Issue 4094

php-general-digest-helplists.php.net
Date: Wed Apr 26 2006 - 13:08:49 CDT


php-general Digest 26 Apr 2006 18:08:49 -0000 Issue 4094

Topics (messages 234769 through 234833):

Php function to Set focus On A form Field
        234769 by: marvin hunkin
        234783 by: Joe Wollard
        234784 by: Philipp Kopf
        234820 by: Ing. Edwin Cruz

Re: PHP/LDAP Setup Problem
        234770 by: Richard Lynch
        234771 by: Sameer N Ingole

Re: Amazon WSDL
        234772 by: Richard Lynch

Re: Upload Progress Meter - what's the latest?
        234773 by: Richard Lynch
        234775 by: Richard Lynch

Re: Protecting index.php
        234774 by: chris smith
        234778 by: Richard Lynch

SQL query to array?
        234776 by: William Stokes
        234780 by: Jim Lucas
        234781 by: Richard Lynch
        234782 by: Joe Wollard
        234787 by: William Stokes

Re: Serveral forms in a page.
        234777 by: William Stokes
        234800 by: chris smith

Re: need help to put input text value into url
        234779 by: Richard Lynch

last-ditch
        234785 by: Elvira Rucker

session
        234786 by: Sichta, Daniel
        234799 by: chris smith
        234808 by: chris smith
        234811 by: Sichta, Daniel
        234814 by: chris smith
        234815 by: Sichta, Daniel
        234816 by: chris smith

PHP 5 + Apache 2 on Windows: ms sql extension problem
        234788 by: Laszlo Nagy
        234796 by: Wolf
        234821 by: Ing. Edwin Cruz

(Apache|php) Bug using modproxy
        234789 by: Lmwangi

Filter out MS Word 'quotes' for RSS
        234790 by: Kevin Davies
        234795 by: chris smith
        234797 by: Wolf
        234805 by: Evan Priestley

Book/Site for internernal PHP5 Core Developing
        234791 by: Thomas Munz
        234794 by: chris smith

Pear Package HTTP_Request
        234792 by: Markus Braun
        234793 by: chris smith
        234801 by: Markus Braun

ESD¾²µç·À»¤¼¼Êõ¼°Ìåϵ½¨Éè¸ß¼¶Åàѵ(AD)
        234798 by: 5ÔÂ20-21ºÅ¿ª¿Î!

Re: cURL & cookies
        234802 by: Eric Butera

How to execute multiples querys
        234803 by: Mauricio Pellegrini
        234804 by: nicolas figaro
        234807 by: Mauricio Pellegrini
        234809 by: chris smith
        234813 by: nicolas figaro
        234817 by: Mauricio Pellegrini
        234818 by: Mauricio Pellegrini
        234822 by: Mauricio Pellegrini
        234824 by: Martin Alterisio
        234829 by: Robert Cummings
        234832 by: Mauricio Pellegrini

bookmarking with a trademark sign in title
        234806 by: Angelo Zanetti
        234810 by: Jay Blanchard
        234812 by: chris smith
        234819 by: Satyam

Re: Using linkDisplayFields of FormBuilder
        234823 by: Joe Henry

Debuggin PHP
        234825 by: hicham
        234826 by: John Nichel
        234827 by: Jochem Maas
        234828 by: Martin Alterisio
        234830 by: Robert Cummings
        234833 by: Jochem Maas

Re: How to execute multiples querys,IT is SOLVED!!
        234831 by: Mauricio Pellegrini

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:


Hi.
is there any php or java script function, where i can embed into my php or
html file, to set focus on to the first form field, like a text box, to go
to that field first, and not to go to the link or button first.
if there are any tips, tricks, or links or code examples, how to fix this
problem.
let me know.
cheers Marvin.

attached mail follows:


PHP can't do that for you but Javascript can. Here's roughly 3 million (no
joke) examples of what you'd like to accomplish:
http://www.google.com/search?q=javascript+focus+first+input

On 4/26/06, marvin hunkin <marvkinhotmail.com> wrote:
>
> Hi.
> is there any php or java script function, where i can embed into my php or
> html file, to set focus on to the first form field, like a text box, to go
> to that field first, and not to go to the link or button first.
> if there are any tips, tricks, or links or code examples, how to fix this
> problem.
> let me know.
> cheers Marvin.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


marvin hunkin schrieb:
> Hi.
> is there any php or java script function, where i can embed into my php
> or html file, to set focus on to the first form field, like a text box,
> to go to that field first, and not to go to the link or button first.
> if there are any tips, tricks, or links or code examples, how to fix
> this problem.
> let me know.
> cheers Marvin.

Hi.

It is not possible to do that using PHP but you can use JavaScript
instead. I recommend the function focus(). For example:
<BODY OnLoad="document.nameform.user.focus();">

Check this tiny tutorial:
http://javascript.internet.com/page-details/focus-onload.html

Did you already remarked that http://www.google.com is using this
function to automatically set the focus on the search field.

regards

Philipp

attached mail follows:


Or if you have header.inc.php and the body tag is global then in your
form.inc.php(for example) or in your template, you can do this:

<script>
Window.onLoad=function(){
        document.nameform.inputField.focus();
}
</script>

Regards!

-----Mensaje original-----
De: Philipp Kopf [mailto:philipp.kopfgmail.com]
Enviado el: Miércoles, 26 de Abril de 2006 01:42 a.m.
Para: php-generallists.php.net
Asunto: [PHP] Re: Php function to Set focus On A form Field

marvin hunkin schrieb:
> Hi.
> is there any php or java script function, where i can embed into my
> php
> or html file, to set focus on to the first form field, like a text box,
> to go to that field first, and not to go to the link or button first.
> if there are any tips, tricks, or links or code examples, how to fix
> this problem.
> let me know.
> cheers Marvin.

Hi.

It is not possible to do that using PHP but you can use JavaScript
instead. I recommend the function focus(). For example:
<BODY OnLoad="document.nameform.user.focus();">

Check this tiny tutorial:
http://javascript.internet.com/page-details/focus-onload.html

Did you already remarked that http://www.google.com is using this
function to automatically set the focus on the search field.

regards

Philipp

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

attached mail follows:


On Tue, April 25, 2006 9:43 pm, Crone, James wrote:
> I need to add LDAP support to my install of PHP. I had my sysadmin
> download OpenLDAP and install the libraries. Our current build of PHP
> is complex and I'd prefer not to have to rebuild just to add LDAP.
> I've
> been told to use the dl() function to load the LDAP library when
> needed
> in PHP. Whenever I dl("libldap.so") PHP returns the following error:
>
> PHP Warning: dl(): Invalid library (maybe not a PHP library)
> 'libldap.so' in .....
>
> What am I doing wrong? Thanks in advance.

libldap.so is the LDAP library -- like, the WHOLE LDAP library, to
which PHP has an interface, if you re-compile PHP.

So you need to compile (or they need to compile) the PHP LDAP
interface down in the ext directory of PHP (or maybe it's in PECL
now).

This will result in a file with a name something like:
ldap_php.so

And *that* file is the one you would use dl() on.

What you did is kind of like buying an airplane when you need to fly
to another city...

You needed just the ldap_php.so, and you tried to load in libldap.so,
which is a system library.

Pretty much all of PHP's extensions work like this.

   PHP PHP Extensions System Software Libraries
PHP Core ----+
             +---- mysql_php.so --------> libmysql.so
             +---- gd_php.so -----------> libgd.so
             +---- libpdf_php.so -------> libpdf.so
.
.
.

That's the basic idea, anyway, even though I'm sure that at least one
of the above is actually incorrect, and the names of the libraries and
.so files vary a bit, here and there.

You only want to dl() the PHP Extension that "bridges" or provides the
"glue" to the System Software Library -- You don't want to dl() the
whole System Software Library.

Replace .so with .dll under Windows, and the same paradigm holds.

HTH

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Crone, James wrote:
> I need to add LDAP support to my install of PHP. I had my sysadmin
> download OpenLDAP and install the libraries.
This isn't correct way. You need these libraries but they are not enough.
> [snip] I've
> been told to use the dl() function
Read carefully. http://php.net/dl says
dl -- Loads a PHP extension at runtime

Note *PHP extension*. You cannot use LDAP libraries directly.
> PHP Warning: dl(): Invalid library (maybe not a PHP library)
> 'libldap.so' in .....
>
> What am I doing wrong? Thanks in advance.
>
You are loading ldap library directly which provide C interface to ldap
functions. You need PHP interface (which is what provided by PHP
extension). It need to be compiled in PHP.

Read more about extensions:
http://www.zend.com/php/internals/extension-writing1.php#Heading2

--
Sameer N. Ingole
Blog: http://weblogic.noroot.org/
---
Better to light one candle than to curse the darkness.

attached mail follows:


On Tue, April 25, 2006 7:13 pm, John Meyer wrote:
> Richard Collyer wrote:
>> John Meyer wrote:
>>> Hey, is it possible to use the Amazon WSDL within PHP?
>>>
>>
>> Lookie what the first google entry for "Amazon WSDL php" was:
>>
>> http://www.onlamp.com/pub/a/php/2003/07/03/php_amazon_soap.html
>>
>> Richard
>
>
> Nice, now I need to navigate the bloody Amazon web services. Is it
> just
> me, or does it look like, just by browsing Amazon itself, you have to
> use Alexis to do web queries. Specifically, I'm trying to find out
> how
> to query using an ISDN.

I have not read the article in that link.

I have NO IDEA what Alexis is, other than some damn toolbar thingie
that my boss installed, and f'ed up his browser with...

But I'm betting a dollar that you do not need Alexis AT ALL, and that
it's only ONE choice of a zillion.

Maybe the Amazon Developer Forums, specifically set up to address
questions like yours, would be most appropriate:

http://developer.amazonwebservices.com/connect/index.jspa

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


On Tue, April 25, 2006 9:23 pm, D. Dante Lorenso wrote:
> Richard Lynch wrote:
>> On Tue, April 25, 2006 5:28 pm, D. Dante Lorenso wrote:
>>
>>> Everything PHP returns from a server is "client side", so your
>>>
>> Oh yeah. I forgot to say...
>> The above presumption is patently false.
>>
>
> Let me clarify: Assuming client/server architecture, if PHP is on the
> server side then something else needs to be on the client side to
> interpret the output of the PHP server. That output is what PHP
> returns
> and it is interpreted and rendered on the client side by definition.
>
> Alternatively: If it is not meant for the client to receive, it is
> not
> (should not) be output by PHP.

Guess I'd better throw away all my command-line scripts and cron jobs,
and all my PHP GTK half-finished projects, and...

Plus, all the times I've got a web page that initiates some
asynchronous process and outputs only a tiny fraction of its output to
the browser, while generating a GREAT DEAL of output elsewhere.

:-)

Maybe we're just posting at cross-purposes here, but PHP does a hell
of a lot more than spit out HTML web pages...

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


On Tue, April 25, 2006 9:55 pm, D. Dante Lorenso wrote:
> Richard Lynch wrote:
> that
> the replies I've gotten from this list so far suggest that internals
> of
> PHP development are seriously opposed to such a feature?

They may or may not be opposed to attempting to use server-side
technology to provide client-side statistical data, for a file that
the CLIENT is uploading.

Which is why I suggested that the request for server-side statistical
tracking of uploads in progress for the server-side statistical
analysis would be a Good Thing to propose.

> I am more
> interested in which project extensions are leading in momentum to
> solve
> the problem I am trying to solve and not blaming other projects
> (browsers) for not building the feature first.

The momentum, as far as I know, of all the project extensions to do
what you describe is zero (0).

> The back-and-forth you refer to is termed 'polling'. With a protocol
> like HTTP, polling is really the only option unless I implement a
> socket
> server which is capable of sending events.

Gah!

I know what it's called.

Let's try AGAIN.

You want to use POLLING from server to client to measure how much data
the client has sent.

Does not the CLIENT already *KNOW* how much data it sent?

Why in the world would you generate all that traffic to compute data
already in existence on the client in the first place?

That is the fundamental problem to which objections are raised on this
issue.

It's just plain daft to poll the server to find out how much data you
sent it, when you're the one sending the data.

> Right. Under the callback method example, I would have access to
> $_SESSION which would already contain enough information about the
> logged in account for my purposes. This is trivial.

If it's trivial, code up the patch and send it.

>> For tying the filenames back to the users who are logged in, you'd
>> have to have an onClick() on the submit button which would send some
>> kind of information (filename, filesize, user) to a PHP script that
>> would log the upload about to begin in a database. The onClick
>> would
>> then return false so that the normal form submission process would
>> kick in.
>>
>
> This will not work. And this is exactly WHY an extention/patch is
> needed. Between the time PHP choses a /tmp file name and the time the
> upload is completed, there is not execution of PHP code. Therefor, we
> don't know the /tmp name assigned to an upload until AFTER the upload
> is
> completed and then it's too late.

Oh but there *IS* execution of all kinds of PHP code between that time
-- Just not in the script that is receiving the file.

Since you're building a statistical monitoring of the process, I'm
suggesting that you have ANOTHER PHP script running to examine the
state of /tmp and monitor the progress from "outside" the script
actually receiving the file.

It won't be pretty, but it can be done with what's available in PHP
today, without patches.

>> You're not going to get ... accuracy ...
>> It won't be so hot for tracking who's uploading what in real-time,
>
> It should be. Using the patch, I already have this working. I now
> want
> a cleaner, supported solution which doesn't involve a custom patch
> which
> will not be supported in the future. Although the patch I am using
> works, it was build for PHP 5.0.3 RC1 and since I am using 5.1.2 you
> can
> understand my concerns that it will fail to continue working when the
> switch is made to PHP 5.2 or PHP 6.0.

If you submit a similar patch, and specifically label it as
server-side statistical analysis feature for uploaded files in
progress, I SUSPECT it has a much better chance of "going" than a
server-side hack to solve a client-side problem.

>> Another option is to provide patch to PHP which gives a special
>> INPUT
>> parameter to a FORM that can be used to provide a callback file to
>> load, and a callback function within that file to call, and then
>> modify the file upload routine to load and call that function.
>
> Passing this from the client form is insecure and can not be trusted.
> Declaring callback functions needs to remain a server-side declaration
> either through code or an INI setting, etc.

You're right. That would be a gaping security hole.

>> It seems genuinely useful enough to this naive reader, and should
>> not
>> cause an undue burden for those who don't use it. Check with
>> PHP-Dev
>> to see if such a patch is likely to be accepted before putting in
>> TOO
>> much time on it.
>>
>
> My original email was searching for advice on which project has
> momentum
> and what the current state of any discussions about the issue were.
> Does anybody have information on the PEAR package which appears to be
> vapor?
>
> http://pecl.php.net/package/postparser
>
> I see the name Curt Zirzow, but no contact information for that
> "author".

He posted a few zillion messages here in PHP-General...

His email has to be in the Marc archives.

> Is there not a package which has been adopted by the community or does
> every developer share Richard's opinion that this feature doesn't
> belong
> in PHP?

AFAIK, no package has achieved any kind of wide-spread acceptance, or
even anything more than a niche acceptance.

Once again, since you've missed it in previous posts:
I happen to think that having SERVER-SIDE introspection for
in-progress file uploads would be a Good Thing.

I just think it's daft to use it with polling for CLIENT-SIDE progress
meters, since the CLIENT already HAS that data, and should expose it
via an API for something JavaScript or other client-side processing.

The nice thing is, once you have the hooks you want for server-side,
it's a pretty trivial exercise to do the polling and client-side you
want.

And if you think I somehow represent the PHP Dev Team and their
thinking, then you're REALLY off-target... :-)

It is only MY opinion that your proposal will have a much greater
chance of success if you drop all references to client-side uses of
the feature, and lobby for it solely on the merits of server-side
feature-set.

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


On 4/26/06, P. Guethlein <petergdeltronix.com> wrote:
>
> Initial index.php file:
>
> <?php
> if(isset($_GET['d'])){setcookie('disp',$_GET['d'],time()+(60*60*24*60));$_COOKIE['disp']=$_GET['d'];}
> include_once('writemenus.php');
>
> if(!isset($_GET['href'])) $include = 'startpage.htm';
> else {
> $include = $_GET['href']; $include = "$include.php";
> if($include=='index.php')$include = 'startpage.htm';
> }
> include_once($include);
> include_once('footer.htm');
> ?>
>
> =============================
> Hackers seem to be able to call a remote script by appending the URL
> to the href= command line . ( $include )

..because you're not checking it, you're just including it.

If you turn off allow_url_fopen then this will stop it, but it's best
to fix it properly.

You could do something like this:

$mydir = dirname(__FILE__);

$include = $_GET['href'].'.php';

if (realpath($mydir.'/'.$include) != $mydir.'/'.$include) {
  $include = 'startpage.htm';
} else {
  $include = $mydir .'/'.$include;
}

You use realpath to get rid of '../' and './' type references (see
http://www.php.net/realpath), then make sure that's the same file as
in the current directory.

If they don't match, it includes startpage.htm.

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On Wed, April 26, 2006 12:53 am, P. Guethlein wrote:
> <?php
> if(isset($_GET['d'])){setcookie('disp',$_GET['d'],time()+(60*60*24*60));$_COOKIE['disp']=$_GET['d'];}

I suppose this isn't so terribly awful, since experienced users can
forge their Cookies as easily as GET, but as a matter of principle,
you SHOULD insure that $_GET['d'] has the data you expect.

> include_once('writemenus.php');
>
> if(!isset($_GET['href'])) $include = 'startpage.htm';

This is fine.

> else {
> $include = $_GET['href']; $include = "$include.php";

This is SOOOOOOOOOOOOOOOOOOOOO not fine!!!

You are allowing the Bad Guys to include *ANY* file they want here!

Never ever ever ever use a variable in include() that the user gets to
pick whatever they want.

You need to decide, in advance, which files the user CAN include, like
your 'startpage.htm' and only allow $include to take on those values
you hvae pre-determined to be valid.

Here's one easy way to do this:
switch($_GET['href']){
  case 'startpage':
  case 'index':
  case 'about':
  case 'contact':
    $include = $_GET['href'] . '.php';
  break;
  default:
    error_log("HACK ATTEMPT $REMOTE_ADDR " . date('m/d/Y h:i:s a);
    die("No.");
  break;
}

> if($include=='index.php')$include = 'startpage.htm';
> }
> include_once($include);
> include_once('footer.htm');
> ?>
>
> =============================
> Hackers seem to be able to call a remote script by appending the URL
> to the href= command line . ( $include )
>
> What buttons do I need to push to stop this? Does PHP have a setting
> to allow only local calls? or do I have to do it in the index.php file
> ? or ??

Required Reading:
http://phpsec.org/

All of it.

The whole damn site.

Now.

Sorry.

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Hello,

Can someone please help me to put the results of a query to an array. Never
done this before:

$sql = "SELECT sortteri,jouk_id,jouk_nimi FROM x_table ORDER BY sortteri
ASC";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
$cur = 1;

//create empty array that contains an array before loop
$arr = array("Team" => array());

while ($num >= $cur) {
$row = mysql_fetch_array($result);
$id = $row["jouk_id"];
$srt = $row["sortteri"];
$nimi = $row["jouk_nimi"];

//append values to the array
$arr = array("Team$cur" => array(0 => $id, 1 => $srt, 2 => $nimi));

$cur++;
}

Thanks
-Will

attached mail follows:


William Stokes wrote:
> Hello,
>
> Can someone please help me to put the results of a query to an array. Never
> done this before:
>
> $sql = "SELECT sortteri,jouk_id,jouk_nimi FROM x_table ORDER BY sortteri
> ASC";
> $result = mysql_query($sql);
> $num = mysql_num_rows($result);
> $cur = 1;
>
> //create empty array that contains an array before loop
> $arr = array("Team" => array());
>
> while ($num >= $cur) {
> $row = mysql_fetch_array($result);
> $id = $row["jouk_id"];
> $srt = $row["sortteri"];
> $nimi = $row["jouk_nimi"];
>
> //append values to the array
> $arr = array("Team$cur" => array(0 => $id, 1 => $srt, 2 => $nimi));
>
> $cur++;
> }
>
> Thanks
> -Will
>
>
You might try this as an alternative:

$cur = 0;
while (list($id, $srt, $nimi) = $mysql_fetch_array($result)) {
        $arr = array("Team{$cur}" => array(0 => $id,
                                        1 => $srt,
                                        2 => $nimi));
        $cur++;
}

Jim

attached mail follows:


On Wed, April 26, 2006 1:39 am, William Stokes wrote:
> Can someone please help me to put the results of a query to an array.

There are only a few thousand tutorials on this on the 'net...

> Never
> done this before:
>
> $sql = "SELECT sortteri,jouk_id,jouk_nimi FROM x_table ORDER BY
> sortteri
> ASC";
> $result = mysql_query($sql);
> $num = mysql_num_rows($result);
> $cur = 1;
>
> //create empty array that contains an array before loop
> $arr = array("Team" => array());
>
> while ($num >= $cur) {

If you do not start indenting your code correctly now, you will most
likely never enjoy much success in your programming efforts.

> $row = mysql_fetch_array($result);
> $id = $row["jouk_id"];
> $srt = $row["sortteri"];
> $nimi = $row["jouk_nimi"];
>
> //append values to the array
> $arr = array("Team$cur" => array(0 => $id, 1 => $srt, 2 => $nimi));

While there is nothing technically "wrong" with this, it's going to
make life harder for you to deal with the "Team$cur" index.

Much easier to do:
$arr[] = $row;

to append to the array.
>
> $cur++;
> }

Or did I miss the part where you described what you saw and what you
expected to see?

Because what you posted is "fine" as far as it goes, as far as I can
tell.

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Will,

Seems to me like you've just done it! Here's another way of doing it that
will utilize mysql_fetch_assoc() to allow your query to dictate the elements
of the array. Keep in mind, I haven't tested this, but since I'm not
entirely sure what you are asking the list, I'll offer it anyway ;-)

<?php
/*...do connection stuff here...*/
$sql = "SELECT sortteri,jouk_id,jouk_nimi FROM x_table ORDER BY sortteri
ASC";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
$Team = null; //We'll fill this up later - gotta love PHP ;-)

// loop over each row in the result set
for($i=0; $i<$num; $i++){
    $tmp = mysql_fetch_assoc($result);

    // loop over each column in the current row
    while(list($key, $val) = each($tmp))
       $Team[$key][$i] = $val;
}
// display the contents of the $Team array
print_r($Team);
?>

On 4/26/06, William Stokes <kallesoperamail.com> wrote:
>
> Hello,
>
> Can someone please help me to put the results of a query to an array.
> Never
> done this before:
>
> $sql = "SELECT sortteri,jouk_id,jouk_nimi FROM x_table ORDER BY sortteri
> ASC";
> $result = mysql_query($sql);
> $num = mysql_num_rows($result);
> $cur = 1;
>
> //create empty array that contains an array before loop
> $arr = array("Team" => array());
>
> while ($num >= $cur) {
> $row = mysql_fetch_array($result);
> $id = $row["jouk_id"];
> $srt = $row["sortteri"];
> $nimi = $row["jouk_nimi"];
>
> //append values to the array
> $arr = array("Team$cur" => array(0 => $id, 1 => $srt, 2 => $nimi));
>
> $cur++;
> }
>
> Thanks
> -Will
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Ooopps.

I just did have array too many. This did the append corretly:

$arr["Team$cur"] = array(id => $id, sort => $srt, jnimi => $nimi);

-Will

""Joe Wollard"" <joe.wollardgmail.com> kirjoitti
viestissä:4b95b27e0604252357y224eb6e4xf351bbdb4593bdb3mail.gmail.com...
Will,

Seems to me like you've just done it! Here's another way of doing it that
will utilize mysql_fetch_assoc() to allow your query to dictate the elements
of the array. Keep in mind, I haven't tested this, but since I'm not
entirely sure what you are asking the list, I'll offer it anyway ;-)

<?php
/*...do connection stuff here...*/
$sql = "SELECT sortteri,jouk_id,jouk_nimi FROM x_table ORDER BY sortteri
ASC";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
$Team = null; //We'll fill this up later - gotta love PHP ;-)

// loop over each row in the result set
for($i
    $tmp = mysql_fetch_assoc($result);

    // loop over each column in the current row
    while(list($key, $val) = each($tmp))
       $Team[$key][$i] = $val;
}
// display the contents of the $Team array
print_r($Team);
?>

On 4/26/06, William Stokes <kallesoperamail.com> wrote:
>
> Hello,
>
> Can someone please help me to put the results of a query to an array.
> Never
> done this before:
>
> $sql = "SELECT sortteri,jouk_id,jouk_nimi FROM x_table ORDER BY sortteri
> ASC";
> $result = mysql_query($sql);
> $num = mysql_num_rows($result);
> $cur = 1;
>
> //create empty array that contains an array before loop
> $arr = array("Team" => array());
>
> while ($num >= $cur) {
> $row = mysql_fetch_array($result);
> $id = $row["jouk_id"];
> $srt = $row["sortteri"];
> $nimi = $row["jouk_nimi"];
>
> //append values to the array
> $arr = array("Team$cur" => array(0 => $id, 1 => $srt, 2 => $nimi));
>
> $cur++;
> }
>
> Thanks
> -Will
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


it was just a question "?"

"Stut" <stuttlegmail.com> kirjoitti viestissä:444E61B0.8050500gmail.com...
> William Stokes wrote:
>> Mulkku?
>
> 'Cause insulting us is the way to convince this list to answer your
> irrelevant questions? Seriously tho, if I may, go join an HTML/Javascript
> list for these questions and try to stick with PHP on this one.
>
> -Stut

attached mail follows:


On 4/25/06, William Stokes <kallesoperamail.com> wrote:
> Hello,
>
> This "might be" more HTML stuff but anyway...
>
> I have several forms in a page which is ok otherwise but the reset buttons
> doesn't clear anything that is queried from DB and printed to the text
> fields. Any idea how to create Reset buttons that clear the fields even when
> the data is not from user input? Or do I have to create reset buttons that
> are actually submit buttons and play with variables after that or something
> like that? Javascript is the way I don't want to go...

The reset button restores the form back to it's original state - if
you preload values or preselect options when you display the form,
then that's what it will reset it back to.

<form>
Blah: <input type="text" name="blah" value="12345">
<input type="reset" value="Reset">
</form>

Change 'blah', hit 'reset' and it will change it back to 12345.

If you want to completely reset the form, then you'll have to either
use javascript or refresh the page with a flag and check..

<?php
if (isset($_GET['clearform'])) {
  $blah = '';
} else {
  $blah = '12345';
}
?>

<form>
Blah: <input type="text" name="blah" value="<?php echo $blah; ?>">
<input type="reset" value="Reset">
</form>

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On Tue, April 25, 2006 6:19 pm, Patrick Aljord wrote:
> I have a form like this:
> <form action="search.php" method="post" target="_self">
> <input type="text" name="search_text" cols="20" rows="10"></input>
> <input type="submit" name="submit_search" value="search" />
> </form>
>
> while this is working fine, I would like the url of search.php to be
> something like search.php?q="value+of+search_text"
> eg, if I enter "php rules" in my text box, the url should be
> http://myfakepage.com/search.php?q="php+rules"
> any idea how to do that?

The EASIEST way is to change "post" to "get" and to rename
"search_text" to "q"

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


attached mail follows:


Hi there !!
 
I have web app which using frames. After session timeout my session is
killed.
The problem is that session is killed even when I doing requests to the
server.
I know why (session is "chain" to the frameset page) but what's the
solution for this?
I have to use frames !! Don't ask why !! :-)
 
THX
 

Dan

 

attached mail follows:


On 4/26/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
> Hi there !!
>
> I have web app which using frames. After session timeout my session is
> killed.
> The problem is that session is killed even when I doing requests to the
> server.
> I know why (session is "chain" to the frameset page) but what's the
> solution for this?

Do you have session_start at the top of every page?

Does it happen on certain pages? Does it happen when you perform a
particular action? We need a lot more info about what's going on.

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On 4/26/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
>
> -----Original Message-----
> From: chris smith [mailto:dmagickgmail.com]
> Sent: Wednesday, April 26, 2006 2:18 PM
> To: Sichta, Daniel
> Cc: php-generallists.php.net
> Subject: Re: [PHP] session
>
> On 4/26/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
> > Hi there !!
> >
> > I have web app which using frames. After session timeout my session is
> > killed.
> > The problem is that session is killed even when I doing requests to
> the
> > server.
> > I know why (session is "chain" to the frameset page) but what's the
> > solution for this?
>
> Do you have session_start at the top of every page?
> A:Yes I do !
>
> Does it happen on certain pages?
> A:On every page !!
>
> Does it happen when you perform a particular action?
> A:No !! On any action
>
> We need a lot more info about what's going on.
> A: I have declared framesets in index.php and after that I'm sending
> request from frameset source pages.
> This is (IMHO)

Where's the rest of the sentence?

Always CC the list. You will get more people looking at your
questions/answers and you will most likely get a quicker response.

Can you explicitly pass the sessionid across:

  <FRAMESET rows="100, 200">
      <FRAME src="blah1.php?session_id=<?php echo SID; ?>">
      <FRAME src="blah2.php?session_id=<?php echo SID; ?>">
  </FRAMESET>

?

Sounds like you're missing something really basic if you're having
issues with every page. Post some code in pastebin.com and send us the
url so we can see what you're doing..

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


Here is application flow
Index.php = login page, I need to start session here. From here
(successful login) I'm going to admin.php which is
Frameset page with source pages.

DS

-----Original Message-----
From: chris smith [mailto:dmagickgmail.com]
Sent: Wednesday, April 26, 2006 4:02 PM
To: Sichta, Daniel
Cc: php-generallists.php.net
Subject: Re: [PHP] session

On 4/26/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
>
> -----Original Message-----
> From: chris smith [mailto:dmagickgmail.com]
> Sent: Wednesday, April 26, 2006 2:18 PM
> To: Sichta, Daniel
> Cc: php-generallists.php.net
> Subject: Re: [PHP] session
>
> On 4/26/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
> > Hi there !!
> >
> > I have web app which using frames. After session timeout my session
is
> > killed.
> > The problem is that session is killed even when I doing requests to
> the
> > server.
> > I know why (session is "chain" to the frameset page) but what's the
> > solution for this?
>
> Do you have session_start at the top of every page?
> A:Yes I do !
>
> Does it happen on certain pages?
> A:On every page !!
>
> Does it happen when you perform a particular action?
> A:No !! On any action
>
> We need a lot more info about what's going on.
> A: I have declared framesets in index.php and after that I'm sending
> request from frameset source pages.
> This is (IMHO)

Where's the rest of the sentence?

Always CC the list. You will get more people looking at your
questions/answers and you will most likely get a quicker response.

Can you explicitly pass the sessionid across:

  <FRAMESET rows="100, 200">
      <FRAME src="blah1.php?session_id=<?php echo SID; ?>">
      <FRAME src="blah2.php?session_id=<?php echo SID; ?>">
  </FRAMESET>

?

Sounds like you're missing something really basic if you're having
issues with every page. Post some code in pastebin.com and send us the
url so we can see what you're doing..

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On 4/27/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
> Here is application flow
> Index.php = login page, I need to start session here. From here
> (successful login) I'm going to admin.php which is
> Frameset page with source pages.

That's nice.. but doesn't help us. We need to see code.

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


Login.php
<?
// starting session here
require_once("include/init.inc");
?>
<table height="100%" width="100%" align="center" cellpadding="2"
cellspacing="0">
<tr>
<td align="right">User</td>
<td><input type="text" name="loginUser"></td>
</tr>
<tr>
<td align="right">Passwrod</td>
<td><input type="password" name="loginPassword"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit"
value="<?=$login["login_submit"];?>"></td>
</tr>
</table>
Login.php
<?
// starting session here
require_once("include/init.inc");
Here is code for checking user and password
And if is ok do this
        ?>
        <script type="text/javascript" language="javascript">
                window.location.href = "admin.php";
        </script>
        <?
}
Admin.php
<?
require_once("include/init.inc");
require_once("include/check.inc");
?>
<html>
        
        <frameset framespacing="0" border="false" frameborder="0"
cols="180,*">
                <frame name="tree" src="menu.php" frameborder="0"
marginwidth="0" marginheight="0" framespacing="0" scrolling="no"
noresize>
                <frame name="master" src="blank.html" frameborder="0"
marginwidth="0" marginheight="0" framespacing="0" scrolling="auto"
noresize>
        </frameset>
        <noframes>
                  <body bgcolor="#FFFFFF">
                  <br><br><center>
                  <h1>No Frames!</h1>
                  <h4>No frames in your browser!</h4>
                  </center></body>
        </noframes>

</html>
And for example in menu.php I'm using
require_once("include/init.inc");

DS
-----Original Message-----
From: chris smith [mailto:dmagickgmail.com]
Sent: Wednesday, April 26, 2006 4:10 PM
To: Sichta, Daniel
Cc: php-generallists.php.net
Subject: Re: [PHP] session

On 4/27/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
> Here is application flow
> Index.php = login page, I need to start session here. From here
> (successful login) I'm going to admin.php which is
> Frameset page with source pages.

That's nice.. but doesn't help us. We need to see code.

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On 4/27/06, Sichta, Daniel <Daniel.Sichtasiemens.com> wrote:
> Login.php
> <?
> // starting session here
> require_once("include/init.inc");

and what's in that file - only the session related stuff.....

If you pass the sessionid across does it work:

....
<frame name="tree" src="menu.php?session_id=<?php echo SID; ?>"
....

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


 Hello All,

I had a problem with a Win2003 server, IIS6 and PHP 5.1.2. The MS SQL
extension was not working. I did not get an answer, but some people
suggested me to use Apache. Now I installed Win 2000 server, Apache
2.0.55 and PHP 5.1.2. The same computer has Microsoft SQL Server
installed. I have only these lines in my php.ini file:

extension_dir="C:\PHP\ext"
extension=php_mssql.dll

I checked phpinfo() and it tells that my php.ini file is at the correct
location (C:\winnt\php.ini.) I can load other extensions. Another
example: if I add "php_curl.dll" then I get a "libsleay32.dll not found"
error message when I try to restart apache. But I do not get any error
message about the php_mssql.dll. It is just not loaded. I'm sure that
all the ms sql client libs are installed, because this is the same
machine where the ms sql server is running. What can be the problem?
Please help me. My bosses are killing me because I could not solve this
problem for weeks. :-(

Thanks,

  Laszlo

attached mail follows:


This setup nagged me for a bit too, until I found the solution...

The DLL files in C:\php need to be put into system32 directory. Once
that happens they work like a charm, but until then, you are plagued
with issues. I have my path set for C:\php and everything as well, but
it was not until copying the DLLs into the C:\Windows\System32 that
everything started working. Thankfully Google held the answer.

Wolf

> I checked phpinfo() and it tells that my php.ini file is at the correct
> location (C:\winnt\php.ini.) I can load other extensions. Another
> example: if I add "php_curl.dll" then I get a "libsleay32.dll not found"
> error message when I try to restart apache. But I do not get any error
> message about the php_mssql.dll. It is just not loaded. I'm sure that
> all the ms sql client libs are installed, because this is the same
> machine where the ms sql server is running. What can be the problem?

attached mail follows:


Try changing your direcive extension_dir:
extension_dir="C:/PHP/ext" instead of extension_dir="C:\PHP\ext"

-----Mensaje original-----
De: Laszlo Nagy [mailto:gandalfdesignaproduct.biz]
Enviado el: Miércoles, 26 de Abril de 2006 04:01 a.m.
Para: php-generallists.php.net
Asunto: [PHP] PHP 5 + Apache 2 on Windows: ms sql extension problem

 Hello All,

I had a problem with a Win2003 server, IIS6 and PHP 5.1.2. The MS SQL
extension was not working. I did not get an answer, but some people
suggested me to use Apache. Now I installed Win 2000 server, Apache
2.0.55 and PHP 5.1.2. The same computer has Microsoft SQL Server
installed. I have only these lines in my php.ini file:

extension_dir="C:\PHP\ext"
extension=php_mssql.dll

I checked phpinfo() and it tells that my php.ini file is at the correct
location (C:\winnt\php.ini.) I can load other extensions. Another
example: if I add "php_curl.dll" then I get a "libsleay32.dll not found"
error message when I try to restart apache. But I do not get any error
message about the php_mssql.dll. It is just not loaded. I'm sure that
all the ms sql client libs are installed, because this is the same
machine where the ms sql server is running. What can be the problem?
Please help me. My bosses are killing me because I could not solve this
problem for weeks. :-(

Thanks,

  Laszlo

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

attached mail follows:


Hi all,
 First time on the list... sorry for any errs.
 I am using mod_proxy to pass requests to an internal server in our
lan. The setup looks like

Enduser---INet_link-----Mod_proxy_server----Lan---PHP_script

Now,

this does not work:

Enduser---https--->Apache_mod_proxy-----http--->Destination_server.

* When a user submits a form (php) with a file upload and $_POST
vars, the $_POST array is mangled (missing) elements and the $_FILES
array is empty

while this works:

 Enduser---http--->Apache_mod_proxy-----http--->Destination_server.

* When a user submits a form with a file upload and $_POST vars,
Everything is all good
lmwangi

So something bad? happens when you use https in the request. Anyone
able to reproduce this. Is it a php bug (i doubt it) but you never
know until u waddle through the mod_proxy voodoo.
Here is a sample script

<snip>

<?php
        if(isset($_POST['btnSubmit'])){
                print_r($_POST);
                print_r($_FILES);
        }
        else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Post Test</title>
 </head>

<body>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"
name="frm_add_content" id="frm_add_content"
enctype="multipart/form-data">
<div>
<input name="id" type="hidden" value="0" />
<input name="MAX_FILE_SIZE" type="hidden" value="2097152" />
<table border="0">

        <tr>
                <td style="white-space: nowrap; background-color:
#CCCCCC;" align="left" valign="top" colspan="2"><b>Add Media</b></td>
        </tr>
        <tr>
                <td align="right" valign="top"><span style="color:
#ff0000">*</span><b>Media id</b></td>
                <td valign="top" align="left"><input class="inputbox"
name="mediaid" type="text" /></td>
        </tr>

        <tr>
                <td align="right" valign="top"><b>Media File</b></td>
                <td valign="top" align="left"><input class="inputbox"
name="mms_media" type="file" /></td>
        </tr>
        <tr>
                <td align="right" valign="top"><span style="color:
#ff0000">*</span><b>Subject</b></td>
                <td valign="top" align="left"><input class="inputbox"
name="subject" type="text" /></td>

        </tr>
        <tr>
                <td align="right" valign="top"><b>Message Body</b></td>
                <td valign="top" align="left"><textarea
class="inputbox" name="msg_body"></textarea></td>
        </tr>
        <tr>
        <tr>

                <td align="right" valign="top"><b></b></td>
                <td valign="top" align="left"><input class="button"
name="btnClear" value="Clear" type="reset" />&nbsp;<input
class="button" name="btnSubmit" value="Submit" type="submit" /></td>
        </tr>
        <tr>
                <td></td>
        <td align="left" valign="top"><span style="font-size:80%;
color:#ff0000;">*</span><span style="font-size:80%;"> denotes required
field</span></td>
        </tr>

</table>
</div>
</form>
</body>
</html>
<?php
}
?>
</snip>

attached mail follows:


Hi All,

I've got a forum/blog system which is displaying correctly in the browser.
However, I've also got an RSS feed that is created from the data entered.

It seems that some of the users are copying and pasting from MS Word or
other packages, and this means that strange quote marks (among others) are
appearing, and breaking the RSS feed.

Obviously I need to convert these on entry, or on output into RSS. Does
anyone know of an easy way to do this, or is it a case of identifying each
unusual character individually?

I've been searching on Google for some advice on this, but not found
anything so far...

Thanks in advance,

Kev

attached mail follows:


On 4/26/06, Kevin Davies <kevin.daviesbonhurst.com> wrote:
> Hi All,
>
> I've got a forum/blog system which is displaying correctly in the browser.
> However, I've also got an RSS feed that is created from the data entered.
>
> It seems that some of the users are copying and pasting from MS Word or
> other packages, and this means that strange quote marks (among others) are
> appearing, and breaking the RSS feed.
>
> Obviously I need to convert these on entry, or on output into RSS. Does
> anyone know of an easy way to do this, or is it a case of identifying each
> unusual character individually?

I don't think there's anything to do this for you.

If it's only quotes you could do it quite simply.

str_replace lets you use arrays for both search and/or replace parameters, so:

$bad_chars = array(...);
$good_chars = "'";

$text = str_replace($bad_chars, $good_chars, $text);

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


Low Tech Solution: Make them paste into Notepad, then Copy from there
and paste into the blog system. If it is internal then it is part of
the process.

If external, check PHPClasses and see if they have one yet.

Wolf

Kevin Davies wrote:
> Hi All,
>
> I've got a forum/blog system which is displaying correctly in the browser.
> However, I've also got an RSS feed that is created from the data entered.
>
> It seems that some of the users are copying and pasting from MS Word or
> other packages, and this means that strange quote marks (among others) are
> appearing, and breaking the RSS feed.
>
> Obviously I need to convert these on entry, or on output into RSS. Does
> anyone know of an easy way to do this, or is it a case of identifying each
> unusual character individually?
>
> I've been searching on Google for some advice on this, but not found
> anything so far...
>
> Thanks in advance,
>
> Kev
>

attached mail follows:


On Apr 26, 2006, at 5:45 AM, Kevin Davies wrote:

> Obviously I need to convert these on entry, or on output into RSS.
> Does
> anyone know of an easy way to do this, or is it a case of
> identifying each
> unusual character individually?

These high-ascii characters have ord() values greater than 126. If
you're rendering to HTML, you can go through your string converting
them into '&#ord_value;', where `ord_value' is the return from ord()
(so your result looks like "&#210;"), which will fix the primary
problem (things breaking) and should at least limit the damage on the
secondary problem (loss of information). In my experience, however,
this will clobber some entities pretty badly. Alternatively, you can
just zap them (into "*" or "~" or some other printable character),
which will work better for text rendering.

You can also mix the two, by identifying individually those
characters that you are concerned with preserving and zapping the
others, e.g.

<?php

/**
* Validate a string as being gremlin-free text. Characters with
ordinal value
* greater than 126 will be converted into the best equivalent.
*
* param any Something which might be a string.
*
* returns array|bool True (valid), false (not valid), or an array of
* unconverted exception ordinal values (valid but dirty).
*/
function validate_text( &$text ) {

     static $conversions = array(
              // Windows & Word
          133 => '&hellip;'
         ,145 => '&lsquo;'
         ,146 => '&rsquo;'
         ,147 => '&ldquo;'
         ,148 => '&rdquo;'
         ,149 => '&bull;'
         ,150 => '&ndash;'
         ,151 => '&mdash;'

                 // Mac
         ,165 => '&bull;'
         ,208 => '&ndash;'
         ,209 => '&mdash;'
         ,210 => '&ldquo;'
         ,211 => '&rdquo;'
         ,212 => '&lsquo;'
         ,213 => '&rsquo;'
         );

     if( is_scalar( $text ) || is_null( $text ) ) {

         $corpus = str_replace(
              array_map( 'chr', array_keys( $conversions ) )
             ,$conversions
             ,$text
             );

         $gremlins = array( );

         for( $ii = 0; $ii < strlen( $corpus ); $ii++ ) {
             if( ($ordv = ord( $corpus[ $ii ]) ) > 126 ) {
                 $gremlins[ $ii ] = $ordv;
                 $corpus[ $ii ] = '*';
                 }
             }

         $text = $corpus;

         if( count( $gremlins ) ) {
             return $gremlins;
             }

         return true;
         }

     return false;
     }

?>

attached mail follows:


hi list!

Does someone know a good Book/website for Develop own C-Extensions for PHP5?

http://us2.php.net/manual/en/zend.php
This site are just basic things, but i wanna do more things. Someone may help
me?

thx

attached mail follows:


On 4/26/06, Thomas Munz <thomasecommerce.com> wrote:
> hi list!
>
> Does someone know a good Book/website for Develop own C-Extensions for PHP5?
>
> http://us2.php.net/manual/en/zend.php
> This site are just basic things, but i wanna do more things. Someone may help
> me?

This might help you out:

http://pecl.php.net/support.php#resources

If not, the internals list would be able to help you a lot better
since they are the ones writing the C code in the first place..

http://www.php.net/mailing-lists.php

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


Hello,

i try to install the HTTP_Request package.

I installed also the Net_Socket with

pear install Net_Socket-1.0.6

But it exists.

Than i try to install the HTTP_Request:

downloading HTTP_Request-1.3.0.tgz ...
Starting to download HTTP_Request-1.3.0.tgz (13,808 bytes)
.....done: 13,808 bytes
requires package `Net_Socket' >= 1.0.2
HTTP_Request: Dependencies failed

Then it comes this.

So i dont understand what the problem is.
I installed the new version of net socket already.

Thanks
marcus

_________________________________________________________________
Haben Spinnen Ohren? Finden Sie es heraus – mit dem MSN Suche Superquiz via
http://www.msn-superquiz.de Jetzt mitmachen und gewinnen!

attached mail follows:


> i try to install the HTTP_Request package.
>
> I installed also the Net_Socket with
>
> pear install Net_Socket-1.0.6
>
> But it exists.
>
> Than i try to install the HTTP_Request:
>
> downloading HTTP_Request-1.3.0.tgz ...
> Starting to download HTTP_Request-1.3.0.tgz (13,808 bytes)
> .....done: 13,808 bytes
> requires package `Net_Socket' >= 1.0.2
> HTTP_Request: Dependencies failed
>
>
> Then it comes this.
>
> So i dont understand what the problem is.
> I installed the new version of net socket already.

You're better off asking the pear list: http://pear.php.net/support/lists.php

They will be able to help you a lot quicker than we can..

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


sorry

>From: "chris smith" <dmagickgmail.com>
>To: "Markus Braun" <charmed21muchotmail.com>
>CC: php-generallists.php.net
>Subject: Re: [PHP] Pear Package HTTP_Request
>Date: Wed, 26 Apr 2006 21:21:24 +1000
>
> > i try to install the HTTP_Request package.
> >
> > I installed also the Net_Socket with
> >
> > pear install Net_Socket-1.0.6
> >
> > But it exists.
> >
> > Than i try to install the HTTP_Request:
> >
> > downloading HTTP_Request-1.3.0.tgz ...
> > Starting to download HTTP_Request-1.3.0.tgz (13,808 bytes)
> > .....done: 13,808 bytes
> > requires package `Net_Socket' >= 1.0.2
> > HTTP_Request: Dependencies failed
> >
> >
> > Then it comes this.
> >
> > So i dont understand what the problem is.
> > I installed the new version of net socket already.
>
>You're better off asking the pear list:
>http://pear.php.net/support/lists.php
>
>They will be able to help you a lot quicker than we can..
>
>--
>Postgresql & php tutorials
>http://www.designmagick.com/

_________________________________________________________________
Haben Spinnen Ohren? Finden Sie es heraus – mit dem MSN Suche Superquiz via
http://www.msn-superquiz.de Jetzt mitmachen und gewinnen!

attached mail follows:


©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥
Í˶©£ºyangjie0288yahoo.com.cn£¨±êÌâдʱ¡°Í˶©¡±ÄÚÈÝдÃ÷ÄúÏë¡°Í˶©µÄÓÊÏ䡱£©

±¨Ãû£ºjie_srtom.com»ò lcy787810yahoo.com.cn£¨»Ø¸´ÄúµÄ±¨Ãû±íµÇ¼Ç±¨Ãû£©
©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥
==========================================================================

                   ¡¶ESD¾²µç·À»¤¼¼Êõ¼°Ìåϵ½¨Éè¡·

==========================================================================

Ö÷°ìµ¥Î»£º Ï£Èñ¿Æ¼¼ÆóÒµ¹ÜÀí×ÉѯÓÐÏÞ¹«Ë¾

ʱ¡¡¡¡¼ä£º2006Äê5ÔÂ20-21ÈÕ (ÖÜÁù¡¢ÈÕ£©

µØ µã£ºËÕ ÖÝ

ËÕÖݵ绰£º0512-67137582 ËÕÖÝ´«Õ棺0512-67137583 ÁªÏµÈË£ºÑîС½ã

ÉϺ£µç»°£º021-51083269 ÉϺ£´«Õ棺021-51083269 ÁªÏµÈË£º·½ÏÈÉú

ÉîÛڵ绰£º0755-22058634 ÉîÛÚ´«Õ棺0755-83524349 ÁªÏµÈË£ºÔøÐ¡½ã
  
·Ñ¡¡¡¡Óãº198OÔª/ÈË(º¬½Ì²Ä¡¢Îç²Í¡¢²èµã¡¢ºÏÓ°µÈ)

============================================================================
¡ö ¡ö¡¾¿Î-³Ì-±³-¾°¡¿

     ±¾¿Î³ÌΪÄú½²ÊÚ£¬µç×ÓÆóÒµÈçºÎ°´ÕÕ¹ú¼ÊͨÐбê×¼½¨Á¢¹æ·¶»¯¡¢ÏµÍ³»¯µÄESD·À»¤Ìåϵ£¬

ͬʱ°ïÖúÄúÕÆÎÕEPAÉèÁ¢¼¼ÇÉ¡¢ESD½ÓµØÉè¼Æ¡¢ESD·À»¤ÓÃÆ·µÄÔ­Àí¡¢Ê¹Óúͼì²âµÈESD·À»¤Ìå

ϵÖеĹؼü¼¼ÊõÎÊÌâ¡£Åàѵ»¹½«ÎªÄúÌṩS20.20±ê×¼ºÍESDÌåϵÈÏÖ¤·½Ãæ×îÐÂ×ÊѶ¡£
==============================================================================
¡ö¡ö¡¾ÀÏ-ʦ-½é-ÉÜ¡¿

ÁõÀÏʦ£¬Ä³¿Æ¼¼×Éѯ¹«Ë¾Ê×ϯESDÌåϵ×Éѯʦ¼°Åàѵ½²Ê¦£¬»¯Ñ§Ñ§Ê¿£¬Ç廪´óѧ¹¤É̹ÜÀí˶ʿ£¬

´Óʹý»¯¹¤¡¢²ÄÁϺ͵ç×ÓÐÐÒµ£¬Ôø¾­ÔÚÖйúºË¹¤Òµ504Ëùµ£ÈιýÑо¿¹¤×÷£¬95ÄêÒÔºóÖ÷Òª´ÓÊÂ

¹ÜÀí¹¤×÷£¬ÊìϤʵ¼ÊÉú²úµ±Öеĸ÷ÖÖ¹ÜÀí»·½Ú£¬99Äê½øÈë·À¾²µçÐÐÒµ£¬²¢³¤ÆÚÖÂÁ¦ÓÚ·À¾²µç²ú

Æ·Êг¡¼°·À¾²µç²úÆ·Ó¦ÓÃÑо¿¹¤×÷£¬¶Ô·À¾²µç²úÆ·¼¼Êõ¼°Êг¡ÓÐÐí¶à¶Àµ½µÄ¼û½â¡£2003ÒÔÀ´£¬

ÁõÏÈÉúרעÓÚµç×Ó²úÆ·Éú²úÆóÒµESD¿ØÖÆÌåϵ½¨ÉèºÍ¹úÄÚÍâESD±ê×¼Ó¦ÓõÄÑо¿ºÍÍÆ¹ã¹¤×÷¡£Áõ

ÀÏʦÓÐÁ¼ºÃµÄ»¯Ñ§¡¢²ÄÁÏѧ¡¢¹ÜÀíѧ»ù´¡£¬·á¸»µÄESD·À»¤Ìåϵ¼°¼¼Êõʵ¼ù¾­Ñ飬ҲÊǹúÄÚ×îÔç

רҵ´Óʾ²µç·À»¤¼¼Êõ×ÉѯµÄר¼Ò£¬ÔøÎªSANYO¡¢FOXCONN¡¢JDS¡¢OPLINK¡¢NAMTAI¡¢HP¡¢

FLEXTRONICS¡¢JABIL¡¢EMERSON¡¢ÖйúÒÆ¶¯µÈ¶à¼ÒÖªÃû¹«Ë¾Ìṩ×Éѯ¡¢¸¨µ¼ºÍÅàѵ·þÎñ¡£
==============================================================================
¡ö ¡ö ¡ö ¡¾¿Î-³Ì-´ó-¸Ù¡¿

µÚ1 Õ ¾²µç¼°¾²µç·À»¤»ù´¡ÀíÂÛ
1.1 ¾²µçµÄ²úÉú»úÀí¼°²úÉú·½Ê½
1.2 ¾²µçÎïÀí²ÎÊý¼ÆËã
1.3 µç×ÓÔªÆ÷¼þµÄ¾²µçʧЧ
1.4 ¾²µç·ÅµçģʽºÍÄ£ÐÍ
1.5 ¾²µçÃô¸Ð¶ÈºÍ·À»¤¼¶±ð

µÚ2Õ µç×Ó²úÆ·Éú²ú³§¾²µç·À»¤¼¼ÊõʵÎñ
2.1 ¾²µç·À»¤µÄ»ù±¾¼¼ÊõÊÖ¶Î
2.2 ESD½ÓµØ¼¼Êõ
2.3 ¹¤×÷̨¡¢¹¤×÷ÇøµÄESD±£»¤
2.4 ÈËÌå¾²µç¿ØÖÆ
2.5 Ãô¸ÐÆ÷¼þµÄ°ü×°¼¼Êõ
2.6 ·À¾²µç²ÄÁϼ¼Êõ
2.7 ¾²µçÔ´¼°²ÄÁÏ¿ØÖÆÒªÇó
2.8 ESD²âÁ¿ºÍ¼à¿Ø
2.9 ³£Ó÷À¾²µçÓÃÆ·µÄ¼ì²âºÍ¼¼ÊõÒªÇó

µÚ3 Õ ESD¼¼Êõ±ê×¼¼°ESDÈÏÖ¤
3.1 ESD±ê×¼µÄÑÝ»¯
3.2 ESD±ê×¼µÄ·ÖÀà
3.3 ¹úÄÚÍâESD±ê×¼×éÖ¯¼°±ê×¼
3.4 ¹ú¼ÊÁ÷ÐеÄESDÌåϵ
3.5 ESDÈÏÖ¤À´Ô´
3.6 ESDÈÏÖ¤ÄÚÈݼ°¶ÔÏó
3.7 ÈÏÖ¤»ú¹¹¼°ÈÏÖ¤³ÌÐò
3.8 S20£®20ÈÏÖ¤µÄ»ù±¾ÒªÇó

µÚ4Õ ESD·À»¤Ìåϵ½¨Éè
4.1 ×éÖ¯·½Ê½¼°ÏîÄ¿¹ÜÀí
4.2 ¹ÜÀíÒªÇó
4.3 ¼¼ÊõÒªÇó
4.4 ÎļþÌåϵ
4.5 ÄÚÉóÒªÇóºÍ¼¼ÇÉ
4.6 ÍÆ¼ö¼ì²â·½·¨ºÍ±ê×¼

¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô
©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥©¥


¡Ñ¡Ñ¡Ñ¡Ñ¡Ñ±¨========Ãû========»Ø========Ö´

>ÎÒ--˾¾ö--¶¨ÅÉѧ--Ô±²Î--¼Ó¡¶ESD¾²µç·À»¤¼¼Êõ¼°Ìåϵ½¨Éè¡·£¬

>Çë--¸ø--Óè--Áô--λ

>Çë´«====Õæµ½0755-83524349Åà--ѵ--²¿ÊÕ

>µ¥Î»Ãû³Æ£º____________________________________Áª ϵ ÈË£º___________

>ÁªÏµµç»°£º_________________´«Õ棺_____________ѧԱÈËÊý£º___________

>ѧԱÐÕÃû£º__________________ ¸¶¿î·½Ê½£º 1.תÕÊ 2.ÏÖ½ð

¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô¡Ô

attached mail follows:


On 4/25/06, Richard Lynch <ceol-i-e.com> wrote:Sounds to me like we have
different versions of cURL and yours is

> better. :-)
>
> Mine phpinfo() curl section has:
> libcurl/7.15.3 OpenSSL/0.9.7d zlib/1.2.1
>
> which would seem to be the most current version...
>
> Or, perhaps, the order in which you set the options matters? Ick.
>
> For me, at least, the Cookie jar did not work until I took out the
> CURLOPT_HEADER, and it DID work after I changed that, and only that.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
> Our production server uses this:
Php 4.4.0
CURL Information libcurl/7.15.1 OpenSSL/0.9.8a zlib/1.1.4

My local machine:
Php 4.3.11
CURL Information libcurl/7.10.5 OpenSSL/0.9.7i ipv6 zlib/1.2.3
(not by choice ;))

attached mail follows:


Hi all

I'm trying to execute two querys and they execute perfectly in fact,
but after the execution of the first query there suposed to be some
variable setted to a certain value.

The problem is this variable is not available at the time the second
query runs.

I`ll try to explain a little bit further

//This is my first query

$quer1=" SET var1=3 ";//Here I`m suposed to set the value for var1 to 3
mysql_query($quer1);

// This is query #2

$query2="SELECT * from table1 where col1=var1 "//Here var1 doesn`t
exist

That wasn't really my first attempt. Originally
I've tryied the whole thing in just one single query but mysql gave me
an error message complinning about the semicolon

Please look at this

$quer1 = "SET var1=3 ;
        SELECt * from table1 Where col1=var1 " ;

This gave a syntax error from MySQL inmmediately before the ";"
(semicolon),

Please any help greatefully appreciated

Thanks
Mauricio

attached mail follows:


Mauricio Pellegrini a écrit :
> Hi all
>
> I'm trying to execute two querys and they execute perfectly in fact,
> but after the execution of the first query there suposed to be some
> variable setted to a certain value.
>
> The problem is this variable is not available at the time the second
> query runs.
>
> I`ll try to explain a little bit further
>
> //This is my first query
>
> $quer1=" SET var1=3 ";//Here I`m suposed to set the value for var1 to 3
> mysql_query($quer1);
>
> // This is query #2
>
> $query2="SELECT * from table1 where col1=var1 "//Here var1 doesn`t
> exist
>
>
why don't you build the second query directly with the value ?
$query2 = "SELECT * from table where col1=".$value;

why do you need a query to set VAR1=3 ?
(do you plan to use VAR in another query ?).

N F

> That wasn't really my first attempt. Originally
> I've tryied the whole thing in just one single query but mysql gave me
> an error message complinning about the semicolon
>
> Please look at this
>
> $quer1 = "SET var1=3 ;
> SELECt * from table1 Where col1=var1 " ;
>
>
> This gave a syntax error from MySQL inmmediately before the ";"
> (semicolon),
>
>
> Please any help greatefully appreciated
>
> Thanks
> Mauricio
>
>

attached mail follows:


On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> Mauricio Pellegrini a écrit :
> > Hi all
> >
> > I'm trying to execute two querys and they execute perfectly in fact,
> > but after the execution of the first query there suposed to be some
> > variable setted to a certain value.
> >
> > The problem is this variable is not available at the time the second
> > query runs.
> >
> > I`ll try to explain a little bit further
> >
> > //This is my first query
> >
> > $quer1=" SET var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > mysql_query($quer1);
> >
> > // This is query #2
> >
> > $query2="SELECT * from table1 where col1=var1 "//Here var1 doesn`t
> > exist
> >
> >
> why don't you build the second query directly with the value ?
> $query2 = "SELECT * from table where col1=".$value;
>
> why do you need a query to set VAR1=3 ?
> (do you plan to use VAR in another query ?).
>
> N F
>
> > That wasn't really my first attempt. Originally
> > I've tryied the whole thing in just one single query but mysql gave me
> > an error message complinning about the semicolon
> >
> > Please look at this
> >
> > $quer1 = "SET var1=3 ;
> > SELECt * from table1 Where col1=var1 " ;
> >
> >
> > This gave a syntax error from MySQL inmmediately before the ";"
> > (semicolon),
> >
> >
> > Please any help greatefully appreciated
> >
> > Thanks
> > Mauricio
> >
> >

Yes, I need to do it exactly this way.
I mean , SET the value for the variable var1 first.
Then execute an undefined number of querys that reference this variable
and its value.

Thanks
Mauricio

attached mail follows:


On 4/26/06, Mauricio Pellegrini <hrrg-infspeedy.com.ar> wrote:
> On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> > Mauricio Pellegrini a écrit :
> > > Hi all
> > >
> > > I'm trying to execute two querys and they execute perfectly in fact,
> > > but after the execution of the first query there suposed to be some
> > > variable setted to a certain value.
> > >
> > > The problem is this variable is not available at the time the second
> > > query runs.
> > >
> > > I`ll try to explain a little bit further
> > >
> > > //This is my first query
> > >
> > > $quer1=" SET var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > > mysql_query($quer1);
> > >
> > > // This is query #2
> > >
> > > $query2="SELECT * from table1 where col1=var1 "//Here var1 doesn`t
> > > exist

If you try this through a mysql console or through something like
phpmyadmin does it work?

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


Mauricio Pellegrini a écrit :
>>> $quer1 = "SET var1=3 ;
>>> SELECt * from table1 Where col1=var1 " ;
>>>
>>>
>>> This gave a syntax error from MySQL inmmediately before the ";"
>>> (semicolon),
>>>
>>>
did you try to run the query above

( SET var1=3 ; SELECt * from table1 Where col1=var1 )

directly from a mysql client ?
perhaps the is interpreted and you have to put a \ before it.
try a print $quer1 once $quer1 is set.
>>> Please any help greatefully appreciated
>>>
>>> Thanks
>>> Mauricio
>>>
>>>
>>>
>
>
> Yes, I need to do it exactly this way.
> I mean , SET the value for the variable var1 first.
> Then execute an undefined number of querys that reference this variable
> and its value.
>
> Thanks
> Mauricio
>
>

attached mail follows:


On Wed, 2006-04-26 at 11:04, chris smith wrote:
> On 4/26/06, Mauricio Pellegrini <hrrg-infspeedy.com.ar> wrote:
> > On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> > > Mauricio Pellegrini a écrit :
> > > > Hi all
> > > >
> > > > I'm trying to execute two querys and they execute perfectly in fact,
> > > > but after the execution of the first query there suposed to be some
> > > > variable setted to a certain value.
> > > >
> > > > The problem is this variable is not available at the time the second
> > > > query runs.
> > > >
> > > > I`ll try to explain a little bit further
> > > >
> > > > //This is my first query
> > > >
> > > > $quer1=" SET var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > > > mysql_query($quer1);
> > > >
> > > > // This is query #2
> > > >
> > > > $query2="SELECT * from table1 where col1=var1 "//Here var1 doesn`t
> > > > exist
>
> If you try this through a mysql console or through something like
> phpmyadmin does it work?

Yes, It works perfectly!.

>From Mysql console or MysqlCC or EMS MySQLmanager

> --
> Postgresql & php tutorials
> http://www.designmagick.com/

attached mail follows:


On Wed, 2006-04-26 at 11:09, nicolas figaro wrote:
> Mauricio Pellegrini a écrit :
> >>> $quer1 = "SET var1=3 ;
> >>> SELECt * from table1 Where col1=var1 " ;
> >>>
> >>>
> >>> This gave a syntax error from MySQL inmmediately before the ";"
> >>> (semicolon),
> >>>

> >>>
> did you try to run the query above
>
> ( SET var1=3 ; SELECt * from table1 Where col1=var1 )
>
> directly from a mysql client ?

Yes, I did and it Works perfectly.

> perhaps the is interpreted and you have to put a \ before it.
> try a print $quer1 once $quer1 is set.

I've tried this too. The output is sintactically correct.
I even copied the output of the query and pasted it to Mysqlcc an
executed it perfectly.

A few minutes ago I found that mysql_query() cannot execute more than
one query at a time
so the form mysql_query("SET var1=3 ; SELECT * from ....") is invalid

But the other way should work

Thanks
Mauricio

> >>> Please any help greatefully appreciated
> >>>
> >>> Thanks
> >>> Mauricio
> >>>
> >>>
> >>>
> >
> >
> > Yes, I need to do it exactly this way.
> > I mean , SET the value for the variable var1 first.
> > Then execute an undefined number of querys that reference this variable
> > and its value.
> >
> > Thanks
> > Mauricio
> >
> >

attached mail follows:


On Wed, 2006-04-26 at 11:04, chris smith wrote:
> On 4/26/06, Mauricio Pellegrini <hrrg-infspeedy.com.ar> wrote:
> > On Wed, 2006-04-26 at 10:32, nicolas figaro wrote:
> > > Mauricio Pellegrini a écrit :
> > > > Hi all
> > > >
> > > > I'm trying to execute two querys and they execute perfectly in fact,
> > > > but after the execution of the first query there suposed to be some
> > > > variable setted to a certain value.
> > > >
> > > > The problem is this variable is not available at the time the second
> > > > query runs.
> > > >
> > > > I`ll try to explain a little bit further
> > > >
> > > > //This is my first query
> > > >
> > > > $quer1=" SET var1=3 ";//Here I`m suposed to set the value for var1 to 3
> > > > mysql_query($quer1);
> > > >
> > > > // This is query #2
> > > >
> > > > $query2="SELECT * from table1 where col1=var1 "//Here var1 doesn`t
> > > > exist
>
> If you try this through a mysql console or through something like
> phpmyadmin does it work?
>

Yes, it works.

> --
> Postgresql & php tutorials
> http://www.designmagick.com/

attached mail follows:


You should be able to do this in two calls to the mysql_query() function.
mysql_query("SET var1=3");
mysql_query("SELECT * from table1 Where col1=var1");

2006/4/26, Mauricio Pellegrini <hrrg-infspeedy.com.ar>:
>
> Hi all
>
> I'm trying to execute two querys and they execute perfectly in fact,
> but after the execution of the first query there suposed to be some
> variable setted to a certain value.
>
> The problem is this variable is not available at the time the second
> query runs.
>
> I`ll try to explain a little bit further
>
> //This is my first query
>
> $quer1=" SET var1=3 ";//Here I`m suposed to set the value for var1 to 3
> mysql_query($quer1);
>
> // This is query #2
>
> $query2="SELECT * from table1 where col1=var1 "//Here var1 doesn`t
> exist
>
>
> That wasn't really my first attempt. Originally
> I've tryied the whole thing in just one single query but mysql gave me
> an error message complinning about the semicolon
>
> Please look at this
>
> $quer1 = "SET var1=3 ;
> SELECt * from table1 Where col1=var1 " ;
>
>
> This gave a syntax error from MySQL inmmediately before the ";"
> (semicolon),
>
>
> Please any help greatefully appreciated
>
> Thanks
> Mauricio
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On Wed, 2006-04-26 at 10:36, Mauricio Pellegrini wrote:
> On Wed, 2006-0