[PHP] Query Returning Error

2004-10-13 Thread Harlequin
Morning all.

this is such a basic question I'm embarrassed to ask but the query worked 
fine a few minutes ago and now returns an error:

I get an error:

Parse error: parse error, unexpected '=' in sample.php on line 2

[CODE]
// Authenticate User:
   Query01 = SELECT * FROM Users
   WHERE UserID='$_POST[TXT_UserID]'
   AND UserPassword='$_POST[TXT_UserPassword]';
   $Result01 = mysql_query($Query01) or die(Error 01:  . mysql_error());
[/CODE]

WTF...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
- 

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



Re: [PHP] Query Returning Error

2004-10-13 Thread Jason Wong
On Wednesday 13 October 2004 15:32, Harlequin wrote:

 this is such a basic question I'm embarrassed to ask but the query worked
 fine a few minutes ago and now returns an error:

Change everything back to what it was a few minutes ago?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Murphy was a grunt
-- Murphy's Military Laws n56
*/

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



Re: [PHP] Query Returning Error

2004-10-13 Thread Harlequin
Doh...!

thanks mate.

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
Jason Wong [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Wednesday 13 October 2004 15:32, Harlequin wrote:

 this is such a basic question I'm embarrassed to ask but the query worked
 fine a few minutes ago and now returns an error:

 Change everything back to what it was a few minutes ago?

 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Murphy was a grunt
 -- Murphy's Military Laws n56
 */ 

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



Re: [PHP] Query Returning Error

2004-10-13 Thread Jason Davidson
should Query01 have a $ in front of it, i assume its a var

Jason

Harlequin [EMAIL PROTECTED] wrote: 
 
 Morning all.
 
 this is such a basic question I'm embarrassed to ask but the query worked 
 fine a few minutes ago and now returns an error:
 
 I get an error:
 
 Parse error: parse error, unexpected '=' in sample.php on line 2
 
 [CODE]
 // Authenticate User:
Query01 = SELECT * FROM Users
WHERE UserID='$_POST[TXT_UserID]'
AND UserPassword='$_POST[TXT_UserPassword]';
$Result01 = mysql_query($Query01) or die(Error 01:  . mysql_error());
 [/CODE]
 
 WTF...?
 
 -- 
 -
  Michael Mason
  Arras People
  www.arraspeople.co.uk
 - 
 
 -- 
 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] Query Returning Error

2004-10-13 Thread Jordi Canals
On Wed, 13 Oct 2004 08:32:17 +0100, Harlequin
[EMAIL PROTECTED] wrote:
 Morning all.
 
 this is such a basic question I'm embarrassed to ask but the query worked
 fine a few minutes ago and now returns an error:
 
 I get an error:
 
 Parse error: parse error, unexpected '=' in sample.php on line 2
 
 [CODE]
 // Authenticate User:
Query01 = SELECT * FROM Users

$Query01

WHERE UserID='$_POST[TXT_UserID]'
AND UserPassword='$_POST[TXT_UserPassword]';
$Result01 = mysql_query($Query01) or die(Error 01:  . mysql_error());
 [/CODE]


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



Re: [PHP] Help Me Understand PHP5, register_globals=off, $HTTP_POST_VARS, and $_POST

2004-10-13 Thread Jason Wong
On Wednesday 13 October 2004 15:08, Francis Chang wrote:

[snip]

 access the post variables.  My question is, is the $HTTP_POST_VARS global
 still populated for backwards compatibility?  In other words, if I have an
 old script that has the following piece of code running on a PHP5.0
 environment with register_globals off (after submission of a form), would
 it still work as expected?

 Function someFunction($variable) {
   global $HTTP_POST_VARS;

   return IsSet($HTTP_POST_VARS[$variable])

 }

manual  Appendix B. Migrating from PHP 4 to PHP 5

see section New Directives.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
There are more dead people than living, and their numbers are increasing.
-- Eugene Ionesco
*/

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



[PHP] PEAR::Auth

2004-10-13 Thread 22
Concerning PEAR::Auth
I can't tune interaction between PEAR::Auth and MySQL auth table .
 
Typical code from manual
?php
$dbtype  = 'mysql';
$dbhost = 'localhost';
$dbuser = '';
$dbpass = '';
$dbname = cosmos;
$dsn = $dbtype://$dbuser:[EMAIL PROTECTED]/$dbname;
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);
require_once Auth/Auth.php;
function loginFunction(){
echo form method=\post\ action=\ . $_SERVER['PHP_SELF'] . \;
echo input type=\text\ name=\username\;
echo input type=\password\ name=\password\;
echo input type=\submit\;
echo /form;
}
$a = new Auth(DB, $dsn, loginFunction);
$a-start();
if ($a-getAuth()){
echo OK;
}
?
 
With typical  SQL statement from manual:
CREATE TABLE auth(
username VARCHAR(50) default '' NOT NULL,
password VARCHAR(32) default '' NOT NULL,
PRIMARY KEY (username),
KEY (password));


I tried:
INSERT INTO auth VALUES ('qq', 'pp');
 After submitting the login form the process buzzes on the procedure start();
I tried too:
INSERT INTO auth VALUES ('qq', PASSWORD('pp'));
I tried (using phpMyAdmin):
GRANT SELECT ,  INSERT , UPDATE , DELETE , CREATE , INDEX , ALTER ON * . * 
TO qq@ localhost WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 
0 MAX_UPDATES_PER_HOUR 0 ;
But process buzzes on the procedure 'start()' as before;
 
 
 
Could you show me the simple 
but concrete example of MySQL query 
that make the above php-code working with
login (for instance) 'qq' and password 'pp'.
 
 
Thank you
Vlad Alivanov
 





[PHP] submission before

2004-10-13 Thread Bruno Santos
hello all.
I've a question that i might think is not much related with PHP, even 
the pages are PHP and everything is working with PHP.

I've a FORM in my site to be written by the user, but, i need to know 
before the value of a field to fill another field in the form depending 
with the
value of the previous field.

i could put just the field i need filed and then, the user submit the 
value and i can after that fill the next field becase of  the 
information from the previous field.
example:

FIELD 1: some text - the user press enter, and the next field is filled 
regarding the information from these field.
how can i accomplish this ??

FIELD 2:
Another FIELD:
submit button
cheers
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] submission before

2004-10-13 Thread Gareth Williams
I think you'll find that this is more of a Javascript problem than a 
PHP one.

On 13 Oct 2004, at 12:11, Bruno Santos wrote:
hello all.
I've a question that i might think is not much related with PHP, even 
the pages are PHP and everything is working with PHP.

I've a FORM in my site to be written by the user, but, i need to know 
before the value of a field to fill another field in the form 
depending with the
value of the previous field.

i could put just the field i need filed and then, the user submit the 
value and i can after that fill the next field becase of  the 
information from the previous field.
example:

FIELD 1: some text - the user press enter, and the next field is 
filled regarding the information from these field.
how can i accomplish this ??

FIELD 2:
Another FIELD:
submit button
cheers
--
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257
--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257
--
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] Query Returning Error

2004-10-13 Thread Graham Cossey
Besides adding $ to Query01, I have had little luck in the past when  using
$_POST or $_GET directly in an evaluated string. If you are still having
problems, try something like:

?php
$user = $_POST['TXT_UserID'];
$pwd = $_POST['TXT_UserPassword'];

// Authenticate User:
   $Query01 = SELECT * FROM Users
   WHERE UserID='$user' AND
 UserPassword='$pwd';
   $Result01 = mysql_query($Query01) or die(Error 01:  . mysql_error());
?

HTH

Graham

 -Original Message-
 From: Harlequin [mailto:[EMAIL PROTECTED]
 Sent: 13 October 2004 08:32
 To: [EMAIL PROTECTED]
 Subject: [PHP] Query Returning Error


 Morning all.

 this is such a basic question I'm embarrassed to ask but the query worked
 fine a few minutes ago and now returns an error:

 I get an error:

 Parse error: parse error, unexpected '=' in sample.php on line 2

 [CODE]
 // Authenticate User:
Query01 = SELECT * FROM Users
WHERE UserID='$_POST[TXT_UserID]'
AND UserPassword='$_POST[TXT_UserPassword]';
$Result01 = mysql_query($Query01) or die(Error 01:  . mysql_error());
 [/CODE]

 WTF...?

 --
 -
  Michael Mason
  Arras People
  www.arraspeople.co.uk
 -

 --
 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] Query Returning Error

2004-10-13 Thread Chris Dowell
You can get around this problem more easily by putting your variables 
inside curly brackets when they appear inside strings.

See here: 
http://uk.php.net/manual/en/language.types.string.php#language.types.string.parsing.complex

Or as an example:
?php
$Query01 = SELECT * FROM Users
WHERE UserID = '{$_POST['TXT_UserID']}'
AND UserPassword = '{$_POST['TXT_UserPassword']}';
$Result01 = mysql_query($Query01) or die (Error 01:  . mysql_error());
?
Note also that you didn't quote the index you were using inside the 
$_POST array. This is wrong - it will work in raw PHP because it will 
be interpreted as an undefined constant, and thus replaced with the 
string, however the behaviour inside a quoted string is even less 
correct, and will almost certainly not do what you expect.

Hope this helps
Cheers
Chris
Graham Cossey wrote:
Besides adding $ to Query01, I have had little luck in the past when  using
$_POST or $_GET directly in an evaluated string. If you are still having
problems, try something like:
?php
$user = $_POST['TXT_UserID'];
$pwd = $_POST['TXT_UserPassword'];
// Authenticate User:
   $Query01 = SELECT * FROM Users
   WHERE UserID='$user' AND
 UserPassword='$pwd';
   $Result01 = mysql_query($Query01) or die(Error 01:  . mysql_error());
?
HTH
Graham

-Original Message-
From: Harlequin [mailto:[EMAIL PROTECTED]
Sent: 13 October 2004 08:32
To: [EMAIL PROTECTED]
Subject: [PHP] Query Returning Error
Morning all.
this is such a basic question I'm embarrassed to ask but the query worked
fine a few minutes ago and now returns an error:
I get an error:
Parse error: parse error, unexpected '=' in sample.php on line 2
[CODE]
// Authenticate User:
  Query01 = SELECT * FROM Users
  WHERE UserID='$_POST[TXT_UserID]'
  AND UserPassword='$_POST[TXT_UserPassword]';
  $Result01 = mysql_query($Query01) or die(Error 01:  . mysql_error());
[/CODE]
WTF...?
--
-
Michael Mason
Arras People
www.arraspeople.co.uk
-
--
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] Query Returning Error

2004-10-13 Thread Graham Cossey
Thanks Chris, that'll help keep my code a bit more 'compact'.
(Sorry Harlequin, kinda hijacked your post here)

