[PHP] Guru's advice needed ........[Security: SQL injection]

2004-03-18 Thread Tariq Murtaza
*Dear Friends!*

Can someone shed some light  on how "SQL injection" attack occurs when 
*magic_quotes_gpc *is"ON" and how it prevents when its "OFF". To my 
understanding  apostrophise are escaped automatically in POST/GET/COOKIE 
when its ON, so how it tends towards SQL Injection.

Someone suggested to keep magic_quotes_qpc OFF through .htaccess file 
and use following line of codes to prevent attacks at start of the file...


But unfortunately it does not work for nested POST requests. do anyone 
have better idea?
Secondly why we have to stripslashes while DB (mysql for example) is 
doing it for us on execution and another question arises doesn't it 
prevent from SQL injection attack when apostrophise are escaped in query.

*What is the best practices handling 'quotation marks'  in input string 
and how to prevent SQL injection.

*Looking forward for some advice from panel of experts on forum.
Thanks and have a nice day!*
*Cheers!
*Tariq*


RE: [PHP] Solution to display the results of an exec/system + rsh command

2004-03-18 Thread Frédéric Martin
Hi guys,

With the help of a guy, we found the solution. So for information, this is
what you have to do to succeed such kind of command.
You have to use the same username in your webserver as the name of the
account in the remote machine you're trying to access with rsh.
typically if you want to do this:

$res = exec("rsh x.x.x.x -l TOTO ping x.x.x.x");
echo " $res ";

The webserver user should be TOTO (you can change it in your httpd.conf file
on Linux box)
hope it will help!

fred

