php-general Digest 17 Feb 2005 16:06:00 -0000 Issue 3291

Topics (messages 208879 through 208922):

Re: Session Vars and Performance
        208879 by: trlists.clayst.com

login error to mySQL from PHP
        208880 by: David Freedman
        208888 by: Dan Phiffer
        208894 by: Burhan Khalid

Re: Password Protection
        208881 by: Bret Hughes
        208893 by: Burhan Khalid
        208895 by: Joe Wollard
        208897 by: Steve
        208904 by: Kevin Javia

Re: Getting floats from 8 byte IEEE binary representations
        208882 by: Bret Hughes
        208884 by: Dan Phiffer

Re: XHTML 1.1  +  php sessions  =  :(
        208883 by: Dan Phiffer
        208887 by: Bret Hughes

Re: strange behaviour upgrade from 4.3.10 -> 5.0.3 : cgi works but apache does 
not
        208885 by: Dan Phiffer

Re: Why is my class throwing this error?
        208886 by: Dan Phiffer
        208890 by: Bret Hughes

Undefined function - mysql_connect() - php5?
        208889 by: Jacques
        208891 by: Lester Caine

Re: php login
        208892 by: William Stokes

Re: Appending DOM doc as child in another DOM doc
        208896 by: Christian Stocker

Re: [PHP-DEV] toString() in SimpleXML?
        208898 by: Leendert Brouwer

Re: pcntl_fork() hangs with FUTEX_WAIT
        208899 by: Steve

Crawlers (was parsing large files - PHP or Perl)
        208900 by: John Cage

Problem connecting to MySQL with PEAR::DB and mysqli
        208901 by: markusjais.gmx.de

md5 passwords to db
        208902 by: William Stokes
        208917 by: AdamT

Re: Dynamic/runtime object creation
        208903 by: joe Lovick
        208911 by: kermodebear.kermodebear.org

Re: Running PHP from inside another application!
        208905 by: Mikael Andersson

map internal extension name to actual file
        208906 by: Zac Barton

Re: reading/writing files outside of web root
        208907 by: Phil Ewington - 43 Plc

FOPEN
        208908 by: Diana Castillo
        208910 by: Mikey

CURLOPT_RETURNTRANSFER
        208909 by: QT

help me
        208912 by: K Karthik
        208921 by: Robby Russell

use_soap_error_handler
        208913 by: FENDT Charles
        208914 by: Jochem Maas
        208915 by: FENDT Charles
        208916 by: Jochem Maas
        208918 by: FENDT Charles
        208920 by: Jochem Maas

traversing multi-dimensional arrays
        208919 by: blackwater dev

username and password auth
        208922 by: William Stokes

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

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


----------------------------------------------------------------------
--- Begin Message ---
On 16 Feb 2005 Richard Lynch wrote:

> Use the exact same session stuff you have now and just dump the
> serialized data into SQL using the 5 functions for session handling. 

Oh, OK, that's what you meant about the 5 functions.  I am not sure of 
the advantage to that, actually something I've always wondered.  
Especially if I am serializing the data anyway -- the way I see it is 
as follows (we are in the realm of theorizing here):  Serializing is 
serializing, likely just as fast whether using the built-in session 
mechanism or a replacement, or even serializing it myself, I'm sure it 
all goes through the same underlying routine.  Writing and reading a 
single flat data record like this through MySQL has to be slower than 
using a flat file, unless PHP flat file access is somehow drastically 
slower than it should be.  Ergo, I'm likely to lose, not gain, by using 
MySQL.  (So why did I ask the original question?  Because I hadn't 
analyzed it this carefully first!)

> It's literally an hour's work to alter the code to use MySQL to store the
> sessions instead of the hard drive.
> 
> This might or might not improve performance.

As mentioned above -- under what circumstances would it improve?  
Perhaps if file open is an expensive operation and the database is 
already open.  But it's hard to think of where one would expect the SQL 
access to be faster.

> It's incredibly UNLIKELY that trying to send an SQL query for every single
> line of code that currently does $_SESSION[...] = ...; is going to be
> faster... I'd almost be willing to say IMPOSSIBLE that would be faster,
> but somebody would post a trivial example to prove me wrong :-)

Totally agree.

