OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 13 Oct 2004 19:22:02 -0000 Issue 3051

php-general-digest-helplists.php.net
Date: Wed Oct 13 2004 - 14:22:02 CDT


php-general Digest 13 Oct 2004 19:22:02 -0000 Issue 3051

Topics (messages 199342 through 199423):

Query Returning Error
        199342 by: Harlequin
        199343 by: Jason Wong
        199344 by: Harlequin
        199345 by: Jason Davidson
        199346 by: Jordi Canals
        199351 by: Graham Cossey
        199353 by: Chris Dowell
        199354 by: Graham Cossey
        199360 by: Ford, Mike

Re: Help Me Understand PHP5, register_globals=off, $HTTP_POST_VARS, and $_POST
        199347 by: Jason Wong
        199352 by: Janet Valade

PEAR::Auth
        199348 by: 22

submission before
        199349 by: Bruno Santos
        199350 by: Gareth Williams

passing GET parameter that has '&' sign
        199355 by: Suka Ada, I Nyoman
        199357 by: Stefan Dengscherz
        199359 by: Suka Ada, I Nyoman
        199361 by: Sune Rievers

detecting ssl
        199356 by: Merlin
        199369 by: Matt M.

Re: Unsubscribe.
        199358 by: Jay Blanchard
        199418 by: The Snake from Hell!
        199422 by: John Nichel

PHP tp PDF
        199362 by: Angelo Zanetti
        199363 by: Jay Blanchard
        199402 by: Pablo M. Rivas

Using HTTP/PUT with PHP & Apache & Any browser in the whole world that works properly??????
        199364 by: Chris Dowell
        199365 by: John Nichel
        199368 by: Chris Dowell

Re: Exporting HTML to Excel
        199366 by: Philip Thompson
        199367 by: Chris Dowell
        199372 by: Philip Thompson
        199373 by: Chris Dowell
        199378 by: Gryffyn, Trevor
        199379 by: Gryffyn, Trevor
        199384 by: Philip Thompson
        199386 by: Chris Dowell
        199387 by: Gryffyn, Trevor
        199388 by: Philip Thompson
        199389 by: John Holmes
        199399 by: Philip Thompson
        199403 by: Gryffyn, Trevor
        199405 by: Vail, Warren

Re: Safe mode & imagecreatefromjpeg
        199370 by: Marek Kilimajer

reg. expressions
        199371 by: Afan Pasalic
        199374 by: Matt M.
        199375 by: Afan Pasalic
        199393 by: John Holmes
        199395 by: Afan Pasalic

time
        199376 by: Jerry Swanson
        199383 by: Robby Russell
        199385 by: Greg Donald

Quick imageSize question
        199377 by: Mag
        199381 by: Stefan Dengscherz
        199382 by: Mag

Re: Are server classes possible?
        199380 by: Jensen, Kimberlee

Security patch from 4.3.8 to 4.3.9
        199390 by: Federico Petronio
        199396 by: Jay Blanchard

mail problems - phpinfo information
        199391 by: Jed R. Brubaker
        199398 by: Jay Blanchard
        199400 by: Matthew Sims
        199406 by: John Nichel
        199407 by: Jed R. Brubaker
        199408 by: John Nichel
        199411 by: John Nichel
        199412 by: bbonkosk.tampabay.rr.com
        199413 by: Matthew Sims
        199420 by: Manuel Lemos

php err msg/issue...
        199392 by: bruce
        199394 by: Jason Davidson
        199397 by: bruce
        199401 by: Curt Zirzow
        199404 by: Matthew Sims
        199410 by: bruce

Re: php err msg/issue... additional information....
        199409 by: bruce

Form Validation
        199414 by: Huang, Ou
        199416 by: Pablo Gosse
        199417 by: Manuel Lemos
        199421 by: John Nichel

SSI and PHP
        199415 by: j kensler
        199419 by: Dan Joseph

Image upload not working correctly
        199423 by: Dave Grant

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


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
-----------------------------

attached mail follows:


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
*/

attached mail follows:


Doh...!

thanks mate.

--
-----------------------------
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-----------------------------
"Jason Wong" <php-generalgremlins.biz> wrote in message
news:200410131538.17862.php-generalgremlins.biz...
> 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
> */

attached mail follows:


should Query01 have a $ in front of it, i assume its a var....

Jason

"Harlequin" <michael.masonarraspeople.co.uk> 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
>
>

attached mail follows:


On Wed, 13 Oct 2004 08:32:17 +0100, Harlequin
<michael.masonarraspeople.co.uk> 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]
>

attached mail follows:


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:michael.masonarraspeople.co.uk]
> Sent: 13 October 2004 08:32
> To: php-generallists.php.net
> 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
>
>