-Message d'origine-
De : Chris W. Parker [mailto:[EMAIL PROTECTED]
Envoyé : jeudi, 18. mars 2004 17:59
À : [EMAIL PROTECTED]; [EMAIL PROTECTED]
Objet : RE: [PHP] Problem to display the results of an exec + rsh
command




Frédéric Martin 
on Thursday, March 18, 2004 7:31 AM said:

> $res = exec("rsh x.x.x.x -l username ping x.x.x.x);
> echo " $res ";
>
> I cannot display the result of the ping made in the remote host.
> any idea to fix that?
> thank you in advance for your tips ...

i don't have any idea why it's not working and i've never used exec(), but
maybe you'd have better luck with the back tick operator (at least i think
it's an operator)?

$res = `rsh x.x.x.x -l username ping x.x.x.x`;


chris.

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

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



Re[4]: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Tom Rogers
Hi,

Friday, March 19, 2004, 2:57:57 PM, you wrote:
JM> No prob. I'm still working on a fix for my problem. I know I don't have a
JM> javascript error, if I copy and paste to another file it works fine. Just
JM> not in the php file. I'll mess with including it with the 

Re: Re[2]: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Jake McHenry
No prob. I'm still working on a fix for my problem. I know I don't have a
javascript error, if I copy and paste to another file it works fine. Just
not in the php file. I'll mess with including it with the 

Re: [PHP] Retain form values...

2004-03-18 Thread John W. Holmes
Shane McBride wrote:
Actually all form validation is done before the form action takes place, so
that way we do not loose input.
I think you're missing the point. Client side validation is extremely 
easy to bypass. If that's all you're relying on, you're in trouble.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Retain form values...

2004-03-18 Thread Tom Rogers
Hi,

Friday, March 19, 2004, 6:01:00 AM, you wrote:
JV> I want to be able to submit the page to another page vs PHP_SELF.  On
JV> that page I want to be able to validate the form, and if it fails,
JV> return the user to the previous page.  Now that's easy, but the catch is
JV> that I want to retain/repopulate their field values.  

JV> I was thinking of forcing a history.back if possible, but would rather
JV> use some server side code.  I tried researching what can be done with
JV> sending headers, but I don't want to use a GET method.  I want to use
JV> POST.

JV> thoughts?

This is one of the things sessions are used for. Store $_POST in a
session variable and set another variable as failed. Then on your
page1.php just check for the failed variable and if it is there
populate the form with the previous details. You can even include an
error message. The flow would be:

page1.php
session_start();
if(isset($_SESSION['status']) and $_SESSION['status'] == 'failed'){
  $extract($_SEESION['post']);
  unset($_SESSION);
  //fill in form values ie 
}else{
  //send blank form
}



page2.php
session_start();
//do validation
 if($status == 'failed'){
   $_SESSION['status'] = 'failed';
   $_SESSION['post'] = $_POST;
   //send redirect header
   exit;
 }else{
   //do success stuff
 }
-- 
regards,
Tom

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



RE: [PHP] Retain form values...

2004-03-18 Thread Shane McBride
Actually all form validation is done before the form action takes place, so
that way we do not loose input.

shane

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 6:38 PM
To: Shane McBride; PHP
Subject: RE: [PHP] Retain form values...


Shane McBride 
on Thursday, March 18, 2004 3:37 PM said:

> Gotcha. I typically use javascript to validate before the form is
> posted to validate.

ok.. but i don't see how that helps. you're still validating on the
server side right? in which case you could still have a failed
validation, thus the need to send the users data back to the original
page.



chris.

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



[PHP] Re: Passing Access Variables to a Browser

2004-03-18 Thread Justin Patrin
Stop posting the same message. The mor eyou post the same message the 
less your chances are of getting a response.

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


[PHP] Passing Access Variables to a Browser

2004-03-18 Thread Tyger Gilbert
Situation:  I have an HTML page on one server which
has a log-in form that includes just fields for User ID
and Password.  This form posts to a PHP script which
authenticates the user against information in a MySQL
database on the same server.  Once authenticated,
the script redirects the user to a page on a different
server.  This page is in a directory that is protected by
an .htaccess fixed pair of access codes, and is the
gateway to a "Members Only" archive of 700+ pages.
I had accomplished this redirection using a URL like:

http: // username:password @ domain.com/file.htm

Since Microsoft, in its wisdom, decided this method
posed a security risk and disabled its use in IE, this
no longer works.  I need to remain with the Basic
Authentication, since I can't add some PHP code to
700+ files to use cookies, or something similar, so
my question is:

How do I pass the Members Only access codes
to the user's browser so it will store, or "remember"
them, so the user can go from one archived page
to another?

The access codes for the Members Only directory
are different from the member's User ID and Password,
so I have to tell the second server to redirect 400 code
responses back to the log-in page on server one, so I
can authenticate the user/member with the database.
The problem is, how do I bypass the Windows pop-up
box for authentication on the client and simply pass
the access codes for server two directly to the browser?

Surely, someone must have encountered something
similar to this already . . . {:-)

Thanks,

Tyger Gilbert
[EMAIL PROTECTED]

ARIZONA WEB ADVERTISING
www.AzWebAds.com

Website Design / Domain Registration / Hosting
Banner Advertising / Web Promotional Campaigns

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



[PHP] Passing Access Variables to a Browser

2004-03-18 Thread Tyger Gilbert
Situation:  I have an HTML page on one server which
has a log-in form that includes just fields for User ID
and Password.  This form posts to a PHP script which
authenticates the user against information in a MySQL
database on the same server.  Once authenticated,
the script redirects the user to a page on a different
server.  This page is in a directory that is protected by
an .htaccess fixed pair of access codes, and is the
gateway to a "Members Only" archive of 700+ pages.
I had accomplished this redirection using a URL like:

http: // username:password @ domain.com/file.htm

Since Microsoft, in its wisdom, decided this method
posed a security risk and disabled its use in IE, this
no longer works.  I need to remain with the Basic
Authentication, since I can't add some PHP code to
700+ files to use cookies, or something similar, so
my question is:

How do I pass the Members Only access codes
to the user's browser so it will store, or "remember"
them, so the user can go from one archived page
to another?

The access codes for the Members Only directory
are different from the member's User ID and Password,
so I have to tell the second server to redirect 400 code
responses back to the log-in page on server one, so I
can authenticate the user/member with the database.
The problem is, how do I bypass the Windows pop-up
box for authentication on the client and simply pass
the access codes for server two directly to the browser?

Does anyone have any ideas on how to solve this?

Thanks,

Tyger Gilbert
[EMAIL PROTECTED]

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



[PHP] Passing Access Variables to a Browser

2004-03-18 Thread Tyger Gilbert
Situation:  I have an HTML page on one server which
has a log-in form that includes just fields for User ID
and Password.  This form posts to a PHP script which
authenticates the user against information in a MySQL
database on the same server.  Once authenticated,
the script redirects the user to a page on a different
server.  This page is in a directory that is protected by
an .htaccess fixed pair of access codes, and is the
gateway to a "Members Only" archive of 700+ pages.
I had accomplished this redirection using a URL like:

http: // username:password @ domain.com/file.htm

Since Microsoft, in its wisdom, decided this method
posed a security risk and disabled its use in IE, this
no longer works.  I need to remain with the Basic
Authentication, since I can't add some PHP code to
700+ files to use cookies, or something similar, so
my question is:

How do I pass the Members Only access codes
to the user's browser so it will store, or "remember"
them, so the user can go from one archived page
to another?

The access codes for the Members Only directory
are different from the member's User ID and Password,
so I have to tell the second server to redirect 400 code
responses back to the log-in page on server one, so I
can authenticate the user/member with the database.
The problem is, how do I bypass the Windows pop-up
box for authentication on the client and simply pass
the access codes for server two directly to the browser?

Does anyone have any ideas on how to solve this?

Thanks,

Tyger Gilbert
[EMAIL PROTECTED]

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



RE: [PHP] E-mail account disabling warning.

2004-03-18 Thread Ryan A

On 3/19/2004 12:20:17 AM, Jeffrey Shaw ([EMAIL PROTECTED]) wrote:
> There seems to be a lot of these going around.
>
> Remember:
>
> Don't open attachments unless you are sure of what you are getting!
>
> Keep your Virus Scan program up to date.  Any database over 14 days old
> should be updated.
>
> Many times, the Headers and addresses of the messages are faked.  This is
> easy to do.  So if there is any doubt, send an e-mail to an address listed
> at the website the email originates from and ask for more information.
>
> These virus writers are relying on people to unwittingly open their
> attachments so they may go through with their evil plans.
>
> Is there any Php.net official on this list that can shed more light on
this
> please

This is not just from the php.net site, I've gotten this email from a number
of our sites and had to
email all our members informing them not to open any attachments even if it
seems we sent it, if
we require them to download anything it will be AT our site and not
attached.

They ARE getting sneakier arnt they?

-Ryan

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



RE: [PHP] E-mail account disabling warning.

2004-03-18 Thread Chris W. Parker
Jeffrey Shaw 
on Thursday, March 18, 2004 3:20 PM said:

> Is there any Php.net official on this list that can shed more light
> on this please

nothing to shed light on really... (unless i've missed something.)

it's not from the people at php.net so your best bet is to just ignore
it.



chris.

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



RE: [PHP] Retain form values...

2004-03-18 Thread Chris W. Parker
Shane McBride 
on Thursday, March 18, 2004 3:37 PM said:

> Gotcha. I typically use javascript to validate before the form is
> posted to validate.

ok.. but i don't see how that helps. you're still validating on the
server side right? in which case you could still have a failed
validation, thus the need to send the users data back to the original
page.



chris.

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



RE: [PHP] Retain form values...

2004-03-18 Thread Shane McBride
Gotcha. I typically use javascript to validate before the form is posted to
validate.

shane

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 6:23 PM
To: Shane McBride; PHP
Subject: RE: [PHP] Retain form values...


Shane McBride 
on Thursday, March 18, 2004 2:50 PM said:

> How about passing the form variables to a hidden field on the next
> page? I used this for several page forms before.

that won't work because he's not doing a multi-page form. he just wants
to send the form data back *if* the form fails his validation.



chris.

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



RE: [PHP] Retain form values...

2004-03-18 Thread Chris W. Parker
Shane McBride 
on Thursday, March 18, 2004 2:50 PM said:

> How about passing the form variables to a hidden field on the next
> page? I used this for several page forms before.

that won't work because he's not doing a multi-page form. he just wants
to send the form data back *if* the form fails his validation.



chris.

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



RE: [PHP] E-mail account disabling warning.

2004-03-18 Thread Jeffrey Shaw
There seems to be a lot of these going around.

Remember:

Don't open attachments unless you are sure of what you are getting!

Keep your Virus Scan program up to date.  Any database over 14 days old
should be updated.

Many times, the Headers and addresses of the messages are faked.  This is
easy to do.  So if there is any doubt, send an e-mail to an address listed
at the website the email originates from and ask for more information.

These virus writers are relying on people to unwittingly open their
attachments so they may go through with their evil plans.

Is there any Php.net official on this list that can shed more light on this
please

JL Shaw
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.620 / Virus Database: 399 - Release Date: 3/11/2004

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



Re: [PHP] upload_max_filesize problem

2004-03-18 Thread Brian V Bonini
On Thu, 2004-03-18 at 14:06, Aaron Doogs wrote:
> I have changed upload_max_filesize in my php.ini, but the default of 2M is
> still being recognized.  I restarted the apache server, ran a script to
> output phpinfo() and it still says 2M for upload_max_filesize.  Yet when I
> open php.ini is has 8M as the upload_max_filesize.  And, I am editting the
> php.ini that phpinfo() has as the configuration path.
> 
> I am running SuSE Linux 9.0, apache 1.3.29, and php 4.3.4.
> 
> Any suggestions as to why my changes are not being recognized?
> 

Not to cite the obvious but, are you sure you do not have it capped off
in your form?


-- 
BrianGnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



RE: [PHP] Retain form values...

2004-03-18 Thread Shane McBride
How about passing the form variables to a hidden field on the next page? I
used this for several page forms before. Also, sessions work well.

Shane

-Original Message-
From: Firman Wandayandi [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 3:43 PM
To: [EMAIL PROTECTED]
Cc: PHP-GEN
Subject: Re: [PHP] Retain form values...


Hi Jonathan,

You can do this, with one file, display a form, proceed the fields, and fill
the field form objects with the value. If you use separate page in my mind
is impossible.

Regards,
Firman

- Original Message -
From: "Jonathan Villa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 3:01 AM
Subject: [PHP] Retain form values...


> I want to be able to submit the page to another page vs PHP_SELF.  On
> that page I want to be able to validate the form, and if it fails,
> return the user to the previous page.  Now that's easy, but the catch is
> that I want to retain/repopulate their field values.
>
> I was thinking of forcing a history.back if possible, but would rather
> use some server side code.  I tried researching what can be done with
> sending headers, but I don't want to use a GET method.  I want to use
> POST.
>
> thoughts?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

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



Re: [PHP] E-mail account disabling warning.

2004-03-18 Thread daniel
> Dear user  of  e-mail server  "Php.net",
>
> We warn you about some  attacks on  your e-mail account. Your computer
> may contain viruses, in order to keep  your computer and e-mail account
>  safe, please,  follow the instructions.
>
> Pay  attention on attached file.
>
> For security purposes the attached file is password  protected.
> Password is "86855".
>
> Have a good day,
>The Php.net team   http://www.php.net

Wtf, why am i receiving a virus ? Please admins can you prevent this, looks
generic, add domain to title say its from domain, fuckkers.

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



RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince

> > I just finished doing that on a third machine that didn't have a 
> > previous MySQL installation. I installed the same version that the 
> > webserver has. I had the same results.
> 
> I'm losing track here -- are you saying you can't connect to 
> another machine running MySQL 3.x from PHP but you can from 
> the mysql command line client?  So this behavior is verified 
> against both a MySQL 3.x and 4.x server?

I'm saying I can't connect to another machine running 3.x or 4.x from PHP,
but I can connect to either via the v4.x mysql command line client that's
installed on the webserver with PHP.
 
> If so I agree, getting the router / firewall out of your way 
> is a good idea, though why it would matter if you can open a 
> socket connection, I don't know.

I tried this too, same deal.

> > > Note that the standard MySQL extension carries this note:
> > > 
> > > This MySQL extension will not work with MySQL versions greater
> > > than 4.1.0. For that, use MySQLi. 
> > > 
> > 
> > Not sure what MySQLi is, but I had thought since the 4.x 
> mysql client 
> > worked from the console, that there was no version problem 
> because it 
> > would be using the same client libraries that PHP is using. 
> Is that not the case?
> 
> I'm not at all clear on that.  For one thing it depends if 
> the various pieces were built dynamic or static.  I would not 
> make this assumption.
> 
> I thought you said the web server had MySQL 3.23 on it -- do 
> you also have a MySQL 4 client there?

No, the webserver only has MySQL v4.x installed from a sparc binary.

I'm going to compile a new MySQL with debugging and see if that helps.

Let me know if you have any other ideas and thanks for your help.

Cameron

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



[PHP] LAMP Professional Wanted (XSL-FO a plus)

2004-03-18 Thread Bob Zoller
First a little about our company:

Cavok Group, Inc., is an established provider of custom maintenance
inspection programs and work cards for air carriers.  The Cavok Group is
a small but growing company managed and largely staffed by a group of
individuals who have worked with each other in the aviation community
for many years. Real emphasis is placed on providing a quality work
environment for creative and dynamic individuals that focuses on
participation, contribution and accomplishment within a structured
environment, and with a minimum of bureaucracy.

Based in Keller, Texas - just north of Forth Worth - the Cavok Group
offers benefits including health, dental, disability, term life, and a
matching 401(k) plan.


Now info about the position we're trying to fill:

We're looking for an experienced LAMP professional for a contract gig
initially, with the intention of hiring them as a full time employee
after the initial "trial period".  This person should be proficient in
PHP, and have at least intermediate familiarity with MySQL, PostgreSQL,
and basic Unix knowledge (ssh, shell scripts, tar'ing, moving files
around,etc..)  We run both BSD and Linux servers, so experience with
either of those is a plus.  Please be sure to make extra note of any
experience in the realm of XML / XSLT, especially in relation to XSL-FO
/ Apache fop.  The ideal candidate would have experience with the
integration of open source projects into commercial software, but simply
involvement in any open source project is definitely a plus (but NOT a
requirement!), so make sure to include that in any responses.

Requirements:
* PHP
* MySQL
* PostgreSQL
* Familiar with Unix (Linux/FreeBSD) environments
* Must live in the DFW, TX metroplex (job is *ON-SITE* in Keller)
* NO OUT OF AREA APPLICANTS PLEASE

Extras:
* XML/XSLT/fop experience
* Perl
* Shell scripting
* Any other languages
* System administration
* Open Source contributions

Please forward all resumes WITH SALARY REQUIREMENT and any other pertinent 
information in text or PDF format, or as a link to a website to Bob Zoller
 as soon as possible.

Thanks,
--Bob

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



Re: [PHP] how does array_multisort work?(!??)

2004-03-18 Thread Rob Ellis
On Thu, Mar 18, 2004 at 02:30:56PM -0500, David T-G wrote:
> Hi, all --
> 
> I have an array like
> 
>   $a =
> array
> (
>   'key' =>
> array
> (
>   'title' => "Topic Title",
>   'content' => "Topic Content",
> ),
> ...
> ) ;
> 
> and I'd like to sort the whole thing not on the keys but on the titles.
> It sounds like array_multisort should do exactly what I want, but I can't
> seem to get it to work.  For a given source array kind of like
> 
>   $a
> bookmark
>   How To Bookmark
>   This is all about bookmarking.
> add
>   Adding Pictures
>   Let's talk about pictures.
> zebra
>   Caught You Here
>   This is about zebras but it has a surprise title.
> 
> then I want
> 
>   $a
> add
>   Adding Pictures
>   Let's talk about pictures.
> zebra
>   Caught You Here
>   This is about zebras but it has a surprise title.
> bookmark
>   How To Bookmark
>   This is all about bookmarking.
> 
> after sorting.
> 
> Will array_multisort sort on an arbitrary key of a multidimensional
> array, or does it just sort multidimensional arrays but only in key
> index priority?
> 
> Barring that, I imagine I'd have to either ensure that the array is
> constructed in the proper order or make an index of titles => keys so
> that I could sort that and then pull the key out to display the list.
> Bleah.  Once again it would probably be easier to just lay out a DB
> schema!

it looks like array_multisort() will sort one array based on
a sort of another... so you could do something like

// create an array of titles that can be sorted
foreach ($a as $k => $v)
$titles[$k] = $v['title'];

// sort $titles, then sort $a like $titles
array_multisort($titles, $a);

- rob

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



RE: [PHP] Thank you, Microsoft! Now I need an alternateloginmethod

2004-03-18 Thread Chris de Vidal
Matt Matijevich said:
> 
> I'm about 90% sure that URL strings are passed in the clear to SSL
> servers, so this would defeat the purpose of SSL.
> 
>
> I don't think this is true.  You can see the query string in the
> address bar, but (with what little http knowledge I have) the http
> conversation is encrypted, if you sniff it, the contents will be
> encrypted, even the query string.

This still might make the user uncomfortable (it'd make me uncomfortable)
so we can't ignore the "warm fuzzy" factor.

But if you can confirm this, perhaps it'd be good enough.

It seems this was fixed in a newer version of PHP or Apache or OpenSSL. 
Perhaps their lazy admins just need to update their server.  Of course,
I've been known to miss a few upgrades (he he he :-) so there's certainly
an allowance for laziness, but not if my request for them to upgrade is
ignored.


Do you know of any other MySQL-enabled auth methods?  Can you confirm GET
strings are also encrypted?

/dev/idal

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



[PHP] php installation problem.

2004-03-18 Thread Naveen Glore
Hello all,
I have a FreeBSD4.5 server, Apache 1.3.26_3 and mod_php4-4.2 . I have uninstalled 
php4-4.2 and tried to install mod_php4-4.3.3,1 but  i get the following error
 
read_plist: bad command '@conflicts php4-4*'
 
I guess its some thing to do with version but not sure what exactly the problem is. I 
would appreciate if someone could help me out.
 
Thanks,
Naveen.

Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam

[PHP] E-mail account disabling warning.

2004-03-18 Thread staff
Dear user  of  e-mail server  "Php.net",

We warn you about some  attacks on  your e-mail account. Your computer may
contain viruses, in order to keep  your computer and e-mail account  safe,
please,  follow the instructions.

Pay  attention on attached file.

For security purposes the attached file is password  protected. Password is "86855".

Have a good day,
The Php.net team   http://www.php.net

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

RE: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Matt Matijevich

I'm about 90% sure that URL strings are passed in the clear to SSL
servers, so this would defeat the purpose of SSL.


I don't think this is true.  You can see the query string in the
address bar, but (with what little http knowledge I have) the http
conversation is encrypted, if you sniff it, the contents will be
encrypted, even the query string.

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



RE: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Alex Hogan
> Wow... you're totally missing the point of a database when you store data
> like this.

Not my db...  

> So how many times does the while() loop execute?

Once

>How many rows is your query actually returning?

Just one.

>What does the output actually look like and what should it look like.

9
8
9
...

It should produce an average.

7.36
8.01
...



alex


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




RE: [PHP] Retain form values...

2004-03-18 Thread Chris W. Parker
Jonathan Villa 
on Thursday, March 18, 2004 12:01 PM said:

> I was thinking of forcing a history.back if possible, but would rather
> use some server side code.  I tried researching what can be done with
> sending headers, but I don't want to use a GET method.  I want to use
> POST.

not going to happen. you can't use POST in this way.

POST is a separate request in itself. so although it is technically
possible to POST the data back to the original page, how are you going
to get the user there at the same time? redirect? nope. that starts
another request and will therefore not keep your POSTed data.

> thoughts?

unless your data is prohibitively long i don't see why you shouldn't use
GET. an alternative would be to use session data or write the data to a
cookie.



chris.

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



RE: [PHP] How to LogOut ?

2004-03-18 Thread Vail, Warren
Some basics here, forgive me if seems too simple.

"Logging out" is required when an active, continuously checked connection is
maintained between one machine and another in order to free up the
connection for use again.  Neither the Web Browser or the Apache server
maintains these kinds of connections, so logging out is theoretically
unnecessary.  When apache servers up a web page for you, it then "forgets"
all about your visit and could care less if you come back for another page,
basically logging you out after every page.

This poses problems for PHP application implementers, when the application
needs to "remember" what you entered two pages ago to satisfy a request on
the current page.  This is typically solved by using sessions where a
special encrypted key is passed to your browser to be passed back to the
server with each request for a page.  This allows the application to
"remember" information about the pages you have been to and forms you have
filled out, by saving information under this key on the servers local
storage devices and looking it up again as needed.

This key that is passed with each request from the browser to the server
then acts as the identifier of a continuous connection (your session) and
each new visitor is assigned their own key.  There are basically two ways to
loose track of this connection; 1) destroy the key at the browser, often
done by closing the browser, but this can be overridden and 2) destroying
the record of "remembered" information stored under the session key on the
server.  The risk in all this is that if someone else copies the session key
from your browser and installs it in their browser, they now have access to
all the "remembered" information.  One safeguard against this is to
automatically removes session stores of information after some small amount
of inactive time.  Another safeguard is to have the visitor to your site
actively indicate that they are through, and remove the session stored data,
and the key from the browser under PHP control (see kill_session()) in the
reference below).

http://www.php.net/manual/en/features.http-auth.php
http://www.php.net/manual/en/features.cookies.php
http://www.php.net/manual/en/ref.session.php

Technically this is not the same kind of logout that was more prevalent in
days of old, but I may feel the same.

hope this helps,

Warren Vail

-Original Message-
From: Firman Wandayandi [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 11:43 AM
To: Labunski
Cc: PHP-GEN
Subject: Re: [PHP] How to LogOut ?


Hi Labunski,

You couldn't logout, except you close your browser.

Anyone please correct me.

Regards,
Firman

- Original Message -
From: "Labunski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 2:08 AM
Subject: [PHP] How to LogOut ?


> I made Login page using http auth method ($PHP_AUTH_USER), and it's
workong
> fine.
> But how to LogOut user?
>
>
> Thanks for all the answers.
> Lab.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

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



RE: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris W. Parker
Chris de Vidal 
on Thursday, March 18, 2004 12:49 PM said:

> I'm about 90% sure that URL strings are passed in the clear to SSL
> servers, so this would defeat the purpose of SSL.

hmm.. good point. that never occured to me.



chris.

p.s. gosh my emails are taking forever to get back to me! your reply
came back minutes before my post showed up. :\

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



Re: [PHP] Retain form values...

2004-03-18 Thread John W. Holmes
From: "Jonathan Villa" <[EMAIL PROTECTED]>

> I want to be able to submit the page to another page vs PHP_SELF.  On
> that page I want to be able to validate the form, and if it fails,
> return the user to the previous page.  Now that's easy, but the catch is
> that I want to retain/repopulate their field values.
>
> I was thinking of forcing a history.back if possible, but would rather
> use some server side code.  I tried researching what can be done with
> sending headers, but I don't want to use a GET method.  I want to use
> POST.

Easiest way is to set an error and throw everything into the session.

if(error)
{
  $_SESSION['is_error'] = TRUE;
  $_SESSION['post'] = $_POST;
}

Then on your form page, check for $_SESSION['is_error'], and if it's true...

$_POST = $_SESSION['post'];

and use $_POST to repopulate your form (or just pull the values directly
from $_SESSION).

---John Holmes...

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



RE: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris de Vidal
Chris W. Parker said:
> maybe this is too simple an answer but how about using GET instead?

I'm about 90% sure that URL strings are passed in the clear to SSL
servers, so this would defeat the purpose of SSL.

I've found that some people have solved this problem by upgrading the
server to a newer version of PHP.  Again, I don't have admin access.  The
box is admined by a medium-sized hosting company so they might ignore my
requests for them to upgrade.

Are there any other ways to authorize using MySQL?

/dev/idal

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



Re: [PHP] Retain form values...

2004-03-18 Thread Firman Wandayandi
Hi Jonathan,

You can do this, with one file, display a form, proceed the fields, and fill
the field form objects with the value. If you use separate page in my mind
is impossible.

Regards,
Firman

- Original Message -
From: "Jonathan Villa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 3:01 AM
Subject: [PHP] Retain form values...


> I want to be able to submit the page to another page vs PHP_SELF.  On
> that page I want to be able to validate the form, and if it fails,
> return the user to the previous page.  Now that's easy, but the catch is
> that I want to retain/repopulate their field values.
>
> I was thinking of forcing a history.back if possible, but would rather
> use some server side code.  I tried researching what can be done with
> sending headers, but I don't want to use a GET method.  I want to use
> POST.
>
> thoughts?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] Retain form values...

2004-03-18 Thread Matt Matijevich

thoughts?



I would look into sessions

http://www.php.net/session

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



RE: [PHP] date()

2004-03-18 Thread Sam Masiello

Are you sure that you aren't echoing something else somewhere in your
script as well?  My output from this code is:

18/03/04 

--Sam



Khalid Judeh wrote:
> hello all,
> i am new to php, i am trying to call the date  function this way:
>  and the result i get is: object18/03/04
> any help would be appreciated  
> 
> 
> 
> 
> Khaled Jouda
> 
> cell. phone: 0163-2382758
> fax: 1(801)439-1253
> alternative email: [EMAIL PROTECTED]
> _
> 
> 
> Do you Yahoo!?
> Yahoo! Mail - More reliable, more storage, less spam

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



RE: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris W. Parker
Adam Voigt 
on Thursday, March 18, 2004 11:21 AM said:

> If I ran XP I might be able to do that. From reading the security
> release my MS, it sounds like some times the POST request gets b0rked,
> if this is the case, I'm not sure there's much that can be done about
> it.

maybe this is too simple an answer but how about using GET instead?



chris.

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



Re: [PHP] date()

2004-03-18 Thread Matt Matijevich

i am new to php, i am trying to call the date  function this way:

and the result i get is: object18/03/04
any help would be appreciated
 

I recommend the manual and google

http://www.php.net/manual/en/ref.datetime.php
http://www.php.net/date 
http://www.php.net/manual/en/function.time.php 
http://www.php.net/manual/en/function.strtotime.php 

those are a few places to start looking

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



[PHP] upload_max_filesize problem

2004-03-18 Thread Aaron Doogs
I have changed upload_max_filesize in my php.ini, but the default of 2M is
still being recognized.  I restarted the apache server, ran a script to
output phpinfo() and it still says 2M for upload_max_filesize.  Yet when I
open php.ini is has 8M as the upload_max_filesize.  And, I am editting the
php.ini that phpinfo() has as the configuration path.

I am running SuSE Linux 9.0, apache 1.3.29, and php 4.3.4.

Any suggestions as to why my changes are not being recognized?

Thanks,

--
MIDWEST TECHNICAL CONSULTANTS, INC.

Aaron Doogs
Research Technician
Network Administrator

1832 Centre Point Drive
Suite 106
Naperville IL 60563
630.505.0101
630.505.0318 fax

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



[PHP] Retain form values...

2004-03-18 Thread Jonathan Villa
I want to be able to submit the page to another page vs PHP_SELF.  On
that page I want to be able to validate the form, and if it fails,
return the user to the previous page.  Now that's easy, but the catch is
that I want to retain/repopulate their field values.  

I was thinking of forcing a history.back if possible, but would rather
use some server side code.  I tried researching what can be done with
sending headers, but I don't want to use a GET method.  I want to use
POST.

thoughts?

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



Re: [PHP] Re: Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Chris de Vidal
Andre Cerqueira said:
> try absolute urls on 'Location' headers
> if thats the problem, ie is not exactly broken, just making some
> (questionable) standards mandatory

There are no Location headers on correct logins.  It's failing on correct
logins.

It's a known bug and they're not pushing out the fix like they did the
bug, so people think it's us requiring them to install software when it's
really a Microsoft problem.

So... do you know of any alternate MySQL login methods?

/dev/idal

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



Re: [PHP] Get form name after submission

2004-03-18 Thread Jonathan Villa

I ended up using a hidden field to pass the value of the form.

Thanks for the replies.


On Thu, 2004-03-18 at 12:21, Robert Cummings wrote:
> On Thu, 2004-03-18 at 12:24, Jonathan Villa wrote:
> > Is there a way to get the name of the form once it's submitted
> > 
> > like $_POST['form1'] or something.
> 
> Include a hidden field with the name of the form for it's value.
> 
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

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



Re: [PHP] How to LogOut ?

2004-03-18 Thread Firman Wandayandi
Hi Labunski,

You couldn't logout, except you close your browser.

Anyone please correct me.

Regards,
Firman

- Original Message -
From: "Labunski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 2:08 AM
Subject: [PHP] How to LogOut ?


> I made Login page using http auth method ($PHP_AUTH_USER), and it's
workong
> fine.
> But how to LogOut user?
>
>
> Thanks for all the answers.
> Lab.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



RE: [PHP] OT PHP Programmers

2004-03-18 Thread Edward Peloke
php|architect also has a forum now for job postings

http://www.phparch.com/discuss/

Eddie

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 1:56 PM
To: Jack Sasportas; PHP
Subject: Re: [PHP] OT PHP Programmers


--- Jack Sasportas <[EMAIL PROTECTED]> wrote:
> Not sure where to post this, but my company is looking to hire an
> inhouse PHP programmer.

You might consider here:

http://www.phpcommunity.org/wiki/Home/PHPJobs

This may potentially turn into a full-fledged PHP job site, depending on
interest.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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


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



Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris de Vidal
Adam Voigt said:
> If I ran XP I might be able to do that. From reading the security
> release my MS, it sounds like some times the POST request gets b0rked,

Yep.

> if this is the case, I'm not sure there's much that can be done about
> it.

...except find an alternate login method, which is my question.  I know
this isn't a problem on every site else there'd be far more uproar against
Microsoft for not pushing it out.  Surely there must be another method
other than the code I showed this mailing list.

I searched this group and someone suggested disabling Apache's keepalives
but I don't have root on this box so that option is out.

At this point it's either disable passwords or find an alternate method;
we're angering customers (thank you Microsoft!).

/dev/idal

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



RE: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Alex Hogan
> thanks for all the white space. one blank line isn't enough for my brain
> to properly separate the different parts of your email. but now, thanks
> to your extra white space i don't have a headache anymore. thanks again!
> it really helps!

Anything I can do.., just a little present from MS Outlook.  Glad to hear
your headache is gone though.

> $entire_recordset = mssql_fetch_array($result);
> 
> foreach($entire_recordset as $row)
> {
> // looping code goes here
> }

Thanks...


alex hogan


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




[PHP] how does array_multisort work?(!??)

2004-03-18 Thread David T-G
Hi, all --

I have an array like

  $a =
array
(
  'key' =>
array
(
  'title' => "Topic Title",
  'content' => "Topic Content",
),
...
) ;

and I'd like to sort the whole thing not on the keys but on the titles.
It sounds like array_multisort should do exactly what I want, but I can't
seem to get it to work.  For a given source array kind of like

  $a
bookmark
  How To Bookmark
  This is all about bookmarking.
add
  Adding Pictures
  Let's talk about pictures.
zebra
  Caught You Here
  This is about zebras but it has a surprise title.

then I want

  $a
add
  Adding Pictures
  Let's talk about pictures.
zebra
  Caught You Here
  This is about zebras but it has a surprise title.
bookmark
  How To Bookmark
  This is all about bookmarking.

after sorting.

Will array_multisort sort on an arbitrary key of a multidimensional
array, or does it just sort multidimensional arrays but only in key
index priority?

Barring that, I imagine I'd have to either ensure that the array is
constructed in the proper order or make an index of titles => keys so
that I could sort that and then pull the key out to display the list.
Bleah.  Once again it would probably be easier to just lay out a DB
schema!


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] date()

2004-03-18 Thread Khalid Judeh
hello all,
i am new to php, i am trying to call the date  function this way:

and the result i get is: object18/03/04
any help would be appreciated
 



Khaled Jouda 

cell. phone: 0163-2382758 
fax: 1(801)439-1253 
alternative email: [EMAIL PROTECTED]
_


Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam

Re: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread John W. Holmes
From: "Alex Hogan" <[EMAIL PROTECTED]>

> I am parsing data returned from a field that looks like this;
>
>  6-8-3-5-10-9-6__7-5-9--etc...

Wow... you're totally missing the point of a database when you store data
like this.

> The code below parses out the data they way I want it but only returns the
> first row.  I need to compare all rows and return an average from each of
> the parsed out numbers.  Where have I made a mistake?
>
>
>
> $i = 0;
>
> $total = array();
>
> while($row = mssql_fetch_array($result)){

So how many times does the while() loop execute? How many rows is your query
actually returning? What does the output actually look like and what should
it look like.

---John Holmes...

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



RE: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Chris W. Parker
Alex Hogan 
on Thursday, March 18, 2004 10:39 AM said:

> Hi All,
> 
> 
> 
> I am parsing data returned from a field that looks like this;
> 
> 
> 
> 6-8-3-5-10-9-6__7-5-9--etc...
> 
> 
> 
> The code below parses out the data they way I want it but only
> returns the first row.  I need to compare all rows and return an
> average from each of the parsed out numbers.  Where have I made a
> mistake? 
> 
> 
> 

thanks for all the white space. one blank line isn't enough for my brain
to properly separate the different parts of your email. but now, thanks
to your extra white space i don't have a headache anymore. thanks again!
it really helps!

and now to more serious matters... ;)

> while($row = mssql_fetch_array($result)){

you're grabbing the entire result set all at once so you'll only execute
this while statement once. that's why it only does the first line. do
the the following instead:

$entire_recordset = mssql_fetch_array($result);

foreach($entire_recordset as $row)
{
// looping code goes here
}

this is just my take on your code at first glance.


hth,
chris.

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



Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Adam Voigt
> Have another look at the code.  Try it on your server if you'd like.  You
> can replicate the problem with an XP box that's recently (this month) been
> automatically updated.

If I ran XP I might be able to do that. From reading the security
release my MS, it sounds like some times the POST request gets b0rked,
if this is the case, I'm not sure there's much that can be done about
it.


-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris de Vidal
Adam Voigt said:
> What exactly is breaking? If it's the header to redirect, you could just
> issue a meta refresh, or a javascript one.

The only time redirects are sent is when there is a failure.  Otherwise
it's a simple post operation to a PHP file with an include.

Have another look at the code.  Try it on your server if you'd like.  You
can replicate the problem with an XP box that's recently (this month) been
automatically updated.

CD

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



[PHP] PHP 4.3.5RC4 Released for Testing

2004-03-18 Thread Ilia Alshanetsky
The much overdue 4.3.5RC4 is finally out and hopefully will shortly (within a 
week) be followed by the final release. In the meantime please download this 
release, which is avaliable from http://qa.php.net/ and try it with against 
your code as well as "make test".

While I do not anticipate any major problems to be discovered this will ensure 
that 4.3.5 will be 100% production ready. If you do come across any critical 
issues or are of aware of some, please report them.

For those of you who will run the PHP's test suite via "make test", please do 
not be alarmed by the following test failures:

Bug #25547 (error_handler and array index with function call) 
[tests/lang/bug25547.phpt]
Bug #24594 (Filling an area using tiles). [ext/gd/tests/bug27582_2.phpt]

Download URLs:
http://downloads.php.net/ilia/php-4.3.5RC4.tar.bz2
http://downloads.php.net/ilia/php-4.3.5RC4.tar.gz
http://downloads.php.net/ilia/php-4.3.5RC4-Win32.zip

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



Re: [PHP] Letter incrementing

2004-03-18 Thread David Otton
On Thu, 18 Mar 2004 15:16:34 +0200, you wrote:

>But I need to do a $variable = "B";
>and then do a $variable++ that will result in
>$variable == "C"

for ($i = 0; $i < 26; $i++)
{
  echo (chr($i + ord('A')));
}


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



[PHP] Re: Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Andre Cerqueira
try absolute urls on 'Location' headers
if thats the problem, ie is not exactly broken, just making some 
(questionable) standards mandatory

Chris De Vidal wrote:
Microsoft broke IE 6.0 SP1 on XP in January, requiring this patch to be
able to log into our MySQL-authenticated website:
http://www.microsoft.com/downloads/details.aspx?FamilyId=254EB128-5053-48A7-8526-BD38215C74B2&displaylang=en
Microsoft won't put out this patch into the regular XP updates (I guess
because many websites use an alternate method and it doesn't impact as
many people).  You have to download it manually.
Of course, this is generating many complaints and we even lost a few
customers; people believe we're requring them to install software just to
log in, when we're really just requiring they fix something Microsoft
broke.
So I really need an alternate MySQL-authenticated method.  Surely they exist?

I have a login page on an SSL-enabled Apache server that (I don't admin).

Here's my code (you can download a complete copy from
http://devidal.tv/~chris/mysql_auth.tar.bz2, including the SQL to create
the members table).
login.php:
==















===
edit_agent.php:
===

echo "You won't be able to see this unless you have a valid login.";

require_once ("close_db.php");
?>
==
check_login.php:


// Only alphanumeric
$password = preg_replace ("/[^\w]/", "", $_POST["password"]);
$query = "
SELECT ID
FROM members
WHERE Email = '$email'
AND Password = PASSWORD('$password')
AND Active = '1'
";
$result = @mysql_query ($query);

// Only if we have matching records
if ([EMAIL PROTECTED] ($result) >= 1)
{
require_once ("close_db.php");
header ("Location: login.php?login_failed=true");
exit;
}
?>
=
valid_email.php:


=
open_db.php is just mysql_connect and mysql_select_db, while close_db.php
is just mysql_free_result and mysql_close.  I've included them in the
tarball above as well as the SQL you will need if you want to try this for
yourself.
Again, this code worked well until Microsoft broke IE.  It still works if
you apply the patch that Microsoft isn't rolling out to everyone.
I'd considered using Apache's .htaccess files, but I haven't tried
connecting that to MySQL for authentication.  And I don't have admin
access on the box to install anything on the server.
Ideas??
/dev/idal
"GNU/Linux is free freedom." -- Me
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread trlists
On 18 Mar 2004 Cameron B. Prince wrote:

> I just finished doing that on a third machine that didn't have a previous
> MySQL installation. I installed the same version that the webserver has. I
> had the same results.

I'm losing track here -- are you saying you can't connect to another 
machine running MySQL 3.x from PHP but you can from the mysql command 
line client?  So this behavior is verified against both a MySQL 3.x and 
4.x server?

If so I agree, getting the router / firewall out of your way is a good 
idea, though why it would matter if you can open a socket connection, I 
don't know.

> > Note that the standard MySQL extension carries this note:
> > 
> > This MySQL extension will not work with MySQL versions greater
> > than 4.1.0. For that, use MySQLi. 
> > 
> 
> Not sure what MySQLi is, but I had thought since the 4.x mysql client worked
> from the console, that there was no version problem because it would be
> using the same client libraries that PHP is using. Is that not the case?

I'm not at all clear on that.  For one thing it depends if the various 
pieces were built dynamic or static.  I would not make this assumption.

I thought you said the web server had MySQL 3.23 on it -- do you also 
have a MySQL 4 client there?

--
Tom

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



Re: [PHP] Get form name after submission

2004-03-18 Thread trlists
On 18 Mar 2004 Richard Davey wrote:

> Good question, but the answer is no - I don't believe you can. You
> could try passing the form name as a hidden form value? Or name your
> submit button accordingly?

I have done this with the Submit button but I find that the results 
vary.  If you click Submit it always works, but for example, with the 
versions I have here, the Submit button value is not posted if you 
press Enter from within a form field in IE, whereas it is in Mozilla.

--
Tom

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



[PHP] How to LogOut ?

2004-03-18 Thread Labunski
I made Login page using http auth method ($PHP_AUTH_USER), and it's workong
fine.
But how to LogOut user?


Thanks for all the answers.
Lab.

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



RE: [PHP] too much trimming

2004-03-18 Thread Chris W. Parker
Ivan Sergio Borgonovo 
on Thursday, March 18, 2004 9:22 AM said:

> but I obtain this:
> -- begin --
> 
> hey my name is goofy  and
>   I feel good
> -- end --
> 
> Lines are indented with tabs.
> I suspect something related to -w flag, but I haven't been able to
> switch this behaviour off.

all i can suggest is that you try putting an extra carriage return in
your code and see what that does. you might also try .


chris.

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



Re: [PHP] Get form name after submission

2004-03-18 Thread Roger Spears
You assign it to a hidden field in your form



in your PHP:
$formName = $_POST['formName'];
of course, this would have to be accomplished BEFORE the form is 
submitted.  Not sure if that is what you are looking for or not...

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


Re: [PHP] OT PHP Programmers

2004-03-18 Thread Chris Shiflett
--- Jack Sasportas <[EMAIL PROTECTED]> wrote:
> Not sure where to post this, but my company is looking to hire an
> inhouse PHP programmer.

You might consider here:

http://www.phpcommunity.org/wiki/Home/PHPJobs

This may potentially turn into a full-fledged PHP job site, depending on
interest.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince
Hi Tom,

> 
> Ah, that's good.  Then it is just a problem of MySQL.
> 
> Have you tried accessing a remote machine running MySQL 3.2x 
> instead of 4.0?  That seems like an obvious potential culprit.

I just finished doing that on a third machine that didn't have a previous
MySQL installation. I installed the same version that the webserver has. I
had the same results.

I was also disappointed to find that the binary distribution I'm using is
not compiled with debugging support. We've also had another thought... The
webservers are load balanced with a Cisco Local Director. This piece of
equipment is between the webserver and the dbserver. So I am now going to
install the same version of MySQL on another server on the same side of the
Local Director and see if that makes a difference. If not, I plan to
recompile MySQL with debugging and continue.

This really blows and I hope I find the solution soon.

> Note that the standard MySQL extension carries this note:
> 
> This MySQL extension will not work with MySQL versions greater
> than 4.1.0. For that, use MySQLi. 
> 

Not sure what MySQLi is, but I had thought since the 4.x mysql client worked
from the console, that there was no version problem because it would be
using the same client libraries that PHP is using. Is that not the case?

Thanks,
Cameron

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



Re: [PHP] str_replace or regex

2004-03-18 Thread Firman Wandayandi
eregi_replace('(\$\$)([a-z].+)', '\1z', '$$a');

Maybe i'm wrong, please crosscheck.

Regards,
Firman

- Original Message -
From: "Adam Williams" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 1:06 AM
Subject: [PHP] str_replace or regex


> Hi, I was wondering if I can get some help with either a str_replace or a
> regex.  I have some data and it always begins with $$ but it can end with
> any letter of the alphabet.  so sometimes its $$a and sometimes its $$b
> and sometimes $$c all the way to $$z. $$a all the way to $$z needs to
> be changed to a /  So is there a way to do this?  I was thinking of a
> str_replace but since the letter always changes I'm not so sure.  Any
help?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] str_replace or regex