> But you'd probably find it easier to write a C extension and
> re-compile PHP to pre-load all the stuff. 
> 
> None of which applies to you, I don't think, but you may want to
> re-read that thread. 

Well when I am not doing PHP programming I do C and C++ programming so 
I could conceivably do that, but have no desire to -- and my client  
certainly wouldn't want to pay for it!

--
Tom

--- End Message ---
--- Begin Message ---
I am attempting to install both phpMyAdmin and phpLens. When attempting to
connect to the mySql server I get the following error message:

 "Unable to connect. Please click on Previous and correct.
[Client does not support authentication protocol requested by server;
consider upgrading MySQL client] "

I am running windows XP and IIS. I really don't understand what is
incompatible with
what here. I am not a person who 'compile'  anything. I am just a casual
user, who
is willing to do what needs to be done, if I only knew what that was.
Thanks.

DavidF

--- End Message ---
--- Begin Message --- David Freedman wrote:
I am attempting to install both phpMyAdmin and phpLens. When attempting to
connect to the mySql server I get the following error message:

 "Unable to connect. Please click on Previous and correct.
[Client does not support authentication protocol requested by server;
consider upgrading MySQL client] "

That looks like an error message specific to either phpMyAdmin or phpLens. You might want to see if they can help you out.


HTH,
-Dan

--- End Message ---
--- Begin Message --- David Freedman wrote:
I am attempting to install both phpMyAdmin and phpLens. When attempting to
connect to the mySql server I get the following error message:

 "Unable to connect. Please click on Previous and correct.
[Client does not support authentication protocol requested by server;
consider upgrading MySQL client] "

This error means that you are using incompatible versions of the MySQL client libraries. If you are are using MySQL 4.1.x then you need to use the mysqli extension (and functions) -- because MySQL has changed the way it encrypts passwords.


Conversely, mysqli connect routines will not work with MySQL versions < 4.1.x.

You have one final option, which is to run MySQL 4.1 with the --old-password switch, which you would have to read up on at the MySQL website to find out how.

One more thing, phpMyAdmin has a toggle in its configuration file that you must set if you are using it with MySQL 4.1.x (it will then use the correct client libraries). I have no idea what phpLens is, so I can't help you there.
--- End Message ---
--- Begin Message ---
On Wed, 2005-02-16 at 21:31, Kevin Javia wrote:
> I am experimenting on my site and I want to make it password protected like
> www.realsolution.com.
> 
> If any one enters correct user name and password, only then they will be
> able to enter into my site.
> 
> How can I do that in PHP?
> 
> Any ideas? Thanks a ton in advance.


Chances are this is not a php thing at all but uses the webserver's
authentication infrastructure.  It depends on the server being used. 
The apache manual has a very good write up on authentication options
available:

See if this gets you started:

http://httpd.apache.org/docs-2.0/howto/auth.html


Bret

--- End Message ---
--- Begin Message --- Kevin Javia wrote:
I am experimenting on my site and I want to make it password protected like
www.realsolution.com.

http://www.zend.com/zend/tut/authentication.php

--- End Message ---
--- Begin Message ---
Kevin,

I'm having some issues with my email client right now so I'm sorry if you've already found the answer. There is a way for PHP to do this without the need to modify your web server's configuration or bothering with .htaccess/ .htpasswd files by simply modifying the http headers that your pages produce. I'm not about to try to give you a working example as the fine folks at phpmyadmin have already done this in the form of an authentication library. If you have phpMyAdmin installed look in the "libraries/auth" directory for a file called "http.auth.lib.php". If not you can get it from www.phpmyadmin.net

Like I said, it is in library form so you can use it in your program as well (be sure to give credit per the GPL) but I haven't done so, so I'm not sure how much modification might be needed.

Cheers!


Bret Hughes wrote:

On Wed, 2005-02-16 at 21:31, Kevin Javia wrote:


I am experimenting on my site and I want to make it password protected like
www.realsolution.com.

If any one enters correct user name and password, only then they will be
able to enter into my site.

How can I do that in PHP?

Any ideas? Thanks a ton in advance.




Chances are this is not a php thing at all but uses the webserver's
authentication infrastructure. It depends on the server being used. The apache manual has a very good write up on authentication options
available:


See if this gets you started:

http://httpd.apache.org/docs-2.0/howto/auth.html


Bret




