Re: [PHP] Nested functions

2002-02-10 Thread DL Neil

Thanks for the confirmations Torben.


  Can one code user-defined functions nested within one another
 Yes.
  - and repeatedly execute them?
 No. ;)

 This is correct. As you know, the thing is that execution keeps running
 into that function declaration every time the containing function is
 run, tries to declare the function, and fails. Essentially: while you
 *can* do nested functions in PHP, don't. :) There really isn't any good
 reason to, anyway--except for (perhaps) a wee bit of namespace
 clarification.

Namespace clarification is exactly what I had in mind - I am post-processing the n=0, 
1, 1 results from a
preg_match_all() and figured that array_walk() would be faster than for{$i...} or 
foreach(). However learning
that array_walk() demanded use of a function, that implied that my 'modular' function 
would have to call a
(short) second to suit the command structure - thus the logic that nesting would 'keep 
things together' in
reuse/restructure situations.

[As you will appreciate, the test bed code was almost directly out of the manual, 
and was only being used so
that I could experiment/get my head around the command/and thereafter test the 
efficiency criteria]

I thought I would ask, if only because other languages, even interpreted languages, do 
cope with this
situation - but as you say, it is not a show-stopper
- a possible case for FUNCTION_once name() as per REQUIRE and INCLUDE?

Thanks again,
=dn



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




php-general Digest 10 Feb 2002 10:00:24 -0000 Issue 1163

2002-02-10 Thread php-general-digest-help


php-general Digest 10 Feb 2002 10:00:24 - Issue 1163

Topics (messages 84139 through 84157):

Re: mysql_select_db() problem
84139 by: Lars Torben Wilson
84148 by: Nick Wilson

Colecting IP information
84140 by: Philip J. Newman
84149 by: cyberskydive

Re: Parameters via Link
84141 by: Manuel Ritsch
84143 by: Lars Torben Wilson
84144 by: Manuel Ritsch
84146 by: Lars Torben Wilson

Nested functions
84142 by: DL Neil
84145 by: Lars Torben Wilson
84157 by: DL Neil

set_error_handler() not catching some errors
84147 by: Charlie Killian
84151 by: Michael Sims
84155 by: Charlie Killian

Sitenavigation
84150 by: Raymond Lilleodegard
84153 by: PHP NY

Phatt MySQL entry
84152 by: Liam MacKenzie

limit to X posts on each page?
84154 by: Hawk

Re: free usefull piece of code for everybody!
84156 by: hugh danaher

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]


--

---BeginMessage---

On Sat, 2002-02-09 at 12:24, Nick Wilson wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi all, 
 I just can't see what could possibly be wrong with my php here:
 
 $sel_db=mysql_select_db(mydb) or die 
 (could not get the bugger);
 exit;
 
 I can 'USE mydb' just fine from the command line so what's the problem?
 (returns the die statement)
 
 Much thanks..
 - -- 
 
 Nick Wilson

I take it that the connection worked fine? (Yeah, dumb question, but you
never know.)

What do you get if you use error checking?

if (!$dbh = mysql_connect(. . .)) {
echo Could not connect; reason was  . mysql_error() . \n;
return false;
}

if (!$sel_db = mysql_select_db('mydb', $dbh)) {
echo Could not select database '$sel_db'; reason was  .
mysql_error() . \n;
return false;
}

i.e. what do you get if you use mysql_error() after this fails?


Torben

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


---End Message---
---BeginMessage---

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Lars Torben Wilson declared
 I take it that the connection worked fine? (Yeah, dumb question, but you
 never know.)

Yeah, all is well as far as connections concerned.

 What do you get if you use error checking?

Well, that seems to be it, I'm getting 'Access deneid to user
'@localhost'.

I'm talking to a guy on the mysql list, apparently it is a
phenomememememememmemonmmm that when you GRANT ALL using wildcards it
tends to grant all on * except localhost! 

- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8ZcMsHpvrrTa6L5oRAqyCAKChAKKFljtpKg+vKArgbLW6KwT2CQCeM5xc
tRuUnNm8WUGOl8M7l1xrXfU=
=xr5Z
-END PGP SIGNATURE-

---End Message---
---BeginMessage---

Trying to colect ip, and name server, dns name from a user how do I do this? can you 
point me to the right place?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012

---End Message---
---BeginMessage---

Dunno right off hand about NS and DNS but a simple getenv('REMOTE_ADDR');
will return the IP address of a user.


Philip J. Newman [EMAIL PROTECTED] wrote in message
001d01c1b1c1$b33fec80$0401a8c0@philip">news:001d01c1b1c1$b33fec80$0401a8c0@philip...
Trying to colect ip, and name server, dns name from a user how do I do this?
can you point me to the right place?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012




---End Message---
---BeginMessage---

Still doesnt' work, any ither suggestions?

Jason Wong [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]...
 On Saturday 09 February 2002 02:23, Manuel Ritsch wrote:
  Hey there
 
  I want to make a webpage out of one main pagewith php, if you press on a
  link i want that it changes the content of the page, but it doesn't seem
to
  work, i tried it like this...
 
  link:
 
  a href=index.php?link=home
 
  php code:
 
  if($link == home)

 if ($link == home);



 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 Trespassers will be shot.  Survivors will be SHOT AGAIN!
 */



---End Message---
---BeginMessage---

On Sat, 2002-02-09 at 15:39, Manuel Ritsch wrote:
 Still doesnt' work, any ither suggestions?

Sounds like you don't have register_globals turned on. (Don't turn it
on! globals are eevviill! ;)

Try:

if ($_REQUEST['link'] == 'home') {
. . .
}

Or, if using an older (pre-4.1.0) version of PHP, try:

if ($HTTP_GET_VARS['link'] == 

Re: [PHP] mysql_select_db() problem

2002-02-10 Thread DL Neil

  What do you get if you use error checking?

 Well, that seems to be it, I'm getting 'Access deneid to user
 '@localhost'.

 I'm talking to a guy on the mysql list, apparently it is a
 phenomememememememmemonmmm that when you GRANT ALL using wildcards it
 tends to grant all on * except localhost!


It's not so much a phenomememememememmemonmmm as a deliberate design feature.

On multi-user machines and network servers it is very common to have a security layer 
allowing tasks to only/not
be performed on the 'system console'. For example, would you want a remote user to 
bring down a mainframe with
some sort of STOP command? If you were an ISP or a DB Service Provider, would you want 
one user (using only one
table, or one database) to be able to reboot the entire MySQL server (and affect all 
the other
users/user-tables/user-databases)?

Thus Fred@localhost is not the same privilege profile as Fred@somewhere-else to enable 
flexibility in
access/security - even if Fred is the only user to ever touch the system! You have 
figured out by now, that to
give Fred the same privileges on the server as from a client machine, they need to be 
GRANTed 'twice'.

Looking at it the other way, such 'security' controls can be either limited by the 
user location, or by the name
of the user, or by both!

Regards,
=dn



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




Re: [PHP] Sitenavigation

2002-02-10 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Raymond Lilleodegard declared
 Hi!
 
 Is i possible to make a function that makes a prev and a next link on the
 page if it returns, say over 20 rows or hits in a query? Could anyone give
 me a hint if they know how to?

There is a very good article on this exact topic at phpbuiler.com
Have fun.
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8ZkszHpvrrTa6L5oRAjYnAJ9Vox0Ora6hTtD1owtKBgP3PqSJkgCfctOP
k1yAJz+Ln1Dy0YUvldAp57E=
=YjNr
-END PGP SIGNATURE-

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




[PHP] possible bug in date() function

2002-02-10 Thread LaserJetter

Using the code below:

$buffer['Last_access'] = 1013336429;
$date = date(H:i D, nS M Y,$buffer['Last_access']);
print $date;

prints 10:20 Sun, 2th Feb 2002
I didnt know there was a 2th of February!!

Is this a bug and do I get a prize for finding it?  ;o)

LJ




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




[PHP] subject line in mail()

2002-02-10 Thread Kunal Jhunjhunwala

Hey,
I'm trying to force a subject line on the reply email of a recieved email...
the recieved email is sent using the mail() function in php... can this be
done? I know i can do it using html by doing :
mailto:[EMAIL PROTECTED]?subject=subect comes here

but not everyone allows html email... can i do something similar using the
mail() function?

Regards,
Kunal Jhunjhunwala

Minds think with ideas, not information. No amount of data, bandwidth, or
processing power can substitute for inspired thought. - Clifford Stoll


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




Re: [PHP] subject line in mail()

2002-02-10 Thread Kunal Jhunjhunwala

yea... this sends out the email just fine... but if a user replies to the
email sent out via this method, the sbuject line changes... i want to keep
it static :)
Regards,
Kunal Jhunjhunwala

Minds think with ideas, not information. No amount of data, bandwidth, or
processing power can substitute for inspired thought. - Clifford Stoll
- Original Message -
From: TV Karthick Kumar [EMAIL PROTECTED]
To: Kunal Jhunjhunwala [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 4:10 PM
Subject: Re: [PHP] subject line in mail()


 Did you use mail(to,subject,message,from) ??...

 Hth,
 Karthick


 - Original Message -
 From: Kunal Jhunjhunwala [EMAIL PROTECTED]
 To: php-list [EMAIL PROTECTED]
 Sent: Sunday, February 10, 2002 11:31 AM
 Subject: [PHP] subject line in mail()


  Hey,
  I'm trying to force a subject line on the reply email of a recieved
 email...
  the recieved email is sent using the mail() function in php... can this
be
  done? I know i can do it using html by doing :
  mailto:[EMAIL PROTECTED]?subject=subect comes here
 
  but not everyone allows html email... can i do something similar using
the
  mail() function?
 
  Regards,
  Kunal Jhunjhunwala
 
  Minds think with ideas, not information. No amount of data, bandwidth,
or
  processing power can substitute for inspired thought. - Clifford Stoll
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com






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




Re: [PHP] subject line in mail()

2002-02-10 Thread Kunal Jhunjhunwala

hi,
hidden value where?? :)
Regards,
Kunal Jhunjhunwala

Minds think with ideas, not information. No amount of data, bandwidth, or
processing power can substitute for inspired thought. - Clifford Stoll
- Original Message -
From: TV Karthick Kumar [EMAIL PROTECTED]
To: Kunal Jhunjhunwala [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 4:47 PM
Subject: Re: [PHP] subject line in mail()


 yeah, that's right, you don't even want to have 'Re: subject' in your
reply
 message ?. mm... if you can pass the subject (value) as a hidden variable
 then you can have it static and move around with it... So far, I have
 thought only this way

 Is it going to help you ?. If it does, you are a happy man.

 Hth,
 Karthick


  yea... this sends out the email just fine... but if a user replies to
the
  email sent out via this method, the sbuject line changes... i want to
keep
  it static :)
  Regards,
  Kunal Jhunjhunwala
 
  Minds think with ideas, not information. No amount of data, bandwidth,
or
  processing power can substitute for inspired thought. - Clifford Stoll
  - Original Message -
  From: TV Karthick Kumar [EMAIL PROTECTED]
  To: Kunal Jhunjhunwala [EMAIL PROTECTED]
  Sent: Sunday, February 10, 2002 4:10 PM
  Subject: Re: [PHP] subject line in mail()
 
 
   Did you use mail(to,subject,message,from) ??...
  
   Hth,
   Karthick
  
  
   - Original Message -
   From: Kunal Jhunjhunwala [EMAIL PROTECTED]
   To: php-list [EMAIL PROTECTED]
   Sent: Sunday, February 10, 2002 11:31 AM
   Subject: [PHP] subject line in mail()
  
  
Hey,
I'm trying to force a subject line on the reply email of a recieved
   email...
the recieved email is sent using the mail() function in php... can
 this
  be