2004-03-18 Thread John W. Holmes
From: "Adam Williams" <[EMAIL PROTECTED]>

> Hi, I was wondering if I can get some help with either a str_replace or a
> regex.  I have some data and it always begins with $$ but it can end with
> any letter of the alphabet.  so sometimes its $$a and sometimes its $$b
> and sometimes $$c all the way to $$z. $$a all the way to $$z needs to
> be changed to a /  So is there a way to do this?  I was thinking of a
> str_replace but since the letter always changes I'm not so sure.  Any
help?

$output = preg_replace('/\$\$[a-z]/','/',$string);

If you wanted to use str_replace, then:

$array = array('$$a','$$b','$$c','$$d'...);
$output = str_replace($array,'/',$string);

---John Holmes...

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



[PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Alex Hogan
Hi All,

 

I am parsing data returned from a field that looks like this;

 

6-8-3-5-10-9-6__7-5-9--etc...

 

The code below parses out the data they way I want it but only returns the
first row.  I need to compare all rows and return an average from each of
the parsed out numbers.  Where have I made a mistake?

 

$i = 0;

$total = array();

while($row = mssql_fetch_array($result)){

$thearray = explode('__', $row[$i]);

$n = 0; 

foreach($thearray as $topelement){

   foreach(explode('--', $topelement) as $element){

if(is_numeric($element)) {  

$total[$n] += $element;

echo $element;

$n++;

}

}

$i++;

}

$avg = array();

$num = count($total);

for($x = 0; $num > $x; $x++) {

$avg[] = $total[$x] / $i;

echo "";

echo $avg[$x];

}

}

 

Thanks,

 

alex hogan

 



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




Re: [PHP] str_replace or regex

2004-03-18 Thread Richard Davey
Hello Adam,

Thursday, March 18, 2004, 6:06:06 PM, you wrote:

AW> Hi, I was wondering if I can get some help with either a str_replace or a
AW> regex.  I have some data and it always begins with $$ but it can end with
AW> any letter of the alphabet.  so sometimes its $$a and sometimes its $$b
AW> and sometimes $$c all the way to $$z. $$a all the way to $$z needs to
AW> be changed to a /  So is there a way to do this?  I was thinking of a
AW> str_replace but since the letter always changes I'm not so sure.  Any help?

If I read that correctly, you want to replace $$ with /, yes?
In which case a str_replace will do that just fine. Ignore the final
letter of the string and just search for $$ and replace with a /.

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

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



Re: [PHP] Get form name after submission

2004-03-18 Thread John W. Holmes
From: "Jonathan Villa" <[EMAIL PROTECTED]>

> Is there a way to get the name of the form once it's submitted
>
> like $_POST['form1'] or something.

No. You'd have to use javascript to set a variable upon submission and then
find that variable.

---John Holmes...

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



Re: [PHP] How to edit a datetime field?

2004-03-18 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]>