--- End Message ---
--- Begin Message ---
Kevin Javia wrote:
I am experimenting on my site and I want to make it password protected like
www.realsolution.com.

If any one enters correct user name and password, only then they will be
able to enter into my site.

How can I do that in PHP?

Any ideas? Thanks a ton in advance.


Try this:



function authenticate() {
  header('WWW-authenticate: basic realm="My protected area"');
  header('HTTP/1.0 401 Unauthorized');
  print 'Please use a correct login!';
  exit;
}


function authorize() { if( (!isset($_SERVER['PHP_AUTH_USER'])) or ($_SERVER['PHP_AUTH_USER'] == '') ) { authenticate(); } else { $login = strtolower($_SERVER['PHP_AUTH_USER']); $passwd = $_SERVER['PHP_AUTH_PW'];

if (.....) { // check $login and $passwd against the list of authorized users
return true;
}
else {
authenticate();
}
}
return false;
}

--- End Message ---
--- Begin Message ---
Thank you people.

"Kevin Javia" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am experimenting on my site and I want to make it password protected
like
> www.realsolution.com.
>
> If any one enters correct user name and password, only then they will be
> able to enter into my site.
>
> How can I do that in PHP?
>
> Any ideas? Thanks a ton in advance.

--- End Message ---
--- Begin Message ---
On Wed, 2005-02-16 at 18:36, Ian Johnson wrote:
> I am trying to write a function which will read a string of bytes from a
> binary file and convert 8 byte sequences to Float type data.  I've been
> through the manual and can find nothing but think I must be missing
> something.  It can't be that hard.  Can someone help me out.
> 
> 

what have you tried?  won't fread() work?

http://us4.php.net/manual/en/function.fread.php

--- End Message ---
--- Begin Message --- Ian Johnson wrote:
I am trying to write a function which will read a string of bytes from a
binary file and convert 8 byte sequences to Float type data.  I've been
through the manual and can find nothing but think I must be missing
something.  It can't be that hard.  Can someone help me out.

Have you tried unpack? (http://php.net/unpack)

HTH,
-Dan

--- End Message ---
--- Begin Message ---
b1nary Developement Team wrote:

I'm having some troubles however, and they come in the form of sessions. When I use session_start(), it throws the PHPSESSID into the URL of all of my links and form actions and what not. This is a problem because in my forms it throws in a hidden input, which doesn't validate right, plus they don't use &amp; insteand of just &. Is there any way to stop a session from being passed through the URL?


From php.net/session:
---
PHP is capable of transforming links transparently. Unless you are using PHP 4.2 or later, you need to enable it manually when building PHP. Under Unix, pass --enable-trans-sid to configure. If this build option and the run-time option session.use_trans_sid are enabled, relative URIs will be changed to contain the session id automatically.


Note: The arg_separator.output php.ini directive allows to customize the argument seperator. For full XHTML conformance, specify &amp; there.
---


HTH,
-Dan

--- End Message ---
--- Begin Message ---
On Wed, 2005-02-16 at 19:07, b1nary Developement Team wrote:
> Hi there guys... First time caller here ;).
> 
> I'm currently developing a content management system.  One of it's 
> features is that it's going to be completely standards compliant (XHTML 
> 1.1).
> 
> I'm having some troubles however, and they come in the form of 
> sessions.  When I use session_start(), it throws the PHPSESSID into the 
> URL of all of my links and form actions and what not.  This is a problem 
> because in my forms it throws in a hidden input, which doesn't validate 
> right, plus they don't use &amp; insteand of just &.  Is there any way 
> to stop a session from being passed through the URL?
> 

Sure enable session.use_only_cookies in php.cfg and cookies will be
used. nothing in the page sent to the browser at all as far as I know.

http://us4.php.net/session

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

--- End Message ---
--- Begin Message ---
Mbneto wrote:

When I call the cli with the same php script, even a more complex one
it works flawlessly.

You may want to double check that the CLI parser isn't the old one:

$ php -v

As for the aborting Apache problem, you may want to look through the error logs.

HTH,
-Dan

--- End Message ---
--- Begin Message --- NathanielGuy#21 wrote:
Error thrown
--
Parse error: parse error, unexpected T_STRING in
/home/blacknut/public_html/picserv/includes/gallery.class on line 52
--