done? I know i can do it using html by doing :
mailto:[EMAIL PROTECTED]?subject=subect comes here
   
but not everyone allows html email... can i do something similar
using
  the
mail() function?
   
Regards,
Kunal Jhunjhunwala
   
Minds think with ideas, not information. No amount of data,
 bandwidth,
  or
processing power can substitute for inspired thought. - Clifford
 Stoll
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
  
  
   _
   Do You Yahoo!?
   Get your free @yahoo.com address at http://mail.yahoo.com
  
  
  
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com






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




Re: [PHP] possible bug in date() function

2002-02-10 Thread Edward van Bilderbeek - Bean IT

it was last week though...

guesss you mean 29th?

Edward

LaserJetter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Using the code below:

 $buffer['Last_access'] = 1013336429;
 $date = date(H:i D, nS M Y,$buffer['Last_access']);
 print $date;

 prints 10:20 Sun, 2th Feb 2002
 I didnt know there was a 2th of February!!

 Is this a bug and do I get a prize for finding it?  ;o)

 LJ




 --
 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] Searching class capable of parsing ID3-tags in MP3-files

2002-02-10 Thread Stefan Rusterholz

I
I search a class to parse mp3-files' id3 tag. I already found one at 
upperdesign.com but it seems not to be capable of parsing newer versions 
of the id3 tag :(
So does anyone know an already existing class doing that for me?

TIA
Stefan Rusterholz


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




[PHP] Re: possible bug in date() function

2002-02-10 Thread LaserJetter

I've just realised that the suffix for the day of the month is correct for
today (1013336429) but it isn't the 2nd today and my clock is set right.
Anyone got any ideas?



Laserjetter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Using the code below:

 $buffer['Last_access'] = 1013336429;
 $date = date(H:i D, nS M Y,$buffer['Last_access']);
 print $date;

 prints 10:20 Sun, 2th Feb 2002
 I didnt know there was a 2th of February!!

 Is this a bug and do I get a prize for finding it?  ;o)

 LJ






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




Re: [PHP] Searching class capable of parsing ID3-tags in MP3-files

2002-02-10 Thread Girish Nath

Hi

There is a class that can manipluate version 1 tags here :

http://leknor.com/code/php/view/class.id3.php.txt

and a some beta code for handling version 2 tags here :

http://leknor.com/code/php/view/beta/class.id3v2.php.txt

I don't know if that helps.

Regards


Girish
--
www.girishnath.co.uk


- Original Message - 
From: Stefan Rusterholz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 12:02 PM
Subject: [PHP] Searching class capable of parsing ID3-tags in MP3-files


I
I search a class to parse mp3-files' id3 tag. I already found one at 
upperdesign.com but it seems not to be capable of parsing newer versions 
of the id3 tag :(
So does anyone know an already existing class doing that for me?

TIA
Stefan Rusterholz


-- 
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] APACHE .htaccess and PHP 403 errors

2002-02-10 Thread Andre Bajew

Hi,

Anyone out there familiar with Apache's .htaccess  running PHP scripts?

I'm using Apaches's mod_rewrite to route some virtual hosts which runs great
but is causing HTTP Error 403 - Access forbidden errors just for my .php
scripts. I assume there is some sort of .htaccess statement that will get my
php scripts back working but I haven't found it yet.

Any help would be sincerely appreciated!!
Andre



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




[PHP] How can I open URL using HTTP POST instead of HTTP GET?

2002-02-10 Thread Zlutarch G.

Hi everyone,

PHP fopen function opens URL using the HTTP GET method. But what if one 
could only open the web page using the HTTP POST method? In this case, fopen 
won't work. Is there a PHP function that is similar to fopen, but uses HTTP 
POST method to open URL instead? If not, then how do I work around this 
problem?

Thanks,

Zlu


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




[PHP] cookie problem

2002-02-10 Thread Impex Holidays Maldives / Hasan

Hi all,

Perhaps some one can help me.

If I send a cookie like 
setcookie(+ACI-cookie+AF8-agtpasswd+ACI-,+ACQ-form+AF8-agent+AF8-pass, time()+-1200, 
+ACI-/+ACI-)+ADs-

it does not work on the terminal which has a new version of windows 2000 and i use 
IE6. The browser does not store the cookie.

but if is use 
setcookie(+ACI-cookie+AF8-agtpasswd+ACI-,+ACQ-form+AF8-agent+AF8-pass)+ADs-
I can retrive the cookie variable.

This happens on a few terminal but for other with win 2000 it both cookie send works 
fine.

Has anyone come across this problem?
Has anyone got any suggestions. Is this a problem of the win 2000 or the browser 
setting.

thanks,
Hasan






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




[PHP] Re: How can I open URL using HTTP POST instead of HTTP GET?

2002-02-10 Thread Hugh Bothwell


Zlutarch G. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi everyone,

 PHP fopen function opens URL using the HTTP GET method. But what if one
 could only open the web page using the HTTP POST method? In this case,
fopen
 won't work. Is there a PHP function that is similar to fopen, but uses
HTTP
 POST method to open URL instead? If not, then how do I work around this
 problem?

Umm... you might have to open a socket and read/write directly.
To do this, you'd have to look up the appropriate RFCs and write
the headers manually.

Anyone got a better idea?



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




RE: [PHP] Re: How can I open URL using HTTP POST instead of HTTP GET?

2002-02-10 Thread James Cox

http://php.net/curl

 -Original Message-
 From: Hugh Bothwell [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, February 10, 2002 4:31 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: How can I open URL using HTTP POST instead of HTTP
 GET?
 
 
 
 Zlutarch G. [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi everyone,
 
  PHP fopen function opens URL using the HTTP GET method. But what if one
  could only open the web page using the HTTP POST method? In this case,
 fopen
  won't work. Is there a PHP function that is similar to fopen, but uses
 HTTP
  POST method to open URL instead? If not, then how do I work around this
  problem?
 
 Umm... you might have to open a socket and read/write directly.
 To do this, you'd have to look up the appropriate RFCs and write
 the headers manually.
 
 Anyone got a better idea?
 
 
 
 -- 
 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] Creating an array with a file

2002-02-10 Thread Scott

Hi All,

I am trying to create an array from a text file that I will process and
rewrite in a new format.  My question is, is it possible to read the
file 
in one line at a time and then separate the tab-delimited fields and
finally rewrite the new file?

The fields are tab delimited and here is what I have attempted in code:

$lines = fopen(oldfile.txt, r);
$newfields = explode(\t, $lines);
echo $newquotes[0];

I get a Resource ID #1 when I echo the line.  

Thanks,

-Scott


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




RE: [PHP] Creating an array with a file--Fixed

2002-02-10 Thread Scott

Nevermind, I was able to figure it out using:

$myfile = file(oldfile.txt);
for ($s=0; $s=count($myfile)-1; $s++) {
$fields = split(\t,$myfile[$s]);
print($fields[1]\n);
}

-Original Message-
From: Scott [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 11, 2002 12:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Creating an array with a file

Hi All,

I am trying to create an array from a text file that I will process and
rewrite in a new format.  My question is, is it possible to read the
file 
in one line at a time and then separate the tab-delimited fields and
finally rewrite the new file?

The fields are tab delimited and here is what I have attempted in code:

$lines = fopen(oldfile.txt, r);
$newfields = explode(\t, $lines);
echo $newquotes[0];

I get a Resource ID #1 when I echo the line.  

Thanks,

-Scott


-- 
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] Phatt MySQL entry

2002-02-10 Thread Peter J. Schoenster

On 10 Feb 2002, at 14:30, Liam MacKenzie wrote:

 I have a form, with 196 fields that I need entered into a database.
 But the form and it's contents need to be changed every day, and I

That distracts me. Does the form change? I think not. It looks like 
a data entry form and the only thing that would change would be 
the DATE. I would think the form remains the same. I did not notice 
any hidden field to indicate the date though.

 need to store the old data in an archive so it can be accessed at a
 later date.

Me, in a hurry, I'd just store one more column in your table: DATE. 
I don't see it. I add that. When they want a previous date they just 
say select all where date = date they want.  

 That means that after a week, I'm going to have a tonne of data.

Umm ... this seems to indicate that maybe the form does change 
??? I'm thinking maybe you might have different users. If so I'd add 
a userid column. 

 Catch is, this form will be used every day for about 3 years.
 I'm pretty certain MySQL can handle it, but I need to know, what
 would be the best way to store this data?

There might be better ways to store the data but I don't usually 
think about those things. I'd ask some old fogey who worked in the 
days of 640K :) ... seriously  ... but I think you'll end up going to 
trouble for no reason. Memory, storage is cheap. A friend was 
moaning that his app was slow (plain cgi/perl so I suggested 
mod_perl/fastcgi) and they just threw a hardware upgrade and all 
was well (but imho should still do mod_perl/fascgi).

 I've set up a calendar, that will take the user to a different version
 of the form every day. Accesible here:

I don't see the reason for a different version of the form for every 
day. Isn't the date the only difference?

 http://www.fernwoodwhc.com/shit/calendar.php And the form I'm talking
 about is here: http://www.fernwoodwhc.com/tech.php

Well about how you would do it. It seems that PHP is in many 
ways like the old one form, one cgi method of development. Were I 
you I would not make my connection to the database in that script. 
I'd do that in only one place. Odd how things tend to evolve and 
before you know it you have 232 scripts all using 
username/password/db/host and then you want to change that.  I'd 
look at something like metabase were I you.

http://phpclasses.upperdesign.com/browse.html/package/20/

Peter



---
Reality is that which, when you stop believing in it, doesn't go
away.
-- Philip K. Dick

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




[PHP] Expat Installation on windows

2002-02-10 Thread karthikeyan

Hi Guys,

  How do i install expat on WinNt.  I have php-4.0.6.  

  Looking forward for yours response.

karthikeyan.



[PHP] Re: mime emails

2002-02-10 Thread Michael Kimsal

Kunal Jhunjhunwala wrote:
 hey..
 does anyone know of any good classes / functions for handling mime emails? i
 am writing a mail checker, and was wondering if there are any pre-written
 mime email handling classes out there...
 thanks!
 Regards,
 Kunal Jhunjhunwala
 
 Minds think with ideas, not information. No amount of data, bandwidth, or
 processing power can substitute for inspired thought. - Clifford Stoll
 
 

I believe there's something in PEAR, which should have come with your
distribution - look at pear.php.net also.  There's some mail handling 
classes, and one deals with not only sending MIME, but unencoding it as 
well.


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




[PHP] my math stinks

2002-02-10 Thread Gary

Hi All,
  This is the first time I have had to deal with math. I have gone 
through the manual and a few books and I think I am worse off then when 
I started. Can someone give me an example of the simple math below. I 
think If I see some in code I can move on from there.

I need to find out if $pa  $pb or $pb  $pa then subtract smallest from 
the largest and add $ca and then add $ps

TIA
Gary


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




Re: [PHP] my math stinks

2002-02-10 Thread Lars Torben Wilson

On Sun, 2002-02-10 at 11:05, Gary wrote:
 Hi All,
   This is the first time I have had to deal with math. I have gone 
 through the manual and a few books and I think I am worse off then when 
 I started. Can someone give me an example of the simple math below. I 
 think If I see some in code I can move on from there.
 
 I need to find out if $pa  $pb or $pb  $pa then subtract smallest from 
 the largest and add $ca and then add $ps
 
 TIA
 Gary

Break the problem down:

 I need to subtract the lesser (minimum) of $pa and $pb from the 
 greater (maximum) of $pa and $pb;
 Then just add $ca and $ps.

So something like this will do it:

  $result = (max($pa, $pb) - min($pa, $pb)) + $ca + $ps;


Hope this helps,

Torben

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] my math stinks

2002-02-10 Thread Jason Wong