> I'm trying to set a datetime field to 24 hours in the future...
> 
> NOW()+6000, which worked on a timestamp field, only gives 12 seconds in 
> the future. Algebra suggested I try NOW()+720 which is invalid.

field = NOW() + INTERVAL 1 DAY

or

field = NOW() + INTERVAL 24 HOUR

---John Holmes...

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



Re: [PHP] Get form name after submission

2004-03-18 Thread Robert Cummings
On Thu, 2004-03-18 at 12:24, Jonathan Villa wrote:
> Is there a way to get the name of the form once it's submitted
> 
> like $_POST['form1'] or something.

Include a hidden field with the name of the form for it's value.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Re: str_replace or regex

2004-03-18 Thread Justin Patrin
Adam Williams wrote:

Hi, I was wondering if I can get some help with either a str_replace or a 
regex.  I have some data and it always begins with $$ but it can end with 
any letter of the alphabet.  so sometimes its $$a and sometimes its $$b 
and sometimes $$c all the way to $$z. $$a all the way to $$z needs to 
be changed to a /  So is there a way to do this?  I was thinking of a 
str_replace but since the letter always changes I'm not so sure.  Any help?
$replacedText = preg_replace('/\$\$[a-z]/', '/', $text);

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


[PHP] Anybody using Ensim Pro 3.5, help badly needed (0T)