For what it's worth, I'm able to execute the code without parse errors (v5.0.3). A long shot, but could there be another file called gallery.class that you've mistaken for this one? (I've done that a couple times.)


HTH,
-Dan

--- End Message ---
--- Begin Message ---
On Wed, 2005-02-16 at 23:11, Dan Phiffer wrote:
> NathanielGuy#21 wrote:
> > Error thrown
> > --
> > Parse error: parse error, unexpected T_STRING in
> > /home/blacknut/public_html/picserv/includes/gallery.class on line 52
> > --
> 
> For what it's worth, I'm able to execute the code without parse errors 
> (v5.0.3). A long shot, but could there be another file called 
> gallery.class that you've mistaken for this one? (I've done that a 
> couple times.)
> 

what about stray no native linefeeds or other non printable chars?

delete the line and retype it.

Bret

--- End Message ---
--- Begin Message ---
I have installed PHP5 on IIS. When I try to make a connection the the MySQL 
database with the following code:

$conn = mysql_connect("localhost", "root", "") or die("Unable to connect");

I get the following error in the browser:

Undefined function my_sqlconnect().

What can be the problem?

I uninstalled PHP5 and installed PHP4 and then I can make a connection 
without any problems...

Please shed some light anyone!!

Jacques 

--- End Message ---
--- Begin Message ---
Jacques wrote:

I have installed PHP5 on IIS. When I try to make a connection the the MySQL database with the following code:

$conn = mysql_connect("localhost", "root", "") or die("Unable to connect");

I get the following error in the browser:

Undefined function my_sqlconnect().

What can be the problem?

I uninstalled PHP5 and installed PHP4 and then I can make a connection without any problems...

Please shed some light anyone!!

PHP5 does not install a driver for MySQL by default. You will need to enable one depending on which version of MySQL you want
php_mysql.dll
php_mysqli.php
This was done partly to comply with changes to MySQL licence conditions, and partly because the older driver will not work correctly with newer versions of MySQL


--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message ---
OK. Thanks a lot. So I need to studu the $_Session more closely.



"Jamie Alessio" <[EMAIL PROTECTED]> kirjoitti 
viestissä:[EMAIL PROTECTED]
>> I need to create solution for user authentication/recognition in my web 
>> page. I think it would be a good idea to use mysql database for storing 
>> the user info because the user info is later used to determine what parts 
>> of site the recognized user is allowed to update.
>>
> William,
> Take a look at the PEAR Auth class:
> http://pear.php.net/package/Auth
> http://pear.php.net/manual/en/package.authentication.auth.php
>
> It allows you to use MySQL to store the user information and will probably 
> save you some time on the actual "login" part of your script.
>
> - Jamie 

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


On Mon, 14 Feb 2005 11:34:15 -0600, Chris Boget <[EMAIL PROTECTED]> wrote:
> Is there a way to take an already existing DomDocument object
> and appending it as a child node within a seperate DomDocument
> object?  Or would I have to pull it apart first and generate new
> DomNode/DomElement objects using the data then append those
> DomNode/DomElement objects to the seperate DomDocument?

//$node1 is a node of $dom1

$node1->appendChild($dom1->importNode($dom2->documentElement,true));

chregu


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


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB

--- End Message ---
--- Begin Message ---
Hi Marcus,

Marcus Boerger wrote:
  having a function __toString() would interfere with the mapping ideas of
SimpleXML. However it is there internally so you simply do one of the
following:
php -r '$x=SimpleXML_load_string("<?xml version=\"1.0\"?><root>blablabla</root>"); echo 
$x, "\n"; var_dump((string)$x);'

I'm aware of that. But how would something like nodeValue() interfere with the mapping ideas behind SimpleXML? IMHO, casts are not intuitive in a development process, especially not when you need them as much as you would in SimpleXML. Now it just feels like working around a problem when coding.



further questions please to [EMAIL PROTECTED]

as you wish..


Monday, February 14, 2005, 1:23:44 PM, you wrote:


Hi,


I have a feature request. Maybe it would be a good idea to have a toString() or perhaps nodeValue() method in SimpleXML's SimpleXMLElement class? It might make it more obvious that the element is still a SimpleXMLElement object when you want to actually use it (when you print it, the value automagically casts to a string internally, so users might think that it will be casted to a string when you directly access it without a specified property/method, which is not the case). I know that the docs say that you should cast it to a string when you want to do a comparison, but apart from that just being an example, maybe my suggestion is a more obvious one to notice?