Graham

 -Original Message-
 From: Chris Dowell [mailto:[EMAIL PROTECTED]
 Sent: 13 October 2004 11:57
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Query Returning Error


 You can get around this problem more easily by putting your variables
 inside curly brackets when they appear inside strings.

 See here:
 http://uk.php.net/manual/en/language.types.string.php#language.typ
 es.string.parsing.complex

 Or as an example:

 ?php

 $Query01 = SELECT * FROM Users
 WHERE UserID = '{$_POST['TXT_UserID']}'
 AND UserPassword = '{$_POST['TXT_UserPassword']}';

 $Result01 = mysql_query($Query01) or die (Error 01:  . mysql_error());

 ?

 Note also that you didn't quote the index you were using inside the
 $_POST array. This is wrong - it will work in raw PHP because it will
 be interpreted as an undefined constant, and thus replaced with the
 string, however the behaviour inside a quoted string is even less
 correct, and will almost certainly not do what you expect.

 Hope this helps

 Cheers

 Chris


 Graham Cossey wrote:
  Besides adding $ to Query01, I have had little luck in the past
 when  using
  $_POST or $_GET directly in an evaluated string. If you are still having
  problems, try something like:
 
  ?php
  $user = $_POST['TXT_UserID'];
  $pwd = $_POST['TXT_UserPassword'];
 
  // Authenticate User:
 $Query01 = SELECT * FROM Users
 WHERE UserID='$user' AND
   UserPassword='$pwd';
 $Result01 = mysql_query($Query01) or die(Error 01:  .
 mysql_error());
  ?
 
  HTH
 
  Graham
 
 
 -Original Message-
 From: Harlequin [mailto:[EMAIL PROTECTED]
 Sent: 13 October 2004 08:32
 To: [EMAIL PROTECTED]
 Subject: [PHP] Query Returning Error
 
 
 Morning all.
 
 this is such a basic question I'm embarrassed to ask but the
 query worked
 fine a few minutes ago and now returns an error:
 
 I get an error:
 
 Parse error: parse error, unexpected '=' in sample.php on line 2
 
 [CODE]
 // Authenticate User:
Query01 = SELECT * FROM Users
WHERE UserID='$_POST[TXT_UserID]'
AND UserPassword='$_POST[TXT_UserPassword]';
$Result01 = mysql_query($Query01) or die(Error 01:  .
 mysql_error());
 [/CODE]
 
 WTF...?
 
 --
 -
  Michael Mason
  Arras People
  www.arraspeople.co.uk
 -
 
 --
 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] passing GET parameter that has '' sign

2004-10-13 Thread Suka Ada, I Nyoman
hi,
I am wondering how do we pass a GET value that has '' sign..
let's say I have this:
process.php?mode=testurl=http://someurl.com/index.php?a=10b=200
that way, process.php will have three variables:
$_GET['mode']  ( = 'test' )
$_GET['url']   ( = 'http://someurl.com/index.php?a=10' )
$_GET['b'] ( = '200' )
But I actually want the variables only two:
$_GET['mode']   ( = 'test' )
$_GET['url']( = 'http://someurl.com/index.php?a=10b=200' )
how to accomplish this?
*I hope my question's not confusing.
Thanks and regards,
Guido
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Unsubscribe.

2004-10-13 Thread Jay Blanchard
[snip]
Been trying to unsubscribe this email account for days now
and now go. Anyone on this list have access to remove me?
[/snip]

And you have clicked on the unsub link in the e-mail?

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



Re: [PHP] passing GET parameter that has '' sign

2004-10-13 Thread Suka Ada, I Nyoman
that solved it! thanks alot Stefan.
-Guido
Stefan Dengscherz wrote:
Hello,
you might try using the urlencoded version of the '' sign which is '%26'.
Works perfectly for me ;)
Best regards,
-sd
On Wed, Oct 13, 2004 at 06:23:25PM +0800, Suka Ada, I Nyoman wrote:
hi,
I am wondering how do we pass a GET value that has '' sign..
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Query Returning Error

2004-10-13 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



 -Original Message-
 From: Chris Dowell [mailto:[EMAIL PROTECTED] 
 Sent: 13 October 2004 11:57
 
 Note also that you didn't quote the index you were using inside the 
 $_POST array. This is wrong - it will work in raw PHP 
 because it will 
 be interpreted as an undefined constant, and thus replaced with the 
 string, however the behaviour inside a quoted string is even less 
 correct, and will almost certainly not do what you expect.

Wrong -- the behaviour inside a quoted string is *more* correct, as it's a
documented valid way to do it (whereas it's a documented way *not* to do it
outside a string!).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services, JG125, James
Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS,
LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



Re: [PHP] passing GET parameter that has '' sign

2004-10-13 Thread Sune Rievers
input must be urlencoded - see http://www.php.net/urlencode for details.

Regards,
Sune Rievers

On Wed, 13 Oct 2004 18:23:25 +0800, Suka Ada, I Nyoman
[EMAIL PROTECTED] wrote:
 hi,
 I am wondering how do we pass a GET value that has '' sign..
 let's say I have this:
 
 process.php?mode=testurl=http://someurl.com/index.php?a=10b=200
 
 that way, process.php will have three variables:
 $_GET['mode']  ( = 'test' )
 $_GET['url']   ( = 'http://someurl.com/index.php?a=10' )
 $_GET['b'] ( = '200' )
 
 But I actually want the variables only two:
 $_GET['mode']   ( = 'test' )
 $_GET['url']( = 'http://someurl.com/index.php?a=10b=200' )
 
 how to accomplish this?
 
 *I hope my question's not confusing.
 
 Thanks and regards,
 Guido
 
 --
 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] PHP tp PDF

2004-10-13 Thread Angelo Zanetti
Hi all, 

Im sure this has been asked before. Im about to start development of an
export section of an intranet where the invoices generated are exported
to a PDF.

I have looked at PDFlib, however I do not wish to pay for the licence
cost, so Im looking for a free alternative, I've found FPDF which from
what I've read is a pretty decent alternative. I have also found some
smaller ones that are less appealing. 

Is FPDF a suitable replacement to PDFlib or should I be looking to use
another library? Any other comments are welcome about FPDF.

Thanks

Angelo

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



RE: [PHP] PHP tp PDF

2004-10-13 Thread Jay Blanchard
[snip]
Is FPDF a suitable replacement to PDFlib or should I be looking to use
another library? Any other comments are welcome about FPDF.
[/snip]

Love it, use it.

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



[PHP] Using HTTP/PUT with PHP Apache Any browser in the whole world that works properly??????

2004-10-13 Thread Chris Dowell
Guys
According to the docs, you need to use either php://stdin or php://input 
 to read from files uploaded via PUT, however I'm unable to get even 
that  far.

My HTML form is as shown:
form action=index.php method=put enctype=multipart/form-data
input type=file name=putfile /input type=submit /
/form
However both firefox  IE use GET instead of PUT. Has anyone used PUT 
for anything, and if so, how did you get this most basic of steps to work?

FYI, googling for html forms method=PUT -xforms gets me nothing.
Cheers
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using HTTP/PUT with PHP Apache Any browser in the whole world that works properly??????

2004-10-13 Thread John Nichel
Chris Dowell wrote:
Guys
According to the docs, you need to use either php://stdin or php://input 
 to read from files uploaded via PUT, however I'm unable to get even 
that  far.

My HTML form is as shown:
form action=index.php method=put enctype=multipart/form-data
input type=file name=putfile /input type=submit /
/form
However both firefox  IE use GET instead of PUT. Has anyone used PUT 
for anything, and if so, how did you get this most basic of steps to work?

FYI, googling for html forms method=PUT -xforms gets me nothing.
Can you just use 'POST' as your form method?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Exporting HTML to Excel

2004-10-13 Thread Philip Thompson
How exactly would I change the mime headers?
~Philip
On Oct 12, 2004, at 5:07 PM, Vail, Warren wrote:
Have you tried changing your file name to project.htm but continue 
issuing
the mime headers for excel?

Warren Vail
-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 12, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Exporting HTML to Excel
Hi all.
This may not be completely a PHP question, but hopefully you will be
able to provide some insight. I have a table in HTML that I want to
export to an excel spreadsheet. Using PHP, I can create an excel
document - however, it's empty/blank. I think I am just doing it
incorrectly. Anybody done this before and/or have any ideas? I would
prefer to NOT use a third-party program.
I've searched the web and php.net, but have been somewhat unsuccessful
in finding anything. Here's what I have so far:
-
?php
header('Content-Type: application/ms-excel');
header('Content-Disposition: attachment; filename=project.xls'); ?
table
tr
tdSomething/td
/tdSomething else/td
/tr
/table
-
I just want it to have that content in the spreadsheet. It's actually
more involved than that, but that's the gist of it.
Thanks in advance.
~Philip
--
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] Exporting HTML to Excel

2004-10-13 Thread Chris Dowell
Header(Content-type: application/ms-excel);
or whatever the content type should be (on IE you can probably get away 
with application/octet-stream as it bases its decisions of file 
extensions for a lot of things).

HTH
Chris
Philip Thompson wrote:
How exactly would I change the mime headers?
~Philip
On Oct 12, 2004, at 5:07 PM, Vail, Warren wrote:
Have you tried changing your file name to project.htm but continue 
issuing
the mime headers for excel?

Warren Vail
-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 12, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Exporting HTML to Excel
Hi all.
This may not be completely a PHP question, but hopefully you will be
able to provide some insight. I have a table in HTML that I want to
export to an excel spreadsheet. Using PHP, I can create an excel
document - however, it's empty/blank. I think I am just doing it
incorrectly. Anybody done this before and/or have any ideas? I would
prefer to NOT use a third-party program.
I've searched the web and php.net, but have been somewhat unsuccessful
in finding anything. Here's what I have so far:
-
?php
header('Content-Type: application/ms-excel');
header('Content-Disposition: attachment; filename=project.xls'); ?
table
tr
tdSomething/td
/tdSomething else/td
/tr
/table
-
I just want it to have that content in the spreadsheet. It's actually
more involved than that, but that's the gist of it.
Thanks in advance.
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

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


Re: [PHP] Using HTTP/PUT with PHP Apache Any browser in the whole world that works properly??????

2004-10-13 Thread Chris Dowell
I could
But on massive file uploads the various gateways between clients and
server are timing out.
I've no evidence that PUT would help me solve this problem, but it's an
avenue I thought worth pursuing, as the whole point of the PUT method is
to send large quantities of data to a server. I am hoping that the
gateways will respect this fact (although I'm not holding my breath).
If anyone has any alternate suggestions (other than Stop using MS
gateway servers, which is unfortunately impossible given our clients),
I'd be happy to hear them.
Cheers
Chris
John Nichel wrote:
Chris Dowell wrote:
Guys
According to the docs, you need to use either php://stdin or 
php://input  to read from files uploaded via PUT, however I'm unable 
to get even that  far.

My HTML form is as shown:
form action=index.php method=put enctype=multipart/form-data
input type=file name=putfile /input type=submit /
/form
However both firefox  IE use GET instead of PUT. Has anyone used PUT 
for anything, and if so, how did you get this most basic of steps to 
work?

FYI, googling for html forms method=PUT -xforms gets me nothing.

Can you just use 'POST' as your form method?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] detecting ssl

2004-10-13 Thread Matt M.
 It worked for me, for thousands of others, but not for everybody. Some people
 just could not use the site anymore. So I guess the SERVER_PORT var can not
 necessarily be count on.
 
 Has anybody an idea how to overcome this?

try

if ( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on' ) {
}

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



Re: [PHP] Safe mode imagecreatefromjpeg

2004-10-13 Thread Marek Kilimajer
Paulo JF Silva wrote:
Hi,
I have PHP 4.3.5 and safe mode on. When I create a new image with 
imagecreatefromjpeg(), the image owner is 'httpd' and not my ftp user. 
[this is in a shared host].