On Monday 11 February 2002 03:05, Gary wrote:
 Hi All,
   This is the first time I have had to deal with math. I have gone
 through the manual and a few books and I think I am worse off then when
 I started. Can someone give me an example of the simple math below. I
 think If I see some in code I can move on from there.

 I need to find out if $pa  $pb or $pb  $pa then subtract smallest from
 the largest and add $ca and then add $ps

Try:

  ABS($pa - $pb) + $ca + $ps;



-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
I want the presidency so bad I can already taste the hors d'oeuvres.
*/

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




Re: [PHP] my math stinks

2002-02-10 Thread Andrew Brampton

$answer = abs($pa - $pb) + $ca +$ps;

No ifs :)
Maybe I'm lazy, but I like 1 line statements

Andrew

- Original Message - 
From: Gary [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 7:05 PM
Subject: [PHP] my math stinks


 Hi All,
   This is the first time I have had to deal with math. I have gone 
 through the manual and a few books and I think I am worse off then when 
 I started. Can someone give me an example of the simple math below. I 
 think If I see some in code I can move on from there.
 
 I need to find out if $pa  $pb or $pb  $pa then subtract smallest from 
 the largest and add $ca and then add $ps
 
 TIA
 Gary
 
 
 -- 
 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: Phatt MySQL entry

2002-02-10 Thread Michael Kimsal

Liam Mackenzie wrote:
 Hi,
 
 I was wondering what you would do in this situation...
 
 I have a form, with 196 fields that I need entered into a database.
 But the form and it's contents need to be changed every day,
 and I need to store the old data in an archive so it can be accessed
 at a later date.
 
 That means that after a week, I'm going to have a tonne of data.
 Catch is, this form will be used every day for about 3 years.
 I'm pretty certain MySQL can handle it, but I need to know, what
 would be the best way to store this data?
 
 I've set up a calendar, that will take the user to a different version
 of the form every day.
 Accesible here:
 http://www.fernwoodwhc.com/shit/calendar.php
 And the form I'm talking about is here:
 http://www.fernwoodwhc.com/tech.php
 
 Here's a copy (minus passwords) of my form...
 I'm sure that there's a better way to do it...
 


I'm sure there is too... :)

Have you any experience with arrays?

PHP can accept data from the form in the form of an array, so you can
build your form and process it with many fewer lines than you have (and
modify things much easier).

If, for example, the club opened at 5:00 am in the future instead of 6,
you'd probably have to go change that big huge SQL statement, and add 
more lines to the code, right?  If you build with arrays, and smartly,
you can avoid much of the work you're doing.

BTW - the 'smartly' thing isn't to imply you're not smart.  I'm simply
saying there are techniques to make this stuff easier, and once you
know them, you won't go back, and you'll work faster.

I'd probably make each time/date a separate entry in a table, so each
day would have 196 entries, instead of one row having 196 columns, which
you seem to be doing.

?
$startkey = 600;
$starttime = (5 * 3600); // EDT is 5 hours behind GMT, so we get 
ourselves to midnight
$starttime = $starttime + (3600 * 6) ; // start off at 6 hours into the 
morning
$endtime = $starttime + (3600 * 18) ; // end 18 hours in the future
? table ?
while ($starttime  $endtime) {
$time = date(h:i A,$starttime);
$x = date(Hi,$starttime);
?
  tdbfont size=2?=$time;?/font/b/td
tdinput type=radio name=fs[?=$x;?] value=fw
input type=radio name=fs[?=$x;?] value=sp/td
tdinput type=text name=num[?=$x;?] size=4/td
tdinput type=text name=sur[?=$x;?] size=8/td
tdinput type=text name=giv[?=$x;?] size=8/td
td
select size=1 name=apt[?=$x;?]
option selected value=11
option value=22
option value=reRe
/select
/td
tdinput type=text name=ph[?=$x;?] size=8/td
tdinput type=checkbox name=c[?=$x;?] value=ON/td
/tr
?
$starttime = $starttime + 1800;
}
?
input type=hidden name=date value=?=$dateValueYouPassIn;?
/table

As an example, this seems more manageable to me.  the EDT is for me - 
that's my timezone.  You'd need to adjust yours to start with, but 
everything else should work OK.  You're left with arrays that will get
submitted to PHP like

$num[0600]
$sur[0600] etc.

if you did this...

?
while (list($k,$v) = each($num)) {
$n = $num[$k];
$s = $sur[$k];
$g = $giv[$k];
$a = $apt[$k];
$p = $ph[$k];
$c = $c[$k];
$f = $fs[$k];
$sql = insert into info (date,time,num,sur,giv,apt,ph,c,fs) values (;
$sql .= '$date','$k','$n','$s','$g$','$a','$p','$c','$f');
// do SQL processing here
}
?

Realize this isn't fully functioning code, but might give you a better 
idea on how to approach it.

Hope that helps...






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




[PHP] Re: subject line in mail()

2002-02-10 Thread Michael Kimsal

Kunal Jhunjhunwala wrote:
 Hey,
 I'm trying to force a subject line on the reply email of a recieved email...
 the recieved email is sent using the mail() function in php... can this be
 done? I know i can do it using html by doing :
 mailto:[EMAIL PROTECTED]?subject=subect comes here
 
 but not everyone allows html email... can i do something similar using the
 mail() function?
 
 Regards,
 Kunal Jhunjhunwala


You can't control anything about what someone sends you.  Regardless
of what you try to do with browser/email client tricks, if I want to
send you a message with the subject as 'foo', that's what you'll get. 
You can't stop or alter that.




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




RE: [PHP] escaping ?

2002-02-10 Thread Martin Towell

what about this?

$contents = str_replace('?xml version=1.0?'.'', '', $contents);


-Original Message-
From: Steven Jarvis [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 09, 2002 8:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] escaping ?


I'm trying to do some string replaces on XML files to import them into a 
prprietary db that doesn't understand XML.

I need to strip the XML tags out of the file.

However, when I use this line:

$contents = str_replace('?xml version=1.0?', '', $contents);

The ? in the string ends my php block.


I know there's an easy answer to this, and I'm probably just suffering 
from Friday afternoon burnout, but can someone let me know how to escape 
those so that I can search for them in the string?

thanks,

Steven


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



php-general Digest 10 Feb 2002 22:08:34 -0000 Issue 1164

2002-02-10 Thread php-general-digest-help


php-general Digest 10 Feb 2002 22:08:34 - Issue 1164

Topics (messages 84158 through 84186):

Re: mysql_select_db() problem
84158 by: DL Neil

Re: Sitenavigation
84159 by: Nick Wilson

possible bug in date() function
84160 by: LaserJetter
84164 by: Edward van Bilderbeek - Bean IT
84166 by: LaserJetter

subject line in mail()
84161 by: Kunal Jhunjhunwala
84162 by: Kunal Jhunjhunwala
84163 by: Kunal Jhunjhunwala
84185 by: Michael Kimsal

Searching class capable of parsing ID3-tags in MP3-files
84165 by: Stefan Rusterholz
84167 by: Girish Nath

APACHE .htaccess and PHP 403 errors
84168 by: Andre Bajew

How can I open URL using HTTP POST instead of HTTP GET?
84169 by: Zlutarch G.
84171 by: Hugh Bothwell
84172 by: James Cox

cookie problem
84170 by: Impex Holidays Maldives / Hasan

Creating an array with a file
84173 by: Scott

Re: Creating an array with a file--Fixed
84174 by: Scott

Re: Phatt MySQL entry
84175 by: Peter J. Schoenster
84183 by: Michael Kimsal
84184 by: Michael Kimsal

Expat Installation on windows
84176 by: karthikeyan

Re: mime emails
84177 by: Michael Kimsal
84178 by: Michael Kimsal

my math stinks
84179 by: Gary
84180 by: Lars Torben Wilson
84181 by: Jason Wong
84182 by: Andrew Brampton

Re: escaping ?
84186 by: Martin Towell

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]


--

---BeginMessage---

  What do you get if you use error checking?

 Well, that seems to be it, I'm getting 'Access deneid to user
 '@localhost'.

 I'm talking to a guy on the mysql list, apparently it is a
 phenomememememememmemonmmm that when you GRANT ALL using wildcards it
 tends to grant all on * except localhost!


It's not so much a phenomememememememmemonmmm as a deliberate design feature.

On multi-user machines and network servers it is very common to have a security layer 
allowing tasks to only/not
be performed on the 'system console'. For example, would you want a remote user to 
bring down a mainframe with
some sort of STOP command? If you were an ISP or a DB Service Provider, would you want 
one user (using only one
table, or one database) to be able to reboot the entire MySQL server (and affect all 
the other
users/user-tables/user-databases)?

Thus Fred@localhost is not the same privilege profile as Fred@somewhere-else to enable 
flexibility in
access/security - even if Fred is the only user to ever touch the system! You have 
figured out by now, that to
give Fred the same privileges on the server as from a client machine, they need to be 
GRANTed 'twice'.

Looking at it the other way, such 'security' controls can be either limited by the 
user location, or by the name
of the user, or by both!

Regards,
=dn



---End Message---
---BeginMessage---

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Raymond Lilleodegard declared
 Hi!
 
 Is i possible to make a function that makes a prev and a next link on the
 page if it returns, say over 20 rows or hits in a query? Could anyone give
 me a hint if they know how to?

There is a very good article on this exact topic at phpbuiler.com
Have fun.
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8ZkszHpvrrTa6L5oRAjYnAJ9Vox0Ora6hTtD1owtKBgP3PqSJkgCfctOP
k1yAJz+Ln1Dy0YUvldAp57E=
=YjNr
-END PGP SIGNATURE-

---End Message---
---BeginMessage---

Using the code below:

$buffer['Last_access'] = 1013336429;
$date = date(H:i D, nS M Y,$buffer['Last_access']);
print $date;

prints 10:20 Sun, 2th Feb 2002
I didnt know there was a 2th of February!!

Is this a bug and do I get a prize for finding it?  ;o)

LJ




---End Message---
---BeginMessage---

it was last week though...

guesss you mean 29th?

Edward

LaserJetter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Using the code below:

 $buffer['Last_access'] = 1013336429;
 $date = date(H:i D, nS M Y,$buffer['Last_access']);
 print $date;

 prints 10:20 Sun, 2th Feb 2002
 I didnt know there was a 2th of February!!

 Is this a bug and do I get a prize for finding it?  ;o)

 LJ




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



---End Message---
---BeginMessage---

I've just realised that the suffix for the day of the month is correct for
today (1013336429) but it isn't the 2nd today and my clock is set right.
Anyone got any ideas?



Laserjetter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Using the 

[PHP] Interest in Project

2002-02-10 Thread Viper

Hi every one I am going to be working on a site that will contain hopefully a 
single point where people can get php class files, Sorce code help, and MySQL 
database help, Plus a kind of comunity for PHP. I know there are other site 
such as this but I would like to create a 1 place for all type site. It will be 
done in PHP and use a MySQL backend if any one is interested in getting in on 
this project please E-mail me at [EMAIL PROTECTED] I think it would be a great 
project. Thanks Guys.

-=Adam=-



-
http://www.2ghz.net/
Welcome To the Future

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




[PHP] file redirect?

2002-02-10 Thread Ed Lazor

I'm trying to figure something out and thought I'd see if you guys have any 
ideas.

The goal:  tracking the number of downloads for files on the server.

The approach:  routing file downloads through /download.php like this:
http://server/download.php?target=/myfile.zip

What I tried that worked was using javascript to launch download.php in a 
new window and use a meta tag to redirect to the file in question, like this:

print meta http-equiv='refresh' content='0; URL=$destination';

This works, but it's really slow, because it usually takes a while to open 
a new browser window.