2004-03-18 Thread Ryan A
Hey,
If anybody uses ensim please help with the below problem...am going totally
nuts.
I reciently tried to upgrade mysql from 3.23 to 4.0 and in the process had
to take out this rpm
phpMyAdmin-2.3.2-ensim2.rpm
and these files:

php-mysql-4.3.3-0ensim2
perl-DBD-MySQL-1.2219-6
MySQL-python22-0.9.1-1ensim1

via
rpm -e phpMyAdmin-2.3.2-ensim2
rpm -e php-mysql-4.3.3-0ensim2
rpm -e perl-DBD-MySQL-1.2219-6
rpm -e MySQL-python22-0.9.1-1ensim1

via instructions of a dude on the mysql list (i dont know linux)

And now I am unable to get into my control ensim panel, I have joined the
mysql list to try to get 4.0 working
but how do I get ensim working again?
How do I put back these files?

Thanks,
-Ryan

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



[PHP] str_replace or regex

2004-03-18 Thread Adam Williams
Hi, I was wondering if I can get some help with either a str_replace or a 
regex.  I have some data and it always begins with $$ but it can end with 
any letter of the alphabet.  so sometimes its $$a and sometimes its $$b 
and sometimes $$c all the way to $$z. $$a all the way to $$z needs to 
be changed to a /  So is there a way to do this?  I was thinking of a 
str_replace but since the letter always changes I'm not so sure.  Any help?

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