I would like to know if there is any way to create the image with my 
user... I can workaround mkdir  stuff with ftp access but i can't 
figure out a workaround this 'problem' caused by safe mode.
It's a little tricky. You need to catch imagecreatefromjpeg() output 
using output buffering, then open a temporary file, write the output 
there, rewind(), and ftp_fput(). Haven't tried it, but should work.

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


[PHP] reg. expressions

2004-10-13 Thread Afan Pasalic
Hi,
on one place I have string something (something_2)
I have to take out of the string everything in brackets and brackets as 
well.
probably I will need to use Regular Expression Functions but I'm really 
bad with them :)

Please, any help!
-afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Exporting HTML to Excel

2004-10-13 Thread Philip Thompson
Chris, as you may have (or may have not) noticed, I did that. Look at 
my original email. I wasn't sure if there was more to it than that.

~Philip
On Oct 13, 2004, at 8:34 AM, Chris Dowell wrote:
Header(Content-type: application/ms-excel);
or whatever the content type should be (on IE you can probably get 
away with application/octet-stream as it bases its decisions of file 
extensions for a lot of things).

HTH
Chris
Philip Thompson wrote:
How exactly would I change the mime headers?
~Philip
On Oct 12, 2004, at 5:07 PM, Vail, Warren wrote:
Have you tried changing your file name to project.htm but continue 
issuing
the mime headers for excel?

Warren Vail
-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 12, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Exporting HTML to Excel
Hi all.
This may not be completely a PHP question, but hopefully you will be
able to provide some insight. I have a table in HTML that I want to
export to an excel spreadsheet. Using PHP, I can create an excel
document - however, it's empty/blank. I think I am just doing it
incorrectly. Anybody done this before and/or have any ideas? I would
prefer to NOT use a third-party program.
I've searched the web and php.net, but have been somewhat 
unsuccessful
in finding anything. Here's what I have so far:

-
?php
header('Content-Type: application/ms-excel');
header('Content-Disposition: attachment; filename=project.xls'); ?
table
tr
tdSomething/td
/tdSomething else/td
/tr
/table
-
I just want it to have that content in the spreadsheet. It's actually
more involved than that, but that's the gist of it.
Thanks in advance.
~Philip
--
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] Exporting HTML to Excel

2004-10-13 Thread Chris Dowell
meek /
sorry
[skulks off into dark corner to cry]
Philip Thompson wrote:
Chris, as you may have (or may have not) noticed, I did that. Look at my 
original email. I wasn't sure if there was more to it than that.

~Philip
On Oct 13, 2004, at 8:34 AM, Chris Dowell wrote:
Header(Content-type: application/ms-excel);
or whatever the content type should be (on IE you can probably get 
away with application/octet-stream as it bases its decisions of file 
extensions for a lot of things).

HTH
Chris
Philip Thompson wrote:
How exactly would I change the mime headers?
~Philip
On Oct 12, 2004, at 5:07 PM, Vail, Warren wrote:
Have you tried changing your file name to project.htm but continue 
issuing
the mime headers for excel?

Warren Vail
-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 12, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Exporting HTML to Excel
Hi all.
This may not be completely a PHP question, but hopefully you will be
able to provide some insight. I have a table in HTML that I want to
export to an excel spreadsheet. Using PHP, I can create an excel
document - however, it's empty/blank. I think I am just doing it
incorrectly. Anybody done this before and/or have any ideas? I would
prefer to NOT use a third-party program.
I've searched the web and php.net, but have been somewhat unsuccessful
in finding anything. Here's what I have so far:
-
?php
header('Content-Type: application/ms-excel');
header('Content-Disposition: attachment; filename=project.xls'); ?
table
tr
tdSomething/td
/tdSomething else/td
/tr
/table
-
I just want it to have that content in the spreadsheet. It's actually
more involved than that, but that's the gist of it.
Thanks in advance.
~Philip
--
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] reg. expressions

2004-10-13 Thread Matt M.
 on one place I have string something (something_2)
 I have to take out of the string everything in brackets and brackets as
 well.
 probably I will need to use Regular Expression Functions but I'm really
 bad with them :)

$string = something (something_2);
$pattern = /\(.*\)/;
$replacement = ;
echo preg_replace($pattern, $replacement, $string);

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



Re: [PHP] reg. expressions

2004-10-13 Thread Afan Pasalic
That was fast! :)
Thanks Matt
-afan
Matt M. wrote:
on one place I have string something (something_2)
I have to take out of the string everything in brackets and brackets as
well.
probably I will need to use Regular Expression Functions but I'm really
bad with them :)

$string = something (something_2);
$pattern = /\(.*\)/;
$replacement = ;
echo preg_replace($pattern, $replacement, $string);
.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] time

2004-10-13 Thread Jerry Swanson
I want to send email every 24. What time format you recomend to use? 
In what format the data should be store in mysql?

TH

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



RE: [PHP] Re: Exporting HTML to Excel

2004-10-13 Thread Gryffyn, Trevor
 Philip Thompson wrote:
 
  -
  ?php
  header('Content-Type: application/ms-excel');
  header('Content-Disposition: attachment; filename=project.xls');
  ?
  
  table
  tr
  tdSomething/td
  /tdSomething else/td
  /tr
  /table
  -
  
  I just want it to have that content in the spreadsheet. 
 
 Works for me... (Excel 2000)
 Something appears in A1
 Something Else appears in B1.

Worked for me too.. Even though I didn't think it would :)  Seemed too
simple.

I'm running Excel 2002.

-TG

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



Re: [PHP] Quick imageSize question

2004-10-13 Thread Stefan Dengscherz
Hello,
that's usually not possible because your webserver can't access the image
on your computer; a possible solution might be to determine the image size
via javascript and submit it with the form, so you can accept or deny the
image upload in your php script - problem: with javascript running on client
side, this is not foolproof. Anyways i don't know exactly how to solve it with
javascript even, so please correct me, if i'm talking crap here.

Best regards,

-sd

On Wed, Oct 13, 2004 at 07:37:29AM -0700, Mag wrote:
 The problem with the above is I can only get the
 dimensions AFTER the file has been uploaded and is on
 disk,which is quite a pain in the ... coz I want to
 accept only images that are smaller than x pixels
 width and then i have to tell the client that their
 upload failed coz their image is too big...is there
 any way to get the dimensions before the upload is
 done?

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



Re: [PHP] Quick imageSize question

2004-10-13 Thread Mag
Hey,

Dont worry about talking crap, I took that risk when I
started this thread :-) I was hopeing that maybe the
image would have the info incoded in it which php
could read before going through the uploador
something like that.

I too am not really sure if its possible, but am
hopeing the big boys on the list who have worked on
stuff like this for a long time will confirm it.

Thanks,
Mag

 Hello,
 that's usually not possible because your webserver
 can't access the image
 on your computer; a possible solution might be to
 determine the image size
 via javascript and submit it with the form, so you
 can accept or deny the
 image upload in your php script - problem: with
 javascript running on client
 side, this is not foolproof. Anyways i don't know
 exactly how to solve it with
 javascript even, so please correct me, if i'm
 talking crap here.
 
 Best regards,
 
 -sd
 
 On Wed, Oct 13, 2004 at 07:37:29AM -0700, Mag wrote:
  The problem with the above is I can only get the
  dimensions AFTER the file has been uploaded and is
 on
  disk,which is quite a pain in the ... coz I want
 to
  accept only images that are smaller than x pixels
  width and then i have to tell the client that
 their
  upload failed coz their image is too big...is
 there
  any way to get the dimensions before the upload is
  done?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



__
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

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



Re: [PHP] time

2004-10-13 Thread Robby Russell
On Wed, 2004-10-13 at 10:31 -0400, Jerry Swanson wrote:
 I want to send email every 24. What time format you recomend to use? 
 In what format the data should be store in mysql?
 
 TH
 

every 24? hours? minutes?

Are you going to be running a script all the time to do this?
You might want to consider using CRONTAB (if in the *nix
environment)...which would call a script to send your email.

-Robby


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



signature.asc
Description: This is a digitally signed message part


Re: [PHP] time

2004-10-13 Thread Greg Donald
On Wed, 13 Oct 2004 10:31:54 -0400, Jerry Swanson [EMAIL PROTECTED] wrote:
 I want to send email every 24. What time format you recomend to use?
 In what format the data should be store in mysql?

Your question is more appropriate for php-db or a MySQL list serv.

I'm not sure why you need to store the time in MySQL at all.  If the
mail needs to go every 24 hours, it seems more like a job for cron.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Exporting HTML to Excel

2004-10-13 Thread Chris Dowell
In an attempt to make amends, have you tried PEAR's 
Spreadsheet_Excel_Writer?

http://pear.php.net/package/Spreadsheet_Excel_Writer
It certainly works, we used it last week (although I have no *personal* 
experience of it)

Cheers
Chris
Chris Dowell wrote:
meek /
sorry
[skulks off into dark corner to cry]
Philip Thompson wrote:
Chris, as you may have (or may have not) noticed, I did that. Look at 
my original email. I wasn't sure if there was more to it than that.

~Philip
On Oct 13, 2004, at 8:34 AM, Chris Dowell wrote:
Header(Content-type: application/ms-excel);
or whatever the content type should be (on IE you can probably get 
away with application/octet-stream as it bases its decisions of file 
extensions for a lot of things).

HTH
Chris
Philip Thompson wrote:
How exactly would I change the mime headers?
~Philip
On Oct 12, 2004, at 5:07 PM, Vail, Warren wrote:
Have you tried changing your file name to project.htm but continue 
issuing
the mime headers for excel?

Warren Vail
-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 12, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Exporting HTML to Excel
Hi all.
This may not be completely a PHP question, but hopefully you will be
able to provide some insight. I have a table in HTML that I want to
export to an excel spreadsheet. Using PHP, I can create an excel
document - however, it's empty/blank. I think I am just doing it
incorrectly. Anybody done this before and/or have any ideas? I would
prefer to NOT use a third-party program.
I've searched the web and php.net, but have been somewhat unsuccessful
in finding anything. Here's what I have so far:
-
?php
header('Content-Type: application/ms-excel');
header('Content-Disposition: attachment; filename=project.xls'); ?
table
tr
tdSomething/td
/tdSomething else/td
/tr
/table
-
I just want it to have that content in the spreadsheet. It's actually
more involved than that, but that's the gist of it.
Thanks in advance.
~Philip
--
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] Re: Exporting HTML to Excel

2004-10-13 Thread Philip Thompson
On Oct 13, 2004, at 10:40 AM, Gryffyn, Trevor wrote:
To all who've helped.
Thanks for your input. [embarrassment] Truthfully, when I gave that
example in my original email, I didn't try that specific one. But it
did work for me also when I attempted that one. [/embarrassment]
The reason I was getting a blank spreadsheet was b/c I was
only showing
specific columns based on whether certain $_SESSION variables
were set.
However, the page that's supposed to export to excel, I did
not include
my `session_start()`, so none of the variables were ever TRUE. Once I
saw that and fixed it, it worked like a charm!
But I have run across a small dilemma at this point. I cannot
open the
excel file using IE. However, I can through Mozilla and Safari. Guess
this is something else I have to look at and try to tackle!
Thanks again!
~Philip