I found another approach, but couldn't get it to work:

$content_type = Content-type:  application/zip;
header($content_type);
header(Content-disposition: filename=.$filename);
header($destination);

It seemed I got close at one point... it would open a File Save window, but 
the file would end up as 0 bytes in size.

My preference is using the second approach if I can get it working, because 
it's much faster than opening a new browser window.  Any ideas of how to 
make it work?

Thanks,

-Ed



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




[PHP] got some advice.... need to know the lingo

2002-02-10 Thread Ben Turner

Hello everyone,

I am working on converting a site from ASP to PHP and I was wondering if
their where any built in functions to perform screen scraping.  In ASP, the
XML DOM is most commonly used to accomplish this.  I am thinking that there
should be something to get the task done in PHP but I cant even find the
correct keywords to use to search for anything like this.  Anyone got some
advice on what to search by or maybe a link to get some more information??


Thanks!
Ben

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




Re: [PHP] file redirect?

2002-02-10 Thread Bogdan Stancescu

Well, you have to send the actual file - otherwise the result of a zero-length
file is not surprising at all.

Bogdan

Ed Lazor wrote:

 I'm trying to figure something out and thought I'd see if you guys have any
 ideas.

 The goal:  tracking the number of downloads for files on the server.

 The approach:  routing file downloads through /download.php like this:
 http://server/download.php?target=/myfile.zip

 What I tried that worked was using javascript to launch download.php in a
 new window and use a meta tag to redirect to the file in question, like this:

 print meta http-equiv='refresh' content='0; URL=$destination';

 This works, but it's really slow, because it usually takes a while to open
 a new browser window.

 I found another approach, but couldn't get it to work:

 $content_type = Content-type:  application/zip;
 header($content_type);
 header(Content-disposition: filename=.$filename);
 header($destination);

 It seemed I got close at one point... it would open a File Save window, but
 the file would end up as 0 bytes in size.

 My preference is using the second approach if I can get it working, because
 it's much faster than opening a new browser window.  Any ideas of how to
 make it work?

 Thanks,

 -Ed


 --
 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] Creating an array with a file

2002-02-10 Thread Bogdan Stancescu

You need to actually read the file in order for this to work. You're just
opening it and then printing the file handle...

Bogdan

Scott wrote:

 Hi All,

 I am trying to create an array from a text file that I will process and
 rewrite in a new format.  My question is, is it possible to read the
 file
 in one line at a time and then separate the tab-delimited fields and
 finally rewrite the new file?

 The fields are tab delimited and here is what I have attempted in code:

 $lines = fopen(oldfile.txt, r);
 $newfields = explode(\t, $lines);
 echo $newquotes[0];

 I get a Resource ID #1 when I echo the line.

 Thanks,

 -Scott

 --
 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] file redirect?

2002-02-10 Thread Philip J. Newman

   what about this?

?php

header(Location: $url_to);
   exit;

?

 http://server/download.php?url_to=/myfile.zip

check out

http://www.philipsdomain.com/hyperlinks/  for a redirect sample.


- Original Message -
From: Ed Lazor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 11, 2002 11:30 AM
Subject: [PHP] file redirect?


 I'm trying to figure something out and thought I'd see if you guys have
any
 ideas.

 The goal:  tracking the number of downloads for files on the server.

 The approach:  routing file downloads through /download.php like this:
 http://server/download.php?target=/myfile.zip

 What I tried that worked was using javascript to launch download.php in a
 new window and use a meta tag to redirect to the file in question, like
this:

 print meta http-equiv='refresh' content='0; URL=$destination';

 This works, but it's really slow, because it usually takes a while to open
 a new browser window.

 I found another approach, but couldn't get it to work:

 $content_type = Content-type:  application/zip;
 header($content_type);
 header(Content-disposition: filename=.$filename);
 header($destination);

 It seemed I got close at one point... it would open a File Save window,
but
 the file would end up as 0 bytes in size.

 My preference is using the second approach if I can get it working,
because
 it's much faster than opening a new browser window.  Any ideas of how to
 make it work?

 Thanks,

 -Ed



 --
 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] weblog lite

2002-02-10 Thread Vincent Stoessel

Hello,
I am interested in adding a small weblog to an existing php driven
site. I've seen the Nuke stuff but that may be a little overkill for me
I just want a simple system for allowing users to post stories about
the site's main topic ,  a follow up discussion forum a la slashdot.org
and macslash but it not scrictly needed for my purposes.
Thanks.
-- 
Vincent Stoessel [EMAIL PROTECTED]
Linux and Java Application Developer
(301) 362-1750
AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica


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




Re: [PHP] file redirect?

2002-02-10 Thread Ed Lazor

At 12:58 AM 2/11/2002 +0200, Bogdan Stancescu wrote:
Well, you have to send the actual file - otherwise the result of a zero-length
file is not surprising at all.

That makes sense.  I thought the last line was doing that.  How would I do 
it in a way that works for local and remote files?


  $content_type = Content-type:  application/zip;
  header($content_type);
  header(Content-disposition: filename=.$filename);
  header($destination);


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




Re: [PHP] file redirect?

2002-02-10 Thread Bogdan Stancescu

Ah, didn't know you also serve remote files. In this case Philip's solution makes
much more sense - otherwise you'll have to download the file on the server side and
upload it to the client, which is way too much fuss to worth it.

Bogdan

Ed Lazor wrote:

 At 12:58 AM 2/11/2002 +0200, Bogdan Stancescu wrote:
 Well, you have to send the actual file - otherwise the result of a zero-length
 file is not surprising at all.

 That makes sense.  I thought the last line was doing that.  How would I do
 it in a way that works for local and remote files?

   $content_type = Content-type:  application/zip;
   header($content_type);
   header(Content-disposition: filename=.$filename);
   header($destination);

 --
 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: got some advice.... need to know the lingo

2002-02-10 Thread Michael Kimsal

Ben Turner wrote:
 Hello everyone,
 
 I am working on converting a site from ASP to PHP and I was wondering if
 their where any built in functions to perform screen scraping.  In ASP, the
 XML DOM is most commonly used to accomplish this.  I am thinking that there
 should be something to get the task done in PHP but I cant even find the
 correct keywords to use to search for anything like this.  Anyone got some
 advice on what to search by or maybe a link to get some more information??
 
 
 Thanks!
 Ben
 


The XML DOM stuff isn't as mature in PHP yet, last I checked 
(unfortunate, because we were hoping it would have been at that point).

How complex are you trying to get?  Could you explain the goal a bit more?


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




[PHP] Re: got some advice.... need to know the lingo

2002-02-10 Thread Michael Kimsal

Ben Turner wrote:
 Hello everyone,
 
 I am working on converting a site from ASP to PHP and I was wondering if
 their where any built in functions to perform screen scraping.  In ASP, the
 XML DOM is most commonly used to accomplish this.  I am thinking that there
 should be something to get the task done in PHP but I cant even find the
 correct keywords to use to search for anything like this.  Anyone got some
 advice on what to search by or maybe a link to get some more information??
 


http://www.carrubbers.org/scripts/php/xpath/

That might be of use to you.  Doesn't require any libraries, and seems
a bit more documented than most other packages.




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




Re: [PHP] Re: got some advice.... need to know the lingo

2002-02-10 Thread Ben Turner

Well not so much processing XML but rather grabbing HTML input and parsing
it for certain values.  I use this approach very heavily for inputing a DB
table with information that needs to be displayed back to the web users.

Ben


- Original Message -
From: Michael Kimsal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 4:53 PM
Subject: [PHP] Re: got some advice need to know the lingo


 Ben Turner wrote:
  Hello everyone,
 
  I am working on converting a site from ASP to PHP and I was wondering if
  their where any built in functions to perform screen scraping.  In ASP,
the
  XML DOM is most commonly used to accomplish this.  I am thinking that
there
  should be something to get the task done in PHP but I cant even find the
  correct keywords to use to search for anything like this.  Anyone got
some
  advice on what to search by or maybe a link to get some more
information??
 


 http://www.carrubbers.org/scripts/php/xpath/

 That might be of use to you.  Doesn't require any libraries, and seems
 a bit more documented than most other packages.




 --
 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] Interest in Project

2002-02-10 Thread Peter J. Schoenster

On 10 Feb 2002, at 17:23, Viper wrote:

 Hi every one I am going to be working on a site that will contain
 hopefully a single point where people can get php class files, Sorce
 code help, and MySQL database help, Plus a kind of comunity for PHP. I
 know there are other site such as this but I would like to create a 1
 place for all type site. It will be done in PHP and use a MySQL
 backend if any one is interested in getting in on this project please
 E-mail me at [EMAIL PROTECTED] I think it would be a great project.

Well I have no end of such places to find. I'm new to PHP. What 
interests me much more is how to go about organizing my project. 
I have such a system using mod_per/Perl. Perl also has 
Mason/AxKit etc. ... I use my own which revolves around 
HTML::Template.

I was recently told about smarty as a templating system and I'm 
going to give it a shot. I'm going to recreate my method in PHP 
which I use in Perl as I just really, really don't like having these php 
pages with programming in them all over the place. I like things to 
be consolidated. 

