[PHP] is $HTTP_REFERER worth trusting?

2002-05-16 Thread Patrick Hsieh

Hello list,

I have a php program which executes a heavy mysql query upon request.
Normally, it should not be requested too often, but I am afraid
malicious user trying to massively call this program.  I am considering
to use $HTTP_REFERER to restrict the connection source, but is it worth
trusting? Is it possible for a hacker to make an identical $HTT_REFERER
in the header? I have no idea how $HTTP_REFERER is made, is it made from
the http client and put in the http header?

If I can't trust $HTTP_REFERER, how can I deny malicious attack like
that?


-- 
Patrick Hsieh <[EMAIL PROTECTED]>
GPG public key http://pahud.net/pubkeys/pahudatpahud.gpg


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




Re: [PHP] Tellwhich browser

2002-05-16 Thread Wolfram Kriesing

Justin French wrote:

>A simple looks around at phpbuilder.com will result in an article on browser
>detection & CSS... the browser detection function he writes can be used for
>many things, including what you want.
>
>Justin French
>
>
>on 16/05/02 12:09 AM, Diana Castillo ([EMAIL PROTECTED])
>wrote:
>
>  
>
>>What is the code to tell whether the user is on IE or Netscape?
>>
>>
checkout PEAR::Net_UserAgent
get it from pear.php.net
or cvs.php.net/cvs.php/pear

-- 
Wolfram

... translating template engine 
  http://sf.net/projects/simpletpl

... authentication system 
  http://sf.net/projects/auth




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




[PHP] help with arrays

2002-05-16 Thread Josh Edwards

This is a basic question but I'm  a basic fellow. If I have an array

$timespread = array("12am-01am"=>0);
$timespread["01am-02am"]=0;
$timespread["02am-03am"]=0; etc

Using $time which is a number, I want to add 1 to the value of
$timespread[$time] without changing the key so if $time =1
I want to have $timespread["01am-02am"]=1;

Using $timespread[$time]+=1; doesn't work.

any ideas?





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




RE: [PHP] is $HTTP_REFERER worth trusting?

2002-05-16 Thread Craig Vincent

> I have a php program which executes a heavy mysql query upon request.
> Normally, it should not be requested too often, but I am afraid
> malicious user trying to massively call this program.  I am considering
> to use $HTTP_REFERER to restrict the connection source, but is it worth
> trusting? Is it possible for a hacker to make an identical $HTT_REFERER
> in the header? I have no idea how $HTTP_REFERER is made, is it made from
> the http client and put in the http header?
>
> If I can't trust $HTTP_REFERER, how can I deny malicious attack like
> that?

An HTTP_REFERER header is sent by the client browser...which means it is
mimicable (and quite easily I might add).  Although adding HTTP_REFERER
restrictions to a script may add a small bit of security against script
kiddies it by no means is a true method of defence against hackers.  The
best thing you can do is temporarily record the IPs of connections to your
script, and then block IPs that connect to the script too often directly
from your routing table.  It doesn't necessarily stop those using proxies
but definately is more reliable than an HTTP_REFERER protection scheme.

Sincerely,

Craig Vincent



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




Re: [PHP] is $HTTP_REFERER worth trusting?

2002-05-16 Thread Dan Hardiker

> Is it possible for a hacker to make an identical $HTT_REFERER
> in the header? I have no idea how $HTTP_REFERER is made, is it made
> from the http client and put in the http header?

Thats exactly how its done. The user agent (browser) takes the URL it was
on when a link was clicked / form submitted etc and places that into a
HTTP header which is sent back to the server. This information can be very
easily faked and is widely implemented into spam / attack bots.
> If I can't trust $HTTP_REFERER, how can I deny malicious attack like
> that?

The best way is authentication. I dont know what the load on your server
is generating, but Im pretty sure there will be an alternative way of
doing it.
eg: on request do the load-based method and dump the details into a
temporary table with a timestamp of the last time it was updated. If you
get the same request within x minutes (or hours / days) then serve up the
generated information from the table.
This would mean that your db no longer gets hammered if malitious users
were to launch 5000 requests at it in the space of 10 mins, it would just 
do the big DB operation the once.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer



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




[PHP] Re: IF Statements

2002-05-16 Thread Martin Wickman

Jon Yates wrote:
> People, hope you can help. The below IF statement is getting a PARSE error.
> Can anyone spot why?
> 
>   if (($this->checkReferralCB($this->benefitRef, $this->benefitNo,
> $this->childDOB)) 
>   && (!$this->checkLocation($this->post, "W")) && (!empty($this->childDOB)))
>   || ($this->checkPregnancy($this->benefitRef, $this->benefitNo))

Geez, use your editors paren-matching capabilities. Any modern editor 
should notify you that you are missing the last parentheses in if 
clause. I recommend emacs or vi.


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




Re: [PHP] Using Sessions under Win98/Apache

2002-05-16 Thread Neil Freeman

FYI...

I'm using sessions successfully using PHP v4.1.0 on Windows NT.

Neil

Edward Marczak wrote:
> 
> 
>*
> This Message Was Virus Checked With : SAVI 3.57 May 2002 Last Updated 13th May 2002
> 
>*
> 
> On 5/15/02 4:30 PM, "SHEETS,JASON (Non-HP-Boise,ex1)"
> [EMAIL PROTECTED] pressed the keys forming the message:
> 
> > Sessions under windows were broken for 4.1.x
> >
> > They were fixed in 4.2.x so you should upgrade.
> 
> Great - a definitive answer.  Thank you.  I'll just have to make note of the
> differences between 4.2.x and older versions.
> 
> Thanks everyone who sent over tips and suggestions.
> --
> Ed Marczak
> [EMAIL PROTECTED]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Neil Freeman   Design Engineer  |
| Phone: +44 (0)1420 526600  Fax  : +44 (0)1420 23741 |
| Email: [EMAIL PROTECTED]   |
|[EMAIL PROTECTED]|
| Web  : www.curvedvision.com |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

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




RE: [PHP] is $HTTP_REFERER worth trusting?

2002-05-16 Thread Dan Hardiker

> Craig Vincent wrote:
> The best thing you can do is temporarily record the
> IPs of connections to your script, and then block IPs that connect to
> the script too often directly from your routing table.  It doesn't
> necessarily stop those using proxies but definately is more reliable
> than an HTTP_REFERER protection scheme.

If you are expecting to have a wide (uncontrolled) audience for the data
you are outputting I would strongly suggest against doing this as the
majority of major ISPs operate transparent web proxies - where everyone
from that ISP will appear to be coming from the same IP.
If I was a malitious user, I would get a block of 50 IPs, place them on a
unix box and then bind randomly to the IPs when making the calls... making
the work around for this security measure trivial.
Im not saying you shouldnt implement any method of security, as some
security is far better than none! Just making sure that everyone is aware
of the consequences and implications.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer



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




Re: [PHP] I'm doing something wrong....

2002-05-16 Thread Martin Wickman

Robert Rothe wrote:

 > Thanks.  So the next() and prev() functions just traverse an array
 > some type of linked list?  This is what precludes direct access to
 > specific elements?

Yup, there is an internal position pointer in every array which are 
used by most array_ functions.


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




[PHP] Re: Generate every possible combination

2002-05-16 Thread Martin Wickman

Evan Nemerson wrote:
> I need to generate every possible combination of the the values in an array. 
> For example, if...
> 
> $array = Array("A", "B", "C");
> I really have no idea where to begin. The best lead I can think of is that 
> there are going to be n! elements in the output array, where n is the size of 
> the input array.

Correct, this also implies that using more than say 20 elements (20!) 
will take *loads* of CPU time and memory. Anyway, I did such a program 
once to test the performance of VB versus Java but alas I dont keep it 
around. It was recursive tho.

A quick check on google came up with some code here:

http://www.delphiforfun.org/Programs/Permutes_1.htm

and som theory here:

http://www.theory-of-evolution.org/Main/chap4/permutations_7.htm


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




[PHP] Re: help with arrays

2002-05-16 Thread Martin Wickman

Josh Edwards wrote:
> This is a basic question but I'm  a basic fellow. If I have an array
> 
> $timespread = array("12am-01am"=>0);
> $timespread["01am-02am"]=0;
> $timespread["02am-03am"]=0; etc
> 
> Using $time which is a number, I want to add 1 to the value of
> $timespread[$time] without changing the key so if $time =1
> I want to have $timespread["01am-02am"]=1;
> 
> Using $timespread[$time]+=1; doesn't work.

Nope, you must say

$timespread["01am-02am"] += 1


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




Re: [PHP] Re: help with arrays

2002-05-16 Thread Dan Hardiker

>> This is a basic question but I'm  a basic fellow. If I have an array
>>
>> $timespread = array("12am-01am"=>0);
>> $timespread["01am-02am"]=0;
>> $timespread["02am-03am"]=0; etc
>>
>> Using $time which is a number, I want to add 1 to the value of
>> $timespread[$time] without changing the key so if $time =1
>> I want to have $timespread["01am-02am"]=1;
>>
>> Using $timespread[$time]+=1; doesn't work.
>
> Nope, you must say
>
> $timespread["01am-02am"] += 1

I think the problem here is your understanding on how array key's work.
The following method would be far more appropriate:


follow or have I lost ya?

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer



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




[PHP] Mysql Query Help needed

2002-05-16 Thread Chris Kay


I have a query 

"select cust_fnn, cust_name, agroup_access.group_access_cust from cust,
agroup_access where
agroup_access.group_access_group='$id' &&
cust.cust_fnn!=agroup_access.group_access_cust order by cust.cust_name"

The 2 tables are as follows

agroup_access

agroup_access_idagroup_access_group
agroup_access_cust

1   9
1610005847
2   9
0265478986
3   9
1610010254

Cust

cst_id  cust_name   cust_fnn(ect)
1   xxx 1610005847
2   x   0265478986

And so on 200+ records

What I am trying to do is pull all records from cust where cust_fnn !=
agroup_access_cust && agroup_access_group=9..

What I am getting is all cust_fnn records but 3 of each and only 2 in
the case of it matching the
agroup_access_cust..

Can anyone see what I may have dome wrong..

I am trying to display them in a drop down box, below is the function
for the drop down box and the line to call the function..