attached mail follows:


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:michael.masonarraspeople.co.uk]
>>Sent: 13 October 2004 08:32
>>To: php-generallists.php.net
>>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
>>
>>
>
>

attached mail follows:


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:phpnodalplane.com]
> Sent: 13 October 2004 11:57
> To: php-generallists.php.net
> 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:michael.masonarraspeople.co.uk]
> >>Sent: 13 October 2004 08:32
> >>To: php-generallists.php.net
> >>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
>
>

attached mail follows:


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:phpnodalplane.com]
> 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: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


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
*/

attached mail follows:


Francis Chang wrote:

> Hello,
>
> I've done some homework on my own by reading through PHP documentation and
> various articles; however, I am still a bit confused as to what is supported
> in PHP 5.0 when register_globals is set to off.
>
> In PHP5.0, if the register_globals parameter is set to off (as it is by
> default), I know that we're supposed to use the $_POST super globals to
> 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])
>
> }
>
> Thanks in advance for your help.
>

The old style array still exists. In PHP 5 there is a setting in php.ini
that allows you to shut off the long arrays. At this point, it is on by
default. At some point, it might become off by default. It's extra work
for PHP to create them if you aren't going to use them.

Janet

--
Janet Valade -- janet.valade.com

attached mail follows:


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:$dbpass$dbhost/$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
 

attached mail follows:


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

--
bvsantoshal.min-saude.pt
--
Divisao de Informatica
informaticahal.min-saude.pt
Tel: +351 272 000 155
Fax: +351 272 000 257

--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
geralhal.min-saude.pt
Tel: +351 272 000 272
Fax: +351 272 000 257

attached mail follows:


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
>
> --
> bvsantoshal.min-saude.pt
> --
> Divisao de Informatica
> informaticahal.min-saude.pt
> Tel: +351 272 000 155
> Fax: +351 272 000 257
>
> --
> Hospital Amato Lusitano
> Av. Pedro Alvares Cabral
> 6000-085 Castelo Branco
> geralhal.min-saude.pt
> 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
>

attached mail follows:


hi,
I am wondering how do we pass a GET value that has '&' sign..
let's say I have this:

process.php?mode=test&url=http://someurl.com/index.php?a=10&b=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=10&b=200' )

how to accomplish this?

*I hope my question's not confusing.

Thanks and regards,
Guido

attached mail follows:


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..
> let's say I have this:
>
> process.php?mode=test&url=http://someurl.com/index.php?a=10&b=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=10&b=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

attached mail follows:


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..

attached mail follows:


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
<sekalikejadian.or.id> wrote:
> hi,
> I am wondering how do we pass a GET value that has '&' sign..
> let's say I have this:
>
> process.php?mode=test&url=http://someurl.com/index.php?a=10&b=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=10&b=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
>
>

attached mail follows:


Hi there,

I am trying to detect ssl with the SERVER variable from PHP. Backgrond is that a
  user might be on an ssl page and the next navigation link he clicks might
simply be a non ssl site, but due to relative links there is no way to create a
non ssl url for that.

My trie was to check the communication port and if the site should not be ssl,
tut the url is a https one, a redirect via php should take place.

Here is the code:
if ($_SERVER[SERVER_PORT] == '443' AND !$SSL){
        header("Location:http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]);
        exit;
}

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?

Thanx for any hint,

Merlin

attached mail follows:


> 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' ) {
}

attached mail follows:


[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?

attached mail follows:


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

attached mail follows:


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
johnkegworks.com

attached mail follows:


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

attached mail follows:


[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.

attached mail follows:


me too ;)

On Wed, 13 Oct 2004 07:37:19 -0500, Jay Blanchard
<jay.blanchardniicommunications.com> wrote:
> [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
>
>

--
Pablo M. Rivas. http://pmrivas.ipupdater.com http://www.r3soft.com.ar
-----------------------------------------------------------

attached mail follows:


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

attached mail follows:


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
johnkegworks.com

attached mail follows:


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?
>

attached mail follows:


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:prthompuark.edu]
> Sent: Tuesday, October 12, 2004 2:21 PM
> To: php-generallists.php.net
> 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>
> <td>Something</td>
> </td>Something 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
>

attached mail follows:


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:prthompuark.edu]
>> Sent: Tuesday, October 12, 2004 2:21 PM
>> To: php-generallists.php.net
>> 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>
>> <td>Something</td>
>> </td>Something 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
>>
>

attached mail follows:


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:prthompuark.edu]
>>> Sent: Tuesday, October 12, 2004 2:21 PM
>>> To: php-generallists.php.net
>>> 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>
>>> <td>Something</td>
>>> </td>Something 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
>>>

attached mail follows:


<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:prthompuark.edu]
>>>> Sent: Tuesday, October 12, 2004 2:21 PM
>>>> To: php-generallists.php.net
>>>> 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>
>>>> <td>Something</td>
>>>> </td>Something 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
>>>>
>
>