I would suggest you start a site which is about THE WAYS of  
DESIGNING solutions with PHP and MySQL (but why, why in the 
world don't you just do it with PHP/RDBMS).  There is more than 
one way and yet I rarely in fact hardly ever find a site DISCUSSING 
this. There are a lot of sites that say this is our way but most of 
them don't even do that .. they just say download XYZ and there is 
no question or discussion of their way.

Now, perhaps I've missed these sites, if so please bombard me 
with the urls. Othewise, consider a site which does this. I have no 
end of bookmarks for sites with the tactical questions. 

Peter
--
http://www.coremodules.com/
PETER J. SCHOENSTER
(901)-652-2002

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




RE: [PHP] Creating an array with a file

2002-02-10 Thread Scott

I am seeking some thoughts on if this is the way I should tackle this
problem.  I have two files, both of them tab delimited text files that I
need to combine and then output a new file.

My idea was to put both files in an array, calling the fields I need,
i.e. $field[0], $field[1] and so on.  I need to loop through the entire
file and output on each loop.  

My concern is the overhead by creating the array's.  Any thoughts.

Thanks,

-Scott

-Original Message-
From: Paul Roberts [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, February 10, 2002 2:35 PM
To: Scott
Subject: Re: [PHP] Creating an array with a file

try this, you need to get the line then explode that, fopen just returns
a file handle.

$file = fopen(oldfile.txt, r);
while (!feof ($fd)) {
$lines = fgets($file, 4096)
$newfields = explode(\t, $lines);
echo $newfields[0].br;
}


Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: Scott [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 11, 2002 5:32 PM
Subject: [PHP] Creating an array with a file


 Hi All,
 
 I am trying to create an array from a text file that I will process
and
 rewrite in a new format.  My question is, is it possible to read the
 file 
 in one line at a time and then separate the tab-delimited fields and
 finally rewrite the new file?
 
 The fields are tab delimited and here is what I have attempted in
code:
 
 $lines = fopen(oldfile.txt, r);
 $newfields = explode(\t, $lines);
 echo $newquotes[0];
 
 I get a Resource ID #1 when I echo the line.  
 
 Thanks,
 
 -Scott
 
 
 -- 
 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] Fooling the client into thinking php script is .jpg

2002-02-10 Thread Liam MacKenzie

Add this inno the appropriate virtual-host

Directory /path/to/the/folder/with/the/jpg/script
AddType application/x-httpd-php .jpg
/Directory

This will parse all .jpg files to the PHP interpreter.

Hope that helped!




- Original Message -
From: Matt Moreton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 11, 2002 11:44 AM
Subject: [PHP] Fooling the client into thinking php script is .jpg


I have a script that outputs an image.  Using the gd library.  But the only
way this script gets to execute is if you call it like:

www.host.com/displayimage.php

That then sends the content header, and the image.  Obviously I am doing
some other stuff in there, which is why I am using a script to generate the
image.  Is it possible somehow to request the file as a .jpg?

www.host.com/displayimage.jpg

Fooling the client into thinking it is just a .jpg image.

I tried changing the .htaccess file for the dir this script was in, so that
when a 404 error is genterated, it redirects to the displayimage.php script.
But its not exactly a transparent redirect.  If you type an invalid url it
simply redirects, displaying the name of the script, displayimage.php while
loading the image.

Any suggestions please?





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




[PHP] email validation (discussion)

2002-02-10 Thread Justin French

Greetings,

I saw this posted in this group a few days back:

function validEmail($email)
  { 
  if
(eregi(^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}, $email))
{
return TRUE; 
}
  else
{ 
return FALSE; 
} 
  }


I passed it onto a programmer friend of mine to help me get my head
around the regexp, which he did help me with, but then continued to
point out that this function would return FALSE for many many valid
email address', and I agree.  I had a look at the mail-header standard
(RFC-822), and almost ANYTHING is a valid email address...

The user (prefix of the @) can contain all sorts of special characters
(,',(,),etc) that weren't allowed for in the above regexp.

The domains (suffix of @) can basicaly be defined as two or more groups
of a-z0-9, separated by a period (.) –– I *think* the above regexp does
this, but I'm no where near an expert.


So I'd rather have a regexp which loosly checks for a valid email,
rather than the very strict one above, which would appear to reject some
valid address'...

To me, checking for something like...

anything@two or more groups of a-z0-9, separated by a .

...is about as strict as it can get, based on my quick read of the spec.
 And I'd be pretty happy with a regexp which does this, but I have no
real clue how to write it.  Any help appreciated.


What would be great is a function which checks an email against the spec
-- has anyone built such a beast?


My friend also told me of a perl function which attempts to look-up the
email address via the DNS MX records... has anyone attempted this in
PHP???  Would there be any specific system requirements or limitations
(email forwarders, etc)


I'm really interested in getting this right, and posting it as an FAQ or
article, rather than it kicking around in this group forever.


Thanks,

Justin French

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




Re: [PHP] Interest in Project

2002-02-10 Thread Viper

I may have worded this wrong. The site will focus on PHP and the use of 
Databases with PHP, (Oracle, Postgres, MySQL, others...). I was typing fast and 
just threw MySQL out :) I do quite a bit of development in PHP and MySQL so I 
am most familiar with it. I am also very familiar with Oracle. I have yet to 
find a PHP help site that focuses on Databases and Code Repositorys Related 
specificaly to PHP and it's use with them. The main thing I want the site to be 
is a Community where people can come to get help and read articles about the 
Use Of PHP in the real world. That sound more interesting? :)

-=Adam=-

Quoting Peter J. Schoenster [EMAIL PROTECTED]:

 On 10 Feb 2002, at 17:23, Viper wrote:
 
  Hi every one I am going to be working on a site that will contain
  hopefully a single point where people can get php class files, Sorce
  code help, and MySQL database help, Plus a kind of comunity for PHP. I
  know there are other site such as this but I would like to create a 1
  place for all type site. It will be done in PHP and use a MySQL
  backend if any one is interested in getting in on this project please
  E-mail me at [EMAIL PROTECTED] I think it would be a great project.
 
 Well I have no end of such places to find. I'm new to PHP. What 
 interests me much more is how to go about organizing my project. 
 I have such a system using mod_per/Perl. Perl also has 
 Mason/AxKit etc. ... I use my own which revolves around 
 HTML::Template.
 
 I was recently told about smarty as a templating system and I'm 
 going to give it a shot. I'm going to recreate my method in PHP 
 which I use in Perl as I just really, really don't like having these php 
 pages with programming in them all over the place. I like things to 
 be consolidated. 
 
 I would suggest you start a site which is about THE WAYS of  
 DESIGNING solutions with PHP and MySQL (but why, why in the 
 world don't you just do it with PHP/RDBMS).  There is more than 
 one way and yet I rarely in fact hardly ever find a site DISCUSSING 
 this. There are a lot of sites that say this is our way but most of 
 them don't even do that .. they just say download XYZ and there is 
 no question or discussion of their way.
 
 Now, perhaps I've missed these sites, if so please bombard me 
 with the urls. Othewise, consider a site which does this. I have no 
 end of bookmarks for sites with the tactical questions. 
 
 Peter
 --
 http://www.coremodules.com/
 PETER J. SCHOENSTER
 (901)-652-2002
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 




-
http://www.2ghz.net/
Welcome To the Future

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




Re: [PHP] Interest in Project

2002-02-10 Thread Liam MacKenzie

It does indeed!

http://www.phinpho.com/

I got the domain a couple of weeks ago, and I have a couple
of mates who are keen to set it all up, now all we need is a
boot in the arse to get it going!

I have some neat servers and a phatt connection.  It'll do to
get us started, but may need some more grunt later on.
http://www.operationenigma.com/setup.txt
There's a brief description for ya.

Looking forward to it, will be swell once it's going!
As for an easier way to talk about it all, IRC sound
good?

Connect to:   irc.holonet.org
Join:  #fearful_right  (A mate's chatroom)
Cya there!

-  Liam (Enigma)


- Original Message -
From: Viper [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, February 11, 2002 12:17 PM
Subject: Re: [PHP] Interest in Project


 I may have worded this wrong. The site will focus on PHP and the use of
 Databases with PHP, (Oracle, Postgres, MySQL, others...). I was typing
fast and
 just threw MySQL out :) I do quite a bit of development in PHP and MySQL
so I
 am most familiar with it. I am also very familiar with Oracle. I have yet
to
 find a PHP help site that focuses on Databases and Code Repositorys
Related
 specificaly to PHP and it's use with them. The main thing I want the site
to be
 is a Community where people can come to get help and read articles about
the
 Use Of PHP in the real world. That sound more interesting? :)

 -=Adam=-

 Quoting Peter J. Schoenster [EMAIL PROTECTED]:

  On 10 Feb 2002, at 17:23, Viper wrote:
 
   Hi every one I am going to be working on a site that will contain
   hopefully a single point where people can get php class files, Sorce
   code help, and MySQL database help, Plus a kind of comunity for PHP. I
   know there are other site such as this but I would like to create a 1
   place for all type site. It will be done in PHP and use a MySQL
   backend if any one is interested in getting in on this project please
   E-mail me at [EMAIL PROTECTED] I think it would be a great project.
 
  Well I have no end of such places to find. I'm new to PHP. What
  interests me much more is how to go about organizing my project.
  I have such a system using mod_per/Perl. Perl also has
  Mason/AxKit etc. ... I use my own which revolves around
  HTML::Template.
 
  I was recently told about smarty as a templating system and I'm
  going to give it a shot. I'm going to recreate my method in PHP
  which I use in Perl as I just really, really don't like having these php
  pages with programming in them all over the place. I like things to
  be consolidated.
 
  I would suggest you start a site which is about THE WAYS of
  DESIGNING solutions with PHP and MySQL (but why, why in the
  world don't you just do it with PHP/RDBMS).  There is more than
  one way and yet I rarely in fact hardly ever find a site DISCUSSING
  this. There are a lot of sites that say this is our way but most of
  them don't even do that .. they just say download XYZ and there is
  no question or discussion of their way.
 
  Now, perhaps I've missed these sites, if so please bombard me
  with the urls. Othewise, consider a site which does this. I have no
  end of bookmarks for sites with the tactical questions.
 
  Peter
  --
  http://www.coremodules.com/
  PETER J. SCHOENSTER
  (901)-652-2002
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




 -
 http://www.2ghz.net/
 Welcome To the Future

 --
 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] Array scanning stops by itself before reaching the end.

2002-02-10 Thread Raúl Sánchez T .

I got this stupid problem:
I create an HTML list of inputs: input name=Answer[] type='checkbox'  that 
stretches to some 25 elements.

When I try to read the values (on or off) with the code below, PHP won't read past 
the 8th. element and says it's found an undefined variable (which is $x). No matter 
what I do, it's always the 8th. element.


for($x = 1; $x = ($TotalAnswers); $x++)
{
 echo($Answer[$x]);
}

Anyone has a prompt solution? I'm getting desperate.
Thanks, Pepinho.



Re: [PHP] Interest in Project

2002-02-10 Thread Peter J. Schoenster

On 10 Feb 2002, at 21:17, Viper wrote:

 I may have worded this wrong. The site will focus on PHP and the use
 of Databases with PHP, (Oracle, Postgres, MySQL, others...). I was
 typing fast and just threw MySQL out :) I do quite a bit of
 development in PHP and MySQL so I am most familiar with it. I am also
 very familiar with Oracle. I have yet to find a PHP help site that
 focuses on Databases and Code Repositorys Related specificaly to PHP
 and it's use with them. The main thing I want the site to be is a
 Community where people can come to get help and read articles about
 the Use Of PHP in the real world. That sound more interesting? :)

Yes and No :)

If you search say google for php/oracle/mysql/rdbms you'll have no end of 
sites to visit. Everywhere I go I see small snippets of how to do this or that.

I'm thinking more on along these lines:

 Smart Architectures in PHP
 Tim Perdue 

http://www.phpbuilder.com/columns/tim20001010.php3

although I think a site could go beyond that and just be smart architectures 
and then show/discuss etc. in Perl/PHP ... 

But heck, I think there is always room for more good sites.

If you did more databases then it might be interesting to show the 
differences between them. Mysql is evolving fast and it's been the one I 
used most but I've also used postgresq and oracle. I've not used triggers or 
stored procedures AT ALL but I'm familiar with them and as a data model 
grows in complexity it really seems easier to me to use such tools rather 
than doing all the work in my programming language. I don't see this stuff 
discussed much. I'd like to see these kinds of things. How you do X in 
Oracle but is done like Y in MySQL, etc.

I'm a little scared of your reference to code repositories. I like CPAN for 
Perl and I guess Pear for PHP but I haven't gotten into it much as I'm still 
learning PHP.  imho the OO approach with classes as black boxes is 
much better than the scripting nature of Perl/PHP. code repositories 
bring to mind cut and paste and I try and avoid that at all costs.

Just my thoughts. I'd certainly like to know when your site goes live. I'm too 
busy to help with anything myself. Unemployed and spending all my time 
trying to find work :) except I can't break my email habits :)

Peter





---
Reality is that which, when you stop believing in it, doesn't go
away.
-- Philip K. Dick

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




Re: [PHP] Interest in Project

2002-02-10 Thread Viper

I dont think any of us can break the E-mail habbit :) I agree with you there 
are alot of sites out there. That is a good idea to show ways to do things in 
different DB's sort of a DB centric site. I guess the main focus of the site is 
community help. Not only code snippet stuff. But Forums and E-mail help. The 
thing about PHP is it is a relativly new language and alot of people need help 
with it. So a site that allows them to comunicate directly with some experts 
can help them greatly. Also looking at code snippets with articles like 
phpbuilder helps people alot when the get stuck. I will let you know when it 
goes up :) Thanks for all your ideas.

-=Adam=-