table
tr
tdSomething/td
/tdSomething else/td
/tr
/table

Btw: the example above has a /td instead of a td on the second cell
so it puts the values in A1 and A2 instead of A1 and B1.
Yeah, I realized that also whenever all of my items were going in 
column A. But I fixed that.

Another note, I put a td=A1+B1/td and it worked fine (put the
formula in and it evaluates just fine that is).
Neeto feature!
Also, if you're having trouble in IE (I didn't, it worked fine) you
might try changing the MIME type to something that'll download and give
the option of save/open.  There was another thread on this list about
creating folders (not with PHP, but opening a file dialog so the user
could create a folder for the download) that had a lot of good info
about forcing the browser to open that dialog box.
What problem are you having in IE right now?  Is it opening INSIDE IE 
as
an Excel sheet embedded or something (like PDFs do with Acrobat 
Reader)?
I had that happen once or twice while testing the code above.
Well, whenever I click on the link to export to excel (in IE), a File 
Download box pops up. It says the 'File name: toexcel.php' and the 
'File type: ' (blank). It asks if I want to open or save. However, the 
File name should not be toexcel.php (that's the page), it should be 
'project.xls'.

The error message I get whenever I try to Open or Save the file is: IE 
cannot dowload toexcel.php from your.server.com. IE was not able to 
open this Internet site. The requested site is either unavailable or 
cannot be found. Please try again later. This is obviously not true 
b/c I can download from elsewhere.

Here's what I have included in the top of my file (just to reiterate):
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=project.xls');
I tried adding the `vnd.` to the content-type, thinking that IE might 
like that better, but it didn't. It works just the same though.

Anyway, good luck. Glad you figured out the session problem, that can 
be
frustrating.

-TG
Thanks. Any ideas?
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Exporting HTML to Excel

2004-10-13 Thread John Holmes
Philip Thompson wrote:
Well, whenever I click on the link to export to excel (in IE), a File 
Download box pops up. It says the 'File name: toexcel.php' and the 
'File type: ' (blank). It asks if I want to open or save. However, the 
File name should not be toexcel.php (that's the page), it should be 
'project.xls'.
This is a known issue with IE. I think one workaround is to give the 
filename in the query string as the last variable, i.e.

toexcel.php?f=project.xls
You can just ignore $_GET['f'] in your code, but I think IE will pick 
that up as the filename when you send the download headers.

The error message I get whenever I try to Open or Save the file is: IE 
cannot dowload toexcel.php from your.server.com. IE was not able to open 
this Internet site. The requested site is either unavailable or cannot 
be found. Please try again later. This is obviously not true b/c I can 
download from elsewhere.
Is this over SSL? I've had issues with this also and the solution was to 
change the session.cache_limiter value. It interfered with the download 
for some reason. A search of the archives should bring up some relevant 
threads.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Security patch from 4.3.8 to 4.3.9

2004-10-13 Thread Federico Petronio
Hello, I would like to know if there is a patch just for the security 
fix from PHP-4.3.8 to PHP-4.3.9 and where can I found it.

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


[PHP] mail problems - phpinfo information

2004-10-13 Thread Jed R. Brubaker
I have been having all kinds of problems with the mail() function in PHP. I 
realize that there are problems inheritly, but I think I am still trying to 
track down the problem.

My latest theory is that PHP isn't set up to work with the right mailing 
program. I know that our system is supposed to be using qmail that actually 
sits on a different server, but I found interesting information in phpinfo 
that is making me wonder if a local sendmail is handling the requests 
instead.

Here are the things I am finding in phpinfo:
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
SMTP localhost localhost
smtp_port 25 25
Path to sendmail /usr/sbin/sendmail -t -i

Enviornment
MAIL /var/mail/kpratt (what does this one do?)

With all of the above refering to sendmail, is there anyway that my mail() 
can actually be using qmail?

Thanks! 

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



[PHP] php err msg/issue...

2004-10-13 Thread bruce
hi...

i'm dealing with an app that's throwing an err/warning msg.. i'm using php5,
on a linux rh8.0 system.

i believe the code was written for php4.

the code is:

if($rec)
 {
$rs-append($setDefaults);
$rs-rows[$rs-pos]-fields=$rec;  generates err msg...
$rs-rows[$rs-pos]-id=-1;
}

$rec = Array ( [0] = 0 [1] = admin [2] = 21232f297a57a5a743894a0e4a801fc3
[3] = [4] = TRUE )


the err msg being generated is:
Php-Txt-Db-Access Error:
PHP Error: [2048] Creating default object from empty value [Line: 1537]
[File: /var/www/html/blast/txtdbapi/resultset.php]


i'm not sure why this is generated, or what's going on, or even how/why to
correct it!! apparently this doesn't happen with php4, but i'm not certain.

any thoughts/opinions/comments would be helpful...

thanks

-bruce

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



Re: [PHP] reg. expressions

2004-10-13 Thread John Holmes
Matt M. wrote:
on one place I have string something (something_2)
I have to take out of the string everything in brackets and brackets as
well.
probably I will need to use Regular Expression Functions but I'm really
bad with them :)

$string = something (something_2);
$pattern = /\(.*\)/;
$replacement = ;
echo preg_replace($pattern, $replacement, $string);
Just note that if there are two bracketed patterns in a string, this 
will have issues. It may or may not be an issue for you, though, 
depending up on your data.

As an alternative:
$string = something (something_2) something (something_4);
$pattern = '/\([^)]\)/';
//or $pattern = '/\(.*\)/U';
$replacement = '';
echo preg_replace($pattern, $replacement, $string);
Also, if there could be line breaks within the bracketed text, you'll 
need extra modifiers... it all just depends upon your data.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php err msg/issue...

2004-10-13 Thread Jason Davidson
I gather $rec is empty.. :)  make sure there is something in it before
you assign it to that object member.

Jason
[EMAIL PROTECTED] wrote: 
 
 hi...
 
 i'm dealing with an app that's throwing an err/warning msg.. i'm using php5,
 on a linux rh8.0 system.
 
 i believe the code was written for php4.
 
 the code is:
 
 if($rec)
  {
 $rs-append($setDefaults);
 $rs-rows[$rs-pos]-fields=$rec;  generates err msg...
 $rs-rows[$rs-pos]-id=-1;
 }
 
 $rec = Array ( [0] = 0 [1] = admin [2] = 21232f297a57a5a743894a0e4a801fc3
 [3] = [4] = TRUE )
 
 
 the err msg being generated is:
 Php-Txt-Db-Access Error:
 PHP Error: [2048] Creating default object from empty value [Line: 1537]
 [File: /var/www/html/blast/txtdbapi/resultset.php]
 
 
 i'm not sure why this is generated, or what's going on, or even how/why to
 correct it!! apparently this doesn't happen with php4, but i'm not certain.
 
 any thoughts/opinions/comments would be helpful...
 
 thanks
 
 -bruce
 
 -- 
 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] reg. expressions

2004-10-13 Thread Afan Pasalic
In my case it will be actually product name (product number) and 
always the same. That means Matt's code will do exactly what I need.
But, thanks for your post - could happen to use that on other place
:)

Thanks John
-afan
John Holmes wrote:
Matt M. wrote:
on one place I have string something (something_2)
I have to take out of the string everything in brackets and brackets as
well.
probably I will need to use Regular Expression Functions but I'm really
bad with them :)

$string = something (something_2);
$pattern = /\(.*\)/;
$replacement = ;
echo preg_replace($pattern, $replacement, $string);

Just note that if there are two bracketed patterns in a string, this 
will have issues. It may or may not be an issue for you, though, 
depending up on your data.

As an alternative:
$string = something (something_2) something (something_4);
$pattern = '/\([^)]\)/';
//or $pattern = '/\(.*\)/U';
$replacement = '';
echo preg_replace($pattern, $replacement, $string);
Also, if there could be line breaks within the bracketed text, you'll 
need extra modifiers... it all just depends upon your data.

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


RE: [PHP] Security patch from 4.3.8 to 4.3.9

2004-10-13 Thread Jay Blanchard
[snip]
Hello, I would like to know if there is a patch just for the security 
fix from PHP-4.3.8 to PHP-4.3.9 and where can I found it.
[/snip]

Looking at http://www.php/net/downloads I do not see one.

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



RE: [PHP] php err msg/issue...

2004-10-13 Thread bruce
$rec is not empty

jason...

1st, if $rec was empty.. the 'if' section would not be called, and the err
would not be thrown

2nd.. i printed the value of '$rec' below the 'if' block of code...

but.. umm thanks...



-Original Message-
From: Jason Davidson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 13, 2004 9:51 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] php err msg/issue...


I gather $rec is empty.. :)  make sure there is something in it before
you assign it to that object member.

Jason
[EMAIL PROTECTED] wrote:

 hi...

 i'm dealing with an app that's throwing an err/warning msg.. i'm using
php5,
 on a linux rh8.0 system.

 i believe the code was written for php4.

 the code is:

 if($rec)
  {
 $rs-append($setDefaults);
 $rs-rows[$rs-pos]-fields=$rec;  generates err msg...
 $rs-rows[$rs-pos]-id=-1;
 }

 $rec = Array ( [0] = 0 [1] = admin [2] =
21232f297a57a5a743894a0e4a801fc3
 [3] = [4] = TRUE )


 the err msg being generated is:
 Php-Txt-Db-Access Error:
 PHP Error: [2048] Creating default object from empty value [Line: 1537]
 [File: /var/www/html/blast/txtdbapi/resultset.php]


 i'm not sure why this is generated, or what's going on, or even how/why to
 correct it!! apparently this doesn't happen with php4, but i'm not
certain.

 any thoughts/opinions/comments would be helpful...

 thanks

 -bruce

 --
 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] mail problems - phpinfo information

2004-10-13 Thread Jay Blanchard
[snip]
... making me wonder if a local sendmail is handling the requests
instead.

With all of the above refering to sendmail, is there anyway that my
mail() 
can actually be using qmail?
[/snip]

From http://www.php.net/mail, something you have not read apparently

For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. [LOOKIE
HERE--If you use another mail program, such as qmail or postfix, be
sure to use the appropriate sendmail wrappers that come with
them.--END LOOKIE] PHP will first look for sendmail in your PATH,
and then in the following:
/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly
recommended to have sendmail available from your PATH. Also, the user
that compiled PHP must have permission to access the sendmail binary. 

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



Re: [PHP] Re: Exporting HTML to Excel