combo5("fnn","select cust_fnn, cust_name,
agroup_access.group_access_cust from cust, agroup_access where
agroup_access.group_access_group='$id' &&
cust.cust_fnn!=agroup_access.group_access_cust order by
cust.cust_name","");

function combo5($name, $query, $sel) {
$dbq=mysql_query($query);
$html="\n";
while( $data = mysql_fetch_array($dbq) ) {
if($data[cust_fnn]==$sel)
$html.="$data[cust_name] : $data[cust_fnn]\n";
else
$html.="$data[cust_name]: $data[cust_fnn]\n";
}
$html.="\n";
return $html;
}

Hope someone can help...

---
Chris Kay, Eleet Internet Services
[EMAIL PROTECTED]
---


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




Re: [PHP] is $HTTP_REFERER worth trusting?

2002-05-16 Thread Patrick Hsieh

Hello "Dan Hardiker" <[EMAIL PROTECTED]>,

Then, it is not safe to do IP-based blocking, right? Any alternative?


On Thu, 16 May 2002 10:10:44 +0100 (BST)
"Dan Hardiker" <[EMAIL PROTECTED]> wrote:

> > Craig Vincent wrote:
> > The best thing you can do is temporarily record the
> > IPs of connections to your script, and then block IPs that connect to
> > the script too often directly from your routing table.  It doesn't
> > necessarily stop those using proxies but definately is more reliable
> > than an HTTP_REFERER protection scheme.
> 
> If you are expecting to have a wide (uncontrolled) audience for the data
> you are outputting I would strongly suggest against doing this as the
> majority of major ISPs operate transparent web proxies - where everyone
> from that ISP will appear to be coming from the same IP.
> If I was a malitious user, I would get a block of 50 IPs, place them on a
> unix box and then bind randomly to the IPs when making the calls... making
> the work around for this security measure trivial.
> Im not saying you shouldnt implement any method of security, as some
> security is far better than none! Just making sure that everyone is aware
> of the consequences and implications.
> 
> -- 
> Dan Hardiker [[EMAIL PROTECTED]]
> ADAM Software & Systems Engineer
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Patrick Hsieh <[EMAIL PROTECTED]>
GPG public key http://pahud.net/pubkeys/pahudatpahud.gpg


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




[PHP] select statement

2002-05-16 Thread Wilbert Enserink

Hi all,


I want to select some records with e.g. ID's 1,3,7 and 8
How can this be done best?

is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??


thx. Wilbert


-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


Re: [PHP] is $HTTP_REFERER worth trusting?

2002-05-16 Thread Dan Hardiker

> Then, it is not safe to do IP-based blocking, right? Any alternative?

As I mentioned in an earlier post (my original reply to you):

> If I can't trust $HTTP_REFERER, how can I deny malicious attack like
> that?

The best way is authentication... that is asking the user for a username
and password before doing getting the data (then you can block out
specific users should they attack you - but you can only do that after the
incident). There are other methods - I dont know what the load on your
server is generating, but Im pretty sure there will be an alternative way
of doing it.

eg: on request do the load-based method and dump the details into a
temporary table with a timestamp of the last time it was updated. If you
get the same request within x minutes (or hours / days) then serve up the
generated information from the table.


This would mean that your db no longer gets hammered if malitious users
were to launch 5000 requests at it in the space of 10 mins, it would just
do the big DB operation the once.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer



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




RE: [PHP] select statement

2002-05-16 Thread John Holmes

Nothing to do with PHP...

SELECT * FROM myTable WHERE ID IN (1,3,7,9);

If you're using MySQL, read the manual:

http://www.mysql.com/documentation/mysql/bychapter/

---John Holmes...

> -Original Message-
> From: Wilbert Enserink [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 7:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] select statement
> 
> Hi all,
> 
> 
> I want to select some records with e.g. ID's 1,3,7 and 8
> How can this be done best?
> 
> is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??
> 
> 
> thx. Wilbert
> 
> 
> -
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -


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




Re: [PHP] select statement

2002-05-16 Thread Jason Wong

On Thursday 16 May 2002 19:19, Wilbert Enserink wrote:
> Hi all,
>
>
> I want to select some records with e.g. ID's 1,3,7 and 8
> How can this be done best?
>
> is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??

Is this a PHP question?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
It took me fifteen years to discover that I had no talent for writing,
but I couldn't give it up because by that time I was too famous.
-- Robert Benchley
*/


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




RE: [PHP] Mysql Query Help needed

2002-05-16 Thread Jay Blanchard

[snip]
"select cust_fnn, cust_name, agroup_access.group_access_cust from cust,
agroup_access where
agroup_access.group_access_group='$id' &&
cust.cust_fnn!=agroup_access.group_access_cust order by cust.cust_name"
[/snip]

try this (note syntactical differences);
"select cust_fnn, cust_name, agroup_access.group_access_cust
from cust, agroup_access
where agroup_access.group_access_group = '$id'
and cust.cust_fnn <> agroup_access.group_access_cust
order by cust.cust_name"

HTH!

Jay


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




php-general Digest 16 May 2002 11:53:17 -0000 Issue 1348

2002-05-16 Thread php-general-digest-help


php-general Digest 16 May 2002 11:53:17 - Issue 1348

Topics (messages 97840 through 97895):

phpmysqladmin ?  still viable?
97840 by: Erik Gilchrist
97842 by: Jason Murray
97843 by: Damian Harouff
97844 by: Danny Shepherd
97845 by: Erik Gilchrist
97846 by: Erik Gilchrist
97851 by: Erik Gilchrist

The future of call time pass-as-reference
97841 by: Frank
97847 by: Lars Torben Wilson

Re: Tellwhich browser
97848 by: Justin French
97878 by: Wolfram Kriesing

Re: Compiling PHP on Solaris 7
97849 by: Billy S Halsey

Plz dont hate me for this
97850 by: Salman Ahmed
97856 by: Vinod Palan
97867 by: Liam MacKenzie

method=post problem
97852 by: Jule
97855 by: John Holmes
97857 by: Janet Valade
97858 by: Miguel Cruz
97859 by: Analysis & Solutions

Re: fopen failing to connect
97853 by: Vail, Warren

Re: PHP editor (win)
97854 by: Vinod Palan

newbie bigtime
97860 by: k spellman
97861 by: Miguel Cruz
97862 by: k spellman
97863 by: k spellman
97864 by: Miguel Cruz
97868 by: Craig Vincent

Re: textarea problem
97865 by: Jason Morehouse

Generate every possible combination
97866 by: Evan Nemerson
97869 by: Martin Towell
97871 by: Austin Marshall
97872 by: Austin Marshall
97886 by: Martin Wickman

Re: Uploading JPEG's - Security Issues?
97870 by: Tom Rogers

class and error handling
97873 by: Gerard Samuel
97874 by: Martin Towell
97875 by: Gerard Samuel

Re: PhP 4.2.1 (and various)
97876 by: Olav Bringedal

is $HTTP_REFERER worth trusting?
97877 by: Patrick Hsieh
97880 by: Craig Vincent
97881 by: Dan Hardiker
97884 by: Dan Hardiker
97890 by: Patrick Hsieh
97892 by: Dan Hardiker

help with arrays
97879 by: Josh Edwards
97887 by: Martin Wickman
97888 by: Dan Hardiker

Re: IF Statements
97882 by: Martin Wickman

Re: Using Sessions under Win98/Apache
97883 by: Neil Freeman

Re: I'm doing something wrong
97885 by: Martin Wickman

Mysql Query Help needed
97889 by: Chris Kay
97895 by: Jay Blanchard

select statement
97891 by: Wilbert Enserink
97893 by: John Holmes
97894 by: Jason Wong

Administrivia:

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

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

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---

First off, I am a total newbie to php and DB stuff.  Pardon the intrusion on 
your busy schedules.  Really.

My host is having a hard time finding phpmysqladmin and he touted this as a 
solution to my wanting to get into the DB arena as well as php.  Does anyone 
know where to get it?   All of my evening has now been wasted googling 
looking for it and perhaps there is a better solution.

And no, I really am out of my game here, but I figured it was a good place 
to ask.  The only caveat the host said was that it MUST be PHP4.x 
compatible.

I sincerely apologize for the intrusion if it's not on topic enough.  I know 
I need to go further in my exploration that the net has via tutorials and 
PHP manual, but if anyone has time I would sincerely appreciate it.  I have 
been lurking for a week or two.  Good stuff to be found here.  Indeed.

I could have all the assumptions above all wrong and some bad 
data/opinions...  sorry.  please explain.  If I am in the wrong place to 
ask, please tell me where the best place to look/ask is.  I don't want to 
waste anybodys time.  I surely would not want mine wasted.

BTW-- I am on DIGEST, so a CC: would be appreciated dearly.

TIA.
Erik

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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

Go to www.google.com -> enter "phpMyAdmin" -> hit "I'm Feeling Lucky"

:)

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

> -Original Message-
> From: Erik Gilchrist [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] phpmysqladmin ? still viable?
> 
> 
> First off, I am a total newbie to php and DB stuff.  Pardon 
> the intrusion on 
> your busy schedules.  Really.
> 
> My host is having a hard time finding phpmysqladmin and he 
> touted this as a 
> solution to my wanting to get into the DB arena as well as 
> php.  Does anyone 
> know where to get it?   All of my evening has now been wasted 
> googling 
> looking for it and perhaps there is a better solution.
> 
> And no, I really am out of my game here, but I figured it was 
> a good place 
> to as

RE: [PHP] IF Statements

2002-05-16 Thread Patrick Lynch

Hi Jon,

Your brackets are just a bit out of sync:

Here is a version that parses. You will have to make sure that my change
does not affect your intended logic.

  if (
($this->checkReferralCB($this->benefitRef,
$this->benefitNo,$this->childDOB)) && 
(!$this->checkLocation($this->post, "W")) &&
(!empty($this->childDOB)) || 
($this->checkPregnancy($this->benefitRef, $this->benefitNo))
)

Best Regards,
Patrick Lynch.

Optip Ltd, Internet & Mobile Development
http://www.optip.com/

-Original Message-
From: Jon Yates [mailto:[EMAIL PROTECTED]] 
Sent: 15 May 2002 15:04
To: '[EMAIL PROTECTED]'
Subject: [PHP] IF Statements


People, hope you can help. The below IF statement is getting a PARSE
error. Can anyone spot why?

Cheers.

Jon
  
  if (($this->checkReferralCB($this->benefitRef, $this->benefitNo,
$this->childDOB)) 
  && (!$this->checkLocation($this->post, "W")) &&
(!empty($this->childDOB)))
  || ($this->checkPregnancy($this->benefitRef, $this->benefitNo))


 <> 




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




[PHP] PHP and MySQL

2002-05-16 Thread City Colleges of Chicago - Mannheim

My program is no longer giving a parse error, but my database is not being
updated (as far as the stock numbers are concerned). Any ideas???

I made the changes below per a few  people on the list:

Quantity of books:



1

2

3

4

5

6

7

8

9

10



The book you are ordering:



Additional Message:











";

}

?>





Renee




RE: [PHP] PHP and MySQL

2002-05-16 Thread Craig Vincent

> mysql_select_db( $db, $link )
>
> or die ( "Couldn't open the $db: ".mysql_error() );
>
>
> if ($submit){
>
> if( $booktitle AND "quantity" ){
>
> $sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE
> booktitle='$booktitle' AND quantity=quantity";
>
> }


Easy enough =)  You're not running the mysql query =)  You're never sending
a command to MySQL to tell it to execute the $sql statement

if( $booktitle AND "quantity" ){

$sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE
booktitle='$booktitle' AND quantity=quantity";
mysql_query($sql);
}

Should do the trick.  Or even cleaner

if( $booktitle AND "quantity" ){
mysql_query("UPDATE Book2 SET stock ='$stock-quantity' WHERE
booktitle='$booktitle' AND quantity=quantity");
}

Sincerely,

Craig Vincent



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




RE: [PHP] PHP and MySQL

2002-05-16 Thread Craig Vincent

Missed a spot =)