Re: [PHP] Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Adam Voigt
What exactly is breaking? If it's the header to redirect, you could just
issue a meta refresh, or a javascript one.


On Thu, 2004-03-18 at 12:38, Chris de Vidal wrote:
> Microsoft broke IE 6.0 SP1 on XP in January, requiring this patch to be
> able to log into our MySQL-authenticated website:
> http://www.microsoft.com/downloads/details.aspx?FamilyId=254EB128-5053-48A7-8526-BD38215C74B2&displaylang=en
> 
> Microsoft won't put out this patch into the regular XP updates (I guess
> because many websites use an alternate method and it doesn't impact as
> many people).  You have to download it manually.
> 
> Of course, this is generating many complaints and we even lost a few
> customers; people believe we're requring them to install software just to
> log in, when we're really just requiring they fix something Microsoft
> broke.
> 
> So I really need an alternate MySQL-authenticated method.  Surely they exist?
> 
> I have a login page on an SSL-enabled Apache server that (I don't admin).
> 
> Here's my code (you can download a complete copy from
> http://devidal.tv/~chris/mysql_auth.tar.bz2, including the SQL to create
> the members table).
> 
> login.php:
> ==
> 
> 
>  if ($_GET["login_failed"])
> {
> ?>
> 
> 
> 
>  }
> ?>
> 
> 
> 
> 
> 
> 
> 
> 
> ===
> 
> edit_agent.php:
> ===
>  require_once ("open_db.php");
> require_once ("check_login.php");
> 
> echo "You won't be able to see this unless you have a valid login.";
> 
> require_once ("close_db.php");
> ?>
> ==
> 
> check_login.php:
> 
>  require_once ("valid_email.php");
> $email = $_POST["email"];
> if (!valid_email ($email))
> {
> require_once ("close_db.php");
> header ("Location: login.php?login_failed=true");
> exit;
> }
> 
> // Only alphanumeric
> $password = preg_replace ("/[^\w]/", "", $_POST["password"]);
> 
> $query = "
> SELECT ID
> FROM members
> WHERE Email = '$email'
> AND Password = PASSWORD('$password')
> AND Active = '1'
> ";
> 
> $result = @mysql_query ($query);
> 
> // Only if we have matching records
> if ([EMAIL PROTECTED] ($result) >= 1)
> {
> require_once ("close_db.php");
> header ("Location: login.php?login_failed=true");
> exit;
> }
> ?>
> =
> 
> valid_email.php:
> 
>  function valid_email($email)
> {
> if (ereg ("^([^[:space:]]+)@(.+)\.(.+)$", $email))
> {
> return TRUE;
> } else {
> return FALSE;
> }
> }
> ?>
> =
> 
> open_db.php is just mysql_connect and mysql_select_db, while close_db.php
> is just mysql_free_result and mysql_close.  I've included them in the
> tarball above as well as the SQL you will need if you want to try this for
> yourself.
> 
> Again, this code worked well until Microsoft broke IE.  It still works if
> you apply the patch that Microsoft isn't rolling out to everyone.
> 
> I'd considered using Apache's .htaccess files, but I haven't tried
> connecting that to MySQL for authentication.  And I don't have admin
> access on the box to install anything on the server.
> 
> Ideas??
> /dev/idal
> "GNU/Linux is free freedom." -- Me
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] Get form name after submission

2004-03-18 Thread Richard Davey
Hello Jonathan,

Thursday, March 18, 2004, 5:24:29 PM, you wrote:

JV> Is there a way to get the name of the form once it's submitted
JV> like $_POST['form1'] or something.

Good question, but the answer is no - I don't believe you can. You
could try passing the form name as a hidden form value? Or name your
submit button accordingly?

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

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



Re: [PHP] putting selected text in textarea i a string

2004-03-18 Thread Richard Davey
Hello R.G.,

Wednesday, March 17, 2004, 9:18:53 PM, you wrote:

RGV> Is it possible to change selected text in a textarea without using java and
RGV> only php or html.