2004-10-13 Thread Philip Thompson
On Oct 13, 2004, at 11:30 AM, John Holmes wrote:
Philip Thompson wrote:
Well, whenever I click on the link to export to excel (in IE), a 
File Download box pops up. It says the 'File name: toexcel.php' and 
the 'File type: ' (blank). It asks if I want to open or save. 
However, the File name should not be toexcel.php (that's the page), 
it should be 'project.xls'.
This is a known issue with IE. I think one workaround is to give the 
filename in the query string as the last variable, i.e.

toexcel.php?f=project.xls
You can just ignore $_GET['f'] in your code, but I think IE will pick 
that up as the filename when you send the download headers.
Tried this, but it doesn't work.

The error message I get whenever I try to Open or Save the file is: 
IE cannot dowload toexcel.php from your.server.com. IE was not able 
to open this Internet site. The requested site is either unavailable 
or cannot be found. Please try again later. This is obviously not 
true b/c I can download from elsewhere.
Is this over SSL? I've had issues with this also and the solution was 
to change the session.cache_limiter value. It interfered with the 
download for some reason. A search of the archives should bring up 
some relevant threads.
Yes, this is on a secure server. I don't have access at this point to 
the .ini file at this point, but I will look into this when my 
supervisor returns tomorrow. Do you happen to know what value to change 
the session.cache_limiter to? I'll search the archives also.

---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
Thanks a bunch.
~Philiip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail problems - phpinfo information

2004-10-13 Thread Matthew Sims
 I have been having all kinds of problems with the mail() function in PHP.
 I
 realize that there are problems inheritly, but I think I am still trying
 to
 track down the problem.

 My latest theory is that PHP isn't set up to work with the right mailing
 program. I know that our system is supposed to be using qmail that
 actually
 sits on a different server, but I found interesting information in phpinfo
 that is making me wonder if a local sendmail is handling the requests
 instead.

 Here are the things I am finding in phpinfo:
 sendmail_from no value no value
 sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
 SMTP localhost localhost
 smtp_port 25 25
 Path to sendmail /usr/sbin/sendmail -t -i

 Enviornment
 MAIL /var/mail/kpratt (what does this one do?)

 With all of the above refering to sendmail, is there anyway that my mail()
 can actually be using qmail?

 Thanks!

The mail settings in php.ini is for Windows only. When using PHP on
Unix/Linux, mail() always defaults to the sendmail binary on localhost. So
you can ignore what it says in phpinfo.

My mail server at home is running Qmail as well as the web server I run at
my work. (Quick plug, Qmail rulez!1!1!!)...okay, anyways, since Qmail
comes with a sendmail wrapper you should have no problems using it with
the mail() function.

If your Qmail server is on a remote host, then you need to configure the
local server's sendmail program to relay mail to the remote server.

/var/mail is where users mail boxes are stored when using to old mail
format mbox. Qmail uses the newer format Maildir which resides in user's
home directory. So it looks like you have a user by the name of kpratt?

-- 
--Matthew Sims
--http://killermookie.org

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



Re: [PHP] php err msg/issue...

2004-10-13 Thread Curt Zirzow
* Thus wrote bruce:
 hi...
 
 i'm dealing with an app that's throwing an err/warning msg.. i'm using php5,
 on a linux rh8.0 system.
 
 i believe the code was written for php4.
 
 the code is:
 
 if($rec)
  {
 $rs-append($setDefaults);
 $rs-rows[$rs-pos]-fields=$rec;  generates err msg...
... 

 the err msg being generated is:
 Php-Txt-Db-Access Error:
 PHP Error: [2048] Creating default object from empty value [Line: 1537]
 [File: /var/www/html/blast/txtdbapi/resultset.php]

This is because the element in $rs-rows[$rs-pos] is not defined
so php made a stdClass before it can assign the -fields member.


Curt
-- 
Quoth the Raven, Nevermore.

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



Re: [PHP] php err msg/issue...

2004-10-13 Thread Matthew Sims
 hi...

 i'm dealing with an app that's throwing an err/warning msg.. i'm using
 php5,
 on a linux rh8.0 system.

 i believe the code was written for php4.

 the code is:

 if($rec)
  {
 $rs-append($setDefaults);
 $rs-rows[$rs-pos]-fields=$rec;  generates err msg...
 $rs-rows[$rs-pos]-id=-1;
 }

 $rec = Array ( [0] = 0 [1] = admin [2] =
 21232f297a57a5a743894a0e4a801fc3
 [3] = [4] = TRUE )


 the err msg being generated is:
 Php-Txt-Db-Access Error:
 PHP Error: [2048] Creating default object from empty value [Line: 1537]
 [File: /var/www/html/blast/txtdbapi/resultset.php]


 i'm not sure why this is generated, or what's going on, or even how/why to
 correct it!! apparently this doesn't happen with php4, but i'm not
 certain.

 any thoughts/opinions/comments would be helpful...

 thanks

 -bruce


Without seeing your classes, PHP4 classes will not work with PHP5. The OO
model has been completely revamped. So if the code works in PHP4 but not
in PHP5, my guess is that you either need to downgrade to PHP4 or re-code
your classes to fit the PHP5 OO model.

-- 
--Matthew Sims
--http://killermookie.org

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



RE: [PHP] Exporting HTML to Excel

2004-10-13 Thread Vail, Warren
 header('Content-Type: application/ms-excel');
 header('Content-Disposition: attachment; filename=project.htm'); ?
AAA used by
excel to determine translation, I believe

I believe the Content-Type is referred to as a mime header (8-}), I often
see something similar in email.

HTH,

Warren Vail
(415) 667-0240
SF211-07-434
 


-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 13, 2004 6:18 AM
To: Vail, Warren
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Exporting HTML to Excel


How exactly would I change the mime headers?

~Philip

On Oct 12, 2004, at 5:07 PM, Vail, Warren wrote:

 Have you tried changing your file name to project.htm but continue
 issuing
 the mime headers for excel?

 Warren Vail

 -Original Message-
 From: Philip Thompson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 12, 2004 2:21 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Exporting HTML to Excel


 Hi all.

 This may not be completely a PHP question, but hopefully you will be 
 able to provide some insight. I have a table in HTML that I want to 
 export to an excel spreadsheet. Using PHP, I can create an excel 
 document - however, it's empty/blank. I think I am just doing it 
 incorrectly. Anybody done this before and/or have any ideas? I would 
 prefer to NOT use a third-party program.

 I've searched the web and php.net, but have been somewhat unsuccessful 
 in finding anything. Here's what I have so far:

 -
 ?php
 header('Content-Type: application/ms-excel');
 header('Content-Disposition: attachment; filename=project.xls'); ?

 table
   tr
   tdSomething/td
   /tdSomething else/td
   /tr
 /table
 -

 I just want it to have that content in the spreadsheet. It's actually 
 more involved than that, but that's the gist of it.

 Thanks in advance.
 ~Philip

 --
 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] mail problems - phpinfo information

2004-10-13 Thread John Nichel
Jed R. Brubaker wrote:
I have been having all kinds of problems with the mail() function in PHP. I 
realize that there are problems inheritly, but I think I am still trying to 
track down the problem.

My latest theory is that PHP isn't set up to work with the right mailing 
program. I know that our system is supposed to be using qmail that actually 
sits on a different server, but I found interesting information in phpinfo 
that is making me wonder if a local sendmail is handling the requests 
instead.

Here are the things I am finding in phpinfo:
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
SMTP localhost localhost
smtp_port 25 25
Path to sendmail /usr/sbin/sendmail -t -i
Enviornment
MAIL /var/mail/kpratt (what does this one do?)
With all of the above refering to sendmail, is there anyway that my mail() 
can actually be using qmail?
Depends on how qmail was installed.  If it was installed on the local 
box, and via instructions like Life With qmail, then yes, it will work 
fine.  qmail has a sendmail wrapper, so you need to just ensure that 
there's a symbolic link to it on sendmail's normal home.

The MTA has to be on the local machine.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail problems - phpinfo information

2004-10-13 Thread Jed R. Brubaker
So as I am not an administrator, and all I have to go on is phpinfo (unless 
anyone has some suggestions), should I be seeing some trace of qmail in the 
phpinfo?

That is why I posted. I apologize if I didn't make it clear. I have read all 
about mail, and even used the fantastic Lemos MIME problem correcting email 
class to try to tackle my problems from a different angle.

Given the paths phpinfo is reporting, is there anyway that the system could 
somehow still be using qmail? Or is that outside the scope of what this 
phpinfo can tell me?

Thanks again!


Jay Blanchard [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
[snip]
... making me wonder if a local sendmail is handling the requests
instead.

With all of the above refering to sendmail, is there anyway that my
mail()
can actually be using qmail?
[/snip]

From http://www.php.net/mail, something you have not read apparently

For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. [LOOKIE
HERE--If you use another mail program, such as qmail or postfix, be
sure to use the appropriate sendmail wrappers that come with
them.--END LOOKIE] PHP will first look for sendmail in your PATH,
and then in the following:
/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly
recommended to have sendmail available from your PATH. Also, the user
that compiled PHP must have permission to access the sendmail binary.  

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



Re: [PHP] mail problems - phpinfo information

2004-10-13 Thread John Nichel
Jay Blanchard wrote:
From http://www.php.net/mail, something you have not read apparently
Pt.  Read?  Why would I do that?  ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] php err msg/issue...

2004-10-13 Thread bruce
curt...

when i print $rs, i get the following:
displaying $rs shows that $rs is:

ResultSet Object (
[colNames] =
Array ( [0] = id [1] = username [2] = password [3] = email [4] =
is_super )
[colAliases] =
Array ( )
[colTables] =
Array ( )
[colTableAliases] =
Array ( )
[colTypes] =
Array ( [0] = inc [1] = str [2] = str [3] = str [4] = str )
[colDefaultValues] =
Array ( [0] = 0 [1] = noname [2] = d41d8cd98f00b204e9800998ecf8427e [3]
= [EMAIL PROTECTED] [4] = FALSE )
[colFuncs] = Array ( )
[colFuncsExecuted] = Array ( )
[rows] = Array ( ) 
[pos] = 0 
[orderColNrs] = Array ( )
[orderTypes] = Array ( ) )

when i print $rs-pos, i get '0'

so are you saying that the code can't handle '$rs-rows[0] = $rec'

if this is the case, how can this be corrected

i guess it boils down to, how do you create/initialize/add a row to the db
structure..???

thanks...

-bruce


ps..

i tried to print $rs-rows[0], and got an 'Undefined offset: 0' err msg
so this would seem to support what you're saying...

so how can i correct/modify this!



-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 13, 2004 10:07 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php err msg/issue...


* Thus wrote bruce:
 hi...

 i'm dealing with an app that's throwing an err/warning msg.. i'm using
php5,
 on a linux rh8.0 system.

 i believe the code was written for php4.

 the code is:

 if($rec)
  {
 $rs-append($setDefaults);
 $rs-rows[$rs-pos]-fields=$rec;  generates err msg...
...

 the err msg being generated is:
 Php-Txt-Db-Access Error:
 PHP Error: [2048] Creating default object from empty value [Line: 1537]
 [File: /var/www/html/blast/txtdbapi/resultset.php]

This is because the element in $rs-rows[$rs-pos] is not defined
so php made a stdClass before it can assign the -fields member.


Curt
--
Quoth the Raven, Nevermore.

--
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] mail problems - phpinfo information

2004-10-13 Thread John Nichel
Jed R. Brubaker wrote:
So as I am not an administrator, and all I have to go on is phpinfo (unless 
anyone has some suggestions), should I be seeing some trace of qmail in the 
phpinfo?
No.
snip
Given the paths phpinfo is reporting, is there anyway that the system could 
somehow still be using qmail? Or is that outside the scope of what this 
phpinfo can tell me?
It could be using any *nix MTA as long as it has a Sendmail wrapper 
(qmail does).  PHP uses the Sendmail binary.  Will only use Sendmail. 
Will only show Sendmail in the phpinfo().  What your sysadmins may or 
may not have done to the Sendmail binary is a different story.