> if( $booktitle AND "quantity" ){

I'm not certain if this if statement is accurate.  I've never used a
statement like this but from the looks of it the AND "quantity" part would
always be true (assuming it parses it).  This could be adding to your
problem as well.  I think you were aiming for something like

if ($booktitle AND $quantity) {

or how I do it (although it looks a bit messier)

if (($booktitle) && ($quantity)) {

Sincerely,

Craig Vincent



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




RE: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Steve Bradwell

  

 (25) - Here's a virtual quarter, call someone who cares.
  
  
Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 5:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Done w/ PHP - VB or C# ?


I know I'll get mauled big-time on this mailing list but I'm thinking
about putting PHP on hold for a while and learning ASP.NET
 
I love PHP and open-source computing but if one wants to get a job in
web development, you'll have a much better time find a job with both PHP
and ASP (among others) skills.
 
I'm going to hop on the ASP bandwagon but I'm not sure if I should
first learn ASP w/ VB or w/ C#
 
Any thoughts on this?  What are the pros and cons of both?
 
Thanks!

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




RE: [PHP] Plz dont hate me for this

2002-05-16 Thread John Horton

Hi,
Also try www.uklinux.net
They have php and perl cgi (with a mysql or postgres backend)

-Original Message-
From: Salman Ahmed [mailto:[EMAIL PROTECTED]]
Sent: 16 May 2002 03:05
To: PHP List
Subject: [PHP] Plz dont hate me for this


Hi,

I am also PHP lover plz dont hate me for this but I really need to know any
free perl hosting company where I can host my perl script. Only
circumstances has made this that I programming in perl. I have no idea where
to put my question, as I always did programming in php and asked this list.
So I am asking this question here to, plz tell me about free CGI hosting
site.

Asking for the help and forgiveness
Statbat

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




[PHP] Multiple drop-down lists

2002-05-16 Thread Brian McGarvie

All,

How would you implement 4 drop down lists

Data in list 2 dependant on list 1, list 3 dependant on list 2 and list
4 dependant on list 3? Using an ODBC source.

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




[PHP] Informix.so module

2002-05-16 Thread Mike Baranski

Has anyone gotten this working with the newest version of PHP?  We have an app 
that uses this, and can't seem to get it to compile.  Bug 15177 is marked as 
critical, but nothing has been done.  Any idea when it'll be fixed?

Mike.
-- 
##
#  Mike Baranski   #
# Security Management Consulting  #
#  http://www.secmgmt.com #
#   919-788-9200 #
#


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




[PHP] snmp replies not printed

2002-05-16 Thread Razvan Cosma

  Hello,
 I have installed php 4.1.2 and ucd 4.2.4 both from tarballs on a linux
box, and compiled php both as an apache module and standalone (same
options, except for the --with-apxs). Now, when I use snmpwalk or whatever
other function from within apache, it works (almost) correctly:
snmp_set_quick_print causes php to return both the OID and the value
although the manual says different, but I can live with that. the
problem is that a simple script run from the standalone interpreter on
the same machine behaves very strange. Example:

#!/usr/local/bin/php -q
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple drop-down lists

2002-05-16 Thread Chris

You may wanna search the archives for this, as its been discussed quite a 
few times before.

Basically it comes down to either using some sort of client scripting 
language (Javascript, VB script etc...), or refreshing the page everytime 
someone makes a choice in the list box and then populating the rest.  IE

They select Ohio in the first box, then you would refresh the page, and 
select * from cities where state = "OH"...

-Chris

At 01:21 PM 5/16/2002 +0100, Brian McGarvie wrote:
>All,
>
>How would you implement 4 drop down lists
>
>Data in list 2 dependant on list 1, list 3 dependant on list 2 and list
>4 dependant on list 3? Using an ODBC source.
>
>--
>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] Newline in fputs

2002-05-16 Thread Henry Grech-Cini

Dear All,

Firstly, I am a newbie to php so please be gentle.

I'm having problems with carriage returns placed in a file on a Linux based
server. When this file is download to a WindowsXP machine the carriage
returns are quite frankly useless. I just get "[]" (where "[]" represents an
undisplayable character. No actual carriage returns or newlines!

I generate the file using the following code (fragment only):

 while($row=mysql_fetch_array($mysql_result))
{
  $f_title=$row["title"];
  $f_first_name=$row["first_name"];
  $f_surname=$row["surname"];
  $f_email=$row["email"];
  fputs($file_op,"$f_title, $f_first_name, $f_surname, $f_email\n");
}

I then use the following link to a download_it.php script as described in
Tansley as follows:

$parameters="file_name=".urlencode($file_name)."&file_size=$file_size";
 echo "download it";

The download_it.php file looks as follows:


Appart from the fact that the Content-Disposition appears not to be working
under IE6 since the file name is not correct.

The downloaded file does not contain Windows type carriage returns of
newlines! However it does contains the data thank goodness.

What is the fix?

Henry Grech-Cini



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




[PHP] fsockopen

2002-05-16 Thread Scott St. John

I am using fsockopen to test several of our SQL and WEB servers at our 
office.  Testing ports 80, 1433 and 8080 work fine, but I would like to 
set something up to test ports on our mainframe.  These are printers 
listening on 9100 and when I test it fails.  I don't see anything in the 
online docs about going above a certain port - or is there something else.

Thanks,

-Scott



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




[PHP] Re: fsockopen

2002-05-16 Thread Henry Grech-Cini

I'm confused!

Did you want to make a new post for this comment or a reply to another post.
Or does it in some way relate to my question. On my newsgroup browser it
appears as if this post is in the wrong place! In answer to my post on
"Newlines in fputs"

Thanks for responding anyway.

Henry

"Scott St. John" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am using fsockopen to test several of our SQL and WEB servers at our
> office.  Testing ports 80, 1433 and 8080 work fine, but I would like to
> set something up to test ports on our mainframe.  These are printers
> listening on 9100 and when I test it fails.  I don't see anything in the
> online docs about going above a certain port - or is there something else.
>
> Thanks,
>
> -Scott
>
>



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




[PHP] what is php.ini on linux?

2002-05-16 Thread andy

Hi there,

I am wondering what the equivalent to php.ini is on linux. There is no such
file on linux. Is there a different name?

I would like to set up the max execution time

Thanx,

Andy



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




Re: [PHP] what is php.ini on linux?

2002-05-16 Thread Rasmus Lerdorf

It is called php.ini.  A php.ini-dist sample file comes with the
distribution.  phpinfo() will tell you where it is supposed to live.  Just
copy php.ini-dist to that_location/php.ini and edit it appropriately.

-Rasmus

On Thu, 16 May 2002, andy wrote:

> Hi there,
>
> I am wondering what the equivalent to php.ini is on linux. There is no such
> file on linux. Is there a different name?
>
> I would like to set up the max execution time
>
> Thanx,
>
> Andy
>
>
>
> --
> 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] what is php.ini on linux?

2002-05-16 Thread Razvan Cosma

there is, is is called... php.ini :)
It should reside in /etc, if there is none, create it and add whatever
options you need in it. In the source tree you will find two files -
php.ini-dist and php.ini-recommended which might be of help.

 On Thu, 16 May 2002, andy wrote:

> Hi there,
>
> I am wondering what the equivalent to php.ini is on linux. There is no such
> file on linux. Is there a different name?
>
> I would like to set up the max execution time
>
> Thanx,
>
> Andy
>
>
>
>



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




[PHP] upload but restrict

2002-05-16 Thread r

Greetings friends, pals, nymphos, programmers, geeks and others, of gods
chosen people!

Here goes,
I have a program that uploads any file and allows the person to see whats in
a particular directory without any problems,
not bad for a newbie eh? stand up and clap!!!

what i want to do is make sure that whatever the person uploads cannot "run"
or be executedany ideas on how to do this?

Baically its a file sharing program..."a" uploads something "b" downloads
it...I just dont want to get screwed in the bargain

I was thinking of using the promise system, make them promise that they wont
do anything bad...but the fact of the matter is people lie.:-)

Any help appreciated.
Cheers,
-Ryan.
P.S after reading this email dont send me mails telling me that I am
crazy.coz i already know that.
And remember "Never get into fistfights with ugly people, they have nothing
to lose."





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




Re: [PHP] what is php.ini on linux?

2002-05-16 Thread andy

I did copy the php.ini-recommended into /etc/php.info, rename it to php.ini
put the max execution time to 6 and restarted apache (php as module)
But I do still get a max execution time 30s reached.

Do you have an idea what's wrong?

Thanx,

Andy
"Rasmus Lerdorf" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> It is called php.ini.  A php.ini-dist sample file comes with the
> distribution.  phpinfo() will tell you where it is supposed to live.  Just
> copy php.ini-dist to that_location/php.ini and edit it appropriately.
>
> -Rasmus
>
> On Thu, 16 May 2002, andy wrote:
>
> > Hi there,
> >
> > I am wondering what the equivalent to php.ini is on linux. There is no
such
> > file on linux. Is there a different name?
> >
> > I would like to set up the max execution time
> >
> > Thanx,
> >
> > Andy
> >
> >
> >
> > --
> > 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] what is php.ini on linux?

2002-05-16 Thread Jay Blanchard

[snip]
I did copy the php.ini-recommended into /etc/php.info, rename it to php.ini
put the max execution time to 6 and restarted apache (php as module)
But I do still get a max execution time 30s reached.

Do you have an idea what's wrong?
[/snip]

Did you restart your HTTP server? If not the php.ini file was not read.
Also, if you are using Apache there is a timeout in that server that must be
changed as well. Same for IIS. Anytime any changes are made to any files
which affects the web server requires that the web server be restarted.

HTH!

Jay



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




Re: [PHP] upload but restrict

2002-05-16 Thread Jason Wong

On Friday 17 May 2002 10:40, r wrote:
> Greetings friends, pals, nymphos, programmers, geeks and others, of gods
> chosen people!
>
> Here goes,
> I have a program that uploads any file and allows the person to see whats
> in a particular directory without any problems,
> not bad for a newbie eh? stand up and clap!!!
>
> what i want to do is make sure that whatever the person uploads cannot
> "run" or be executedany ideas on how to do this?

Why? Who is going to run it, and where are they going to run it?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I am looking for a honest man.
-- Diogenes the Cynic
*/


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




Re: [PHP] what is php.ini on linux?

2002-05-16 Thread Jason Wong

On Thursday 16 May 2002 22:09, andy wrote:
> I did copy the php.ini-recommended into /etc/php.info, rename it to php.ini
> put the max execution time to 6 and restarted apache (php as module)
> But I do still get a max execution time 30s reached.
>
> Do you have an idea what's wrong?

Run phpinfo() to see where php is expecting it's php.ini file.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Your lucky number has been disconnected.
*/


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




Re: [PHP] Re: fsockopen

2002-05-16 Thread Jason Wong

On Thursday 16 May 2002 21:31, Henry Grech-Cini wrote:
> I'm confused!
>
> Did you want to make a new post for this comment or a reply to another
> post. Or does it in some way relate to my question. On my newsgroup browser
> it appears as if this post is in the wrong place! In answer to my post on
> "Newlines in fputs"

Lazy person replied to an existing post instead start a new one. Messes up 
threading for everyone.

> Thanks for responding anyway.

Probably not :)

> "Scott St. John" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > I am using fsockopen to test several of our SQL and WEB servers at our
> > office.  Testing ports 80, 1433 and 8080 work fine, but I would like to
> > set something up to test ports on our mainframe.  These are printers
> > listening on 9100 and when I test it fails.  I don't see anything in the
> > online docs about going above a certain port - or is there something
> > else.
> >
> > Thanks,
> >
> > -Scott

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Sin has many tools, but a lie is the handle which fits them all.
*/


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




[PHP] LDAP Search Scope / Schema Retrieval

2002-05-16 Thread D Canfield

Two related questions:

1) Is there any work being done to support the retrieval of the LDAP
schema in PHP (similar to Perl's Net::LDAP::Schema)?  Is there any other
good way to get this information into PHP?

2) Is there any way to change the search scope of an LDAP search in
PHP?  Specifically, the following OpenLDAP search command will fetch the
schema from the server: 
 ldapsearch -s base -x -b 'cn=subschema' objectclass=* +
But, I can find no way to switch the search scope from SUB to BASE, so
the equivalent call in PHP won't work.

Any suggestions?

Thanks

DC




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




Re: [PHP] Newline in fputs

2002-05-16 Thread Analysis & Solutions

On Thu, May 16, 2002 at 02:14:13PM +0100, Henry Grech-Cini wrote:
> 
> I'm having problems with carriage returns placed in a file on a Linux based
> server. When this file is download to a WindowsXP machine the carriage
> returns are quite frankly useless.

Unix type machines separate lines with a newline char "\n"
Windows type machines separate lines with a return and newline "\r\n"

If you want things to look nice on both, use "\r\n"

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Problems with mail() w/Win2k

2002-05-16 Thread Jared Boelens

Hey guys I recently join this list and this is my first real post to it so
if I f**k something up please do beat me to death. :)

I have a simple mailer script that was mailing POSTed form information to a
client, this script was running on a Debian box w/Apache.  This server is
having hardware issues so I moved the sites to a win2k machine.  The same
script bombs out when it trys to use the mail() function.

The error message I receive is not so enlightening:

Warning: Server Error in D:\Inetpub\belcoind.com\mailFunc.php on line 24

I changed the line in the php.ini to read:

SMTP = localhost;

the server has its own smtp service running on it

I also tried:

SMTP = mail.mydomain.com;

This genereated the same problem.

I have been using PHP with Apache forever but I rarely use it on Windows so
any insight into this problem would be great.


Thanks in advance,

-Jared


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




[PHP] recognising plain text files

2002-05-16 Thread Lee P Reilly

Hi,

I am doing some validation on files that are being upload. I only wish
to allow users to upload files that are in *plain text* format (not
neccessarily with a .txt extension). I have the following piece of code,
which works fine in IE, but in Netscape Navigator:

if ($file_type != "text/plain")
... error handling...

Can anyone explain the reason for this, or offer a better solution?

Thanks,

Lee



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




Re: [PHP] recognising plain text files

2002-05-16 Thread Rasmus Lerdorf

The uploaded mime type is set by the browser, not by PHP.  So I guess in
your Netscape case it isn't sending the right type.

Perhaps have a look at the 'file' UNIX-level command and use that.

-Rasmus

On Thu, 16 May 2002, Lee P Reilly wrote:

> Hi,
>
> I am doing some validation on files that are being upload. I only wish
> to allow users to upload files that are in *plain text* format (not
> neccessarily with a .txt extension). I have the following piece of code,
> which works fine in IE, but in Netscape Navigator:
>
> if ($file_type != "text/plain")
> ... error handling...
>
> Can anyone explain the reason for this, or offer a better solution?
>
> Thanks,
>
> Lee
>
>
>
> --
> 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] Uploading JPEG's - Security Issues?

2002-05-16 Thread Andre Dubuc

My question will probably expose my woeful lack understanding of security 
breaches, but perhaps someone can enlighten me.

On my site, registered members will be allowed to upload jpg/jpeg 
pictures. I'm concerned about possible security problems. First, is there a 
way to ensure that a picture (and not some other malicious stuff) has been 
uploaded? 

Aside from checking the mime type info associated with the file, is there any 
way of verifying what's in the file that has been uploaded? (I'm using Linux 
LM8.2) Would it be possible to fake info to fool this check? Would 
verification checks for html/scripts/commands be of any use?

Secondly, since the file in question is already uploaded and saved to disk in 
/tmp or wherever, wouldn't any verification scheme be sort of, 
'after-the-fact'?

I would appreciate any input, suggestions, or ideas on what to do here. Am I 
being overly-paranoid about this, or do I have  legitimate security concern.

Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2

Tia,
Andre


 -- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/


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




Re: [PHP] tag img and php

2002-05-16 Thread Jim lucas

show the contents of 'try_param.php' please.

Jim Lucas
- Original Message - 
From: "Maciej Przybycien" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 15, 2002 10:38 AM
Subject: [PHP] tag img and php


> 
> Hi,
> I included php file as html img:
>  height="240" >
> and Netscape brawser seems not to interpret that. However if I change 
> try_param.php -> try_param.png then image can be desplayed. 
> 
> According to the documentation 'try_param.php' should be interpereted
> fine. 
> What could be the problem?
> 
>  Thank you,
> Maciek
> 
> 
> 
> -- 
> 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] Uploading JPEG's - Security Issues?

2002-05-16 Thread Rasmus Lerdorf

Are you afraid of someone embedding PHP in a .jpg file?  That's not really
an issue as your web server is probably configured to only serve up PHP as
.php files.  Likewise, your web server config is likely such that any .jpg
file is served up as content-type image/jpeg and as such it really doesn't
matter what sort of junk is embedded in the image.  At most it will show
up as a broken image icon in your browser.

-Rasmus

On Tue, 14 May 2002, Andre Dubuc wrote:

> Thanks Rasmus,
>
> I thought there had to be function out there that could examine the actual
> contents.
>
> Now the question remains, would an ereg/eregi check for html/code/commands
> work on a "jpg/jpeg" type file? From a brief examination of one, I note that
> it's not text, but code. I tried writing some text commands into a jpeg file
> to see what would happen, and wasn't too surprised that the file didn't load
> -- but then again, I don't know what I'm doing:>
>
> I suppose, following what I saw in a movie "Along Came a Spider" --
> manipulating image files with hidden text files, etc. -- sort of put me on
> guard. I have no idea whether this is even possible. . . sounds probable
> though. Would be great to find out before the site is compromised.
>
> Tia,
> Andre
>
>
> On Tuesday 14 May 2002 10:32 pm, you wrote:
> > Have a look at the getimagesize() function.  This function looks at the
> > actual file data, not the mime type nor the file's extension but the data
> > itself and tells you what sort of image file it is.
> >
> > And no, it wouldn't really be after the fact because because stores the
> > file with a temporary random filename in /tmp ensuring not to overwrite
> > anything that is already there.  It is then your job to perform the check
> > and copy the file to some appropriate directory on your server.  If you
> > don't do anything with the file, PHP will automatically delete it at the
> > end of the request.
> >
> > -Rasmus
> >
> > On Tue, 14 May 2002, Andre Dubuc wrote:
> > > My question will probably expose my woeful lack understanding of security
> > > breaches, but perhaps someone can enlighten me.
> > >
> > > On my site, registered members will be allowed to upload jpg/jpeg
> > > pictures. I'm concerned about possible security problems. First, is there
> > > a way to ensure that a picture (and not some other malicious stuff) has
> > > been uploaded?
> > >
> > > Aside from checking the mime type info associated with the file, is there
> > > any way of verifying what's in the file that has been uploaded? (I'm
> > > using Linux LM8.2) Would it be possible to fake info to fool this check?
> > > Would verification checks for html/scripts/commands be of any use?
> > >
> > > Secondly, since the file in question is already uploaded and saved to
> > > disk in /tmp or wherever, wouldn't any verification scheme be sort of,
> > > 'after-the-fact'?
> > >
> > > I would appreciate any input, suggestions, or ideas on what to do here.
> > > Am I being overly-paranoid about this, or do I have  legitimate security
> > > concern.
> > >
> > > Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2
> > >
> > > Tia,
> > > Andre
> > >
> > >
> > >  --
> > > Please pray the Holy Rosary to end the holocaust of abortion.
> > > Remember in your prayers the Holy Souls in Purgatory.
> > >
> > > May God bless you abundantly in His love!
> > > For a free Cenacle Scriptural Rosary Booklet:
> > > http://www.webhart.net/csrb/
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> Please pray the Holy Rosary to end the holocaust of abortion.
> Remember in your prayers the Holy Souls in Purgatory.
>
> May God bless you abundantly in His love!
> For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/
>


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




[PHP] some Javascript functions with PHP

2002-05-16 Thread savaidis


I use:
print('');
print('document.write("Code Name: "+navigator.appCodeName+"
");'); print(''); How is possible to keep this info to a MySQL database with PHP? I think is not possible becouse PHP runs first. Also how is possible to get with PHP info like this (browser type ecc) and user's IP address without Javascript? Or use Javascript and then run a php script to write it to the MySQL database? Thanks Prodromos Savaidis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Console application with PHP

2002-05-16 Thread DoL

Hi All

I am trying to write something similar to a server console display, is it a
good idea to use PHP?

Wondering how things like
1. server clock (similar to a clock applet)
2. server status
can be displayed with PHP code?

Note: I need to display the above two in a continuous fashion on the status
bar!!

Many Thanks
Dominic




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




Re: [PHP] tag img and php

2002-05-16 Thread Maciej Przybycien


Thank you for responding to my email. I am still stuck with my problem.

I am using additionally jpgraph-1.6.1. Here is the content of my try.php
file:
SetScale("textlin");
$graph->img->SetMargin(30,30,50,50);
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->title->Set("SMT HISTOGRAMS");

// A new plot
$ydata =
array(55,66,67,66,67,67,66,68,67,66,68,67,68,67,68,67,68,68,68,68,68,69,68,68,68,68,68,68,68,68,68,69,68,68,70,67,69,68,69,68,69,68,69,68,68,69,68,68,68,69,68,68,68,69,68,68,68,68,69,68,69,67,69,68,68,68,69,69,68,68,69,67,68,68,68,69,69,69,69,69,69,69,68,68,68,68,68,68,68,68,68,68,68,68,68,68,69,68,69,67,69,68,69,68,69,68,69,68,69,67,68,67,69,68,68,68,69,69,69,68,68,69,69,68,69,69,69,68);
// Create the linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);

// A new plot
$ydata1 =
array(57,68,69,68,69,69,69,70,69,70,69,69,70,70,70,70,70,69,70,70,71,70,70,70,70,70,71,70,71,70,71,70,71,69,70,71,71,70,70,71,70,70,71,70,71,70,70,70,71,69,71,70,71,70,71,70,70,70,70,70,70,70,69,70,70,69,70,69,71,69,70,69,70,69,70,69,70,69,71,69,70,69,71,69,70,69,70,70,70,69,70,69,70,69,70,69,70,69,69,69,70,69,69,69,70,69,70,69,69,69,70,69,70,69,69,69,70,69,70,69,69,69,70,69,70,68,69,69);
// Create the linear plot
$lineplot1=new LinePlot($ydata1);
// Add the plot to the graph
$graph->Add($lineplot1);

$graph->Stroke();
?>


I thought that I maight have set some file access uncerrectly and Java
servlets cannot read them so I tried to display simple file:
"; ?>
I got the same result as previously.


I can display any of those files when I load html file:



SMT MONITORING---







So I am really confused. I just suppose that the problem is somehow
related to html being generated on-fly in Java servlets. But I don't
understand why is that.

The source of Java generated html page is:


SMT MONITORING







 Thanks,
   Maciek




On Thu, 16 May 2002, Jim lucas wrote:

> show the contents of 'try_param.php' please.
> 
> Jim Lucas
> - Original Message - 
> From: "Maciej Przybycien" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, May 15, 2002 10:38 AM
> Subject: [PHP] tag img and php
> 
> 
> > 
> > Hi,
> > I included php file as html img:
> >  > height="240" >
> > and Netscape brawser seems not to interpret that. However if I change 
> > try_param.php -> try_param.png then image can be desplayed. 
> > 
> > According to the documentation 'try_param.php' should be interpereted
> > fine. 
> > What could be the problem?
> > 
> >  Thank you,
> > Maciek
> > 
> > 
> > 
> > -- 
> > 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] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

Hi,

I was wondering if someone knows how to save the image from the given  url 
http://domain.com/image.gif   into a file on a local machine

Any suggestion will be greatly appreciated.
Thank you in advance


Victor Polyushko





[PHP] uh, oh errors?

2002-05-16 Thread Jas

Not sure how to resolve this, looked at php.net for the headers available
and this is the error I am recieving:

Warning: Cannot add header information - headers already sent by (output
started at /path/to/connection/script/db.php:6) in /path/to/login/checking
file/auth_done.php on line 13

Here is the code that is in auth_done.php:

session_start();
require '/path/to/login/checking file/db.php';
$db_table = 'auth_users';
$sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
password(\"$p_word\")";
$result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
$num = mysql_numrows($result);
 if ($num !=0) {
  session_register('u_name');
  session_register('p_word');
  $msg_success = "Good freakin job poindexter!!";
  } else {
  header ("Location: index.php"); // This is line 13 that is my error
generator
  }

This is the code for the db.php script:


Any help would be great!  I am assuming there is another way to redirect
users besides the header function, just not sure what it is or how to use
it.  Thanks in advance,
Jas



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




Re: [PHP] uh, oh errors?

2002-05-16 Thread Rasmus Lerdorf

What is on line 6 of the db.php file?  Do you have a stray carriage return
at the end of this file?

On Thu, 16 May 2002, Jas wrote:

> Not sure how to resolve this, looked at php.net for the headers available
> and this is the error I am recieving:
>
> Warning: Cannot add header information - headers already sent by (output
> started at /path/to/connection/script/db.php:6) in /path/to/login/checking
> file/auth_done.php on line 13
>
> Here is the code that is in auth_done.php:
>
> session_start();
> require '/path/to/login/checking file/db.php';
> $db_table = 'auth_users';
> $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> password(\"$p_word\")";
> $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> $num = mysql_numrows($result);
>  if ($num !=0) {
>   session_register('u_name');
>   session_register('p_word');
>   $msg_success = "Good freakin job poindexter!!";
>   } else {
>   header ("Location: index.php"); // This is line 13 that is my error
> generator
>   }
>
> This is the code for the db.php script:
>  $dbh = mysql_connect('localhost','username','password') or die('Could not
> connect to database, please try again later');
> mysql_select_db('db_name') or die('Could not select database, please try
> again later');
> ?>
>
> Any help would be great!  I am assuming there is another way to redirect
> users besides the header function, just not sure what it is or how to use
> it.  Thanks in advance,
> Jas
>
>
>
> --
> 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] uh, oh errors?

2002-05-16 Thread Patrick Lynch

Hi Jas,

I normally output can output a JaveScript
document.location.href="XXX.XXX"; command

Plan B is to do your processing before there is any output and then
decide whether or not to do a redirect using the header() function.

Best Regards,
Patrick Lynch.

Optip Ltd, Internet & Mobile Development
Co. Clare, Ireland.
http://www.optip.com/



-Original Message-
From: Jas [mailto:[EMAIL PROTECTED]] 
Sent: 16 May 2002 18:11
To: [EMAIL PROTECTED]
Subject: [PHP] uh, oh errors?


Not sure how to resolve this, looked at php.net for the headers
available and this is the error I am recieving:

Warning: Cannot add header information - headers already sent by (output
started at /path/to/connection/script/db.php:6) in
/path/to/login/checking file/auth_done.php on line 13

Here is the code that is in auth_done.php:

session_start();
require '/path/to/login/checking file/db.php';
$db_table = 'auth_users';
$sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
password(\"$p_word\")"; $result = @mysql_query($sql,$dbh) or
die("Couldn't execute query"); $num = mysql_numrows($result);  if ($num
!=0) {
  session_register('u_name');
  session_register('p_word');
  $msg_success = "Good freakin job poindexter!!";
  } else {
  header ("Location: index.php"); // This is line 13 that is my error
generator
  }

This is the code for the db.php script:


Any help would be great!  I am assuming there is another way to redirect
users besides the header function, just not sure what it is or how to
use it.  Thanks in advance, Jas



-- 
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] some Javascript functions with PHP

2002-05-16 Thread Kevin Stone

The user's IP address is stored in the PHP global, $REMOTE_ADDR.  Browser
information can be extracted from the get_browser()
 function.  http://www.php.net/manual/en/function.get-browser.php
-Kevin

- Original Message -
From: "savaidis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 7:44 AM
Subject: [PHP] some Javascript functions with PHP


>
> I use:
> print('');
> print('document.write("Code Name: "+navigator.appCodeName+"
");'); > print(''); > > How is possible to keep this info to a MySQL database with PHP? > I think is not possible becouse PHP runs first. > Also how is possible to get with PHP info like this (browser type ecc) > and user's IP address without Javascript? > Or use Javascript and then run a php script to write it to the MySQL > database? > > > Thanks > > Prodromos Savaidis > > > > -- > 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] Can anyone help me save img from URL?

2002-05-16 Thread Patrick Lynch

As fas as I know, the only way to do this is to give somebody
instructions to right click on the file and so "Save As".

Plan B is to put the GIF in a ZIP file and let it be downloaded like
that.

Best Regards,
Patrick Lynch.

Optip Ltd, Internet & Mobile Development
Co. Clare, Ireland.
http://www.optip.com/



-Original Message-
From: Victor Polyushko [mailto:[EMAIL PROTECTED]] 
Sent: 16 May 2002 18:05
To: [EMAIL PROTECTED]
Subject: [PHP] Can anyone help me save img from URL?


Hi,

I was wondering if someone knows how to save the image from the given
url http://domain.com/image.gif   into a file on a local machine

Any suggestion will be greatly appreciated.
Thank you in advance


Victor Polyushko





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




Re: [PHP] uh, oh errors?

2002-05-16 Thread Jas

That worked, I had about 3 blank lines trailing my ?>.  Thanks a ton!
Jas

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What is on line 6 of the db.php file?  Do you have a stray carriage return
> at the end of this file?
>
> On Thu, 16 May 2002, Jas wrote:
>
> > Not sure how to resolve this, looked at php.net for the headers
available
> > and this is the error I am recieving:
> >
> > Warning: Cannot add header information - headers already sent by (output
> > started at /path/to/connection/script/db.php:6) in
/path/to/login/checking
> > file/auth_done.php on line 13
> >
> > Here is the code that is in auth_done.php:
> >
> > session_start();
> > require '/path/to/login/checking file/db.php';
> > $db_table = 'auth_users';
> > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> > password(\"$p_word\")";
> > $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> > $num = mysql_numrows($result);
> >  if ($num !=0) {
> >   session_register('u_name');
> >   session_register('p_word');
> >   $msg_success = "Good freakin job poindexter!!";
> >   } else {
> >   header ("Location: index.php"); // This is line 13 that is my error
> > generator
> >   }
> >
> > This is the code for the db.php script:
> >  > $dbh = mysql_connect('localhost','username','password') or die('Could
not
> > connect to database, please try again later');
> > mysql_select_db('db_name') or die('Could not select database, please try
> > again later');
> > ?>
> >
> > Any help would be great!  I am assuming there is another way to redirect
> > users besides the header function, just not sure what it is or how to
use
> > it.  Thanks in advance,
> > Jas
> >
> >
> >
> > --
> > 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] Uploading JPEG's - Security Issues?

2002-05-16 Thread Jim Winstead

Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> Are you afraid of someone embedding PHP in a .jpg file?  That's not really
> an issue as your web server is probably configured to only serve up PHP as
> .php files.  Likewise, your web server config is likely such that any .jpg
> file is served up as content-type image/jpeg and as such it really doesn't
> matter what sort of junk is embedded in the image.  At most it will show
> up as a broken image icon in your browser.

right.

the thing you may need to worry about, if you provide some sort of
service that allows for anyone to upload a jpeg file that anyone else
can then download, is people using programs that piggyback other data
(mp3 files, rar archives, etc) on those images.

one simple check you can do to minimize this is to compare the image
dimensions to the file size -- if you've got a 120x120 image in a three
meg jpeg file, something is probably awry. so with a combination of
php's getimagesize() and filesize(), you can try to detect that sort of
thing.

(this is one of the problems that plague sites that provide free
webspace. it's only a security issue insofar as this can constitute an
effective denial-of-service 'attack' on your systems.)

jim

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




Fw: [PHP] uh, oh errors?

2002-05-16 Thread Kevin Stone

Don't feel bad about this.  This is something that messes a lot of people
up.  The browser knows where your headers end and where content begins by
adding blank line between the headers and the rest of the page.  ALL headers
must come before any content is printed to the page.  PHP will give you that
error if you attempt to write a new header.  So in fact your problem is not
on Line 13.. but is actually on Line 11.  There are at least two ways to
avoid this...

1. Don't print content before headers.  :)
2. Use output buffering to write the whole page before it is outputed to the
browser.

Hope this helps,
-Keivn

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:10 AM
Subject: [PHP] uh, oh errors?


> Not sure how to resolve this, looked at php.net for the headers available
> and this is the error I am recieving:
>
> Warning: Cannot add header information - headers already sent by (output
> started at /path/to/connection/script/db.php:6) in /path/to/login/checking
> file/auth_done.php on line 13
>
> Here is the code that is in auth_done.php:
>
> session_start();
> require '/path/to/login/checking file/db.php';
> $db_table = 'auth_users';
> $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> password(\"$p_word\")";
> $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> $num = mysql_numrows($result);
>  if ($num !=0) {
>   session_register('u_name');
>   session_register('p_word');
>   $msg_success = "Good freakin job poindexter!!";
>   } else {
>   header ("Location: index.php"); // This is line 13 that is my error
> generator
>   }
>
> This is the code for the db.php script:
>  $dbh = mysql_connect('localhost','username','password') or die('Could not
> connect to database, please try again later');
> mysql_select_db('db_name') or die('Could not select database, please try
> again later');
> ?>
>
> Any help would be great!  I am assuming there is another way to redirect
> users besides the header function, just not sure what it is or how to use
> it.  Thanks in advance,
> Jas
>
>
>
> --
> 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] uh, oh errors?

2002-05-16 Thread Kevin Stone

DOH!  I retract that statement about Line 11.. I saw it and immediately
thought you were printing out that line, clearly you're not.  But the rest
of my point is still valid, and Rasmus pointed out the true location of the
error.  Anyway glad to hear you got the problem solved so quickly.

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: "PHP-general" <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:23 AM
Subject: Fw: [PHP] uh, oh errors?


> Don't feel bad about this.  This is something that messes a lot of people
> up.  The browser knows where your headers end and where content begins by
> adding blank line between the headers and the rest of the page.  ALL
headers
> must come before any content is printed to the page.  PHP will give you
that
> error if you attempt to write a new header.  So in fact your problem is
not
> on Line 13.. but is actually on Line 11.  There are at least two ways to
> avoid this...
>
> 1. Don't print content before headers.  :)
> 2. Use output buffering to write the whole page before it is outputed to
the
> browser.
>
> Hope this helps,
> -Keivn
>
> - Original Message -
> From: "Jas" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 16, 2002 11:10 AM
> Subject: [PHP] uh, oh errors?
>
>
> > Not sure how to resolve this, looked at php.net for the headers
available
> > and this is the error I am recieving:
> >
> > Warning: Cannot add header information - headers already sent by (output
> > started at /path/to/connection/script/db.php:6) in
/path/to/login/checking
> > file/auth_done.php on line 13
> >
> > Here is the code that is in auth_done.php:
> >
> > session_start();
> > require '/path/to/login/checking file/db.php';
> > $db_table = 'auth_users';
> > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> > password(\"$p_word\")";
> > $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> > $num = mysql_numrows($result);
> >  if ($num !=0) {
> >   session_register('u_name');
> >   session_register('p_word');
> >   $msg_success = "Good freakin job poindexter!!";
> >   } else {
> >   header ("Location: index.php"); // This is line 13 that is my error
> > generator
> >   }
> >
> > This is the code for the db.php script:
> >  > $dbh = mysql_connect('localhost','username','password') or die('Could
not
> > connect to database, please try again later');
> > mysql_select_db('db_name') or die('Could not select database, please try
> > again later');
> > ?>
> >
> > Any help would be great!  I am assuming there is another way to redirect
> > users besides the header function, just not sure what it is or how to
use
> > it.  Thanks in advance,
> > Jas
> >
> >
> >
> > --
> > 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] Using Sessions under Win98/Apache

2002-05-16 Thread Edward Marczak

On 5/16/02 5:17 AM, "Neil Freeman" <[EMAIL PROTECTED]> wrote:

> FYI...
> 
> I'm using sessions successfully using PHP v4.1.0 on Windows NT.

Hurmph.  Well, the upgrade to 4.2.x did it for me under 98.  I just need to
check the rest of my code, though.  For now, seems pretty harmless.  Thanks,
though.
-- 
Ed Marczak
[EMAIL PROTECTED]

P.S.  Are you also using Apache?  Or IIS?


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




[PHP] Gettext and PHP4.2.0?

2002-05-16 Thread Bram van Leur

Hi everyone,

I've recently (for once in my life!) succesfully compiled PHP4.2.0 using 
the following configure command-line:
'./configure' '--prefix=/usr' '--with-config-file-path=/etc' 
'--disable-debug' '--enable-pic' '--enable-inline-optimization' 
'--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' 
'--with-regex=system' '--with-gettext=shared' '--with-zlib' 
'--with-gdbm' '--with-layout=GNU' '--enable-debugger' 
'--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem=shared' 
'--enable-sysvshm=shared' '--enable-track-vars' '--enable-yp' 
'--enable-ftp' '--enable-wddx' '--without-unixODBC' '--without-oracle' 
'--without-oci8' '--with-mysql=/usr' '--with-gd-dir=/usr' '--with-flex' 
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-ttf'

As you can see it contains "--with-gettext" so I'd expect a function 
like bindtextdomain() is availible. However, Horde (chora, actually) 
reports:
Fatal error: Call to undefined function: bindtextdomain() in 
/home/virtual/site4/fst/var/www/html/horde/lib/Lang.php on line 91

What could have gone wrong and how can I fix it?

Thanks in advance

-- 
Bram v. Leur
The Netherlands

Proud to PHP!


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




RE: [PHP] uh, oh errors?

2002-05-16 Thread Sysadmin

What are some benefits to using output buffering versus just letting it 
generate as it goes?

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 1:24 PM
To: PHP-general
Subject: Fw: [PHP] uh, oh errors?


Don't feel bad about this.  This is something that messes a lot of 
people
up.  The browser knows where your headers end and where content begins 
by
adding blank line between the headers and the rest of the page.  ALL 
headers
must come before any content is printed to the page.  PHP will give you 
that
error if you attempt to write a new header.  So in fact your problem is 
not
on Line 13.. but is actually on Line 11.  There are at least two ways to
avoid this...

1. Don't print content before headers.  :)
2. Use output buffering to write the whole page before it is outputed 
to the
browser.

Hope this helps,
-Keivn

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:10 AM
Subject: [PHP] uh, oh errors?


> Not sure how to resolve this, looked at php.net for the headers 
available
> and this is the error I am recieving:
>
> Warning: Cannot add header information - headers already sent by 
(output
> started at /path/to/connection/script/db.php:6) in 
/path/to/login/checking
> file/auth_done.php on line 13
>
> Here is the code that is in auth_done.php:
>
> session_start();
> require '/path/to/login/checking file/db.php';
> $db_table = 'auth_users';
> $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
> password(\"$p_word\")";
> $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
> $num = mysql_numrows($result);
>  if ($num !=0) {
>   session_register('u_name');
>   session_register('p_word');
>   $msg_success = "Good freakin job poindexter!!";
>   } else {
>   header ("Location: index.php"); // This is line 13 that is my error
> generator
>   }
>
> This is the code for the db.php script:
>  $dbh = mysql_connect('localhost','username','password') or die('Could 
not
> connect to database, please try again later');
> mysql_select_db('db_name') or die('Could not select database, please 
try
> again later');
> ?>
>
> Any help would be great!  I am assuming there is another way to 
redirect
> users besides the header function, just not sure what it is or how to 
use
> it.  Thanks in advance,
> Jas
>
>
>
> --
> 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] uh, oh errors?

2002-05-16 Thread Jerome Houston

one REALLY notable advantage is:

if you us ob_*() functions, instead of writing HTML pages with php tags 
inserted, you can write XML pages with PHP tags inserted.  then after you're 
done, you can pass the contents of the output buffer to an XSLT processer 
like sablotron, THEN outputting an HTML page.

-jerome


Original Message Follows
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] uh, oh errors?
Date: Thu, 16 May 2002 13:43:30 -0400

What are some benefits to using output buffering versus just letting it
generate as it goes?

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 1:24 PM
To: PHP-general
Subject: Fw: [PHP] uh, oh errors?


Don't feel bad about this.  This is something that messes a lot of
people
up.  The browser knows where your headers end and where content begins
by
adding blank line between the headers and the rest of the page.  ALL
headers
must come before any content is printed to the page.  PHP will give you
that
error if you attempt to write a new header.  So in fact your problem is
not
on Line 13.. but is actually on Line 11.  There are at least two ways to
avoid this...

1. Don't print content before headers.  :)
2. Use output buffering to write the whole page before it is outputed
to the
browser.

Hope this helps,
-Keivn

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:10 AM
Subject: [PHP] uh, oh errors?


 > Not sure how to resolve this, looked at php.net for the headers
available
 > and this is the error I am recieving:
 >
 > Warning: Cannot add header information - headers already sent by
(output
 > started at /path/to/connection/script/db.php:6) in
/path/to/login/checking
 > file/auth_done.php on line 13
 >
 > Here is the code that is in auth_done.php:
 >
 > session_start();
 > require '/path/to/login/checking file/db.php';
 > $db_table = 'auth_users';
 > $sql = "SELECT * from $db_table WHERE un = \"$u_name\" AND pw =
 > password(\"$p_word\")";
 > $result = @mysql_query($sql,$dbh) or die("Couldn't execute query");
 > $num = mysql_numrows($result);
 >  if ($num !=0) {
 >   session_register('u_name');
 >   session_register('p_word');
 >   $msg_success = "Good freakin job poindexter!!";
 >   } else {
 >   header ("Location: index.php"); // This is line 13 that is my error
 > generator
 >   }
 >
 > This is the code for the db.php script:
 >  $dbh = mysql_connect('localhost','username','password') or die('Could
not
 > connect to database, please try again later');
 > mysql_select_db('db_name') or die('Could not select database, please
try
 > again later');
 > ?>
 >
 > Any help would be great!  I am assuming there is another way to
redirect
 > users besides the header function, just not sure what it is or how to
use
 > it.  Thanks in advance,
 > Jas
 >
 >
 >
 > --
 > 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


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: [PHP] uh, oh errors?

2002-05-16 Thread Robert Cummings

[EMAIL PROTECTED] wrote:
> 
> What are some benefits to using output buffering versus just letting it
> generate as it goes?

Pros:

- headers can be added at any time
- buffer content can be post processed (gz compression) (xslt)
- if an error occurs can avoid serving half a document

Cons:

- transmission of content doesn't start until preprocessor completes
- slightly more overhead since content must be stored in memory until
  buffer is flushed.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Uploading JPEG's - Security Issues?

2002-05-16 Thread Andre Dubuc

Thanks Rasmus,

I thought there had to be function out there that could examine the actual 
contents. 

Now the question remains, would an ereg/eregi check for html/code/commands 
work on a "jpg/jpeg" type file? From a brief examination of one, I note that 
it's not text, but code. I tried writing some text commands into a jpeg file 
to see what would happen, and wasn't too surprised that the file didn't load 
-- but then again, I don't know what I'm doing:>

I suppose, following what I saw in a movie "Along Came a Spider" -- 
manipulating image files with hidden text files, etc. -- sort of put me on 
guard. I have no idea whether this is even possible. . . sounds probable 
though. Would be great to find out before the site is compromised.

Tia,
Andre


On Tuesday 14 May 2002 10:32 pm, you wrote:
> Have a look at the getimagesize() function.  This function looks at the
> actual file data, not the mime type nor the file's extension but the data
> itself and tells you what sort of image file it is.
>
> And no, it wouldn't really be after the fact because because stores the
> file with a temporary random filename in /tmp ensuring not to overwrite
> anything that is already there.  It is then your job to perform the check
> and copy the file to some appropriate directory on your server.  If you
> don't do anything with the file, PHP will automatically delete it at the
> end of the request.
>
> -Rasmus
>
> On Tue, 14 May 2002, Andre Dubuc wrote:
> > My question will probably expose my woeful lack understanding of security
> > breaches, but perhaps someone can enlighten me.
> >
> > On my site, registered members will be allowed to upload jpg/jpeg
> > pictures. I'm concerned about possible security problems. First, is there
> > a way to ensure that a picture (and not some other malicious stuff) has
> > been uploaded?
> >
> > Aside from checking the mime type info associated with the file, is there
> > any way of verifying what's in the file that has been uploaded? (I'm
> > using Linux LM8.2) Would it be possible to fake info to fool this check?
> > Would verification checks for html/scripts/commands be of any use?
> >
> > Secondly, since the file in question is already uploaded and saved to
> > disk in /tmp or wherever, wouldn't any verification scheme be sort of,
> > 'after-the-fact'?
> >
> > I would appreciate any input, suggestions, or ideas on what to do here.
> > Am I being overly-paranoid about this, or do I have  legitimate security
> > concern.
> >
> > Using: Apache 1.3.23 + PHP 4.1.2 + PostgreSQL 7.2
> >
> > Tia,
> > Andre
> >
> >
> >  --
> > Please pray the Holy Rosary to end the holocaust of abortion.
> > Remember in your prayers the Holy Souls in Purgatory.
> >
> > May God bless you abundantly in His love!
> > For a free Cenacle Scriptural Rosary Booklet:
> > http://www.webhart.net/csrb/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/

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




[PHP] Making Multiple Pages

2002-05-16 Thread Jason Soza

I have some ideas on how this should be done, but I'm at work and can't 
really test them, so I was thinking maybe I could run it by you all and 
maybe get some feedback and/or new ideas.

I have a PHP/MySQL-generated page that displays image thumbnails. 
Currently, I have a loop that makes a table and table rows, fills the 
rows with the thumbnails, then when there's no more information, it 
completes whatever row it's on with blank 's, then closes the table.

This was working fine, but my site is actually attracting more traffic 
than I originally thought, and I'm getting more image submissions. It's 
getting to where it's no longer practical to arrange all the thumbnails 
onto one page, I need to have like 25 on one page, then have the script 
create a link at the bottom so users can click and see the next 25.

I'm thinking I need to use some kind of row count language in the 
script, i.e. first count how many rows are in the MySQL table, if it's 
less than 25, just display them all. If there's more than 25, display 
only 1 - 25, then create a link to view 26 - 50, etc.

Is that what I need to be looking into? Any other ideas would be 
appreciated. Thanks!

Jason Soza


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




Re: [PHP] eregi(mail)

2002-05-16 Thread Liam Gibbs

Thanks to all who helped out with the eregi(mail)
stuff. I got my problem solved, and on top of that,
there were some bugs that I found in the code. Thanks
again to everyone.


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: [PHP] LDAP Search Scope / Schema Retrieval

2002-05-16 Thread Matt Rohrer

On Thu, May 16, 2002 at 09:34:16AM -0500, D Canfield wrote:
> Two related questions:
> 
> 1) Is there any work being done to support the retrieval of the LDAP
> schema in PHP (similar to Perl's Net::LDAP::Schema)?  Is there any other
> good way to get this information into PHP?
> 
> 2) Is there any way to change the search scope of an LDAP search in
> PHP?  Specifically, the following OpenLDAP search command will fetch the
> schema from the server: 
>  ldapsearch -s base -x -b 'cn=subschema' objectclass=* +
> But, I can find no way to switch the search scope from SUB to BASE, so
> the equivalent call in PHP won't work.
> 
> Any suggestions?

look into ldap_read() and the optional arguments to ldap_search()

 matt

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




Re: [PHP] Making Multiple Pages

2002-05-16 Thread Kevin Stone

$query = "SELECT * FROM mytable LIMIT $i, 20";

Where 20 is the number of rows to retrieve and $i is the starting row.

By incrementing $i + 20 you can do next, prev buttons, or parse the total
number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - next).

Search www.mysql.com for more information about using LIMIT in your queries.

-Kevin

- Original Message -
From: "Jason Soza" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 12:31 PM
Subject: [PHP] Making Multiple Pages


> I have some ideas on how this should be done, but I'm at work and can't
> really test them, so I was thinking maybe I could run it by you all and
> maybe get some feedback and/or new ideas.
>
> I have a PHP/MySQL-generated page that displays image thumbnails.
> Currently, I have a loop that makes a table and table rows, fills the
> rows with the thumbnails, then when there's no more information, it
> completes whatever row it's on with blank 's, then closes the table.
>
> This was working fine, but my site is actually attracting more traffic
> than I originally thought, and I'm getting more image submissions. It's
> getting to where it's no longer practical to arrange all the thumbnails
> onto one page, I need to have like 25 on one page, then have the script
> create a link at the bottom so users can click and see the next 25.
>
> I'm thinking I need to use some kind of row count language in the
> script, i.e. first count how many rows are in the MySQL table, if it's
> less than 25, just display them all. If there's more than 25, display
> only 1 - 25, then create a link to view 26 - 50, etc.
>
> Is that what I need to be looking into? Any other ideas would be
> appreciated. Thanks!
>
> Jason Soza
>
>
> --
> 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] Console application with PHP

2002-05-16 Thread Vail, Warren

PHP and Web Servers probably make a bad choice for what is essentially a
real time application.  PHP and web servers expect to serve up a page of
essentially HTML(and Javascript, or Java Applets), then close the connection
to a browser so that it can handle the requests of others, and not deal with
that connection again until the browser makes another connection, usually as
a result of a hotlink click, or submit.

There is a way to simulate what you want using JavaScript (if PHP can output
HTML, it can also output Javascript).  Check http://www.hotscripts.com in
their JavaScript section for routines to perform 3 functions,

1. a routine which will cause the a page to request a refresh every 10
seconds or so, there by requesting the same page, which your PHP can fill
with the latest (real-time?) data.
2. a routine for using JavaScript to display data on the status line.
3. a routine for displaying the time (using the clock on the browser
machine).

hope this helps,


Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-Original Message-
From: DoL [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 9:12 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Console application with PHP


Hi All

I am trying to write something similar to a server console display, is it a
good idea to use PHP?

Wondering how things like
1. server clock (similar to a clock applet)
2. server status
can be displayed with PHP code?

Note: I need to display the above two in a continuous fashion on the status
bar!!

Many Thanks
Dominic




-- 
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] Re: [PHP-DEV] Console application with PHP

2002-05-16 Thread Markus Fischer

Hi,

all is possible. I suggest taking a look at
http://gtk.php.net/ and
http://www.php.net/manual/en/features.commandline.php for a
start.

- Markus

On Fri, May 17, 2002 at 12:12:20AM +0800, DoL wrote : 
> Hi All
> 
> I am trying to write something similar to a server console display, is it a
> good idea to use PHP?
> 
> Wondering how things like
> 1. server clock (similar to a clock applet)
> 2. server status
> can be displayed with PHP code?
> 
> Note: I need to display the above two in a continuous fashion on the status
> bar!!
> 
> Many Thanks
> Dominic
> 
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
-
"I mean "When in doubt, blame mcrypt" is more often right than wrong :)"
"Always right, never wrong :)"
- Two PHP developers who want to remain unnamed

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




[PHP] Re: Date Function in Php

2002-05-16 Thread Baba Buehler

Vinod Palan wrote:
> hi ,
> Do any one have date functions like that we have in asp 1) Dateadd()
> 2) Datediff()
> etc?

There are some classes in PEAR that may do what you want, take a look at 
Date & Date::Calc.

baba


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




Re: [PHP] Making Multiple Pages

2002-05-16 Thread Jason Soza

Great! I think that's the SQL function I needed.

Now for the PHP part - I'm a bit fo a newbie at writing code, so bear 
with me here. My query string is currently something like:

$sql = mysql_query("SELECT * FROM mytable WHERE color=$color");

So I would modify that to read:

$sql = mysql_query("SELECT * FROM mytable WHERE color=$color LIMIT $i, 
25");

Where $i = 1 To get just the first 25 records. I think I'm confused on 
how to set $i and create links. Would I just initially set $i = "1"; 
then make links that point to:

myscript.php?color=red&i=25

Then have a $_GET['i'] variable in my script and set $i equal to that?

Your help is appreciated. Thanks again.

Jason Soza

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
Date: Thursday, May 16, 2002 10:53 am
Subject: Re: [PHP] Making Multiple Pages

> $query = "SELECT * FROM mytable LIMIT $i, 20";
> 
> Where 20 is the number of rows to retrieve and $i is the starting row.
> 
> By incrementing $i + 20 you can do next, prev buttons, or parse 
> the total
> number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 -
> next).
> 
> Search www.mysql.com for more information about using LIMIT in 
> your queries.
> 
> -Kevin
> 
> - Original Message -
> From: "Jason Soza" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 16, 2002 12:31 PM
> Subject: [PHP] Making Multiple Pages
> 
> 
> > I have some ideas on how this should be done, but I'm at work 
> and can't
> > really test them, so I was thinking maybe I could run it by you 
> all and
> > maybe get some feedback and/or new ideas.
> >
> > I have a PHP/MySQL-generated page that displays image thumbnails.
> > Currently, I have a loop that makes a table and table rows, 
> fills the
> > rows with the thumbnails, then when there's no more information, it
> > completes whatever row it's on with blank 's, then closes 
> the table.
> >
> > This was working fine, but my site is actually attracting more 
> traffic> than I originally thought, and I'm getting more image 
> submissions. It's
> > getting to where it's no longer practical to arrange all the 
> thumbnails> onto one page, I need to have like 25 on one page, 
> then have the script
> > create a link at the bottom so users can click and see the next 25.
> >
> > I'm thinking I need to use some kind of row count language in the
> > script, i.e. first count how many rows are in the MySQL table, 
> if it's
> > less than 25, just display them all. If there's more than 25, 
> display> only 1 - 25, then create a link to view 26 - 50, etc.
> >
> > Is that what I need to be looking into? Any other ideas would be
> > appreciated. Thanks!
> >
> > Jason Soza
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




[PHP] Warning: Max file size of 4194304 bytes exceeded...

2002-05-16 Thread Lee P Reilly

Hi,

I have another quick question (still on the topic of validating uploaded
files). I have upload_max_filesize = 4194304 in my php.ini file. When I
upload the file, the script that processes does the following:

1-Sets up the session info
2-Starts the HTML header template
3-Displays user login info
4-Does some error checking - file validation & file content validation.
5-Various info & menus are displayed
6- echos the HTML footer

This way, if there are any errors I can display them in a nice way i.e.
in between the HTML headers.

The question(s):

- Is there anyway to catch the error that causes the "Warning: Max file
size of blah exceeded" message
  e.g. something like if (max_file_exceeded) {...} ? Right now, this
message appears at the top of the screen (therefore, before any of the
script is processes).

- Is there anyway to prevent the error message from being displayed on
screen, and perhaps set a flag so we know that the problem has occured?

Thank you very much in advance for any input.

- Lee




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




Re: [PHP] Making Multiple Pages

2002-05-16 Thread Kevin Stone

One way to get it started would be to work strictly within the links.  Don't
initilize $i unless it is not set (which logically would mean your visitng
the page for the first time).  So..

if (!isset($_GET['i']))
$i = 0;
else
$i += 20;

Another way would be to extract the number of total rows, divide by 20, and
build a list of links in a for() loop.
$num_rows = mysql_num_rows($sql);
$num_pages = floor($num_rows/20);
for ($i=0; $i
To: "Kevin Stone" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 1:15 PM
Subject: Re: [PHP] Making Multiple Pages


> Great! I think that's the SQL function I needed.
>
> Now for the PHP part - I'm a bit fo a newbie at writing code, so bear
> with me here. My query string is currently something like:
>
> $sql = mysql_query("SELECT * FROM mytable WHERE color=$color");
>
> So I would modify that to read:
>
> $sql = mysql_query("SELECT * FROM mytable WHERE color=$color LIMIT $i,
> 25");
>
> Where $i = 1 To get just the first 25 records. I think I'm confused on
> how to set $i and create links. Would I just initially set $i = "1";
> then make links that point to:
>
> myscript.php?color=red&i=25
>
> Then have a $_GET['i'] variable in my script and set $i equal to that?
>
> Your help is appreciated. Thanks again.
>
> Jason Soza
>
> - Original Message -
> From: "Kevin Stone" <[EMAIL PROTECTED]>
> Date: Thursday, May 16, 2002 10:53 am
> Subject: Re: [PHP] Making Multiple Pages
>
> > $query = "SELECT * FROM mytable LIMIT $i, 20";
> >
> > Where 20 is the number of rows to retrieve and $i is the starting row.
> >
> > By incrementing $i + 20 you can do next, prev buttons, or parse
> > the total
> > number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 -
> > next).
> >
> > Search www.mysql.com for more information about using LIMIT in
> > your queries.
> >
> > -Kevin
> >
> > - Original Message -
> > From: "Jason Soza" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, May 16, 2002 12:31 PM
> > Subject: [PHP] Making Multiple Pages
> >
> >
> > > I have some ideas on how this should be done, but I'm at work
> > and can't
> > > really test them, so I was thinking maybe I could run it by you
> > all and
> > > maybe get some feedback and/or new ideas.
> > >
> > > I have a PHP/MySQL-generated page that displays image thumbnails.
> > > Currently, I have a loop that makes a table and table rows,
> > fills the
> > > rows with the thumbnails, then when there's no more information, it
> > > completes whatever row it's on with blank 's, then closes
> > the table.
> > >
> > > This was working fine, but my site is actually attracting more
> > traffic> than I originally thought, and I'm getting more image
> > submissions. It's
> > > getting to where it's no longer practical to arrange all the
> > thumbnails> onto one page, I need to have like 25 on one page,
> > then have the script
> > > create a link at the bottom so users can click and see the next 25.
> > >
> > > I'm thinking I need to use some kind of row count language in the
> > > script, i.e. first count how many rows are in the MySQL table,
> > if it's
> > > less than 25, just display them all. If there's more than 25,
> > display> only 1 - 25, then create a link to view 26 - 50, etc.
> > >
> > > Is that what I need to be looking into? Any other ideas would be
> > > appreciated. Thanks!
> > >
> > > Jason Soza
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>



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




[PHP] Re: Warning: Max file size of 4194304 bytes exceeded...

2002-05-16 Thread Lee P Reilly

> - Is there anyway to prevent the error message from being displayed on
> screen, and perhaps set a flag so we know that the problem has occured?

I know that if I set display_errors = Off in php.ini I can stop the message
from being displayed, but can I set a flag to say the upload_max_filesize
has been exceeded and handle the error my own way?

Cheers,
Lee


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




RE: [PHP] Making Multiple Pages

2002-05-16 Thread Cal Evans

Do a google search for ADODB. It's a PHP database abstraction layer. It has
built in 'pagination' methods (Previous X, next X) along with an example of
how to use them.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Jason Soza [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 1:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Making Multiple Pages


I have some ideas on how this should be done, but I'm at work and can't
really test them, so I was thinking maybe I could run it by you all and
maybe get some feedback and/or new ideas.

I have a PHP/MySQL-generated page that displays image thumbnails.
Currently, I have a loop that makes a table and table rows, fills the
rows with the thumbnails, then when there's no more information, it
completes whatever row it's on with blank 's, then closes the table.

This was working fine, but my site is actually attracting more traffic
than I originally thought, and I'm getting more image submissions. It's
getting to where it's no longer practical to arrange all the thumbnails
onto one page, I need to have like 25 on one page, then have the script
create a link at the bottom so users can click and see the next 25.

I'm thinking I need to use some kind of row count language in the
script, i.e. first count how many rows are in the MySQL table, if it's
less than 25, just display them all. If there's more than 25, display
only 1 - 25, then create a link to view 26 - 50, etc.

Is that what I need to be looking into? Any other ideas would be
appreciated. Thanks!

Jason Soza


--
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] Making Multiple Pages

2002-05-16 Thread J Smith


You should also add an ORDER BY clause in there, as the SQL standard doesn't 
guarantee the order that rows are retrieved in. There's a chance that 
you'll get, say, 20 rows on the first page, go to the second page and get 
some of the rows you've already seen on the first page. If you use an ORDER 
BY, you'll at least guarantee that you'll get them in the same order each 
time.

J


Kevin Stone wrote:

> $query = "SELECT * FROM mytable LIMIT $i, 20";
> 
> Where 20 is the number of rows to retrieve and $i is the starting row.
> 
> By incrementing $i + 20 you can do next, prev buttons, or parse the total
> number of rows into page links (prev - 1, 2, 3, 4, 5, 6.. 10.. 20 - next).
> 
> Search www.mysql.com for more information about using LIMIT in your
> queries.
> 
> -Kevin
> 


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




[PHP] refreshing PHP on onClick

2002-05-16 Thread Leotta, Natalie (NCI/IMS)

This might be a little bit JS and a little bit PHP.  I'm wondering if
there's an easy way to refresh a PHP page on an "onClick" and change one
parameter (say someone wants to redraw the graph, but with the points).  I
don't want to pay attention to any of the other parameters that could have
changed on the screen (we've got a bunch of selects).  We had come up with a
really complicated way which involved changing the parameters to the most
recent line drawn, deleting the most recent line, and then submitting with
those parameters and the showPoints value changed, but that sounds pretty
complicated.
 
If anyone could come up with a quicker way that didn't involve the whole
submitting thing, that would be easier.  My page has all of the vars that
are necessary in hidden vars, and has HTML, PHP, and a handful of JS.
 
Thanks!
 
-Natalie
 

Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
[EMAIL PROTECTED] 

 



Re: [PHP] refreshing PHP on onClick

2002-05-16 Thread Robert Cummings

"Leotta, Natalie (NCI/IMS)" wrote:
> 
> This might be a little bit JS and a little bit PHP.  I'm wondering if
> there's an easy way to refresh a PHP page on an "onClick" and change one
> parameter (say someone wants to redraw the graph, but with the points).  I
> don't want to pay attention to any of the other parameters that could have
> changed on the screen (we've got a bunch of selects).  We had come up with a
> really complicated way which involved changing the parameters to the most
> recent line drawn, deleting the most recent line, and then submitting with
> those parameters and the showPoints value changed, but that sounds pretty
> complicated.
> 
> If anyone could come up with a quicker way that didn't involve the whole
> submitting thing, that would be easier.  My page has all of the vars that
> are necessary in hidden vars, and has HTML, PHP, and a handful of JS.

You wouldn't happen to have a demo would you? A visualization
would help me a lot.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] refreshing PHP on onClick

2002-05-16 Thread Kevin Stone

I'm not certain I understand your situation.  If you're trying to keep state
between each new input then I would recommend PHP sessions to store your
variables. Could you elaborate more what you're trying to do?
-Kevin

- Original Message -
From: "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 1:48 PM
Subject: [PHP] refreshing PHP on onClick


> This might be a little bit JS and a little bit PHP.  I'm wondering if
> there's an easy way to refresh a PHP page on an "onClick" and change one
> parameter (say someone wants to redraw the graph, but with the points).  I
> don't want to pay attention to any of the other parameters that could have
> changed on the screen (we've got a bunch of selects).  We had come up with
a
> really complicated way which involved changing the parameters to the most
> recent line drawn, deleting the most recent line, and then submitting with
> those parameters and the showPoints value changed, but that sounds pretty
> complicated.
>
> If anyone could come up with a quicker way that didn't involve the whole
> submitting thing, that would be easier.  My page has all of the vars that
> are necessary in hidden vars, and has HTML, PHP, and a handful of JS.
>
> Thanks!
>
> -Natalie
>
>
> Natalie S. Leotta
> Information Management Services, Inc.
> (301) 680-9770
> [EMAIL PROTECTED]
>
>
>



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




RE: [PHP] refreshing PHP on onClick

2002-05-16 Thread Leotta, Natalie (NCI/IMS)

It's all in a password protected site because the data's all confidential at
this point in time, but I can give you a mental picture.  

There are a bunch of dropdowns - State, Cancer, Sex, Race, Age.  We're
drawing a graph of best fit lines - up to 5 allowed on the graph, then we
start over replacing them.  We don't draw the actual data points unless the
user clicks on a checkbox.  They want that checkbox to be instant
gratification, without making the user refresh.  I just want a way to make
it do the refresh (and let me change that one variable, so it draws the
points or doesn't draw the points), but not a full submit because that would
add another line to the graph.

I'm sorry I can't send you the URL at this stage of the game.  it should be
up and running this summer though :-)

Thanks for any help you can give me!!

-Natalie

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 16, 2002 3:56 PM
To: Leotta, Natalie (NCI/IMS)
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] refreshing PHP on onClick


"Leotta, Natalie (NCI/IMS)" wrote:
> 
> This might be a little bit JS and a little bit PHP.  I'm wondering if 
> there's an easy way to refresh a PHP page on an "onClick" and change 
> one parameter (say someone wants to redraw the graph, but with the 
> points).  I don't want to pay attention to any of the other parameters 
> that could have changed on the screen (we've got a bunch of selects).  
> We had come up with a really complicated way which involved changing 
> the parameters to the most recent line drawn, deleting the most recent 
> line, and then submitting with those parameters and the showPoints 
> value changed, but that sounds pretty complicated.
> 
> If anyone could come up with a quicker way that didn't involve the 
> whole submitting thing, that would be easier.  My page has all of the 
> vars that are necessary in hidden vars, and has HTML, PHP, and a 
> handful of JS.

You wouldn't happen to have a demo would you? A visualization would help me
a lot.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] refreshing PHP on onClick

2002-05-16 Thread Robert Cummings

"Leotta, Natalie (NCI/IMS)" wrote:
> 
> It's all in a password protected site because the data's all confidential at
> this point in time, but I can give you a mental picture.
> 
> There are a bunch of dropdowns - State, Cancer, Sex, Race, Age.  We're
> drawing a graph of best fit lines - up to 5 allowed on the graph, then we
> start over replacing them.  We don't draw the actual data points unless the
> user clicks on a checkbox.  They want that checkbox to be instant
> gratification, without making the user refresh.  I just want a way to make
> it do the refresh (and let me change that one variable, so it draws the
> points or doesn't draw the points), but not a full submit because that would
> add another line to the graph.

Since you're already using javascript... you could try generating 2 images
at the same time, one with the data points drawn, the other without, then using
the same technology as for javascript rollovers, you could replace the image
when the onClick event is caught. Instant gratification, and no messy varable
replacements.

> I'm sorry I can't send you the URL at this stage of the game.  it should be
> up and running this summer though :-)

No problem, completely understandable :)

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] BUG?: for loop using chars

2002-05-16 Thread Erich Reimberg N

Hello,

I'm trying to generate this list of letters A..Z, using this

   for ($l='A'; $l<='Z'; $l++)
  echo $l."-";

And it doesn't work. It generates the output included at the end of
this message (I used  to be shorter)

But this works
   for ($l='A'; $l<='Y'; $l++)
  echo $l."-";
generating the expected output.

IS this a bug in PHP?

Any help? Please, if you can, Cc to my email: [EMAIL PROTECTED]

TIA,
Erich

---
Wrong output:
A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z-AA-AB-AC-AD-AE-AF-
AG-AH-AI-YV-YW-YX-YY-YZ-

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




RE: [PHP] refreshing PHP on onClick

2002-05-16 Thread Leotta, Natalie (NCI/IMS)

This sounds like it might work.  Thanks for your help!!  I knew there had to
be a better way than what my coworkers came up with :-)

-Natalie

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 16, 2002 4:09 PM
To: Leotta, Natalie (NCI/IMS)
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] refreshing PHP on onClick


"Leotta, Natalie (NCI/IMS)" wrote:
> 
> It's all in a password protected site because the data's all 
> confidential at this point in time, but I can give you a mental 
> picture.
> 
> There are a bunch of dropdowns - State, Cancer, Sex, Race, Age.  We're 
> drawing a graph of best fit lines - up to 5 allowed on the graph, then 
> we start over replacing them.  We don't draw the actual data points 
> unless the user clicks on a checkbox.  They want that checkbox to be 
> instant gratification, without making the user refresh.  I just want a 
> way to make it do the refresh (and let me change that one variable, so 
> it draws the points or doesn't draw the points), but not a full submit 
> because that would add another line to the graph.

Since you're already using javascript... you could try generating 2 images
at the same time, one with the data points drawn, the other without, then
using the same technology as for javascript rollovers, you could replace the
image when the onClick event is caught. Instant gratification, and no messy
varable replacements.

> I'm sorry I can't send you the URL at this stage of the game.  it 
> should be up and running this summer though :-)

No problem, completely understandable :)

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] Informix compile problem

2002-05-16 Thread Mike Baranski

I posted a fix on the bug report form, but don't know how to implement it in 
the configure script.  Someone should add it that knows what they're doing.

http://bugs.php.net/bug.php?id=15177

Mike B.
-- 
##
#  Mike Baranski   #
# Security Management Consulting  #
#  http://www.secmgmt.com #
#   919-788-9200 #
#


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




Re: [PHP] fsockopen

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Scott St. John wrote:
> I am using fsockopen to test several of our SQL and WEB servers at our 
> office.  Testing ports 80, 1433 and 8080 work fine, but I would like to 
> set something up to test ports on our mainframe.  These are printers 
> listening on 9100 and when I test it fails.  I don't see anything in the 
> online docs about going above a certain port - or is there something else.

"When I test it fails" is not a useful problem report.

Show the relevant parts of the code you're running and tell us what, 
specifically is happening (i.e., if an error message is displayed, paste 
that into your problem report; if a variable seems to be getting an 
unexpected value, change your code to print that value out, and then show 
us both the code and the value that it actually printed out).

Otherwise it's just sort of a guessing game.

miguel


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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Michael Kimsal

Miguel Cruz wrote:
> 



> all the power of DOS batchfiles. Every single thing you want to do - even
> basic filesystem operations like working with directories and file
> permissions!!! - requires purchasing expensive and buggy .COM components
> from nasty little companies with horrible documentation and nonexistent
> customer service. I consider it an incredibly developer-hostile
> environment (unless you're in the business of developing developer tools,
> which seems to be the lynchpin of the ASP ponzi scheme).

As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
I'd have to say that you could definitely at least read a directory's
contents without having to purchase external libraries.  Please don't
go overboard.

Wouldn't it be cool if you didn't have to be a C programmer to
write PHP extensions that you could distribute to others (whether
for profit or not)?  I certainly think so, but it's currently not
possible right now.  All those "nasty little companies" you mention
are making some money because they can program VB, wrap up stuff
as DLLs, and sell them.  They see a need in the ASP community and
address it, while being able to make some money too.  What a novel
concept!

> 
> Your choices are your own, but it's always seemed to me that it makes more 
> sense to be focus on being really good at something fun, than to spread 
> out to things that every other loser is already doing. 

It's all perspective.  I'm not saying everyone who does PHP is a loser,
but I have met more than a few losers who happen to work in PHP.  Same
with every other language.

> Insofar as it can 
> be said about a programming language, PHP is actually fun - in a way that 
> only Perl seems to match (though Perl is certainly a more frustrating kind 
> of fun).
> 
> As for .NET, I thought I just read that Microsoft was pulling everything 
> in for a rethink because of all the negative reactions it was getting.

Where the heck did you read that?  Do you know what .NET is?
Glad that you do, because most other people don't - there really
isn't a good definition, so it's hard to say someone 'pulled everything 
in'.  What MS has done is retarget the 'hailstorm' service to
corporate intranets looking to do internal authentication as opposed
to a public authentication system.  Hardly retracting .NET from
the scene.

There's a lot of interesting concepts in the .NET codebase out there now 
(ASP.NET webforms, for example) as well as other platforms
(Java springs to mind).  Just because it's "not PHP" shouldn't mean
you ignore it or worse yet, publicly denigrate it.



Michael Kimsal
http://www.logicreate.com/
734-480-9961





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




Re: [PHP] upload but restrict

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, r wrote:
> Here goes,
> I have a program that uploads any file and allows the person to see whats in
> a particular directory without any problems,
> not bad for a newbie eh? stand up and clap!!!
> 
> what i want to do is make sure that whatever the person uploads cannot "run"
> or be executedany ideas on how to do this?
> 
> Baically its a file sharing program..."a" uploads something "b" downloads
> it...I just dont want to get screwed in the bargain

Not sure I get your question. Cannot be "run" or "executed" by whom? By 
the web server? Just don't let it run them. By people who download them? 
Impossible. There are too many executable formats. The only choice would 
be to have a whitelist of file formats (i.e., "GIF", "JPEG", "PNG", use 
'file' to check the prologue of each file, and then toss anything else.

miguel

P.S. Your system clock is about 11 hours fast (or you've selected the
wrong time zone), which is annoying since it puts your messages out of 
sequence and I can't tell whether or not they've been replied to without 
reading through 200 other headers.


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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Michael Kimsal wrote:
> Miguel Cruz wrote:
>> all the power of DOS batchfiles. Every single thing you want to do - even
>> basic filesystem operations like working with directories and file
>> permissions!!! - requires purchasing expensive and buggy .COM components
>> from nasty little companies with horrible documentation and nonexistent
>> customer service. I consider it an incredibly developer-hostile
>> environment (unless you're in the business of developing developer tools,
>> which seems to be the lynchpin of the ASP ponzi scheme).
> 
> As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
> I'd have to say that you could definitely at least read a directory's
> contents without having to purchase external libraries.  Please don't
> go overboard.

It's been a while, but I remember that it was impossible to create a
functional directory browser with off-the-shelf ASP functionality. The
file component was categorically unwilling to follow mounted shares until
we got some extra add-in. This was after a month of debate in newsgroup
microsoft.public.this.that.the-other-thing, and plenty of experimentation
during which I discovered, reported, and was contacted by MS engineers
about more bugs than I've ever encountered in PHP.

> Wouldn't it be cool if you didn't have to be a C programmer to write PHP
> extensions that you could distribute to others (whether for profit or
> not)?  I certainly think so, but it's currently not possible right now.  
> All those "nasty little companies" you mention are making some money
> because they can program VB, wrap up stuff as DLLs, and sell them.  
> They see a need in the ASP community and address it, while being able to
> make some money too.  What a novel concept!

I don't think it's a bad thing that they see a niche and try to fill it. I 
think it's a bad thing from the web developer's perspective that there are 
so many unfilled niches.

Furthermore, in contrast to the PHP/Open Source world I find the
profiteering got annoying after a while. It was a drag just having to fill
out a P.O. every week to buy another ridiculous little thing that may or
may not be production-quality and had a no-refund policy.

And the fact is, most of those little companies provide wretched
documentation and support, and there is no real onlne user community in
the Windows world to exchange information with. Well, there are lots of
users, but the ratio of crap-to-usefulness in the fora is so high that
finding information is painful at best.

> It's all perspective.  I'm not saying everyone who does PHP is a loser,
> but I have met more than a few losers who happen to work in PHP.  Same
> with every other language.

No doubt. But a development environment that's the centerpiece of every
late-night-TV-commercial "Are you tired of your Burger Hut job? We'll
teach you to be a computer programmer earning $70k/year in only 3
weeks!!!" tech school is bound to have a higher percentage of losers than
others.

>> As for .NET, I thought I just read that Microsoft was pulling everything 
>> in for a rethink because of all the negative reactions it was getting.
> 
> Where the heck did you read that?  Do you know what .NET is?

Slashdot. And no, to be honest.

> There's a lot of interesting concepts in the .NET codebase out there now
> (ASP.NET webforms, for example) as well as other platforms (Java springs
> to mind).  Just because it's "not PHP" shouldn't mean you ignore it or
> worse yet, publicly denigrate it.

Public denigration of what I don't understand is how I strike out at a
callous world that's denied me my just deserts: fame, millions, and a
torrid love affair with Nancy Reagan. Either address the fundamental
injustice here or cut me some slack.

miguel


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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Victor Polyushko wrote:
> I was wondering if someone knows how to save the image from the given
> url http://domain.com/image.gif into a file on a local machine

lynx -source -dump http://domain.com/image.gif > image.gif

miguel


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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Robert Cummings

Miguel Cruz wrote:
> 
> Public denigration of what I don't understand is how I strike out at a
> callous world that's denied me my just deserts: fame, millions, and a
> torrid love affair with Nancy Reagan. Either address the fundamental
> injustice here or cut me some slack.

Couldn't have said it better *heheheh*

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Robert Cummings

Miguel Cruz wrote:
> 
> On Thu, 16 May 2002, Victor Polyushko wrote:
> > I was wondering if someone knows how to save the image from the given
> > url http://domain.com/image.gif into a file on a local machine
> 
> lynx -source -dump  > image.gif

If there were actually an image I'd use:

wget http://domain.com/image.gif

Cheers,
Rob.
--
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] Passing to an Applet

2002-05-16 Thread Joshua Baker

All right I've seen in done in jsp and asp, but I'd like to know if I can do it in PHP 
as well.

I've got an applet, which is in the page replay.php, with these parameters that I need 
to fill from a URL.

 









I need to pass 2 parameter in the URL from another page to this one, those parameters 
are
FILEPREFIX and MAXINDEX.

I've set my link to read as 

The question is how to I, if I can, use PHP to take those variables from the URL 
string and use them for the values on that page.

I know most people want to just say RTFM or look it up, but at this point if anyone 
could just tell me what this would be under or where exactly this info is, if it's 
possible in php.  Thanks

Anti-Blank
Site Designer/Unix Admin




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

Hi Guys,

Thank you fo your input. I am sorry I am new to the list so + English is not
my first language :-( anyhow., I shoudl 've made my question more clear.

I am trying to save the image from the given URL
(http://domain.com/image.gif) running a PHP script on the page. I have tried
fread() and it does not allow me to accomplish that :-((


Have you guys ever come across such a problem?

Again thank you very much for your suggestions

Best Regards,
Victor Polyushko




- Original Message -
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Miguel Cruz" <[EMAIL PROTECTED]>
Cc: "Victor Polyushko" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 2:01 PM
Subject: Re: [PHP] Can anyone help me save img from URL?


> Miguel Cruz wrote:
> >
> > On Thu, 16 May 2002, Victor Polyushko wrote:
> > > I was wondering if someone knows how to save the image from the given
> > > url http://domain.com/image.gif into a file on a local machine
> >
> > lynx -source -dump  > image.gif
>
> If there were actually an image I'd use:
>
> wget http://domain.com/image.gif
>
> Cheers,
> Rob.
> --
> .-.
> | Robert Cummings |
> :-`.
> | Webdeployer - Chief PHP and Java Programmer  |
> :--:
> | Mail  : mailto:[EMAIL PROTECTED] |
> | Phone : (613) 731-4046 x.109 |
> :--:
> | Website : http://www.webmotion.com   |
> | Fax : (613) 260-9545 |
> `--'
>


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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Michael Kimsal

Miguel Cruz wrote:


>>As much as I'm not a fan of ASP (2 or 2.5, not worked with 3 much),
>>I'd have to say that you could definitely at least read a directory's
>>contents without having to purchase external libraries.  Please don't
>>go overboard.
> 
> 
> It's been a while, but I remember that it was impossible to create a
> functional directory browser with off-the-shelf ASP functionality. The
> file component was categorically unwilling to follow mounted shares until
> we got some extra add-in. This was after a month of debate in newsgroup
> microsoft.public.this.that.the-other-thing, and plenty of experimentation
> during which I discovered, reported, and was contacted by MS engineers
> about more bugs than I've ever encountered in PHP.


This isn't specifically ASP, but NT permissions in general.  PHP running
under "off the shelf" Windows can't access shares either.

> 
> I don't think it's a bad thing that they see a niche and try to fill it. I 
> think it's a bad thing from the web developer's perspective that there are 
> so many unfilled niches.
> 
> Furthermore, in contrast to the PHP/Open Source world I find the
> profiteering got annoying after a while. It was a drag just having to fill
> out a P.O. every week to buy another ridiculous little thing that may or
> may not be production-quality and had a no-refund policy.
> 
> And the fact is, most of those little companies provide wretched
> documentation and support, and there is no real onlne user community in
> the Windows world to exchange information with. Well, there are lots of
> users, but the ratio of crap-to-usefulness in the fora is so high that
> finding information is painful at best.
> 

Honestly, I find that now in the PHP community as well, to a larger 
extent than I used to, but perhaps it's because I/we aren't in the
'sessions v cookies' mentality anymore.

Compiling GD support, for one, is a pain in the ass which you
can't get really get good support for, due to the variety of systems. 
Servlet support as well.  Java support has gotten better, but
it generally just magically happens.  I don't think I've had too
many deep technical issues that have been resolved with help
from the PHP community.  Not because they're 'lesser' people,
but we're trying to do stuff that most people don't do.  It'd be
like trying to get JScript support at an ASP site.  Yeah,
JScript works with ASP, but no one really uses it much,
compared to VBScript.






> 
>>
>>Where the heck did you read that?  Do you know what .NET is?
> 
> 
> Slashdot. And no, to be honest.

:)  Great answer.  Honestly.


> 
> 
>>There's a lot of interesting concepts in the .NET codebase out there now
>>(ASP.NET webforms, for example) as well as other platforms (Java springs
>>to mind).  Just because it's "not PHP" shouldn't mean you ignore it or
>>worse yet, publicly denigrate it.
> 
> 
> Public denigration of what I don't understand is how I strike out at a
> callous world that's denied me my just deserts: fame, millions, and a
> torrid love affair with Nancy Reagan. Either address the fundamental
> injustice here or cut me some slack.
> 

Not sure how old you are or when you had this thing for Nancy -
never been 'fanciable' since I've known her (but maybe I'm too much
of a youngster).


Michael Kimsal
http://www.logicreate.com


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




  1   2   >