regards,


Leendert






--- End Message ---
--- Begin Message ---
Well, but I don't use multithreading? PHP is running as CLI exec, not compiled into Apache...


That's my configure command:
./configure  --enable-pcntl --with-curl --with-mysql

Or do I have to care for thread safety anyway?

Regards,
Steve



Richard Lynch wrote:
Steve wrote:

I have a program which creates a lot of children over the time, which
terminate themselves after they are finished.

After some time however, the parent process hangs; apparently in
pcntl_fork(). The child from this fork, however, seems to run normally.
An strace on the parent shows "futex(0x471cb0, FUTEX_WAIT, 2, NULL"

The program runs on PHP 5.0.3-cli and Linux 2.6.

Has anyone an idea what could be the reason for that hang?


Didja try:
http://www.google.com/search?q=FUTEX_WAIT

I did and got:
http://lists.boost.org/MailArchives/boost-users/msg07650.php

So I'm guessing you didn't compile *everything* on your PHP/Apache system
with multi-thread support.


--- End Message ---
--- Begin Message ---
Hi there

Just an update. We altered our code last night and the result is that we have managed to bring in everything with no problem now. The slowest part was actually pulling down the emails which are on another server. I'd like to thank everyone for their help

I have another project I'm working on - more as a hobby than anything else. I need to create a crawler that will crawl approximately 100,000 domains, pull in the information and then classify the content based on some logic (still to be decided but thinking of using bayesian filters). Is there anyone on this list who has written fast and decent crawlers in PHP who would be willing to share their experiences?

Thanks again for your help - it was much appreciated

John
--- End Message ---
--- Begin Message ---
hello


when connecting to MySQL 4.1 using PHP 5 and PEAR::DB I get this error:

DB Error: connect failed

a closer look gets this:

Can't connect to local MySQL server through socket 'localhost' (2)

the code for the connection is like this::

========
public static function getConnection() {
   $mysql_user = "myname";
   $mysql_password = "secret";
   $mysql_host = "localhost";
   $db_name = "mydb";
   $dsn = "mysqli://$mysql_user:[EMAIL PROTECTED]/$db_name";
   echo $dsn;
   $db = DB::connect($dsn);
   if(DB::isError($db)) {
      echo $db->getMessage();
   }
   return $db;             
}
=======

the DSN looks correct:
and in the php.ini I set the following option:

mysqli.default_socket = /var/lib/mysql/mysql.sock

this is where the socket for mysql access is.
then I restarted apache and mysqld.

the MySQL Server is running. I can connect via mysql on the command line
but not with PEAR::DB. 

I am using PHP 5, the latest PEAR::DB, Apache 1.3 on a Redhat 7.3 System.

any ideas what's wrong here ?

Markus

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

I need to make a script/form that can create username and md5 password and 
save the info to mysql db.

Can anyone help?

Thanks
-Will
 

--- End Message ---
--- Begin Message ---
On Thu, 17 Feb 2005 11:33:45 +0200, William Stokes <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I need to make a script/form that can create username and md5 password and
> save the info to mysql db.
> 
You can use:  http://www.php.net/md5 to make MD5 hashes from strings,
or you can just the format of the database field to MD5, which IIRC
will automagically store whatever's assigned to it as an MD5 hash.

-- 
AdamT
"Justify my text?  I'm sorry, but it has no excuse."

--- End Message ---
--- Begin Message ---
Thanks for your help Jason, yes aggregating methods was what i had in mind,
but now as i explore it as a option i realise that it would work best is if
their was a way for me to pull my object out of the database variables, data,
methods and all and then instantiate them some how, with out any of the code
being prewritten.

a bit like create_function() for lambada type functions, but in this case for
my more general object code... and searching the hell out of all these formums
 gives me the classkit functions, so i guess i will try and install and give
them a try...
anyhow
cheers
 joe

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

If you are careful, you can build a string of PHP and eval() it to create a new
class definition. I've done this before, but it was for the novelty more than
needed to actually use it.

I know for a fact that I have seen several projects for this on the web;
However, I tried doing a quick search and I was unable to find anything.
Figures. do:

Anyways, yes it is possible and people have done it before, but if I were going
down this path I would second guess myself as to if this was the best solution.
You should be able to get by with something simpler (and less time consuming to
develop and test). I recommend finding a different solution, but if this is
what _you_ need to do then who am I to tell you no?

Best of luck!
-KBear


Original Message Below:
Hi,
     forgive me if this is a complete noob question....
        What i want to do is create an object at runtime with members and 
methods based
on the result of queries from my db back end. is this (a) possible? or (b)
something i should get out of my head and go and find a better solution?
        basically is their a create_object() style function, and some
add_method() / add_member() style functions, that to allow me to instance things
dynamically at runtime.

sorry that i am not being to clear, but i hope you can get my gist, thanks in
advance to any help any of you can give me!

cheers
joe

--- End Message ---
--- Begin Message ---
Thanx!

I found a component for Delphi that solved my problem through SAPI.
It's called PHP4Delphi.

/ Mike

"Jason Barnett" <[EMAIL PROTECTED]> skrev i meddelandet 
news:[EMAIL PROTECTED]

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

Does anyone have any good ideas of how to find out what extension was 
loaded/enabled from what actual file.

For example the "ming" extension (thats its internal name) could come from 
php_ming.dll in my extensions dir. But if the file name is say mingFlash.dll 
how can i determine (in php) that my ming functions come from the mingFlash.dll 
file?

I had thoughts of getting the name of the first function from 
get_extension_funcs("ming") and then seeing if the text of the function name 
appeared in the actual content of mingFlash.dll, but it seems a bit inaccurate 
and slow. Can unpack help me here?

To re-cap id love to be able to say (from within php), yea the ming extension 
was loaded by enabling the mingFlash.dll in php.ini.

Hope that makes sense

Zac

--- End Message ---
--- Begin Message ---
> Jason Wong wrote:
> > On Wednesday 09 February 2005 02:31, Richard Lynch wrote:
> >> Phil Ewington - 43 Plc wrote:
> >> > For some reason user_prefs will not open
> >> > for read/write even when I tested it under apache.apache and chmod'd
> >> > to 755,
> >> > perhaps because /home is owned by root?
> >>
> >> Something went wrong with this test.
> >>
> >> You SHOULD have been able to read/write that file in PHP, assuming
> >> 'apache' is the user PHP runs as.  Use http://php.net/phpinfo to
> >> confirm that it really *IS* 'apache' user that's running apache/php.
> >
> > It *will* fail if apache has no access to $HOME!
>
> I stand corrected.
>
> In addition to read/write access to the file itself, Apache must have at
> least eXecute (directory listing) permission to the directory containing
> that file.
>
> /home being owned by root is not the issue -- But if it's not something
> the apahce user can 'ls /home' and get the contents of, then you've got a
> problem.

Thanks for all the input guys. The cron job suggestion is a great idea and I
will go with this over using sudo. Thanks again.

- Phil Ewington.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005

--- End Message ---
--- Begin Message ---
   How can I read the contents of a web page that uses basic authentication? 
I want to use fopen() but dont know how to do this and also send the 
username and password

-- 
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 Ext 216
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
      http://www.destinia.com

--- End Message ---
--- Begin Message ---
http://uk.php.net/header should help you.

BTW, you should address your replies to the list and not to individual ppl.

Mikey

> -----Original Message-----
> From: Diana Castillo [mailto:[EMAIL PROTECTED] 
> Sent: 17 February 2005 12:36
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] FOPEN
> 
> how do I send headers with php?
> ----- Original Message -----
> From: "Mikey" <[EMAIL PROTECTED]>
> To: "'Diana Castillo'" <[EMAIL PROTECTED]>
> Sent: Thursday, February 17, 2005 1:32 PM
> Subject: RE: [PHP] FOPEN
> 
> 
> >>    How can I read the contents of a web page that uses basic
> >> authentication?
> >> I want to use fopen() but dont know how to do this and also
> >> send the username and password
> >
> > I don't know exactly what they are, but it should just be a case of 
> > sending
> > the correct HTTP headers at the start of your request
> > http://www.w3.org/Protocols/#Specs should give you the 
> information you
> > need...
> >
> > HTH,
> >
> > Mikey
> > 
> 
> 

--- End Message ---
--- Begin Message ---
dear Sirs,

I am running a script which is on the remote server. I do not want to wait
output of that script, when I run my script. Because some time, other script
takes a long time to complete job. I just want to run other script.