Quoting Peter J. Schoenster [EMAIL PROTECTED]:

 On 10 Feb 2002, at 21:17, Viper wrote:
 
  I may have worded this wrong. The site will focus on PHP and the use
  of Databases with PHP, (Oracle, Postgres, MySQL, others...). I was
  typing fast and just threw MySQL out :) I do quite a bit of
  development in PHP and MySQL so I am most familiar with it. I am also
  very familiar with Oracle. I have yet to find a PHP help site that
  focuses on Databases and Code Repositorys Related specificaly to PHP
  and it's use with them. The main thing I want the site to be is a
  Community where people can come to get help and read articles about
  the Use Of PHP in the real world. That sound more interesting? :)
 
 Yes and No :)
 
 If you search say google for php/oracle/mysql/rdbms you'll have no end of 
 sites to visit. Everywhere I go I see small snippets of how to do this or
 that.
 
 I'm thinking more on along these lines:
 
  Smart Architectures in PHP
  Tim Perdue 
 
 http://www.phpbuilder.com/columns/tim20001010.php3
 
 although I think a site could go beyond that and just be smart architectures
 
 and then show/discuss etc. in Perl/PHP ... 
 
 But heck, I think there is always room for more good sites.
 
 If you did more databases then it might be interesting to show the 
 differences between them. Mysql is evolving fast and it's been the one I 
 used most but I've also used postgresq and oracle. I've not used triggers or
 
 stored procedures AT ALL but I'm familiar with them and as a data model 
 grows in complexity it really seems easier to me to use such tools rather 
 than doing all the work in my programming language. I don't see this stuff 
 discussed much. I'd like to see these kinds of things. How you do X in 
 Oracle but is done like Y in MySQL, etc.
 
 I'm a little scared of your reference to code repositories. I like CPAN
 for 
 Perl and I guess Pear for PHP but I haven't gotten into it much as I'm still
 
 learning PHP.  imho the OO approach with classes as black boxes is 
 much better than the scripting nature of Perl/PHP. code repositories 
 bring to mind cut and paste and I try and avoid that at all costs.
 
 Just my thoughts. I'd certainly like to know when your site goes live. I'm
 too 
 busy to help with anything myself. Unemployed and spending all my time 
 trying to find work :) except I can't break my email habits :)
 
 Peter
 
 
 
 
 
 ---
 Reality is that which, when you stop believing in it, doesn't go
 away.
 -- Philip K. Dick
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 




-
http://www.2ghz.net/
Welcome To the Future

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




[PHP] Rounding....

2002-02-10 Thread Matthew Clark

Seeing as the mathematically correct way to round numbers is to round down
to n for n-1=m=n.5 and up to n+1 for n.5mn+1, I wonder why the PHP
round() function couldn't include a little 'fuzz' to handle the rounding
problems we encounter due to floating point representation in the hardware?
It could even be a configurable option - but it would save writing a
wrapper...



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




[PHP] 2 conditions why wont they work??

2002-02-10 Thread Brad Wright

Hi all,
Im was sure you could select a row from a mySQL database based on 2
conditions. My code:


$query2 = select * from Table where  userNo = $userNo and clientID =
$clientID;
$result2 = mysql_query($query2,$db);


This returns :
Warning: Supplied argument is not a valid MySQL result resource

b ut if i change the line to:
$query2 = select * from Table where  userNo = $userNo;
$result2 = mysql_query($query2,$db);

it works (but get all the rows with userNo = $userNo.

HELP Im sure this should work...what am i doing wrong???


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




Re: [PHP] Array scanning stops by itself before reaching the end.

2002-02-10 Thread Bogdan Stancescu

Are you actually checking more than eight checkboxes? Otherwise you don't _get_ the 
ones which are unchecked at all - that's the way it works. The ideal way to do this - 
if you have to do it with arrays - is to walk
$Answer and check WHAT'S in there, rather than IF there is something in there. This 
obviously assumes you're setting distinct values for the checked checkboxes in HTML.

Anyway, the first thing to try is to set more than eight checkboxes in HTML and see if 
you get the error at different indexes.

HTH

Bogdan

Raúl Sánchez T. wrote:

 I got this stupid problem:
 I create an HTML list of inputs: input name=Answer[] type='checkbox'  that 
stretches to some 25 elements.

 When I try to read the values (on or off) with the code below, PHP won't read 
past the 8th. element and says it's found an undefined variable (which is $x). No 
matter what I do, it's always the 8th. element.

 for($x = 1; $x = ($TotalAnswers); $x++)
 {
  echo($Answer[$x]);
 }

 Anyone has a prompt solution? I'm getting desperate.
 Thanks, Pepinho.


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




Re: [PHP] 2 conditions why wont they work??

2002-02-10 Thread Bogdan Stancescu

Do an echo($clientID) before - it most probably is either empty or it's a
string and MySQL actually issues errors there.

Bogdan

Brad Wright wrote:

 Hi all,
 Im was sure you could select a row from a mySQL database based on 2
 conditions. My code:

 $query2 = select * from Table where  userNo = $userNo and clientID =
 $clientID;
 $result2 = mysql_query($query2,$db);

 This returns :
 Warning: Supplied argument is not a valid MySQL result resource

 b ut if i change the line to:
 $query2 = select * from Table where  userNo = $userNo;
 $result2 = mysql_query($query2,$db);

 it works (but get all the rows with userNo = $userNo.

 HELP Im sure this should work...what am i doing wrong???

 --
 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] 2 conditions why wont they work??

2002-02-10 Thread Matthew Clark

Yes - that's most likely the answer.. if the echo doesn't help, try
something like this..

$result2 = mysql_query($query2,$db) or die(mysql_error());

If mysql is throwing up an error, that'll present it too you and stop
execution..



-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: 11 February 2002 03:39
To: Brad Wright
Cc: PHP General List
Subject: Re: [PHP] 2 conditions why wont they work??


Do an echo($clientID) before - it most probably is either empty or it's a
string and MySQL actually issues errors there.

Bogdan

Brad Wright wrote:

 Hi all,
 Im was sure you could select a row from a mySQL database based on 2
 conditions. My code:

 $query2 = select * from Table where  userNo = $userNo and clientID =
 $clientID;
 $result2 = mysql_query($query2,$db);

 This returns :
 Warning: Supplied argument is not a valid MySQL result resource

 b ut if i change the line to:
 $query2 = select * from Table where  userNo = $userNo;
 $result2 = mysql_query($query2,$db);

 it works (but get all the rows with userNo = $userNo.

 HELP Im sure this should work...what am i doing wrong???

 --
 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] 2 conditions why wont they work??

2002-02-10 Thread Brad Wright

Thanks,

$clientID is a string but is not empty...already tried echo($clientID) and
it is not empty.

Did you mean that if the value of $cientID is a string it wont work

Thanks
Brad

 From: Bogdan Stancescu [EMAIL PROTECTED]
 Date: Mon, 11 Feb 2002 05:38:31 +0200
 To: Brad Wright [EMAIL PROTECTED]
 Cc: PHP General List [EMAIL PROTECTED]
 Subject: Re: [PHP] 2 conditions why wont they work??
 
 Do an echo($clientID) before - it most probably is either empty or it's a
 string and MySQL actually issues errors there.
 
 Bogdan
 
 Brad Wright wrote:
 
 Hi all,
 Im was sure you could select a row from a mySQL database based on 2
 conditions. My code:
 
 $query2 = select * from Table where  userNo = $userNo and clientID =
 $clientID;
 $result2 = mysql_query($query2,$db);
 
 This returns :
 Warning: Supplied argument is not a valid MySQL result resource
 
 b ut if i change the line to:
 $query2 = select * from Table where  userNo = $userNo;
 $result2 = mysql_query($query2,$db);
 
 it works (but get all the rows with userNo = $userNo.
 
 HELP Im sure this should work...what am i doing wrong???
 
 --
 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] Fooling the client into thinking php script is .jpg

2002-02-10 Thread Bogdan Stancescu

...however, this may not be the best solution since actual JPEG's accidentally
containing the ? string will issue errors (!) on your server. The proper way
to do this is leave it .php if possible.

Bogdan

Liam MacKenzie wrote:

 Add this inno the appropriate virtual-host

 Directory /path/to/the/folder/with/the/jpg/script
 AddType application/x-httpd-php .jpg
 /Directory

 This will parse all .jpg files to the PHP interpreter.

 Hope that helped!

 - Original Message -
 From: Matt Moreton [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, February 11, 2002 11:44 AM
 Subject: [PHP] Fooling the client into thinking php script is .jpg

 I have a script that outputs an image.  Using the gd library.  But the only
 way this script gets to execute is if you call it like:

 www.host.com/displayimage.php

 That then sends the content header, and the image.  Obviously I am doing
 some other stuff in there, which is why I am using a script to generate the
 image.  Is it possible somehow to request the file as a .jpg?

 www.host.com/displayimage.jpg

 Fooling the client into thinking it is just a .jpg image.

 I tried changing the .htaccess file for the dir this script was in, so that
 when a 404 error is genterated, it redirects to the displayimage.php script.
 But its not exactly a transparent redirect.  If you type an invalid url it
 simply redirects, displaying the name of the script, displayimage.php while
 loading the image.

 Any suggestions please?

 --
 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] 2 conditions why wont they work??

2002-02-10 Thread Bogdan Stancescu

No, with your syntax it won't. You have to quote it in the query, as in
$query2 = select * from Table where  userNo = $userNo and clientID =
'$clientID';

Bogdan

Brad Wright wrote:

 Thanks,

 $clientID is a string but is not empty...already tried echo($clientID) and
 it is not empty.

 Did you mean that if the value of $cientID is a string it wont work

 Thanks
 Brad

  From: Bogdan Stancescu [EMAIL PROTECTED]
  Date: Mon, 11 Feb 2002 05:38:31 +0200
  To: Brad Wright [EMAIL PROTECTED]
  Cc: PHP General List [EMAIL PROTECTED]
  Subject: Re: [PHP] 2 conditions why wont they work??
 
  Do an echo($clientID) before - it most probably is either empty or it's a
  string and MySQL actually issues errors there.
 
  Bogdan
 
  Brad Wright wrote:
 
  Hi all,
  Im was sure you could select a row from a mySQL database based on 2
  conditions. My code:
 
  $query2 = select * from Table where  userNo = $userNo and clientID =
  $clientID;
  $result2 = mysql_query($query2,$db);
 
  This returns :
  Warning: Supplied argument is not a valid MySQL result resource
 
  b ut if i change the line to:
  $query2 = select * from Table where  userNo = $userNo;
  $result2 = mysql_query($query2,$db);
 
  it works (but get all the rows with userNo = $userNo.
 
  HELP Im sure this should work...what am i doing wrong???
 
  --
  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] 2 conditions why wont they work??

2002-02-10 Thread Brad Wright

Ahh..that seems to have fixed it. Its now pulling NO data, but is not giving
error msg
thanks, 1/2 way there now :)