PHP -- Sendmail Binary //using Sendmail
PHP -- Sendmail Binary (really qmail wrapper) -- qmail //using qmail
Have shell access to the box?  Look in /var for a qmail directory.  Can 
you recieve email on the box?  If so, look at the headers.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail problems - phpinfo information

2004-10-13 Thread bbonkosk


- Original Message -
From: Jed R. Brubaker [EMAIL PROTECTED]
Date: Wednesday, October 13, 2004 1:21 pm
Subject: Re: [PHP] mail problems - phpinfo information

 So as I am not an administrator, and all I have to go on is 
 phpinfo (unless 
 anyone has some suggestions), should I be seeing some trace of 
 qmail in the 
 phpinfo?

No.

 
 That is why I posted. I apologize if I didn't make it clear. I 
 have read all 
 about mail, 

maybe read, but not quite understanding?

and even used the fantastic Lemos MIME problem 
 correcting email 
 class to try to tackle my problems from a different angle.
 
 Given the paths phpinfo is reporting, is there anyway that the 
 system could 
 somehow still be using qmail? Or is that outside the scope of what 
 this 
 phpinfo can tell me?

Yes, it could be using qmail, or sendmail, or postfix.  PHP calls sendmail which is 
a binary that could be a shell for any of the MTA's mentioned above.  The sendmail 
provides a interface for PHP, it is up to the sys admin to make sure that the MTA 
being used is properly configured.


 
 Thanks again!
 
 
 Jay Blanchard [EMAIL PROTECTED] wrote in 
 message 
 news:[EMAIL PROTECTED]
 [snip]
 ... making me wonder if a local sendmail is handling the requests
 instead.
 
 With all of the above refering to sendmail, is there anyway that my
 mail()
 can actually be using qmail?
 [/snip]
 
 From http://www.php.net/mail, something you have not read 
 apparently
 For the Mail functions to be available, PHP must have access to the
 sendmail binary on your system during compile time. [LOOKIE
 HERE--If you use another mail program, such as qmail or 
 postfix, be
 sure to use the appropriate sendmail wrappers that come with
 them.--END LOOKIE] PHP will first look for sendmail in your PATH,
 and then in the following:
 /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly
 recommended to have sendmail available from your PATH. Also, the user
 that compiled PHP must have permission to access the sendmail 
 binary.  
 
 -- 
 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] mail problems - phpinfo information

2004-10-13 Thread Matthew Sims
 So as I am not an administrator, and all I have to go on is phpinfo
 (unless
 anyone has some suggestions), should I be seeing some trace of qmail in
 the
 phpinfo?

 That is why I posted. I apologize if I didn't make it clear. I have read
 all
 about mail, and even used the fantastic Lemos MIME problem correcting
 email
 class to try to tackle my problems from a different angle.

 Given the paths phpinfo is reporting, is there anyway that the system
 could
 somehow still be using qmail? Or is that outside the scope of what this
 phpinfo can tell me?

 Thanks again!

If you're on a linux/unix machine, don't even look at phpinfo about mail
stuff. The mail() function always goes to the sendmail binary.

Do you have a shell account? Can you perform this command?

# echo Test | sendmail [EMAIL PROTECTED]

And do you receive it? Does 'which sendmail' return you the path to where
the sendmail binary is?

You should be contacting the admin of this server and be asking these
questions. We can't answer them since we don't own/have access to the
machine.

-- 
--Matthew Sims
--http://killermookie.org

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



[PHP] Form Validation

2004-10-13 Thread Huang, Ou
I am currently working on a newsletter mailing list project and
developed a form in php. I would like to validate before it is
submitted. What would be the best way to validate a form? Write your own
routines or using a form validator. I just started learning PHP, so
don't have much experience on this. I am thinking using a form validator
but not sure where I can get it. 

Any suggestions would be appreciated! 

Thanks.

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



[PHP] SSI and PHP

2004-10-13 Thread j kensler
I've got to use some server side includes (and some SETs). 
And PHP is set up as a CGI program.

If I include the php page from the .shtml page, the php page cannot
receive queries.

.php files are not set up to process these includes.

And of course virtual(), etc. do not work because PHP is set up as CGI.

Anyone know of any good work around tricks?

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



RE: [PHP] Form Validation

2004-10-13 Thread Pablo Gosse
Huang, Ou wrote:
 I am currently working on a newsletter mailing list project and
 developed a form in php. I would like to validate before it is
 submitted. What would be the best way to validate a form? Write your
 own routines or using a form validator. I just started learning PHP,
 so don't have much experience on this. I am thinking using a form
 validator but not sure where I can get it. 
 
 Any suggestions would be appreciated!
 
 Thanks.

http://pear.php.net/package/HTML_QuickForm

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



[PHP] Re: Form Validation

2004-10-13 Thread Manuel Lemos
Hello,
On 10/13/2004 03:03 PM, Ou Huang wrote:
I am currently working on a newsletter mailing list project and
developed a form in php. I would like to validate before it is
submitted. What would be the best way to validate a form? Write your own
routines or using a form validator. I just started learning PHP, so
don't have much experience on this. I am thinking using a form validator
but not sure where I can get it. 

Any suggestions would be appreciated! 
You may want to try this popular forms generation and validation class:
http://www.phpclasses.org/formsgeneration
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Unsubscribe.

2004-10-13 Thread The Snake from Hell!
Yes. Try yourself. All 3 ways provided to unsubscribe do no
work. 

Brad

[snip]Been trying to unsubscribe this email account for
days nowand now go. Anyone on this list have access to
remove me?
[/snip]

And you have clicked on the unsub link in the e-mail?

-- 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] SSI and PHP

2004-10-13 Thread Dan Joseph
 I've got to use some server side includes (and some SETs).
 And PHP is set up as a CGI program.
 
 If I include the php page from the .shtml page, the php page cannot
 receive queries.
 
 .php files are not set up to process these includes.
 
 And of course virtual(), etc. do not work because PHP is set up as CGI.
 
 Anyone know of any good work around tricks?

I've moved to using include(), I can't use SSIs either.  Is this a
viable option for you?  Do you maybe have some code examples we could
take a look at to help you further?

-Dan Joseph

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



[PHP] Re: mail problems - phpinfo information

2004-10-13 Thread Manuel Lemos
Hello,
On 10/13/2004 01:41 PM, Jed R. Brubaker wrote:
I have been having all kinds of problems with the mail() function in PHP. I 
realize that there are problems inheritly, but I think I am still trying to 
track down the problem.

My latest theory is that PHP isn't set up to work with the right mailing 
program. I know that our system is supposed to be using qmail that actually 
sits on a different server, but I found interesting information in phpinfo 
that is making me wonder if a local sendmail is handling the requests 
instead.

Here are the things I am finding in phpinfo:
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
SMTP localhost localhost
smtp_port 25 25
Path to sendmail /usr/sbin/sendmail -t -i
Enviornment
MAIL /var/mail/kpratt (what does this one do?)
With all of the above refering to sendmail, is there anyway that my mail() 
can actually be using qmail?
I don't think so.
qmail is by default at /var/qmail. If you have installed qmail, you 
should have uninstalled sendmail first, otherwise it may cause system 
havoc (all sorts of problems).

Anyway, qmail comes with a sendmail emulation wrapper in 
/var/qmail/bin/sendmail. The right thing to do is to uninstall sendmail 
and do something like:

ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
Notice that it is /usr/lib/sendmail, which is the default sendmail 
program location since ever. Usually that location is a symbolic link to 
the real location of the sendmail (emulation) program. 
/usr/sbin/sendmail is the location of the real sendmail program (not the 
qmail emulation).

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Form Validation

2004-10-13 Thread John Nichel
Huang, Ou wrote:
I am currently working on a newsletter mailing list project and
developed a form in php. I would like to validate before it is
submitted. What would be the best way to validate a form? Write your own
routines or using a form validator. I just started learning PHP, so
don't have much experience on this. I am thinking using a form validator
but not sure where I can get it. 

Any suggestions would be appreciated! 
Before the form is submitted?  Can't do it with PHP.  JavaScript is your 
answer.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Unsubscribe.

2004-10-13 Thread John Nichel
The Snake from Hell! wrote:
Yes. Try yourself. All 3 ways provided to unsubscribe do no
work.
Just worked for me.  I'm subscribed with two email address...one for 
home, and one for work...and unsubscribed the home one.  Emails kept 
coming thru to the work address, but no more to the home address.  Be 
sure you're trying to unsubscribe the email address which is actually in 
the database. ie. make sure the address that the phplist sends to 
doesn't just forward to the email address you recieve it at (common 
problem).

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Image upload not working correctly

2004-10-13 Thread Dave Grant
Hello.  I am working on a rather large form for my work that accepts, among 
other things, 2 images, one smaller one 65 x 93 pixels, and a larger one 105 
x 150 pixels, both in JPG format.  Let me run through the whole process, 
showing my code.

I use simple, standard HTML for the form:

input type=file name=thumbImage size=15
input type=file name=fullImage size=15

I check the $_FILES array to make sure the server uploads the images:

array(2) {
  [thumbImage]=
  array(5) {
[name]=
string(15) DAK01_thumb.jpg
[type]=
string(11) image/pjpeg
[tmp_name]=
string(14) /tmp/phpXxmX1s
[error]=
int(0)
[size]=
int(7161)
  }
  [fullImage]=
  array(5) {
[name]=
string(14) DAK01_full.jpg
[type]=
string(11) image/pjpeg
[tmp_name]=
string(14) /tmp/php05LOkc
[error]=
int(0)
[size]=
int(12235)
  }
}


I do the following error checking for various things:

// Small Thumbnail Image
 if (trim($_FILES[thumbImage][tmp_name])) {
  if ($_FILES[thumbImage][size]  10240) {
   $formVars[results] .= The small photo must be 10240 bytes or lessbr 
/;
  }
  if ($_FILES[thumbImage][type] != image/pjpeg  
$_FILES[thumbImage][type] != image/jpeg) {
   $formVars[results] .= The small photo must be in .jpg formatbr /;
  }
  $imgSize = getimagesize($_FILES[thumbImage][tmp_name]);
  if ($imgSize[0]  65) {
   $formVars[results] .= The small photo must be 65 pixels wide or 
lessbr /;
  }
 }
 // Full Image
 if (trim($_FILES[fullImage][tmp_name])) {
  if ($_FILES[fullImage][size]  20480) {
   $formVars[results] .= The large photo must be 20480 bytes or lessbr 
/;
  }
  if ($_FILES[fullImage][type] != image/pjpeg  
$_FILES[fullImage][type] != image/jpeg) {
   $formVars[results] .= The large photo must be in .jpg formatbr /;
  }
  $imgSize = getimagesize($_FILES[fullImage][tmp_name]);
  if ($imgSize[0]  105) {
   $formVars[results] .= The large photo must be 105 pixels wide or 
lessbr /;
  }
 }

Then, I move the temp image files:

// Copy image to $GLOBALS[dvdimgpath].$_POST[gameId]._[thumb/full].jpg
  $thumbPath = $GLOBALS[dvdimgpath].$_POST[gameId]._thumb.jpg;
  $fullPath = $GLOBALS[dvdimgpath].$_POST[gameId]._full.jpg;
  echo Thumb image uploaded to .$thumbPath.br /\n;
  if (!move_uploaded_file($_FILES[thumbImage][tmp_name], $thumbPath)) {
   $formVars[results] .= Image file could not moved to the images dir. 
Please try again;
  }
  echo Full image uploaded to .$fullPath.br /\n;
  if (!move_uploaded_file($_FILES[fullImage][tmp_name], $fullPath)) {
   $formVars[results] .= Image file could not moved to the images dir. 
Please try again;
  }

Everything works fine, except that the images are simply not there when we 
go look for them.  The best explanation I can come up with is that they are 
not moved, but I have no idea why.  I've done this with no problem on my 
personal site.  Is it a problem with the move_uploaded_file function?  Any 
ideas?

Thanks! 

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



[PHP] Installing PHP 5.0.2 on Fedora Core 2

2004-10-13 Thread Don
Hi,
 
I'm getting an error trying to install PHP 5.0.2 on a fresh Fedora Core 2
installation:
 
Sorry, I cannot run apxs
apxs was not found
 
I verified this by searching the drive, it is not there.  Is Apache
installed by default without using --enable-so ?
 
If so, what can I do?
 
Thanks,
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.776 / Virus Database: 523 - Release Date: 10/12/2004
 

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



Re: [PHP] ezmlm-sub or alternative

2004-10-13 Thread Mark Hubert
Thanks so much for the insight which is a much simpler way.
I successfully set up a test page (a form) that takes email to, from, 
subject and body and sends it.

?php
$emailto=$_GET['emailto'];
$emailfrom=$_GET['emailfrom'];
$emailsub=$_GET['emailsub'];
$emailbody=$_GET['emailbody'];
$headers = From: $emailfrom\r\n;
$headers .= Return-Path: $emailfrom\r\n;
if(mail($emailto, $emailsub, $emailbody, $headers)) {
echoEmail Sent;
exit;
}
echo Email Error;
?
However, when I send a message to subscribe to the EZMLM list, it sends 
ok, but doesn't get added to the list. When I send a test message to 
myself I noticed that the Return-path in the email sent is not what I 
set in my script, but that of the apache user. I wonder if that is 
where the EZMLM-sub gets the address for submission and is sending the 
confirmation to the dead mailbox.

Any insight?
Thanks,
Mark

On Oct 11, 2004, at 8:55 PM, James McGlinn wrote:
Hi Mark,
 I'm writing a little script (my 3rd) that takes name (first, last) 
and email address
and writes it to txt file and submits the email address to an EZMLM 
list server.

All is well but I'm not sure where to go for the submission.
The command line - ezmlm-sub works (from the shell)... if the user is 
root or vpopmail.

 Is there a safe way to run the shell command via a php script?
Or can someone suggest another way to submit an address to ezmlm.
You can make use of the public interface to ezmlm-sub by sending an 
email to listname[EMAIL PROTECTED]

You'll need to set the 'From:' header of your emails to the address of 
your subscriber.

You can find information on the mail() function at 
http://www.php.net/mail

James McGlinn
Project Manager
BCom, BSc, Zend Certified Engineer (PHP)
Servers.co.nz Ltd
68 Shortland St, Auckland	PO Box 3688 Shortland St, Auckland, New 
Zealand
Phone: 0800 4 SERVERS	Fax: +64 9 358 5187

--
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] hy problems with php 5.01 installation !

2004-10-13 Thread Nicolae Serban
I try to install php 5.01 on Windows 2003 Server with Apache 2.052 !
I try to install as Module and as Cgi !! ( i restart the server if you
asking of that :-) )

When i try an test.php (  just phpinfo(); ) in the web page apears
just the code of the test.php !!!

When i try to install as module i have no error ! 

Thankyou , !
-- 
-
 Nicolae Serban  
--- http://e-dream.dtedu.net -
-

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



[PHP] deleting multiple items from a database

2004-10-13 Thread Adil
Hey everyone, I'm trying to delete multiple records from a database using
PHP. I have a file list page which shows each entry in the database with a
checkbox next to it.  At the bottom of the page is a Delete button.  A
user should be able to check as many items on the file list and hit delete
which would cause all checked items to be wiped from the database.

Unfortunately I'm running into really erratic behavior with this.  First the
page worked fine on Mac(in the Safari browser) but not on IE  on any OS.
Now I can only delete the first time in the list but ONLY in Safari once
more.

As far as the code goes what I'm doing is retrieving each record from the
database and assigning the value attribute of each checkbox the unique id
from the database.  From that point on, when a checkbox is checked and the
delete button is pressed, I push each checked unique id into an array and
then call a function that cycles through the array and deletes each database
entry.  The last step is a simple page refresh.   I'm posting some of the
more relevant sections of the code I've used below:

echo form action=\{$_SERVER['PHP_SELF']}\ method=\post\;
//form declaration
echo input type=\submit\ value=\Delete\value=\Submit\;
//The delete button
tdinput type=\checkbox\
value=\{$row['upload_id']}\/inputbr//td;//This is what the
checkbox is coded as
$stack[] = $row['upload_id'];//This should get pushed into an
array called stack when the delete button is hit(and it does when I echo it
out, so this part works)
 echo /form;

 if (isset($_POST['stack'])) {
deleteFiles();//This checks to see if the array stack is not
empty, and if not it calls this function which is declared as shown below.
}


function deleteFiles() {
foreach($_POST['stack'] as $i) {//This should work but I can't
tell if it is or isn't
 mysql_query(DELETE FROM uploads WHERE upload_id = . $i);
}
   header(Location: http://; . $_SERVER['PHP_SELF']);//forces a
page refresh to show the file list without the items that were deleted.
}


I appreciate any help I can get on this.
Thank you
Adil.

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



[PHP] .htaccess and .htpasswd

2004-10-13 Thread Afan Pasalic
# .htaccess
AuthType Basic
AuthName Restricted Area
AuthUserFile /www/html/path/to/file/admin/.htpasswd
require valid-user
# .htpasswd
Admin:ChqaxtiTH1e0E
Both files are in same directory.
Why it doesn't work?
Can I use as AuthUserFile .htpasswd since they are in the same directory?
I know its not smart but let's get this working and I'll move .htpasswd 
later to upper level :)


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


Re: [PHP] .htaccess and .htpasswd

2004-10-13 Thread Matthew Sims
 # .htaccess
 AuthType Basic
 AuthName Restricted Area
 AuthUserFile /www/html/path/to/file/admin/.htpasswd
 require valid-user

 # .htpasswd
 Admin:ChqaxtiTH1e0E

 Both files are in same directory.

 Why it doesn't work?

 Can I use as AuthUserFile .htpasswd since they are in the same
 directory?

 I know its not smart but let's get this working and I'll move .htpasswd
 later to upper level :)



 -afan


Dude...do you know what mailing list you're on?

http://httpd.apache.org/lists.html

-- 
--Matthew Sims
--http://killermookie.org

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



Re: [PHP] .htaccess and .htpasswd

2004-10-13 Thread Matt M.
try an apache mailing list.

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



Re: [PHP] .htaccess and .htpasswd

2004-10-13 Thread Afan Pasalic
Oops!
Sorry guy, sent to wrong place!
I apology.
:)
-afan
Matt M. wrote:
try an apache mailing list.
.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] .htaccess and .htpasswd

2004-10-13 Thread John Nichel
Afan Pasalic wrote:
# .htaccess
AuthType Basic
AuthName Restricted Area
AuthUserFile /www/html/path/to/file/admin/.htpasswd
require valid-user
# .htpasswd
Admin:ChqaxtiTH1e0E
Both files are in same directory.
Why it doesn't work?
Can I use as AuthUserFile .htpasswd since they are in the same directory?
I know its not smart but let's get this working and I'll move .htpasswd 
later to upper level :)
Did my filter throw an Apache mailing list email into my php folder?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] .htaccess and .htpasswd

2004-10-13 Thread Afan Pasalic
Yes, I sent it on wrong place.
:)
Sorry.
-afan

Matthew Sims wrote:
# .htaccess
AuthType Basic
AuthName Restricted Area
AuthUserFile /www/html/path/to/file/admin/.htpasswd
require valid-user
# .htpasswd
Admin:ChqaxtiTH1e0E
Both files are in same directory.
Why it doesn't work?
Can I use as AuthUserFile .htpasswd since they are in the same
directory?
I know its not smart but let's get this working and I'll move .htpasswd
later to upper level :)

-afan

Dude...do you know what mailing list you're on?
http://httpd.apache.org/lists.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] deleting multiple items from a database

2004-10-13 Thread Jay Blanchard
[snip]
function deleteFiles() {
foreach($_POST['stack'] as $i) {//This should work but I
can't
tell if it is or isn't
 mysql_query(DELETE FROM uploads WHERE upload_id = . $i);
}
[/snip]

Try print_r $_POST['stack'] and see what you get.

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



Re: [PHP] php err msg/issue...

2004-10-13 Thread Curt Zirzow
* Thus wrote bruce:
 curt...
 
 when i print $rs, i get the following:
 displaying $rs shows that $rs is:
 
 ResultSet Object (

 [rows] = Array ( ) 
 [pos] = 0 
...

 when i print $rs-pos, i get '0'
 
 so are you saying that the code can't handle '$rs-rows[0] = $rec'

Thats different than what you originally had:
  $rs-rows[0]-fields = $rec

php is being friendly and creating an object before assigning the
variable (to a non-existing array element). The error you are
getting is because you have E_STRICT included in your
error_reporting level.  

;E_STRICT  - run-time notices, enable to have PHP suggest changes
 to your code which will ensure the best interoperability
 and forward compatibility of your code

 if this is the case, how can this be corrected

$rs-rows[0] = new stdClass();
$rs-rows[0]-fields = $rec;

Curt.
-- 
Quoth the Raven, Nevermore.

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



Re: [PHP] Installing PHP 5.0.2 on Fedora Core 2

2004-10-13 Thread Greg Donald
On Wed, 13 Oct 2004 15:55:46 -0400, Don [EMAIL PROTECTED] wrote:
 I'm getting an error trying to install PHP 5.0.2 on a fresh Fedora Core 2
 installation:
 
 Sorry, I cannot run apxs
 apxs was not found
 
 I verified this by searching the drive, it is not there.  Is Apache
 installed by default without using --enable-so ?
 
 If so, what can I do?

Search the mailing list archives, a very similar if not exact issue
was discussed just last week:

http://marc.theaimsgroup.com/?l=php-general


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] hy problems with php 5.01 installation !

2004-10-13 Thread Greg Donald
On Wed, 13 Oct 2004 23:06:29 +0300, Nicolae Serban
[EMAIL PROTECTED] wrote:
 I try to install php 5.01 on Windows 2003 Server with Apache 2.052 !
 I try to install as Module and as Cgi !! ( i restart the server if you
 asking of that :-) )
 
 When i try an test.php (  just phpinfo(); ) in the web page apears
 just the code of the test.php !!!
 
 When i try to install as module i have no error !
 
 Thankyou , !

You missed a step somewhere!

Try, try again!

http://www.php.net/manual/en/install.windows.apache2.php !


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] deleting multiple items from a database