RGV> There are lots of solutions in a javascript but i would like to try it
RGV> without. If it is possible to place the in a textarea selected text in the
RGV> return of a function i like to believe is can be done. So how kan i put
RGV> selected text in a string.

Erm, your post doesn't make a great deal of sense - but just to
clarify, no you cannot modify the contents of a live textarea from a
PHP function for the simple reason that what you want is a CLIENT-SIDE
change and PHP is 100% SERVER-SIDE. Try using a JavaScript function to
modify a live textarea field.

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

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



[PHP] Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Chris de Vidal
Microsoft broke IE 6.0 SP1 on XP in January, requiring this patch to be
able to log into our MySQL-authenticated website:
http://www.microsoft.com/downloads/details.aspx?FamilyId=254EB128-5053-48A7-8526-BD38215C74B2&displaylang=en

Microsoft won't put out this patch into the regular XP updates (I guess
because many websites use an alternate method and it doesn't impact as
many people).  You have to download it manually.

Of course, this is generating many complaints and we even lost a few
customers; people believe we're requring them to install software just to
log in, when we're really just requiring they fix something Microsoft
broke.

So I really need an alternate MySQL-authenticated method.  Surely they exist?

I have a login page on an SSL-enabled Apache server that (I don't admin).

Here's my code (you can download a complete copy from
http://devidal.tv/~chris/mysql_auth.tar.bz2, including the SQL to create
the members table).

login.php:
==















===

edit_agent.php:
===

==

check_login.php:

= 1)
{
require_once ("close_db.php");
header ("Location: login.php?login_failed=true");
exit;
}
?>
=

valid_email.php:


=

open_db.php is just mysql_connect and mysql_select_db, while close_db.php
is just mysql_free_result and mysql_close.  I've included them in the
tarball above as well as the SQL you will need if you want to try this for
yourself.

Again, this code worked well until Microsoft broke IE.  It still works if
you apply the patch that Microsoft isn't rolling out to everyone.

I'd considered using Apache's .htaccess files, but I haven't tried
connecting that to MySQL for authentication.  And I don't have admin
access on the box to install anything on the server.

Ideas??
/dev/idal
"GNU/Linux is free freedom." -- Me

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



[PHP] PHP 5 Release Candidate 1

2004-03-18 Thread Andi Gutmans
The PHP development team is proud to announce the release of PHP 5 Release 
Candidate 1.
Some of the key features of PHP 5 include:

- The Zend Engine II with a new object model and dozens of new features.
- XML support has been completely redone in PHP 5, all extensions are now 
focused around the excellent libxml2 library (http://www.xmlsoft.org/).
- A new MySQL extension named MySQLi for developers using MySQL 4.1 and 
later. Additionally to a functional interface this new extension also 
includes an object-oriented interfaced and support for many of MySQL's new 
features such as prepared statements.
- SQLite has been bundled with PHP. For more information on SQLite, please 
visit their website.
- A brand new built-in SOAP extension for interoperability with Web Services.
- A new SimpleXML extension for easily accessing and manipulating XML as 
PHP objects. It can also interface with the DOM extension and vice-versa.
- Streams have been greatly improved, including the ability to access 
low-level socket operations on streams.
- And lots more...

PHP 5 is now feature complete and quite stable. The purpose of the release 
candidate is to start widespread testing and use in non-mission critical 
applications.

Enjoy! 

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


[PHP] Get form name after submission

2004-03-18 Thread Jonathan Villa
Is there a way to get the name of the form once it's submitted

like $_POST['form1'] or something.

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



Re: [PHP] Re: Global variables in a class? Nested classes VS inheritance...

2004-03-18 Thread Justin Patrin
Chris W. Parker wrote:

I make a database connection outside of my classes... lets call it
$myDBConnection. I need to use this connection in a class nested in a
class... Was wondering the most efficient way of doing this? I don't
want to create a new db connection in the class. I want to use the
existing one...


this is really a non-issue if you set up your classes correctly. your
base class should be the one that handles all the database interaction.
this class should have a member that stores the connection.
your extended class should be the one that is more specific to the task
at hand, i.e. managing a user.
the extended class can access all the members of the parent class the
same as if it were it's own.


class DB
{
  var $connection;
  function set_conn()
  {
$this->connection = "hello";
  }
}
class User extends DB
{
  function get_connection()
  {
return $this->connection;
  }
}
?>

Any thoughts? Would it make things easyer if the base class
inherited all nested classes instead of nesting them?
Any help would be appreciated.


hopefully i've sufficiently answered your question.



chris.
You may want to take a look at static variables.
http://php.net/variables.scope
Look for "static". Static vars may also be in classes.
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] putting selected text in textarea i a string

2004-03-18 Thread R.G. Vervoort
Is it possible to change selected text in a textarea without using java and
only php or html.

There are lots of solutions in a javascript but i would like to try it
without. If it is possible to place the in a textarea selected text in the
return of a function i like to believe is can be done. So how kan i put
selected text in a string.

tanks

roy

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



[PHP] too much trimming

2004-03-18 Thread Ivan Sergio Borgonovo
I've simple code like this:

-- begin --
#!/usr/bin/php -q


hey my name is 
and
I feel good
-- end --

I would expect this output:

-- begin --

hey my name is goofy
and
I feel good
-- end --

but I obtain this:
-- begin --

hey my name is goofyand
I feel good
-- end --

Lines are indented with tabs.
I suspect something related to -w flag, but I haven't been able to
switch this behaviour off.

thx

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



Re: [PHP] Turn on E_ALL Error Reporting

2004-03-18 Thread Roger Spears
Also, when I use that code in my scripts, if there are any variables 
(arrays too) that are in existence with no value:

$someVariable = "";

it will throw a warning on the screen.

First time I saw that I went into panic mode thinking that I had a huge 
amount of errors/warnings...

You are also going to see some numbers associated with the 
errors/warnings.  You can find out what they mean by going here:
http://us2.php.net/manual/en/function.error-reporting.php

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


RE: [PHP] Re: Global variables in a class? Nested classes VS inheritance...

2004-03-18 Thread Chris W. Parker
>> I make a database connection outside of my classes... lets call it
>> $myDBConnection. I need to use this connection in a class nested in a
>> class... Was wondering the most efficient way of doing this? I don't
>> want to create a new db connection in the class. I want to use the
>> existing one...

this is really a non-issue if you set up your classes correctly. your
base class should be the one that handles all the database interaction.
this class should have a member that stores the connection.

your extended class should be the one that is more specific to the task
at hand, i.e. managing a user.

the extended class can access all the members of the parent class the
same as if it were it's own.

connection = "hello";
  }
}

class User extends DB
{
  function get_connection()
  {
return $this->connection;
  }
}

?>

>> Any thoughts? Would it make things easyer if the base class
>> inherited all nested classes instead of nesting them?
>> 
>> Any help would be appreciated.

hopefully i've sufficiently answered your question.




chris.

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



Re: [PHP] HTML/PHP page print

2004-03-18 Thread Filip de Waard
On Mar 18, 2004, at 4:52 PM, Manisha Sathe wrote:
Hello,

I want to print a document. The values are picked up from database and 
then
PHP displays it is on screen. But I want to print in some predefined 
format
(Customer has printed stationary) by using Browser's print button.

How can avoid other stuff on my web page ? Also when i print then 
title of
document / page no / url / date also get displayed. How can i avoid it 
?
This has nothing to do with PHP, but more with presentation (client 
side). I would like to recommend 
http://www.alistapart.com/articles/goingtoprint/, which is an excellent 
article written by CSS guru Eric Meyer about printing from the web.

Regards,

Filip de Waard

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


RE: [PHP] Simple: Whats wrong with this?

2004-03-18 Thread Chris W. Parker
Ford, Mike 
on Thursday, March 18, 2004 5:02 AM said:

> Not quite -- the increment is performed immediately after the access
> -- in fact, as part of the same operation.  So:
> 
> $x = 3;
> $y = ($x++ * 2) + $x;
> 
> is likely to give you $y==10, not 9.

i see. good example.



chris.

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



Re: [PHP] Letter incrementing

2004-03-18 Thread Justin Patrin
echo char(ord('A') + 1);

Brent Baisley wrote:

You want to use the char() function. What you need to do is increment an 
ascii value and then convert that value to a letter. So ascii 65 is A.
$asciiVal = 65;
echo char($asciiVal);  A
$asciiVal++;
...

On Mar 18, 2004, at 8:16 AM, Brent Clark wrote:

Hi all

Does anyone know how, or even if it is possible to increment a letter 
from the alphabet.

I know that if you use
e.g
$o = 1;
$o++;
will result in $o ==  2,.

But I need to do a $variable = "B";
and then do a $variable++ that will result in
$variable == "C"


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


Re: [PHP] HTML/PHP page print

2004-03-18 Thread Jason Giangrande
Manisha Sathe wrote:
How can avoid other stuff on my web page ?
I assume you want to only print the information and not the page header, 
footer, navigation, etc.  There are several ways to do this.  The best 
way is with CSS.  However, if you have not created your page primarily 
with CSS this won't work real well.  The second step is to simply remove 
 any headers or footers that you are including in your page when you 
want to print.  In others words create a link on the page that says 
print that when clicked will not load any footers or headers.  If you 
don't include any footers or headers, you could create a script that 
would remove  tags and some others in order to print only the 
relevant material.

Also when i print then title of document / page no / url / date also get displayed.
How can i avoid it ?
This kind of information is usually from the OS, browser or printer 
driver.  Therefore, it would be very hard if not impossible to turn off 
through server-side scripting or even with JavaScript.