I used following curl option but still my script grap other script outputs.

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 0);

What I should to do?



any idea

--- End Message ---
--- Begin Message ---
can u help me to use $_SERVER['remote_addr'] to find the IP address ?
i am new to php. i also want to find what page of my site he is viewing ?

--- End Message ---
--- Begin Message ---
On Thu, 2005-02-17 at 19:11 +0530, K Karthik wrote:
> > can u help me to use $_SERVER['remote_addr'] to find the IP address ?
> > i am new to php. i also want to find what page of my site he is viewing ?
> 

print_r($_SERVER);

what do you see?



-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
****************************************/

--- End Message ---
--- Begin Message ---
Hello...

Someone knows how this work ?
use_soap_error_handler

I search a way to handle SoapFault exceptions from the SoapServer class...

Regards

FENDT Charles
--- End Message ---
--- Begin Message --- FENDT Charles wrote:
Hello...

Someone knows how this work ?
use_soap_error_handler

I don't have a clue but looking at the docs you have at least 2 other ways of handling SOAP errors:

1. http://php.paradoxical.co.uk/manual/en/function.is-soap-fault.php
2. use a try/catch block

try {
        // do some SOAP stuff here
}
catch (SoapFault $e) {
        // catch SOAP specific exceptions here
}
catch (Exception $e) {
        // catch general exceptions
}


I DO NOT KNOW what the classname of the Soap Exception assuming SoapServer does not just throw std Exceptions... so I guessed that it might be called SoapFault.... the manual seems to indicate that this is correct.

HTH - (I just figured out wtf HTH means :-)


I search a way to handle SoapFault exceptions from the SoapServer class...

Regards

FENDT Charles


--- End Message ---
--- Begin Message --- Jochem Maas a écrit :
FENDT Charles wrote:

Hello...

Someone knows how this work ?
use_soap_error_handler


I don't have a clue but looking at the docs you have at least 2 other ways of
handling SOAP errors:


1. http://php.paradoxical.co.uk/manual/en/function.is-soap-fault.php

is_soap_fault is only for SoapClient...

2. use a try/catch block

try {
    // do some SOAP stuff here
}
catch (SoapFault $e) {
    // catch SOAP specific exceptions here
}
catch (Exception $e) {
    // catch general exceptions
}

and "try" catch nothing !!!

just an exmple :

<?php
echo "begin\n";
$server = new SoapServer(null, "http://test/";);
try {
  $server->handle("");
} catch (Exception $e) {
  echo "ERROR\n";
}
echo "end\n";
?>