brad


 From: Bogdan Stancescu [EMAIL PROTECTED]
 Date: Mon, 11 Feb 2002 05:46:46 +0200
 To: Brad Wright [EMAIL PROTECTED]
 Cc: PHP General List [EMAIL PROTECTED]
 Subject: Re: [PHP] 2 conditions why wont they work??
 
 No, with your syntax it won't. You have to quote it in the query, as in
 $query2 = select * from Table where  userNo = $userNo and clientID =
 '$clientID';
 
 Bogdan
 
 Brad Wright wrote:
 
 Thanks,
 
 $clientID is a string but is not empty...already tried echo($clientID) and
 it is not empty.
 
 Did you mean that if the value of $cientID is a string it wont work
 
 Thanks
 Brad
 
 From: Bogdan Stancescu [EMAIL PROTECTED]
 Date: Mon, 11 Feb 2002 05:38:31 +0200
 To: Brad Wright [EMAIL PROTECTED]
 Cc: PHP General List [EMAIL PROTECTED]
 Subject: Re: [PHP] 2 conditions why wont they work??
 
 Do an echo($clientID) before - it most probably is either empty or it's a
 string and MySQL actually issues errors there.
 
 Bogdan
 
 Brad Wright wrote:
 
 Hi all,
 Im was sure you could select a row from a mySQL database based on 2
 conditions. My code:
 
 $query2 = select * from Table where  userNo = $userNo and clientID =
 $clientID;
 $result2 = mysql_query($query2,$db);
 
 This returns :
 Warning: Supplied argument is not a valid MySQL result resource
 
 b ut if i change the line to:
 $query2 = select * from Table where  userNo = $userNo;
 $result2 = mysql_query($query2,$db);
 
 it works (but get all the rows with userNo = $userNo.
 
 HELP Im sure this should work...what am i doing wrong???
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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




RE: [PHP] 2 conditions why wont they work??

2002-02-10 Thread Matthew Clark

In your code below, mysql will throw an error if $clientID is empty or
non-numeric because it is not surrounded with quotation marks.. mysql will
treat it as a field name (or just throw a syntax error if it's empty).

-Original Message-
From: Brad Wright [mailto:[EMAIL PROTECTED]]
Sent: 11 February 2002 03:45
To: Bogdan Stancescu
Cc: PHP General List
Subject: Re: [PHP] 2 conditions why wont they work??


Thanks,

$clientID is a string but is not empty...already tried echo($clientID) and
it is not empty.

Did you mean that if the value of $cientID is a string it wont work

Thanks
Brad

 From: Bogdan Stancescu [EMAIL PROTECTED]
 Date: Mon, 11 Feb 2002 05:38:31 +0200
 To: Brad Wright [EMAIL PROTECTED]
 Cc: PHP General List [EMAIL PROTECTED]
 Subject: Re: [PHP] 2 conditions why wont they work??

 Do an echo($clientID) before - it most probably is either empty or it's a
 string and MySQL actually issues errors there.

 Bogdan

 Brad Wright wrote:

 Hi all,
 Im was sure you could select a row from a mySQL database based on 2
 conditions. My code:

 $query2 = select * from Table where  userNo = $userNo and clientID =
 $clientID;
 $result2 = mysql_query($query2,$db);

 This returns :
 Warning: Supplied argument is not a valid MySQL result resource

 b ut if i change the line to:
 $query2 = select * from Table where  userNo = $userNo;
 $result2 = mysql_query($query2,$db);

 it works (but get all the rows with userNo = $userNo.

 HELP Im sure this should work...what am i doing wrong???

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


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



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


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




Re: [PHP] APACHE .htaccess and PHP 403 errors

2002-02-10 Thread Bogdan Stancescu

Just a guess, but is it possible that you get 403 because of file permissions?

Sorry if this is stupid, but I vaguely remember something similar related to
file permissions, so I took the chance... :-)

Bogdan

Andre Bajew wrote:

 Hi,

 Anyone out there familiar with Apache's .htaccess  running PHP scripts?

 I'm using Apaches's mod_rewrite to route some virtual hosts which runs great
 but is causing HTTP Error 403 - Access forbidden errors just for my .php
 scripts. I assume there is some sort of .htaccess statement that will get my
 php scripts back working but I haven't found it yet.

 Any help would be sincerely appreciated!!
 Andre

 --
 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] 2 conditions why wont they work??

2002-02-10 Thread Bogdan Stancescu

Well, that's probably because of the data - no entries with both conditions
satisfied... Use or if that's what you actually want to do. ;-)

Bogdan

Brad Wright wrote:

 Ahh..that seems to have fixed it. Its now pulling NO data, but is not giving
 error msg
 thanks, 1/2 way there now :)

 brad

  From: Bogdan Stancescu [EMAIL PROTECTED]
  Date: Mon, 11 Feb 2002 05:46:46 +0200
  To: Brad Wright [EMAIL PROTECTED]
  Cc: PHP General List [EMAIL PROTECTED]
  Subject: Re: [PHP] 2 conditions why wont they work??
 
  No, with your syntax it won't. You have to quote it in the query, as in
  $query2 = select * from Table where  userNo = $userNo and clientID =
  '$clientID';
 
  Bogdan
 
  Brad Wright wrote:
 
  Thanks,
 
  $clientID is a string but is not empty...already tried echo($clientID) and
  it is not empty.
 
  Did you mean that if the value of $cientID is a string it wont work
 
  Thanks
  Brad
 
  From: Bogdan Stancescu [EMAIL PROTECTED]
  Date: Mon, 11 Feb 2002 05:38:31 +0200
  To: Brad Wright [EMAIL PROTECTED]
  Cc: PHP General List [EMAIL PROTECTED]
  Subject: Re: [PHP] 2 conditions why wont they work??
 
  Do an echo($clientID) before - it most probably is either empty or it's a
  string and MySQL actually issues errors there.
 
  Bogdan
 
  Brad Wright wrote:
 
  Hi all,
  Im was sure you could select a row from a mySQL database based on 2
  conditions. My code:
 
  $query2 = select * from Table where  userNo = $userNo and clientID =
  $clientID;
  $result2 = mysql_query($query2,$db);
 
  This returns :
  Warning: Supplied argument is not a valid MySQL result resource
 
  b ut if i change the line to:
  $query2 = select * from Table where  userNo = $userNo;
  $result2 = mysql_query($query2,$db);
 
  it works (but get all the rows with userNo = $userNo.
 
  HELP Im sure this should work...what am i doing wrong???
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

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


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




Re: [PHP] Rounding....

2002-02-10 Thread Bogdan Stancescu

I guess that's because nobody knows beforehand which direction the fuzz should
go - should it go a little upwards or a little downwards in order to match
all systems?

Just my two cents.

Bogdan

Matthew Clark wrote:

 Seeing as the mathematically correct way to round numbers is to round down
 to n for n-1=m=n.5 and up to n+1 for n.5mn+1, I wonder why the PHP
 round() function couldn't include a little 'fuzz' to handle the rounding
 problems we encounter due to floating point representation in the hardware?
 It could even be a configurable option - but it would save writing a
 wrapper...

 --
 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] 2 conditions why wont they work??

2002-02-10 Thread Brad Wright

Bogdan,
It appears that $clientID is saved with a space at the start .. when i check
for its value (using session_encode() ) it gives that value  test 3 when
it should be test 3.


input type=hidden name=XclientID value=?php echo
$row[clientID];?


this is the extract form the form on the previous page which sets $clientID.

I am sure that a space is being added but cant find where.

Thanks for yr help,
Brad
 From: Bogdan Stancescu [EMAIL PROTECTED]
 Date: Mon, 11 Feb 2002 05:53:46 +0200
 To: Brad Wright [EMAIL PROTECTED]
 Cc: PHP General List [EMAIL PROTECTED]
 Subject: Re: [PHP] 2 conditions why wont they work??
 
 Well, that's probably because of the data - no entries with both conditions
 satisfied... Use or if that's what you actually want to do. ;-)
 
 Bogdan
 
 Brad Wright wrote:
 
 Ahh..that seems to have fixed it. Its now pulling NO data, but is not giving
 error msg
 thanks, 1/2 way there now :)
 
 brad
 
 From: Bogdan Stancescu [EMAIL PROTECTED]
 Date: Mon, 11 Feb 2002 05:46:46 +0200
 To: Brad Wright [EMAIL PROTECTED]
 Cc: PHP General List [EMAIL PROTECTED]
 Subject: Re: [PHP] 2 conditions why wont they work??
 
 No, with your syntax it won't. You have to quote it in the query, as in
 $query2 = select * from Table where  userNo = $userNo and clientID =
 '$clientID';
 
 Bogdan
 
 Brad Wright wrote:
 
 Thanks,
 
 $clientID is a string but is not empty...already tried echo($clientID) and
 it is not empty.
 
 Did you mean that if the value of $cientID is a string it wont work
 
 Thanks
 Brad
 
 From: Bogdan Stancescu [EMAIL PROTECTED]
 Date: Mon, 11 Feb 2002 05:38:31 +0200
 To: Brad Wright [EMAIL PROTECTED]
 Cc: PHP General List [EMAIL PROTECTED]
 Subject: Re: [PHP] 2 conditions why wont they work??
 
 Do an echo($clientID) before - it most probably is either empty or it's a
 string and MySQL actually issues errors there.
 
 Bogdan
 
 Brad Wright wrote:
 
 Hi all,
 Im was sure you could select a row from a mySQL database based on 2
 conditions. My code:
 
 $query2 = select * from Table where  userNo = $userNo and clientID =
 $clientID;
 $result2 = mysql_query($query2,$db);
 
 This returns :
 Warning: Supplied argument is not a valid MySQL result resource
 
 b ut if i change the line to:
 $query2 = select * from Table where  userNo = $userNo;
 $result2 = mysql_query($query2,$db);
 
 it works (but get all the rows with userNo = $userNo.
 
 HELP Im sure this should work...what am i doing wrong???
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 -- 
 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] 2 conditions why wont they work??

2002-02-10 Thread Bogdan Stancescu

Most unusual indeed. The quick/ugly solution is to trim() the incoming $clientID.
But that's not appropriate if you expect valid entries starting with a space (well,
two spaces in your case) :)

Gotta hit the sack now - check out the time over here! :)

Bogdan

Brad Wright wrote:

 Bogdan,
 It appears that $clientID is saved with a space at the start .. when i check
 for its value (using session_encode() ) it gives that value  test 3 when
 it should be test 3.

 input type=hidden name=XclientID value=?php echo
 $row[clientID];?

 this is the extract form the form on the previous page which sets $clientID.

 I am sure that a space is being added but cant find where.

 Thanks for yr help,
 Brad


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




Re: [PHP] File Upload Performance

2002-02-10 Thread Vincent Stoessel

Linn Kubler wrote:
 I've setup an upload form for uploading files to my server.  It seems to
 work well except the performance is pretty sad.  For example it took 20
 minutes to upload a 50MB file over a 100Mb LAN.  This is running on Linux
 w/Apache.
 
 At the heart of the script is the copy() function.  Anyone have any
 suggestions how to boost performance on this script?  Or, at least explain
 why this is happening?
 
 Thanks in advance,
 Linn
 
 


First I would try to isolate the problem by removing the network
from the equation.

1. Try ftping or scp a file from the client machine to the server and the
note the difference between that and your script.
2. Comment out the  copy() line in your upload script to see if that
really make a difference.

3.  Add a timer to the script to see how long it actually takes to do it's
thing.

4  Run top and free -m in separate  terminals  to see how the server
is reacting to your script as it executes.

5. Try out Zend's debug server, it might be of some use in this situation.

Good luck.

 
 
 



-- 
Vincent Stoessel [EMAIL PROTECTED]
Linux and Java Application Developer
(301) 362-1750
AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica


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




Re: [PHP] Content Management

2002-02-10 Thread Vincent Stoessel

I would also check out the midgard project which has made vast improvements
in the current 1.4.x series.  http://www.midgard-project.org/

karthikeyan wrote:
 Hi,
 
   How should i go about to developing a php application to manage the content of a 
web site OR is there allready some ready made script available which i can use in my 
project.
 
   Looking forward for yours response.
 
 karthikeyan.
 
 



-- 
Vincent Stoessel [EMAIL PROTECTED]
Linux and Java Application Developer
(301) 362-1750
AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica


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




[PHP] Forms and IE

2002-02-10 Thread Sean Hurley


Please forgive me if this has been covered before. I have searched the list 
and could not find reference to a similar problem.

I am completetly new to PHP and I am stuck. I am creating a very simple 
form. Essentially the user agrees or disagrees to a message. If the user 
agrees, they are sent to another form. It they disagree they are sent home.

My script works with Netscape and Opera but not Internet Explorer (ver 
6.0.2) and I cannot figure out why. As I said it is very simple and the 
relevant parts are displayed as follows:
form method=post action=agree.php
..
I have read the terms and Agree input type=checkbox name=agree[] 
value=agree I Do Not Agree input type=checkbox name=disagree 
value=disagree
input type=submit name=submit value=Submit
...
agree.php
?
if ($agree)  /* (I have tried this also with ($isset = $agree))  */
{ header (location: ?link=form);
}
else
{ header (location: /LETS);
}
?