attached mail follows:


> Philip Thompson wrote:
>
> > -------------
> > <?php
> > header('Content-Type: application/ms-excel');
> > header('Content-Disposition: attachment; filename="project.xls"');
> > ?>
> >
> > <table>
> > <tr>
> > <td>Something</td>
> > </td>Something 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

attached mail follows:


One recommendation might be to make something in Excel, do a Save As..
To HTML and see what kind of tags it puts in the HTML. There are some
in there specifically for storing formulas and such. You can probably
embed that in the HTML you output via this method and do some fancy
stuff with Excel.

-TG

> -----Original Message-----
> From: Gryffyn, Trevor
> Sent: Wednesday, October 13, 2004 10:41 AM
> To: php-generallists.php.net
> Subject: RE: [PHP] Re: Exporting HTML to Excel
>
>
> > Philip Thompson wrote:
> >
> > > -------------
> > > <?php
> > > header('Content-Type: application/ms-excel');
> > > header('Content-Disposition: attachment; filename="project.xls"');
> > > ?>
> > >
> > > <table>
> > > <tr>
> > > <td>Something</td>
> > > </td>Something 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
>

attached mail follows:


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

On Oct 13, 2004, at 9:45 AM, Gryffyn, Trevor wrote:

> One recommendation might be to make something in Excel, do a Save As..
> To HTML and see what kind of tags it puts in the HTML. There are some
> in there specifically for storing formulas and such. You can probably
> embed that in the HTML you output via this method and do some fancy
> stuff with Excel.
>
> -TG
>
>> -----Original Message-----
>> From: Gryffyn, Trevor
>> Sent: Wednesday, October 13, 2004 10:41 AM
>> To: php-generallists.php.net
>> Subject: RE: [PHP] Re: Exporting HTML to Excel
>>
>>
>>> Philip Thompson wrote:
>>>
>>>> -------------
>>>> <?php
>>>> header('Content-Type: application/ms-excel');
>>>> header('Content-Disposition: attachment; filename="project.xls"');
>>>> ?>
>>>>
>>>> <table>
>>>> <tr>
>>>> <td>Something</td>
>>>> </td>Something 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
>

attached mail follows:


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:prthompuark.edu]
>>>>> Sent: Tuesday, October 12, 2004 2:21 PM
>>>>> To: php-generallists.php.net
>>>>> 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>
>>>>> <td>Something</td>
>>>>> </td>Something 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
>>>>>
>>
>>
>

attached mail follows:


> 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>
> >>>> <td>Something</td>
> >>>> </td>Something 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.

Another note, I put a <td>=A1+B1</td> and it worked fine (put the
formula in and it evaluates just fine that is).

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.

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

-TG

attached mail follows:


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>
>>>>>> <td>Something</td>
>>>>>> </td>Something 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

attached mail follows:


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

attached mail follows:


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

attached mail follows:


> 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.

Just curious, are right-clicking and doing "Save Target As..." or just
clicking on the link.

If you're right-clicking and doing that, then it's probably going to get
the toexcel.php filename. If your PHP script in toexecl.php is the same
as the example you posted earlier, all you should have to do is click on
the link. Then it's all about whether IE is configured to download or
display within IE, the XLS filetype.

On that other thread I mentioned, they talked about changing the mime
type to "octet/stream" I believe it was.. Then the .XLS for the
filename triggers the Excel viewing.... Or something. It's something to
play with at least. I don't have time to play and test, but thought I'd
share the info.

-TG

attached mail follows:


> 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:prthompuark.edu]
Sent: Wednesday, October 13, 2004 6:18 AM
To: Vail, Warren
Cc: php-generallists.php.net
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:prthompuark.edu]
> Sent: Tuesday, October 12, 2004 2:21 PM
> To: php-generallists.php.net
> 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>
> <td>Something</td>
> </td>Something 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
>

attached mail follows:


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.

attached mail follows:


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

attached mail follows:


> 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);

attached mail follows:


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);
>
>
> .
>

attached mail follows:


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

attached mail follows:


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.
>

attached mail follows:


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

attached mail follows:


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 | robbyplanetargon.com
* 503.351.4730 | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

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

iD8DBQBBbUpR0QaQZBaqXgwRAj30AJsHswi2ZQU7ci9vbCHZAFgOufBQGwCeLo4U
L3DQN3jUY0E2m0/uOHlFgjg=
=D/+G
-----END PGP SIGNATURE-----

attached mail follows:


On Wed, 13 Oct 2004 10:31:54 -0400, Jerry Swanson <pmysqlgmail.com> 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/

attached mail follows:


Hi,
I am just experimenting with images and uploading,
I have written a script that successfully uploads imgs
and I am using this to get the file dimensions:

$a = getimagesize("a.jpg");
echo $a[0] . " " .$a[1] . " " . $a[3];

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?

I have GD 2+ if that helps.

Thanks,
Mag

=====
------
- 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!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

attached mail follows:


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?

attached mail follows:


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 upload....or
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

attached mail follows:


Have you considered using XML data files as your cache and then parsing those files?

-----Original Message-----
From: Jed R. Brubaker [mailto:jrb21398hotmail.com]
Sent: Tue 10/12/2004 12:18 PM
To: php-generallists.php.net
Cc:
Subject: Are server classes possible?
I am thinking like JavaBeans. Here is what I have going on:

I have a series of rather database intensive queries that I would like some
class to cache and provide access for page loads. I don't care how the
information is stored, but I am trying to minimize the database call down to
only once an hour at the most.

The trick is that I just want the data - like a quazi-db table in memory...

Is there something like that I should look at? Somewhere in PEAR?

Thank you in advance!

attached mail follows:


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

attached mail follows:


[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.

attached mail follows:


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!

attached mail follows:


[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. "

attached mail follows:


> 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>

attached mail follows:


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
johnkegworks.com

attached mail follows:


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" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B03522B76nemesis...
[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. "

attached mail follows:


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

Pffffttttt. Read? Why would I do that? ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


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
johnkegworks.com

attached mail follows:


----- Original Message -----
From: "Jed R. Brubaker" <jrb21398hotmail.com>
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" <jay.blanchardniicommunications.com> wrote in
> message
> news:C8F323573C030A448F3E5A2B6FE2070B03522B76nemesis...
> [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
>
>

attached mail follows:


> 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 youremail.com

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>

attached mail follows:


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

attached mail follows:


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

attached mail follows:


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

Jason
<bedouglasearthlink.net> 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
>
>

attached mail follows:


$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:jdavidsonzworg.com]
Sent: Wednesday, October 13, 2004 9:51 AM
To: bedouglasearthlink.net; php-generallists.php.net
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
<bedouglasearthlink.net> 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
>
>

attached mail follows:


* 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."

attached mail follows:


> 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>

attached mail follows:


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]
=> noemailexample.com [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:php-generalzirzow.dyndns.org]
Sent: Wednesday, October 13, 2004 10:07 AM
To: php-generallists.php.net
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

attached mail follows:


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]
=> noemailexample.com [4] => FALSE )
[colFuncs] => Array ( )
[colFuncsExecuted] => Array ( )
[rows] => Array ( )
[pos] => 0
[orderColNrs] => Array ( )
[orderTypes] => Array ( ) )

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] =>1232f297a57a5a743894a0e4a801fc3
[3] => [4] => TRUE )

so... it looks like the code is trying to add a line/record into the result
object...

ie:
 $rs->rows[0]->fields= $rec....

the question is, why doesn't this work??? or should it work???
 from the $rs display, $rs->rows[0] appears to be a blank array...

any thought/insight....

thanks...

-bruce

-----Original Message-----
From: bruce [mailto:bedouglasearthlink.net]
Sent: Wednesday, October 13, 2004 9:59 AM
To: 'Jason Davidson'; php-generallists.php.net
Subject: RE: [PHP] php err msg/issue...

$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:jdavidsonzworg.com]
Sent: Wednesday, October 13, 2004 9:51 AM
To: bedouglasearthlink.net; php-generallists.php.net
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
<bedouglasearthlink.net> 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

attached mail follows:


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.

attached mail follows:


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

attached mail follows:


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

attached mail follows:


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
johnkegworks.com

attached mail follows:


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?

attached mail follows:


> 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

attached mail follows:


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 less<br
/>";
  }
  if ($_FILES["thumbImage"]["type"] != "image/pjpeg" &&
$_FILES["thumbImage"]["type"] != "image/jpeg") {
   $formVars["results"] .= "The small photo must be in .jpg format<br />";
  }
  $imgSize = getimagesize($_FILES["thumbImage"]["tmp_name"]);
  if ($imgSize[0] > 65) {
   $formVars["results"] .= "The small photo must be 65 pixels wide or
less<br />";
  }
 }
 // Full Image
 if (trim($_FILES["fullImage"]["tmp_name"])) {
  if ($_FILES["fullImage"]["size"] > 20480) {
   $formVars["results"] .= "The large photo must be 20480 bytes or less<br
/>";
  }
  if ($_FILES["fullImage"]["type"] != "image/pjpeg" &&
$_FILES["fullImage"]["type"] != "image/jpeg") {
   $formVars["results"] .= "The large photo must be in .jpg format<br />";
  }
  $imgSize = getimagesize($_FILES["fullImage"]["tmp_name"]);
  if ($imgSize[0] > 105) {
   $formVars["results"] .= "The large photo must be 105 pixels wide or
less<br />";
  }
 }

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!