:-(

that's why y search some stuff over use_soap_error_handler
Is the solution there ???

FENDT Charles



I DO NOT KNOW what the classname of the Soap Exception assuming SoapServer
does not just throw std Exceptions... so I guessed that it might be called
SoapFault.... the manual seems to indicate that this is correct.

HTH - (I just figured out wtf HTH means :-)


I search a way to handle SoapFault exceptions from the SoapServer class...


Regards

FENDT Charles


--- End Message ---
--- Begin Message --- FENDT Charles wrote:
Jochem Maas a écrit :

FENDT Charles wrote:

Hello...

Someone knows how this work ?
use_soap_error_handler



I don't have a clue but looking at the docs you have at least 2 other ways of
handling SOAP errors:


1. http://php.paradoxical.co.uk/manual/en/function.is-soap-fault.php


is_soap_fault is only for SoapClient...

ah, ok, sorry.


2. use a try/catch block

try {
    // do some SOAP stuff here
}
catch (SoapFault $e) {
    // catch SOAP specific exceptions here
}
catch (Exception $e) {
    // catch general exceptions
}


and "try" catch nothing !!!

just an exmple :

<?php
echo "begin\n";
$server = new SoapServer(null, "http://test/";);
try {
  $server->handle("");
} catch (Exception $e) {
  echo "ERROR\n";
}
echo "end\n";
?>

I can't test this (no machine with the SOAP extension + lack of time + less than stellar skills when it comes to compiling stuff :-)

I am wondering what the return value of $server->handle() is, maybe
you will have to check the return value to see if an error occurs.


:-(

that's why y search some stuff over use_soap_error_handler
Is the solution there ???

FENDT Charles



I DO NOT KNOW what the classname of the Soap Exception assuming SoapServer
does not just throw std Exceptions... so I guessed that it might be called
SoapFault.... the manual seems to indicate that this is correct.


HTH - (I just figured out wtf HTH means :-)


I search a way to handle SoapFault exceptions from the SoapServer class...


Regards

FENDT Charles



--- End Message ---
--- Begin Message --- Jochem Maas a écrit :
FENDT Charles wrote:

Jochem Maas a écrit :

FENDT Charles wrote:

Hello...

Someone knows how this work ?
use_soap_error_handler




I don't have a clue but looking at the docs you have at least 2 other ways of
handling SOAP errors:


1. http://php.paradoxical.co.uk/manual/en/function.is-soap-fault.php



is_soap_fault is only for SoapClient...


ah, ok, sorry.


2. use a try/catch block

try {
    // do some SOAP stuff here
}
catch (SoapFault $e) {
    // catch SOAP specific exceptions here
}
catch (Exception $e) {
    // catch general exceptions
}



and "try" catch nothing !!!

just an exmple :

<?php
echo "begin\n";
$server = new SoapServer(null, "http://test/";);
try {
  $server->handle("");
} catch (Exception $e) {
  echo "ERROR\n";
}
echo "end\n";
?>


I can't test this (no machine with the SOAP extension + lack of time +
less than stellar skills when it comes to compiling stuff :-)

I am wondering what the return value of $server->handle() is, maybe
you will have to check the return value to see if an error occurs.

void ... :-(

void SoapServer::handle([string])
no exception...

in 2 words... NO INFORMATION on what happened

FENDT Charles


:-(

that's why y search some stuff over use_soap_error_handler
Is the solution there ???

FENDT Charles



I DO NOT KNOW what the classname of the Soap Exception assuming SoapServer
does not just throw std Exceptions... so I guessed that it might be called
SoapFault.... the manual seems to indicate that this is correct.


HTH - (I just figured out wtf HTH means :-)


I search a way to handle SoapFault exceptions from the SoapServer class...


Regards

FENDT Charles



--- End Message ---
--- Begin Message ---
FENDT Charles wrote:

...

just an exmple :

<?php
echo "begin\n";
$server = new SoapServer(null, "http://test/";);
try {
  $server->handle("");
} catch (Exception $e) {
  echo "ERROR\n";
}
echo "end\n";
?>



I can't test this (no machine with the SOAP extension + lack of time + less than stellar skills when it comes to compiling stuff :-)

I am wondering what the return value of $server->handle() is, maybe
you will have to check the return value to see if an error occurs.


void ... :-(

void SoapServer::handle([string])
no exception...

in 2 words... NO INFORMATION on what happened

have you tried setting a handler function for the SoapServer, before calling SoapServer::handle() ?:

function test($v) { var_dump($v); }

$server->addFunction("test");

if you do that do you get any output? if not then I'm really no more help to
you... you next best bet is to dive into CVS and check the test scripts (if 
there are any),
unpublished documentation/examples (if there are any) and the source code (if 
it means
anything to you.)

if all that fails you might consider going higher up the PHP foodchain
and mailing the maintainer/list politely asking whether there maybe a problem - 
if you
do decide to mail the maintainer  or internals or something - be polite, 
apologetic, consise
and make sure you detail your problem fully - they are all busy people and you 
want to
maximise the chance of getting a useful reply :-).



FENDT Charles

...

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

What is the best way to do this?  I have two arrays:

$cars=array("ford","chevy");
$models=array("ford"=>array("ranger","escape"),"chevy"=>array("malibu","tahoe"));

then I need to traverse both arrays:

   foreach ($cars as $car){
                   //now I need to get into the models array and echo out all 
of the
models that
                 //coincide with the specific car so it should print
out ford-ranger
                //I basically want to do this but can't
               //how can I get into this second array without looping
through the whole thing each time?
   foreach($cars[$car] as $model){
          
              }

                  }

Thanks!

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

What is the best or right way to compare users name and password given in a 
web form to data in mysql database?

I saw one example where sql SELECT query was made with username and password 
as WHERE and the script tested how many rows was returned from database if 
there was 1 row returned the login was accepted.

Is there other ways to do this? What if the usertable has more than these 2 
columns.

Thanks
-Will 

--- End Message ---

Reply via email to