As I said, this works fine with Netscape and Opera but not IE.
Any suggestions and/or advice is appreciated.

Thanks.



_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




RE: [PHP] Forms and IE

2002-02-10 Thread Martin Towell

might be the header(location...);  bit - you might need to specify the
full address

-Original Message-
From: Sean Hurley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms and IE



Please forgive me if this has been covered before. I have searched the list 
and could not find reference to a similar problem.

I am completetly new to PHP and I am stuck. I am creating a very simple 
form. Essentially the user agrees or disagrees to a message. If the user 
agrees, they are sent to another form. It they disagree they are sent home.

My script works with Netscape and Opera but not Internet Explorer (ver 
6.0.2) and I cannot figure out why. As I said it is very simple and the 
relevant parts are displayed as follows:
form method=post action=agree.php
..
I have read the terms and Agree input type=checkbox name=agree[] 
value=agree I Do Not Agree input type=checkbox name=disagree 
value=disagree
input type=submit name=submit value=Submit
...
agree.php
?
if ($agree)  /* (I have tried this also with ($isset = $agree))  */
{ header (location: ?link=form);
}
else
{ header (location: /LETS);
}
?

As I said, this works fine with Netscape and Opera but not IE.
Any suggestions and/or advice is appreciated.

Thanks.



_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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



Re: [PHP] Forms and IE

2002-02-10 Thread Jason Lotito

Answered below:

- Original Message -
From: Sean Hurley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 11:40 PM
Subject: [PHP] Forms and IE



 Please forgive me if this has been covered before. I have searched the
list
 and could not find reference to a similar problem.

 I am completetly new to PHP and I am stuck. I am creating a very simple
 form. Essentially the user agrees or disagrees to a message. If the user
 agrees, they are sent to another form. It they disagree they are sent
home.

 My script works with Netscape and Opera but not Internet Explorer (ver
 6.0.2) and I cannot figure out why. As I said it is very simple and the
 relevant parts are displayed as follows:
 form method=post action=agree.php
 ..
 I have read the terms and Agree input type=checkbox name=agree[]

agree[] is the problem here. For IE, it hands it to PHP, and so PHP see's it
as an array, or
$array[0]

So, take out the [] and you should be alright.

Jason Lotito
www.newbienetwork.net


 value=agree I Do Not Agree input type=checkbox name=disagree
 value=disagree
 input type=submit name=submit value=Submit
 ...
 agree.php
 ?
 if ($agree)  /* (I have tried this also with ($isset = $agree))  */
 { header (location: ?link=form);
 }
 else
 { header (location: /LETS);
 }
 ?

 As I said, this works fine with Netscape and Opera but not IE.
 Any suggestions and/or advice is appreciated.

 Thanks.



 _
 MSN Photos is the easiest way to share and print your photos:
 http://photos.msn.com/support/worldwide.aspx


 --
 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] Forms and IE

2002-02-10 Thread Sean Hurley

Well, damn.
When I read your suggestion I didn't quite accept it. I thought
no, it would return an error if it couldn't find the page, but with nothing 
to lose I tried it. And it worked. Thank you. Thanks a lot.

From: Martin Towell [EMAIL PROTECTED]
To: 'Sean Hurley' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] Forms and IE
Date: Mon, 11 Feb 2002 15:48:17 +1100

might be the header(location...);  bit - you might need to specify the
full address

-Original Message-
From: Sean Hurley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms and IE



Please forgive me if this has been covered before. I have searched the list
and could not find reference to a similar problem.

I am completetly new to PHP and I am stuck. I am creating a very simple
form. Essentially the user agrees or disagrees to a message. If the user
agrees, they are sent to another form. It they disagree they are sent home.

My script works with Netscape and Opera but not Internet Explorer (ver
6.0.2) and I cannot figure out why. As I said it is very simple and the
relevant parts are displayed as follows:
form method=post action=agree.php
..
I have read the terms and Agree input type=checkbox name=agree[]
value=agree I Do Not Agree input type=checkbox name=disagree
value=disagree
input type=submit name=submit value=Submit
...
agree.php
?
if ($agree)  /* (I have tried this also with ($isset = $agree))  */
{ header (location: ?link=form);
}
else
{ header (location: /LETS);
}
?

As I said, this works fine with Netscape and Opera but not IE.
Any suggestions and/or advice is appreciated.

Thanks.



_
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: [PHP] Forms and IE

2002-02-10 Thread Analysis and Solutions

Hi Sean:

Sean Hurley wrote:
 
 Agree input type=checkbox name=agree[] value=agree
 I Do Not Agree input type=checkbox name=disagree value=disagree

 if ($agree)  /* (I have tried this also with ($isset = $agree))  */
 { header (location: ?link=form);
 }
 else
 { header (location: /LETS);
 }

Several things here.  You're probably having problems because you defined
agree as an array (via the brackets in name=agree[]), but in your code
you're examining it as a regular variable.  By the way ($isset = $agree)
isn't real, at least in this context.  You mean if ( isset($agree) ) {...

Now, to do this job right...  First, use radio buttons.  Second, make
disagree the default.  Third examine the information in PHP.  Fourth, use a
full URL in the Location.  Fifth, write clean code, using indents to
demarcate nesting so your code is easier to read.

FORM:
   input type=radio name=Agree value=Y / I Agree
   input type=radio name=Agree value=N checked / I Do Not Agree


RECEIVING SCRIPT:
   if ($Agree == 'Y') {
  header('Location: http://foo.org/?link=form');
   } else {
  header('Location: http://foo.org/LETS/');
   }


Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 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 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

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




Re: [PHP] Fooling the client into thinking php script is .jpg

2002-02-10 Thread Christopher William Wesley

On Mon, 11 Feb 2002, Matt Moreton wrote:
 I have a script that outputs an image.  Using the gd library.  But the
...
 the image.  Is it possible somehow to request the file as a .jpg?
 www.host.com/displayimage.php

Assuming you're using Apache, you can use a rewrite rule (with
mod_rewrite).  http://httpd.apache.org/docs/mod/mod_rewrite.html

Turn the rewrite engine on, then specify a rewrite rule which tells apache
to execute your script when a certain file is requested.

Using the file names you specified, add this to your httpd.conf (or your
.htaccess):

RewriteEngine on
RewriteRule ^/displayimage.jpg$ /displayimage.php [L]

You can then just use /displayimage.jpg as an image src, then when a
visitor's browser requests it, apache will execute  return
/displayimage.php instead, and the visitor will never know.

~Chris   /\
 \ / September 11, 2001
  X  We Are All New Yorkers
 / \ rm -rf /bin/laden


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




[PHP] PHP Technology Comparisons

2002-02-10 Thread Richard Lynch

First, I'm going to apologize for posting when I don't even lurk any 
more, much less contribute. :-|

Those of you who remember me from back in the day will probably 
forgive me -- Those of you who don't, well, what can I say?  Time 
and Tools is how an old friend and I used to put it.

Speaking of Tools (and Time, for that matter), the REAL purpose of 
this post is to announce that I've (finally!) gotten around to fixing 
the cobbler's kid's shoes, and the PHP Technology Comparisons page 
is back in operation.

This page originally started when I got tired of the Which PHP 
Shopping Cart Is Best? thread (for the 40th time) back around in 
1998, I think...  I decided it was time to once and for damn well all 
survey the public and get the answer and never have to sit through 
*THAT* thread again.  (Well, in theory...)

Anyway, this application will probably win an award for crudest 
interface of all time, but the darn thing works.  (Dammit Jim, I'm a 
Programmer, not a Designer!)

And, since you see the previous voter's results as you vote, no 
pollster worth their salt (or whatever pollsters get paid in) is 
going to consider it valid.  Yeah, whatever.

I did at least replace the text headings across the top with some 
nifty dynamic images with vertical text, so you only have to scroll 
half as much horizontally as you used to...  As if anybody even 
remembers the stupid page that's been dead for half a year or so... 
You still can't see all the features at once, but it's half as bad as 
it was. :-)

Of course, in fixing it up, I've decided to start adding new 
Technologies to compare every month or so (solely subject to my whim, 
of course).

At the moment, the comparison in question is:
(drum roll please)

PHP Optimization Technologies

So whether you think the Zend Cache is the bomb or not, here's your 
chance to vote for it on the features and technologies *YOU* think 
matter.

Anybody on the planet (okay, anybody who can use a web-browser) can 
nominate their favorite (or most-hated) Solution, and, similarly, 
anybody on the planet (repeat disclaimer) can nominate an important 
Feature.

Voting is strictly on the honor system, since you know and I know 
that *ANY* on-line poll can be rigged, schemed, gamed, or otherwise 
hacked, I've decided to not even *bother* with *ANY* kind of control 
whatsoever other than your honor.

Think of it as an wide-open free-form People's Choice meets Consumer 
Reports, where you decide what the features to compare are, and you 
decide which products to rate, and, come to think of it, you decide 
which ones are the best.

Fortunately, this is the 'Net and we all end up with the collective 
wisdom of as many of you as bother vote, instead of 6 mystery guys in 
the employ of Consumer Reports, eh?

Naturally, the old PHP Shopping Cart results are still available, and 
you can even vote on the old survey[s] if you want (mostly because it 
was easier to leave it alone than to hack it to stop you from voting).

So if you're looking for a shopping cart, and want to see how they 
all stack up, this is the place.

Similarly, if you're looking to get more out of your PHP-enabled 
web-server, you know what to do:

http://l-i-e.com/compare/

Release the hounds!!!

PS  I was going to do PHP Code Profilers only there don't seem to 
*BE* any :-(  Please, somebody prove me wrong...
-- 
Got Music? http://l-i-e.com/artists.htm

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




[PHP] configuring webhost

2002-02-10 Thread mm fernandez


hi. i'm new here and i'm also new to php. thing is though, i'd like to ask 
something with regard to configuring the web host to make it support php. 
see, i work for a company which also offers web hosting but due to lack of 
technical people here, we're not sure how to configure our server to support 
php. i know how to install and configure php on a local pc but i don't know 
anything about configuring a web host. hmm...i'm not so technical 
myselfcan anyone help?

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] configuring webhost

2002-02-10 Thread Philip J. Newman

You could hire me! then pay me.

- Original Message -
From: mm fernandez [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 11, 2002 8:34 PM
Subject: [PHP] configuring webhost



 hi. i'm new here and i'm also new to php. thing is though, i'd like to ask
 something with regard to configuring the web host to make it support php.
 see, i work for a company which also offers web hosting but due to lack of
 technical people here, we're not sure how to configure our server to
support
 php. i know how to install and configure php on a local pc but i don't
know
 anything about configuring a web host. hmm...i'm not so technical
 myselfcan anyone help?

 _
 Join the world's largest e-mail service with MSN Hotmail.
 http://www.hotmail.com


 --
 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] Cache-Control: no-cache and browser back button problem

2002-02-10 Thread Steven Haryanto

why does the cache control header generated by php (under 
session_cache_limiter = nocache) needs to have no-store? It 
makes pressing Back in the browser requests a new version of the 
page (which is unwanted in some situations, e.g. while filling 
form and needs to edit a few fields before re-submitting).

Also, when I am editing the script and had a fatal error (like a 
PHP syntax error), the stored version of the page by the browser 
is always the one with a fatal error, and I need to always 
refresh to get the current version (I am using a 'Never check 
for newer versions of pages' in my browser, which is fine for 
most circumstances).

Can I remove the 'no-store' parameter from the generated 
Cache-Control header, without resorting to session_cache_limiter 
= private (since this also have some Refresh problems in IE)?

--
sh


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