--
Jason Giangrande <[EMAIL PROTECTED]>
http://www.giangrande.org
http://www.dogsiview.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Problem to display the results of an exec + rsh command

2004-03-18 Thread Chris W. Parker
Frédéric Martin 
on Thursday, March 18, 2004 7:31 AM said:

> $res = exec("rsh x.x.x.x -l username ping x.x.x.x);
> echo " $res ";
> 
> I cannot display the result of the ping made in the remote host.
> any idea to fix that?
> thank you in advance for your tips ...

i don't have any idea why it's not working and i've never used exec(), but maybe you'd 
have better luck with the back tick operator (at least i think it's an operator)?

$res = `rsh x.x.x.x -l username ping x.x.x.x`;


chris.

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



Re[4]: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Tom Rogers
Hi,

Friday, March 19, 2004, 2:26:06 AM, you wrote:

F> "Tom Rogers" <[EMAIL PROTECTED]> wrote in message
F> news:[EMAIL PROTECTED]

F> Cool, it works!
F> include ("the file where the tables are stored") after the the
F> variables are defined, and it works.
F> I took 3 semesters of C and C++  programming. I should have figured that out myself.

F> Thanks Tom. Can you steer me to where the E_ALL error reporting gets activated?
F> Some ini file I imagine?

F> And oh yeah, I don't know if it helped Jake, but it worked for me.
F> Thanks for starting the topic, Jake.

F> Dale

For permenent settings it is done in php.ini   ('error_reporting')
while developing you can put this at the top of each page:

error_reporting(E_ALL);

-- 
regards,
Tom

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



RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread trlists
On 18 Mar 2004 Cameron B. Prince wrote:

> I'm sure this is good to know because it proves at least part of PHP can
> reach the other machine... Which hopefully rules out a TCP/IP problem. I'm
> going to enable debugging on the MySQL server and see if that tells me
> anything.

Ah, that's good.  Then it is just a problem of MySQL.

Have you tried accessing a remote machine running MySQL 3.2x instead of 
4.0?  That seems like an obvious potential culprit.

Note that the standard MySQL extension carries this note:

This MySQL extension will not work with MySQL versions greater
than 4.1.0. For that, use MySQLi. 

--
Tom

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



Re: Re[2]: [PHP] ereg_replace help

2004-03-18 Thread trlists
On 18 Mar 2004 Richard Davey wrote:

> Nope, because in the only reference book I had to hand it said the ^
> matched the start of a string so it didn't occur to me to try it.
> 
> Thanks to John I now know when used in a block it's no longer limited
> to the start of the string. The code you posted above works, thanks.

The '^' has a totally different meaning inside a character class than 
its meaning outside the class.  It's not a amtter of it being "limited" 
so much as just "different" (actually I guess "overloaded" is the real 
term).

--
Tom

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



[PHP] Turn on E_ALL Error Reporting

2004-03-18 Thread Roger Spears
Hello,

I changed the title of this email so it doesn't thread hijack...

I use a simple function like this to turn on and show warnings and 
errors.  It's my understanding though, if the error is catastrophic, it 
will not be displayed on the screen no matter what you do.  Not sure 
about that though...

I did not create this function, nor am I taking credit for it.  I'm 
sharing it.  I think it came from one of my many PHP books, possibly the 
PHP Cookbook...


function pc_error_handler($errno, $error, $file, $line, $context)
  {
$message = "[ERROR][$errno][$error][$file:$line]";
print "$message";
?>
mailto:[EMAIL PROTECTED]">email this error

print "";
  }

error_reporting(E_ALL);
set_error_handler('pc_error_handler');
?>
This will show the warning/error on the screen and provide a link for 
the viewer to use to report said error.  You must replace 
"[EMAIL PROTECTED]" with your email address.

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


[PHP] installing.

2004-03-18 Thread Edward Peloke
Hello,

I know this is probably something stupid but...

I have two windows2000 machines, both with Apache 1.3.2 and PHP 4.3.  One of
the machines works fine yet the other keeps throwing the error that it can't
find the apache.dll when apache loads..


Syntax error on line 989 of c:/program files/apache
group/apache/conf/httpd.conf
:
Cannot load c:/php/sapi/php4apache.dll into server: (126) The specified
module c
ould not be found:

Note the errors or messages above, and press the  key to exit.  13...


I have the same httpd.conf files for both, the same php folders, the .dll is
in the sapi folder, in the windows system directory, etc.  What could be the
problem?

Thanks,
Eddie


 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

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



Re: [PHP] How to edit a datetime field?

2004-03-18 Thread Richard Davey
Hello Brian,

Thursday, March 18, 2004, 4:10:20 PM, you wrote:

BD> I'm trying to set a datetime field to 24 hours in the future...

BD> NOW()+6000, which worked on a timestamp field, only gives 12 seconds in
BD> the future. Algebra suggested I try NOW()+720 which is invalid.

UPDATE table SET datefield = DATE_ADD(now(), INTERVAL 24 hour)

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

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



Re: Re[2]: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Five

"Tom Rogers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Hi,
>
> Friday, March 19, 2004, 1:11:52 AM, you wrote:
>
>
> F> Doesn't  $name = "blah blah";  define it enough?
>
>
> Not if it comes after   $table_1 = "".$name."";
> at this point $name does not exist. Try turning on E_ALL error
> reporting and it will tell you things like this.
>
> -- 
> regards,
> Tom

Cool, it works!
include ("the file where the tables are stored") after the the variables are defined, 
and it works.
I took 3 semesters of C and C++  programming. I should have figured that out myself.

Thanks Tom. Can you steer me to where the E_ALL error reporting gets activated?
Some ini file I imagine?

And oh yeah, I don't know if it helped Jake, but it worked for me.
Thanks for starting the topic, Jake.

Dale

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



RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince
Hi Tom,

This was a good idea...

> You might try an fsockopen() to port 3306 on the dbserver and 
> see if it works.  If not, you get a reasonably descriptive error.
> 
> I just tried a couple of known servers and bogus addresses with this
> code:
> 
>  $ipaddr = "localhost";  # substitute the IP address here $fp 
> = fsockopen($ipaddr, 3306, $errno, $errstr, 5.0); 
> var_dump($fp, $errno, $errstr); if ($fp)
>   fclose($fp);
> ?>

I setup the test page and pointed to the dbserver:

IP: 192.168.1.44 
resource(2) of type (stream) int(0) string(0) "" 

I then pointed it at localhost:

IP: localhost 
resource(2) of type (stream) int(0) string(0) "" 

And then another webserver without MySQL:

IP: 192.168.1.26 
bool(false) int(146) string(18) "Connection refused" 

I'm sure this is good to know because it proves at least part of PHP can
reach the other machine... Which hopefully rules out a TCP/IP problem. I'm
going to enable debugging on the MySQL server and see if that tells me
anything.

Thanks,
Cameron

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



[PHP] How to edit a datetime field?

2004-03-18 Thread Brian Dunning
I'm trying to set a datetime field to 24 hours in the future...

NOW()+6000, which worked on a timestamp field, only gives 12 seconds in 
the future. Algebra suggested I try NOW()+720 which is invalid.

Any suggestions? Thanks!

- Brian

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


[PHP] HTML/PHP page print

2004-03-18 Thread Manisha Sathe
Hello,

I want to print a document. The values are picked up from database and then
PHP displays it is on screen. But I want to print in some predefined format
(Customer has printed stationary) by using Browser's print button.

How can avoid other stuff on my web page ? Also when i print then title of
document / page no / url / date also get displayed. How can i avoid it ?

Thanks in advance

Regards
Manisha

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



Re[2]: [PHP] ereg_replace help

2004-03-18 Thread Richard Davey
Hello Chris,

Thursday, March 18, 2004, 3:28:01 PM, you wrote:

CH> did you try
CH> $output = ereg_replace('[^[:alnum:]]', '', $string);
CH> ?

Nope, because in the only reference book I had to hand it said the ^
matched the start of a string so it didn't occur to me to try it.

Thanks to John I now know when used in a block it's no longer limited
to the start of the string. The code you posted above works, thanks.

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

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



Re: [PHP] php code to connect to MS-SQL SERVER

2004-03-18 Thread Adam Voigt
mssql_connect('repo',$User,$Pass);
mssql_select_db('test');

On Thu, 2004-03-18 at 02:31, Rafi Sheikh wrote:
> Hello folks.
> 
> Basics: Apache 1.3.29, PHP 4.3.4, on WIN 2K-Pro   
> 
> SYS DSN=using SQL Server driver a connection exists (tested via Ms-Access)
> against a SQL Server
> 
> PROBLEM: I am very new in php, therefore requesting if a simple snippet of
> code can be listed showing the proper way of making a connection to a SQL
> server in a PHP script.
> 
> Names to Use:
> System DNS=repo
> SQL Server Database name=test
> User=rookie
> 
> 
> I tried 
> he manual on PHP site, and read about ODBC_connect and odbc_fetch_array but
> I admit that at 1.30 in the morning I am way over my head on this.  Any
> pointer to a source (beg level) or help with a code snippet is deeply
> appreciated.
> 
> Regards,
> 
> RS
> 
> 
> 
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity to
> which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified that
> any dissemination, distribution or copying of this e-mail is prohibited. If
> you have received this e-mail in error, please notify the sender by replying
> to this message and delete this e-mail immediately.
-- 

Adam Voigt
[EMAIL PROTECTED]

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



  1   2   >