2004-10-13 Thread Robby Russell
On Wed, 2004-10-13 at 16:11 -0400, Adil wrote:
 function deleteFiles() {
 foreach($_POST['stack'] as $i) {//This should work but I
 can't
 tell if it is or isn't
  mysql_query(DELETE FROM uploads WHERE upload_id = . $i);
 }
header(Location: http://; . $_SERVER['PHP_SELF']);//forces
 a
 page refresh to show the file list without the items that were
 deleted.
 }

For sanity of your mysql database, you might consider making this one
query.

Something like
DELETE FROM table WHERE id IN (32,34,46,432,35);

generating your list of numbers/ids from your array...

-Robby

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



signature.asc
Description: This is a digitally signed message part


[PHP] rename() on NT

2004-10-13 Thread Jed R. Brubaker
Can this be done when the file already exists?

 cleong at organic dot com says
29-Mar-2000 04:36
rename() doesn't seem to overwrite files on NT. The behavior is an 
OS-dependent side-effect I guess.

on the PHP site @ http://us2.php.net/manual/en/function.rename.php

So this this true, or is there some work around that doesn't involve 
unlinking the file first?

Thanks!

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



Re: [PHP] deleting multiple items from a database

2004-10-13 Thread Curt Zirzow
* Thus wrote Adil:
 
 As far as the code goes what I'm doing is retrieving each record from the
 database and assigning the value attribute of each checkbox the unique id
 from the database.  From that point on, when a checkbox is checked and the
 delete button is pressed, I push each checked unique id into an array and
 then call a function that cycles through the array and deletes each database
 entry.  The last step is a simple page refresh.   I'm posting some of the
 more relevant sections of the code I've used below:
 
 echo form action=\{$_SERVER['PHP_SELF']}\ method=\post\;
 //form declaration
 echo input type=\submit\ value=\Delete\value=\Submit\;
 //The delete button
 tdinput type=\checkbox\
 value=\{$row['upload_id']}\/inputbr//td;//This is what the
 checkbox is coded as

This is your problem, you need to give the checkbox a name:
input type=checkbox name=stack[] value=...

When the form is submitted $_POST['stack'] will contain an array of
items that were checked.


Curt
-- 
Quoth the Raven, Nevermore.

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



[PHP] question about mkdir() and ownership permissions

2004-10-13 Thread Jason FB
PHP General List,
I am trying to use mkdir() on a shared unix server to create a 
directory within my home space. I have to have the ability for my 
user on this server to upload to this folder, however I think that 
mkdir() creates the directory and makes it owned by the process 
running Apache -- nobody, httpd, or apache depending on the system 
(which is someone else's so I don't know)

I get permission denied when I try to upload to these folders.
I suppose I could use mkdir and specify the mode as 0777 to give 
broad write access to these folders, but I always thought this was a 
security risk.

Does anyone know how I can create a directory which is owned by my 
user account on this server-- or have any other creative suggetions?

Thanks.
Jason FB


Re: [PHP] mail problems - phpinfo information

2004-10-13 Thread Jason Wong
On Thursday 14 October 2004 01:10, Matthew Sims wrote:

 The mail settings in php.ini is for Windows only. When using PHP on
 Unix/Linux, mail() always defaults to the sendmail binary on localhost. So
 you can ignore what it says in phpinfo.

That's incorrect. The 

  sendmail_path =

setting is very much a un*x only setting (although for most standard server 
setups you never need to change it).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Intel CPUs are not defective, they just act that way.
-- Henry Spencer
*/

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



Re: [PHP] Security patch from 4.3.8 to 4.3.9

2004-10-13 Thread Jason Wong
On Thursday 14 October 2004 00:55, Jay Blanchard wrote:
 [snip]
 Hello, I would like to know if there is a patch just for the security
 fix from PHP-4.3.8 to PHP-4.3.9 and where can I found it.
 [/snip]

 Looking at http://www.php/net/downloads I do not see one.

Maybe that's why the OP asked? Anyway I don't see the reason why one would 
want a patch. Surely bandwidth can't be an issue? And applying a patch would 
most certainly mean taking the webserver offline briefly as would a full 
upgrade.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The first version always gets thrown away.
*/

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



[PHP] Determine variable with the lowest value?

2004-10-13 Thread BOOT
Any help with this would be appreciated.

I am trying to come up with something that will find which variable(s) have
the lowest value and inidicate which variable this is. In the event that
variables have an equally low value then it is to randomly pick one of the
variables and idicate which this is.

I have been able to do this by means of if comparisons but the more I
variables I add then the more complicated and messy it becomes. There has to
be a simpler way. If it makes any difference, the variables could just as
easily be array elements.

example:

$a = 2
$b =2
$c= 4
$d= 5
$e=6
$f =7

the code should determine that $a and $b have the lowest value, and randomly
pick one of them. if $a was = 1 instead then it would just pick $a


Thanks for any suggestions!

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



Re: [PHP] Determine variable with the lowest value?

2004-10-13 Thread Greg Donald
On Wed, 13 Oct 2004 17:19:28 -0500, BOOT [EMAIL PROTECTED] wrote:
 the code should determine that $a and $b have the lowest value, and randomly
 pick one of them. if $a was = 1 instead then it would just pick $a
 
 Thanks for any suggestions!

Use an array.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Determine variable with the lowest value?

2004-10-13 Thread Jason Wong
On Thursday 14 October 2004 06:19, BOOT wrote:

[snip]

 I have been able to do this by means of if comparisons but the more I
 variables I add then the more complicated and messy it becomes. There has
 to be a simpler way. If it makes any difference, the variables could just
 as easily be array elements.

So stick them into an array and use one of the many array functions.

 the code should determine that $a and $b have the lowest value, and
 randomly pick one of them. if $a was = 1 instead then it would just pick $a

The randomly pick one part you would have to code yourself.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
It's amazing how much better you feel once you've given up hope.
*/

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



Re: [PHP] ezmlm-sub or alternative

2004-10-13 Thread Jason Wong
On Thursday 14 October 2004 04:01, Mark Hubert wrote:

 However, when I send a message to subscribe to the EZMLM list, it sends
 ok, but doesn't get added to the list. When I send a test message to
 myself I noticed that the Return-path in the email sent is not what I
 set in my script, but that of the apache user. I wonder if that is
 where the EZMLM-sub gets the address for submission and is sending the
 confirmation to the dead mailbox.

http://zend.com/lists/php-general/200410/msg00887.html

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Yow!  We're going to a new disco!
*/

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



Re: [PHP] question about mkdir() and ownership permissions

2004-10-13 Thread Jason Wong
On Thursday 14 October 2004 06:02, Jason FB wrote:

 Does anyone know how I can create a directory which is owned by my
 user account on this server-- or have any other creative suggetions?

If you have it, use FTP.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Ask not for whom the Bell tolls, and you will pay only the station-to-station
rate.
-- Howard Kandel
*/

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



Re: [PHP] Image upload not working correctly

2004-10-13 Thread Jason Wong
On Thursday 14 October 2004 02:40, Dave Grant wrote:

 echo Thumb image uploaded to .$thumbPath.br /\n;
 echo Full image uploaded to .$fullPath.br /\n;

Do these look OK?

 Everything works fine, except that the images are simply not there when we
 go look for them.  The best explanation I can come up with is that they are
 not moved, but I have no idea why.  I've done this with no problem on my
 personal site.  Is it a problem with the move_uploaded_file function?  Any
 ideas?

What does the PHP error log say?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Faith goes out through the window when beauty comes in at the door.
*/

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



Re: [PHP] Form Validation

2004-10-13 Thread Mattias Thorslund
There are several JavaScript solutions for validating forms on the 
client side. Search on hotscripts.com and google.com.

Client-side validation (in the browser) is useful, but you shouldn't 
depend on it to guarantee that the data that your users submit is 
valid.  You should also validate the data in your PHP script as you 
process the form.

Oh, and there are several PHP-based list managers available, for 
instance phplist, so you may not need to program it yourself.

/Mattias
Huang, Ou wrote:
I am currently working on a newsletter mailing list project and
developed a form in php. I would like to validate before it is
submitted. What would be the best way to validate a form? Write your own
routines or using a form validator. I just started learning PHP, so
don't have much experience on this. I am thinking using a form validator
but not sure where I can get it. 

Any suggestions would be appreciated! 

Thanks.
 


--
More views at http://www.thorslund.us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Working out the image path...partly solved, please have a look at my code

2004-10-13 Thread Mag
Hey Matt,


  /../imgs/blah.jpg should return
  http://www.textx.com/t1/t2/imgs/blah.jpg
  
  but its returning:
  http://www.textx.com/t1/t2/t3/imgs/blah.jpg
  
  and this: /../../imgs/blah.jpg
  should return:
 http://www.textx.com/t1/imgs/blah.jpg
  
  but its returning:
  http://www.textx.com/t1/t2/imgs/blah.jpg
  
  in both cases one extra level directory :-(
  
  Any ideas?



 ok, I gave it a try and honestly this is probably
 over my head :) but
 here is something to try


Nope, no go...but dont worry about it, most of the PHP
gurus on the list have not replied so I guess it was
beyond them tooso where do we mere mortals have a
chance :-D

Will leave it as as for now and come back to it at a
later date i guess.

Thanks for trying.
Mag


 
 ?php
 
 $url='http://www.textx.com/t1/t2/t3/blah.html';
 
 function ret_url($rel_path, $base = '')
 {
   $base_path = substr($base, 0, strpos($base,
 '/',7));
 
   if(substr($rel_path,0,1)=='/' 
 strpos($rel_path,'/../') === false)
   {  
   return $base_path.$rel_path; 
   }
 
 elseif(strpos($rel_path,'://')  0)
 {  return $rel_path; }
 
 else {  
   return collapse(dirname($base),$rel_path); 
   }
 
 return $rel_path;
 }
 
 /* this function removes the /../ parts */
 function collapse($path,$rel_path)
 {
   
   $parsed = parse_url($path);
   preg_match_all('/\/\.\./',$rel_path, $matches); 
   if(($count = count($matches[0]))  0) {
   $parts = preg_split('/\//', $parsed['path'], -1,
 PREG_SPLIT_NO_EMPTY);
   for ($i = 1;$i = $count; $i++) {
   array_pop($parts);
   }
   $path = str_replace($parsed['path'],
 '/'.implode($parts,'/'), $path);
   }
 
   $rel_path = (preg_match('/^\//',$rel_path)) ?
 $rel_path :'/'.$rel_path;
   $path = preg_replace('/\/\.\./', '',
 $path.$rel_path);
   
   return $path;
 }
 
 
 $uris = array();
 $uris[] = '/blah.jpg';
 $uris[] ='/imgs/blah.jpg';
 $uris[] ='imgs/blah.jpg';
 $uris[] ='../imgs/blah.jpg';
 $uris[] ='/../imgs/blah.jpg';  // ## not working ##
 $uris[] ='/../../imgs/test.jpg'; // ## not working
 ##
 $uris[] ='http://some-site-blah.com/imgs/blah.jpg';
 
 echo 'table border=1';
 foreach($uris as $uri)
 {
 echo 'trtd'.htmlspecialchars($uri).'/

tdtd'.htmlspecialchars(ret_url($uri,$url)).'/td/tr';
 }
 echo '/table';
 ?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



__
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 

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