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 21 Jul 2003 17:41:48 -0000 Issue 2189

php-general-digest-helplists.php.net
Date: Mon Jul 21 2003 - 12:41:48 CDT


php-general Digest 21 Jul 2003 17:41:48 -0000 Issue 2189

Topics (messages 156014 through 156094):

Re: list server problem
        156014 by: Lars Torben Wilson

free hosting
        156015 by: Bang Dodi
        156054 by: electroteque

Passing Serialized Array via Hidden field
        156016 by: Andrei Verovski (aka MacGuru)
        156017 by: Sam Baum
        156018 by: Mirek Novak
        156023 by: Andrei Verovski (aka MacGuru)
        156024 by: Jacob Vennervald Madsen
        156058 by: John Nichel
        156081 by: Chris Shiflett
        156087 by: John Manko

PHP 5 and COM problem
        156019 by: Aaron

regex help?
        156020 by: John Herren
        156021 by: John Herren
        156039 by: David Nicholson
        156040 by: sven

Re: Mail From option in PHP.ini
        156022 by: Ivo Fokkema
        156078 by: Peter Torraca

Re: Sending email with the windows version of php
        156025 by: Ivo Fokkema

Re: mail function
        156026 by: Ivo Fokkema
        156027 by: Chris Hayes
        156028 by: Peda
        156030 by: Ivo Fokkema
        156075 by: Curt Zirzow

Help?
        156029 by: chenqi1.zte.com.cn
        156031 by: Ryan Gibson
        156032 by: Ivo Fokkema

SQL select
        156033 by: Jiøí Nìmec
        156037 by: David Nicholson

Re: scoring/sorting db search results based on score
        156034 by: Marek Kilimajer
        156035 by: Marek Kilimajer

Re: ANY ONE CAN TELL ME WHAT PORT mssql_connect uses?
        156036 by: Nabil

Re: Image Stored in DB has errors
        156038 by: Marek Kilimajer

help with ad serving
        156041 by: electroteque

Re: popping up download dialog box
        156042 by: Michael Müller

How to..
        156043 by: Haseeb
        156046 by: Jon Haworth
        156080 by: Paul Chvostek

constants
        156044 by: Michael Müller
        156055 by: Haseeb

Re: GD2 makes black thumbnails
        156045 by: Marek Kilimajer

Register Globals
        156047 by: Daryl Meese
        156049 by: skate
        156050 by: stfmoreau
        156051 by: Petre Agenbag
        156053 by: Ford, Mike [LSS]
        156056 by: stfmoreau
        156059 by: John Manko
        156089 by: Curt Zirzow

News Reader
        156048 by: David Goodchild
        156052 by: Jon Haworth
        156070 by: Steve

Help with Date
        156057 by: Elliot Tobin
        156061 by: John Manko
        156062 by: Jon Haworth
        156063 by: Adam Voigt
        156064 by: Ford, Mike [LSS]
        156065 by: John Manko
        156067 by: John Manko
        156068 by: Ford, Mike [LSS]

Generating .rtf file
        156060 by: Aliaksei Kurets

Re: Auto session timeout
        156066 by: Hardik Doshi

PHP POSTGRESQL AND WML
        156069 by: haydo hassan

Print help
        156071 by: Ron Allen
        156073 by: Jay Blanchard
        156093 by: Kevin Stone

File download by php header...
        156072 by: Scott Fletcher
        156074 by: Chris Hayes
        156076 by: Curt Zirzow
        156079 by: Scott Fletcher
        156090 by: Scott Fletcher

Re: Error - when trying to connect to postgresql
        156077 by: Peter Torraca

a good PHP free forum?
        156082 by: Denis L. Menezes
        156084 by: Dan Joseph
        156085 by: Jonathan Villa
        156088 by: Step Schwarz

need help with mysql union
        156083 by: r-militante.northwestern.edu

need help with MySQL full text searching!!!!
        156086 by: Angelo Zanetti
        156091 by: James Rodenkirch

Re: jpeg photo file upload problem
        156092 by: motorpsychkill

CSV import
        156094 by: jwulff

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:


On Sun, 2003-07-20 at 11:04, Andu wrote:
> --On Monday, July 21, 2003 01:34:11 +0800 Jason Wong
> <php-generalgremlins.biz> wrote:
>
> > On Monday 21 July 2003 00:39, Andu wrote:
> >
> >> > The executive summary is that there is nothing to be fixed. If you're
> >> > using a less than adequate mail client which does not understand the
> >> > mailing list info contained in the headers then you should either
> >> > change clients or, even easier, just add the mailing list address
> >> > into your address book.
> >>
> >> Nonsense, all clients understand reply-to if it's there and that is the
> >> obligation of the sender which in this case is the list server not my
> >> client.
> >
> > Please read the archives.
>
> There's several thousand emails in there, give me a subject or something. I
> already attempted to do that but the search only takes 2 words, it looks
> like and chances I use the relevant ones are low, just spent some time
> without any relevant success.

I searched using the terms 'list' and 'reply-to', and the thread was on
the first page. But it depends on which archive you're searching, of
course, and you didn't specify which one you are looking in. The one I
used was http://marc.theaimsgroup.com/?l=php-general&r=1&w=2

> So what you're saying is that all the lists i've been on in the past 7-8
> years were doing it wrong but this one doesn't.

This is correct. Many lists have used reply-to in a broken fashion, and
many people have become trained to expect this behaviour. Please do a
search on the net for a document entitled 'Reply-to Considered Harmful'
for more discussion on the topic. I've seen arguments about this every
couple of months for the last 10 years and quite frankly am too sick of
it to bother anymore. (And no, I don't run this list, I just work on
the manual.)

> The list is not the originator of my message but an inteligent list
> server knows that the vast majority of the clients want to reply to
> the list not the originator of the message.

This is not a valid assumption. I would consider any list broken which
tried to outthink my decisions like that.

> > It is the mail client's job (or the list subscriber to be more precise)
> > to direct a reply to the appropriate place and not the list's
> > responsibility to second-guess where a reply should be directed.
>
> So what do I do if I have one account only? Should I keep changing the
> Reply-To for each email I send so that replies to other unrelated mail
> don't end up on php list? The list should second-guess members of the list
> want to reply to the list 99% of the time without being wrong.

I disagree. Oddly, I've known people who have been operating using the
correct methodology for well over a decade with no ill effects.

--
 Torben Wilson <torbenphp.net> +1.604.709.0506
 http://www.thebuttlesschaps.com http://www.inflatableeye.com
 http://www.hybrid17.com http://www.themainonmain.com
 -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----

attached mail follows:


http://cmax.port5.com

______________________________________________________________
Mau ringtones yang gaya ? --> http://www.ponselgaya.com

attached mail follows:


spam !

-----Original Message-----
From: Bang Dodi [mailto:bangdodilycos.co.uk]
Sent: Monday, July 21, 2003 3:55 PM
To: php-generallists.php.net
Subject: [PHP] free hosting

http://cmax.port5.com

______________________________________________________________
Mau ringtones yang gaya ? --> http://www.ponselgaya.com

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

attached mail follows:


Hi,

I am need to pass serialized assotiative array via form hidden field
(not GET or POST). In order to do it, I did the following:
urlencode(serialize($my_array)). However, after retrieving data from
hidden field and unserialize I've got junk.

Someone can explain me what I did wrong?

Also, do I need to do addslashes/stripslashes with serialized (or
encoded ?) data?

Thanks in advance for any suggestion.

*********************************************
* Best Regards --- Andrei Verovski
*
* Personal Home Page
* http://snow.prohosting.com/guru4mac
* Mac, Linux, DTP, Development, IT WEB Site
*********************************************

attached mail follows:


am Monday 21 July 2003 09:24 schrieb Andrei Verovski:

> I am need to pass serialized assotiative array via form hidden field
> (not GET or POST).

What does this mean? If you dont use GET or POST your form cant be
submitted.

> In order to do it, I did the following:
> urlencode(serialize($my_array)). However, after retrieving data from
> hidden field and unserialize I've got junk.

Just guessing: tried it w/o urlencode?

Sam

attached mail follows:


Andrei Verovski (aka MacGuru) napsal(a):
> Hi,
>
> I am need to pass serialized assotiative array via form hidden field
> (not GET or POST). In order to do it, I did the following:
> urlencode(serialize($my_array)). However, after retrieving data from
> hidden field and unserialize I've got junk.
>
> Someone can explain me what I did wrong?
>
> Also, do I need to do addslashes/stripslashes with serialized (or
> encoded ?) data?
>
> Thanks in advance for any suggestion.

try to encodedata with base64_encode http://cz.php.net/base64-encode
and retrieved data base64_decode
Ha :) here http://cz.php.net/serialize - in the wiki it is already said :)

--
Mirek Novak
jabberID: mireknjs.netlab.cz
ICQ: 119499448

attached mail follows:


On Monday, Jul 21, 2003, at 10:38 Europe/Helsinki, Sam Baum wrote:

> am Monday 21 July 2003 09:24 schrieb Andrei Verovski:
>
>> I am need to pass serialized assotiative array via form hidden field
>> (not GET or POST).
>
> What does this mean? If you dont use GET or POST your form cant be
> submitted.
>

I am need to pass serialized assotiative arrays (qty of 3) TO form
without GET, using hidden fields, but of course, I will use POST to
acquire form data.

>> In order to do it, I did the following:
>> urlencode(serialize($my_array)). However, after retrieving data from
>> hidden field and unserialize I've got junk.
>
> Just guessing: tried it w/o urlencode?

Yes, I did. I've got junk on my web page, because of special chars and
sequences in "serialized" data.

*********************************************
* Best Regards --- Andrei Verovski
*
* Personal Home Page
* http://snow.prohosting.com/guru4mac
* Mac, Linux, DTP, Development, IT WEB Site
*********************************************

attached mail follows:


Just tried it out and you should use htmlspecialchars() instead of
urlencode(). When you put it in a hidden field the browser is
responsable for urlencoding the data.

Jacob

On Mon, 2003-07-21 at 09:24, Andrei Verovski wrote:
> Hi,
>
> I am need to pass serialized assotiative array via form hidden field
> (not GET or POST). In order to do it, I did the following:
> urlencode(serialize($my_array)). However, after retrieving data from
> hidden field and unserialize I've got junk.
>
> Someone can explain me what I did wrong?
>
> Also, do I need to do addslashes/stripslashes with serialized (or
> encoded ?) data?
>
> Thanks in advance for any suggestion.
>
>
> *********************************************
> * Best Regards --- Andrei Verovski
> *
> * Personal Home Page
> * http://snow.prohosting.com/guru4mac
> * Mac, Linux, DTP, Development, IT WEB Site
> *********************************************
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone: +45 36 94 41 66
Mobile: +45 61 68 58 51

attached mail follows:


Andrei Verovski (aka MacGuru) wrote:
> Hi,
>
> I am need to pass serialized assotiative array via form hidden field
> (not GET or POST). In order to do it, I did the following:

Ummmm....is there a third form method that I'm not aware of?

> urlencode(serialize($my_array)). However, after retrieving data from
> hidden field and unserialize I've got junk.

Why are you urlencode'ing it?

> Someone can explain me what I did wrong?

Did you urldecode it before you unserialized it? Better yet, don't
urlencode it at all.

> Also, do I need to do addslashes/stripslashes with serialized (or
> encoded ?) data?

You shoudn't, but if you add on the submit, don't forget to strip on the
retrival.

> Thanks in advance for any suggestion.
>
>
> *********************************************
> * Best Regards --- Andrei Verovski
> *
> * Personal Home Page
> * http://snow.prohosting.com/guru4mac
> * Mac, Linux, DTP, Development, IT WEB Site
> *********************************************
>

attached mail follows:


--- Andrei Verovski <andreil1mail.starlett.lv> wrote:
> I am need to pass serialized assotiative array via form hidden
> field (not GET or POST).

This is impossible. A hidden form field is simply a form field that is not
displayed to the user. Form actions must be GET or POST.

> In order to do it, I did the following: urlencode(serialize($my_array)).

Don't URL encode the value of the form field, since the browser will take care
of that. You should probably use POST rather than GET, because serializing an
array might yield a very long string and make the URL too large for the Web
browser and/or Web server to handle.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


Just a small point, you can have both GET and POST.

------ search.html -----
<form method=POST
action='page.php?action=search&sid=09h34fnn3f0qn34f8n38fn34htq83th83qh' >
<input name=search type=text>
<input type=submit value='Find It!'>
</form>

----- page.php --------
$sid = $_GET['sid'];
session_id($sid);
session_start();

$search = $_POST['search'];

Also, for those who don't know, you can even reference hash links

<a href='page.php?action=something#myhashlink>

Chris Shiflett wrote:

>--- Andrei Verovski <andreil1mail.starlett.lv> wrote:
>
>
>>I am need to pass serialized assotiative array via form hidden
>>field (not GET or POST).
>>
>>
>
>This is impossible. A hidden form field is simply a form field that is not
>displayed to the user. Form actions must be GET or POST.
>
>
>
>>In order to do it, I did the following: urlencode(serialize($my_array)).
>>
>>
>
>Don't URL encode the value of the form field, since the browser will take care
>of that. You should probably use POST rather than GET, because serializing an
>array might yield a very long string and make the URL too large for the Web
>browser and/or Web server to handle.
>
>Hope that helps.
>
>Chris
>
>=====
>Become a better Web developer with the HTTP Developer's Handbook
>http://httphandbook.org/
>
>
>

attached mail follows:


I just updated my binaries to their PHP 5 counterparts (from
http://kromann.info/php4.php) and im getting issues with COM.

The following line:

$foo=new COM("GnucDNA.Core");

Generates this error:

Fatal error: Class 'com' not found in <path to script> on line <line num>

The COM object has been registered and if it means anything im a PHPGTK
developer. Any help appreicated.

attached mail follows:


Can't seem to get this to work...

trying to yank stuff xxx from
<TD class=a8b noWrap align=middle width=17 bgColor=#cccccc>xxx</TD>

and stuff yyy from

<TD class=a8b noWrap width=100>&nbsp;yyy</TD>

preg_match("&nbsp;(.*)</TD>$|i", $l, $regs);

works for the second example, even though it isn't the correct way, but
nothing works for for me for the first example.

Any help is appreciated!

attached mail follows:


Can't seem to get this to work...

trying to yank stuff xxx from
<TD class=a8b noWrap align=middle width=17 bgColor=#cccccc>xxx</TD>

and stuff yyy from

<TD class=a8b noWrap width=100>&nbsp;yyy</TD>

preg_match("|&nbsp;(.*)</TD>$|i", $l, $regs);

works for the second example, even though it isn't the correct way, but
nothing works for for me for the first example.

Any help is appreciated!

attached mail follows:


Hello,

This is a reply to an e-mail that you wrote on Mon, 21 Jul 2003 at
08:59, lines prefixed by '>' were originally written by you.
> Can't seem to get this to work...
> trying to yank stuff xxx from
> <TD class=a8b noWrap align=middle width=17
bgColor=#cccccc>xxx</td>

Try this:

preg_match("/<td[^>]*>(.*)</TD>/i", $l, $regs);

HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

attached mail follows:


hi john,
try a regex like this:
'/<td[^>]*>(.*)</td>/i'
ciao SVEN

John Herren wrote:
> Can't seem to get this to work...
>
> trying to yank stuff xxx from
> <TD class=a8b noWrap align=middle width=17 bgColor=#cccccc>xxx</TD>
>
> and stuff yyy from
>
> <TD class=a8b noWrap width=100>&nbsp;yyy</TD>
>
> preg_match("|&nbsp;(.*)</TD>$|i", $l, $regs);
>
> works for the second example, even though it isn't the correct way,
> but nothing works for for me for the first example.
>
> Any help is appreciated!

attached mail follows:


Hi,

Paul is right, you can't change the Return-Path header. On a windows server
you could use the 'sendmail_from' setting in php.ini, but that doesn't work
on Linux/Unix. Also, the -f 5th argument of the mail() function does not
function with safe_mode on in php. It also generates a
X-Authentication-error in the emailheader (for me, at least) and I am told
it can lead to dangerous security problems.

I gave up some time ago to try and fix this problem. When my emails don't
reach the target because visitors don't fill in their correct emailaddress,
I won't receive any delivery errors. I used Reply-To, Error-To and whatever
more, but I couldn't fix it. Maybe something can be added to a later release
of PHP to fix this? I for one would be extremely happy with that.

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands

"Brian S. Drexler" <sysadminsaginawcontrol.com> wrote in message
news:000901c34d3d$4e209d90$686fa2cesaginawcontrol.com...
> Ok, I want to specify who the mail is coming from by using the
sendmail_path
> option in the PHP.ini. I've added the -fmemydomain.com to it, but I want
> to be able to dynmaically change memydomain.com to youmydomain.com or
> whatever else. Anyone have any ideas how I can do this? I'm pulling the
> e-mail I'd like to change it to from a MySQL database but can I rewrite
the
> php.ini file on the fly or am I stuck. Any help is greatly appreciated.
> Thanks!
>
> Brian
>

attached mail follows:


On 07/18/2003 12:00 PM, Brian S. Drexler wrote:
> Ok, I want to specify who the mail is coming from by using the sendmail_path
> option in the PHP.ini. I've added the -fmemydomain.com to it, but I want
> to be able to dynmaically change memydomain.com to youmydomain.com or
> whatever else. Anyone have any ideas how I can do this? I'm pulling the
> e-mail I'd like to change it to from a MySQL database but can I rewrite the
> php.ini file on the fly or am I stuck. Any help is greatly appreciated.
Why not just add the From: header to the fourth mail() param?
Something like this:

$email = "userwherever.org";
$admin_email = "webmastermath.purdue.edu";
$body = "blah blah blah";

$mail = mail($email, "Information you requested", $body, "From: $admin_email");

I've found that this sets the headers the way most clients expect to
see them. We use it a lot to tidy up emails set from "reset your
password" functions and the like. It should be trivial to set the
From: header based on a db result or whatever.

There is a much expanded version of this solution regarding sending
emails with attachments through mail() on in the online php manual,
check out "kieran dot huggins at rogers dot com"'s comments and some
others on the http://us4.php.net/mail page (it's a 06-Nov-2002
comment).

I'm coming in a bit late to this conversation -- hopefully I'm not
too far off base with this reply. If I am, sorry!

peter

--
Peter Torraca
Webmaster, Math Department
Purdue Univ., Math 813
765-494-9998

attached mail follows:


> > hello,
> >
> > My client is wanting to transfer their web site from a system that uses:
freebsd, apache, mysql and php, to a windows based hosting service.
> >
> Did you tell them this is a bad idea.
:)

> > So I was wondering if the Windows version of PHP sends e-mail with the
same commands as Sendmail or do I have to re-write the scripts. Or can you
tell me what form of email sending windows would use.
> >
> if you use the php mail command, you shouldn't have any problems. In
> the unix version the mail command uses sendmail where the windows
> version connects to a smtp server and sends the message its self.
You would need to set 'SMTP' and 'sendmail_from' in your php.ini. The
'sendmail_path' doesn't work for Windows, so you can leave that blank.

Nothing else changes then...

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands

attached mail follows:


> I put this PHP script on web server:
>
> <?php
> if (mail("ena-monaeunet.yu", "brati", "peda", "From: Peda")== TRUE)
> print("U redu je");
> else
> print("Greska");
> ?>
>
> But It seems that mail function doesn't work. I don't get any e-mail.
>
> Can anyone tell me what is wrong.

Does mail() return true? I mean, do you get printed "U redu je"? If so, your
email should've been sent by PHP.

You are really missing a bunch of headers. I'm not sure if this is your
problem, but I think it's not a bad idea to include more headers, also
because more and more ISP's add some kind of spamfilter which might drop
your email. So maybe by adding more headers, you can solve this.

I use this:

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "From: Name <YouDomain.com>\r\n";

$body = "Whatever is in your email";

$to = "Name <Where-everthis-needs-to-go.com>";
$check_mail = mail($to, "Subject", $body, $headers);

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands

attached mail follows:


At 10:39 21-7-03, you wrote:
> > I put this PHP script on web server:
> >
> > <?php
> > if (mail("ena-monaeunet.yu", "brati", "peda", "From: Peda")== TRUE)
> > print("U redu je");
> > else
> > print("Greska");
> > ?>
> >
> > But It seems that mail function doesn't work. I don't get any e-mail.
> >
> > Can anyone tell me what is wrong.
>
>Does mail() return true? I mean, do you get printed "U redu je"? If so, your
>email should've been sent by PHP.
>
>You are really missing a bunch of headers. I'm not sure if this is your
>problem, but I think it's not a bad idea to include more headers, also
>because more and more ISP's add some kind of spamfilter which might drop
>your email. So maybe by adding more headers, you can solve this.
>
>I use this:
>
>$headers = "MIME-Version: 1.0\r\n";
>$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
>$headers .= "X-Priority: 3\r\n";
>$headers .= "X-MSMail-Priority: Normal\r\n";
>$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
>$headers .= "From: Name <YouDomain.com>\r\n";
>
>$body = "Whatever is in your email";
>
>$to = "Name <Where-everthis-needs-to-go.com>";
>$check_mail = mail($to, "Subject", $body, $headers);

When PHP sends an email to a non existing email address such as
YouDomain.com, the warning mail you normally get returned often does not
arrive in your mailbox. Therefore I add two additional headers:

     ."Reply-To: medomain.nl\r\n"
     ."Return-path: <medomain.nl\r\n"

and now I do get the notification mail when mail bounces.

attached mail follows:


Thank you!!!
Headers solved my problem.

attached mail follows:


> >Does mail() return true? I mean, do you get printed "U redu je"? If so,
your
> >email should've been sent by PHP.
> >
> >You are really missing a bunch of headers. I'm not sure if this is your
> >problem, but I think it's not a bad idea to include more headers, also
> >because more and more ISP's add some kind of spamfilter which might drop
> >your email. So maybe by adding more headers, you can solve this.
> >
> >I use this:
> >
> >$headers = "MIME-Version: 1.0\r\n";
> >$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
> >$headers .= "X-Priority: 3\r\n";
> >$headers .= "X-MSMail-Priority: Normal\r\n";
> >$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
> >$headers .= "From: Name <YouDomain.com>\r\n";
> >
> >$body = "Whatever is in your email";
> >
> >$to = "Name <Where-everthis-needs-to-go.com>";
> >$check_mail = mail($to, "Subject", $body, $headers);
>
> When PHP sends an email to a non existing email address such as
> YouDomain.com, the warning mail you normally get returned often does not
> arrive in your mailbox. Therefore I add two additional headers:
>
> ."Reply-To: medomain.nl\r\n"
> ."Return-path: <medomain.nl\r\n"
>
> and now I do get the notification mail when mail bounces.
That's funny, because I always had that problem, too. By adding Reply-To and
Return-path, it did not fix my problem. Boucing emails never got back to me.
Return-path was overwritten by my hostingserver to 'nobody...' and Reply-To
was apparently ignored by the server bouncing the email. Do you think
servers differ in this a lot?

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands

attached mail follows:


* Thus wrote Ivo Fokkema (I.F.A.C.FokkemaLUMC.nl):
> > >Does mail() return true? I mean, do you get printed "U redu je"? If so,
> >
> > When PHP sends an email to a non existing email address such as
> > YouDomain.com, the warning mail you normally get returned often does not
> > arrive in your mailbox. Therefore I add two additional headers:
> >
> > ."Reply-To: medomain.nl\r\n"
> > ."Return-path: <medomain.nl\r\n"
> >
> > and now I do get the notification mail when mail bounces.
> That's funny, because I always had that problem, too. By adding Reply-To and
> Return-path, it did not fix my problem. Boucing emails never got back to me.
> Return-path was overwritten by my hostingserver to 'nobody...' and Reply-To
> was apparently ignored by the server bouncing the email. Do you think
> servers differ in this a lot?

So much confusion on mail.....

Return-Path: inserted by all smtp servers on delivery.
Reply-To: handled by client
Errors-To: Maybe handled by smtp server.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


I installed apache1.3.12 as the web server and php5 beta version,I write a
test.html and test.php like this:
//test.htm

<form action="test.php" method="post">
Name:<input type="text" name="name"><br>
<input type=image src="image.gif" name="sub">
</form>
//test.php
<?php
  echo "Hello!".$name ;
?>
the same source works well with php4 and apache 1.3.27
but it doesn't work well in my new enviroment, until I modified test.php
like this
//new test.php
<?php
  echo "Hello!".$_POST['name'] ;
?>

who can tell me which one cause this problem,Is the version php5 not
satisfy or the apache 1.3.12?

attached mail follows:


See archive posts about register_globals which came in php 4.1 (I think) if
you don't want to change your scripts you can turn off register_globals in
the .htaccess or php.ini files

On 21/7/03 10:34 am, "chenqi1zte.com.cn" <chenqi1zte.com.cn> wrote:

> I installed apache1.3.12 as the web server and php5 beta version,I write a
> test.html and test.php like this:
> //test.htm
>
> <form action="test.php" method="post">
> Name:<input type="text" name="name"><br>
> <input type=image src="image.gif" name="sub">
> </form>
> //test.php
> <?php
> echo "Hello!".$name ;
> ?>
> the same source works well with php4 and apache 1.3.27
> but it doesn't work well in my new enviroment, until I modified test.php
> like this
> //new test.php
> <?php
> echo "Hello!".$_POST['name'] ;
> ?>
>
> who can tell me which one cause this problem,Is the version php5 not
> satisfy or the apache 1.3.12?
>

Ryan Gibson
-----------
ryan_gibsonjmp-partnerhip.co.uk

attached mail follows:


<chenqi1zte.com.cn> wrote in message
news:OF998A284F.C6E2E7B4-ON48256D6A.00308616com.cn...
> I installed apache1.3.12 as the web server and php5 beta version,I write a
> test.html and test.php like this:
> //test.htm
>
> <form action="test.php" method="post">
> Name:<input type="text" name="name"><br>
> <input type=image src="image.gif" name="sub">
> </form>
> //test.php
> <?php
> echo "Hello!".$name ;
> ?>
> the same source works well with php4 and apache 1.3.27
> but it doesn't work well in my new enviroment, until I modified test.php
> like this
> //new test.php
> <?php
> echo "Hello!".$_POST['name'] ;
> ?>
>
> who can tell me which one cause this problem,Is the version php5 not
> satisfy or the apache 1.3.12?
Check your php.ini for this setting : 'register_globals'. With your new
installation, it is set to off, causing $_POST['name'] (the original
variable!) not to be registered to $name. With register_globals set to on,
you can use your first script.

I want to warn you though, PHP depricates the use of register_globals = On,
so it would be recommendable to use your modified script and keep coding
using $_POST, $_GET and these kind of global variables.

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands

attached mail follows:


heloo,

i have got a MySQL table:

id_comp id_goods type

cooler aa1256 n
cooler aa1255 n
cooler aa1317 f
cooler aa1196 n

cpu cpu183 n
cpu cpu177 f
cpu cpu190 n

gk gk1265 f
gk gk1258 n
gk NULL i
gk gk1193 n
gk gk1257 n

mb mb1111 f

ram mem713 n
ram me1112 f
ram mem704 n
ram me1081 n

and I need only first row of each component order by type. so:

cooler aa1317 f
cpu cpu177 f
gk NULL i
mb mb1111 f
ram me1112 f

has somebody some idea hot to select?

jiøí nìmec, ICQ: 114651500
www.menea.cz - www stránky a aplikace

attached mail follows:


Hello,

This is a reply to an e-mail that you wrote on Mon, 21 Jul 2003 at
11:08, lines prefixed by '>' were originally written by you.

> heloo,
> i have got a MySQL table:
> id_comp id_goods type
> has somebody some idea hot to select?

This is off topic for this list but here goes...

SELECT * FROM tablename GROUP BY id_comp

will probably do it.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

attached mail follows:


I use mysql, so this was for mysql - LIKE is case insesitive and returns
0 for false and 1 for true.

Dean E. Weimer wrote:
>>Try
>>SELECT ...., (((keywords LIKE '%$search%') * 5) + ((title LIKE
>>'%$search%') * 3) + (description LIKE '%$search%')) score FROM .....
>>ORDER BY score DESC
>
>
> PostgreSQL cannot type cast the Boolean type so you have to use a case
> statement, also changing like to ilike will get results regardless of
> case.
>
> SELECT ...., ((CASE WHEN (keywords ILIKE '%$search%') THEN 5 ELSE 0 END) +
> (CASE WHEN (title ILIKE '%$search%') THEN 3 ELSE 0 END) + (CASE WHEN
> (description ILIKE '%$search%') THEN 1 ELSE 0 END)) AS score FROM ....
> ORDER BY score DESC
>

attached mail follows:


I don't know how postgres server would optimize the query, but in teory
there should be only a slight overhead as the (I)LIKE results should be
cached. How much takes to order by depends on the number of rows returned.

Dave [Hawk-Systems] wrote:
> Appreciate the responses...

> We are talking a db of under 10k records where the search would take place on.
> what are the ramifications of this as a load on the postgres server? Wouldn't
> want to have a great search query that grinds the server to a halt everytime
> someone searches regardless of the accuracy of the end result :)
>
> Thanks
>
> Dave
>
>
>

attached mail follows:


Dear Michael;

I am Requesting your help, Redhat 7.3 to connect to the remote windows MS
SQL 7.0
Days and trying to use FreeTDS..

can you help please how to confiure php with sybase as you said?? because it
told me mssql_connect call for undefined function... but actualy i need to
use odbc_connect from linux...

more info:
-I need to connect from Linux box ( www server) and retrieve the data from a
remote MS SQL 7 , that located on the same network..
-please note that their is a CISCO firewall between the two.. and it only
allowed tcp/ip with ports 80, 443 , 1433 for ODBC... ( from windows to
windows I managed, but from LINUX)
-I spent a lot of time trying to use unixODBC with php-odbc , iODBC ,
freeTDS .. and whatever I could do, and until now I didn't find a way to
connect.. and I was getting so much errors like unixODBC DSN not found ...
so much painful story..

PLEASE HELP ME COZ I M GOING TO PULL MY HAIR OFF....

"Michael Sims" <mhsimsmidsouth.rr.com> wrote in message
news:dg59hvg9qpko5cu23juft2ns2aq432kten4ax.com...
On Tue, 15 Jul 2003 19:36:42 +0300, you wrote:

>how can i specify the port for the direct connection
>mssql_connect()

I've never had the need to do this, so I cannot verify that this
works, but I believe you can supply a port number in the servername
argument:

mssql_connect('192.168.0.1:1433', 'someuser', 'somepass');

You can also define this in the FreeTDS "interfaces" file, I believe,
but again I'm not sure as I use the default port.

>can u give me some hints regarding the FreeTDS

Read this article, it helped me out immensely when I set it all up:

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

>if i used it then i have to confugure the DSN in liunx am i wrong?

Not sure what you mean here. If you're referring to a Windows "Data
Source Name" then that is not really relevant on a Linux platform. If
you have access to port 1433 on the SQL server all you need to do is
to download and install FreeTDS (follow the article above for help,
and when all else fails read the FreeTDS documentation), then rebuild
PHP with the "--with-sybase" option. After you have done that you can
simply supply an IP address or hostname to the mssql_connect() call.

Give it a shot and if you run into problems I'd be glad to try an
answer any specific questions you may have.

attached mail follows:


I'm not sure if this solves you problem, but addslashes escapes BOTH
single and double quotes. Use str_replace("'", "\\'", ....) instead

Guru Geek wrote:

> Hello,
>
> I went to bed last night and this was working. I woke up this morning
> and something has happened or someone has tampered with it. I have
> noticed that the LONGBLOB in the database which stores the actual binary
> of the image states that it contains 25.3k and the actual 'image_size'
> field states 25.9k and I'm wondering if something is trimming part of
> the image off. Can anyone out there in PHP land spot an error in my
> code that would create a problem like this? When I try to view the
> photos it returns "the picture you are trying to view contains errors".
>
> HERE'S THE CODE FOR INSERTING PHOTOS INTO THE DATABASE:
>
> if ($userpic != "none")
> {
> $image = addslashes (fread(fopen
> ($HTTP_POST_FILES["userpic"]["tmp_name"], "r"),
> filesize
> ($HTTP_POST_FILES["userpic"]["tmp_name"])));
> $File_name = strtolower($HTTP_POST_FILES["userpic"]["name"]);
> $File_size = $HTTP_POST_FILES["userpic"]["size"];
> $File_type = strtolower($HTTP_POST_FILES["userpic"]["type"]);
>
> function filecheck($File_name)
> {
> $ext = strrchr($File_name, ".");
> $image_type = array (".png", ".jpg", ".jpeg", ".bmp", ".gif",
> ".tif", ".tiff", ".pcx");
> if ( in_array ($ext, $image_type) )
> {
> global $goodext;
> $goodext = 1;
> }
> }
>
> filecheck($File_name);
> if (!$goodext)
> {
> echo "Your photo is not in a valid format.<br>";
> exit;
> }
> } else {
> $File_name = " ";
> }
>
> $db_host="localhost";
> $db_user="";
> $db_pass="";
> $db_db="main";
> mysql_connect($db_host,$db_user,$db_pass) or die(mysql_error());
> mysql_select_db($db_db) or die(mysql_error());
>
> $do= "INSERT INTO table
> (name,email,age,location,interests,about,image,image_type,image_size,image_name)
> VALUES
> ('$name','$email','$dobtimestamp','$location','$interests','$about','$image','$File_type','$File_size','$File_name')";
>
> $r=mysql_query($do) or die(mysql_error());
>
> HERE'S THE CODE FOR VIEWING SAID PHOTOS:
> $r=mysql_query("SELECT
> name,email,age,location,interests,about,image_size FROM table WHERE
> name='$name'");
> $a=mysql_fetch_array($r);
> if ($a['image_size'] > 0)
> {
> print "<img src='getimage.php?name=$name' border=2></img>";
> }
>
> HERE'S THE CODE FOR getimage.php:
> <?php
> $query = mysql_query("SELECT image,image_type,image_size FROM table
> WHERE name = '$name'");
> $image = mysql_result($query,0,"image");
> $image_type = mysql_result($query,0,"image_type");
> $image_size = mysql_result($query,0,"image_size");
> Header( "Content-type: $image_type");
> Header( "Content-Length: $image_size");
> echo $image;
> ?>
>
> Thank all of you in advance,
> Rog
>
>
>

attached mail follows:


hi there my next project at work is to build an ad server for both image and
flash , i am storing each ad entry into a banner_ads table then another
table media to store each of the banners into which links to the banner ,
although in the created admin tool i allow for multiple uploads so a flash
file can be uploaded for the banner entry and a animated gif version can
also be uploaded for the banner entry , or just an animated gif banner
version , ok so when i select for a banner with a start and end date range
which is valid and is to be shown on a selected site id i grab the files
associated with it which are the flash and image, so in my while loop i end
up with to rows of results how would it be possible to display this and how
am i able to tell if the banner is a flash file with the animated gif
version of if the banner is just an animated gif and display it differently
? let me know thankyou

attached mail follows:


try this:
<?php
function download($file , $name) {
    $size = filesize($file);
    header("Content-type: application/octet-stream");
    header("Content-disposition: attachment; filename=".$name);
    header("Content-Length: ".$size);
    header("Pragma: no-cache");
    header("Expires: 0");
    readfile($file);
}

download("file_on_server.dat","download_as_.dat");
?>

attached mail follows:


hi,
i have heard a lot of people commenting about the coding style of other
programmers. i think everyone has his own style. but i also say that there
should be a standard that should be followed by everyone. i know that there
are many good tutorials that explain how to code. anyway i have my own style
 i like keeping all the functions in one file and the include the file
whenever i need any function. now there are few problems in that. i prefer
writing functions for almost everything sometimes the functions file grows
to over 5,000 lines. now this is not good. when ever i need one simple
function i had to include all the file. now i also don't like keeping
functions in every file that uses it. this is becoming a big problem for me.
also i have seen some programmer that prefer to use only one file as front
end and place switch or if conditions and include other files depending on
the condition. i think its good way of doing things but when the magnitude
of the projects grows i find it very difficult for me to keep working. i
find it very hard to concentrate.

this is the problem, i have thought of the solution i.e. divide the
functions into files. and then include only that file that has the function.
but i thought i would ask you people how you handle this. may be i would
find something that suits me more then this solution.

thanx in advance.
Haseeb

attached mail follows:


Hi Haseeb,

> i.e. divide the functions into files. and then include
> only that file that has the function.

That's how I usually do it - for example, I have a file called
"dates.lib.php" which contains all my functions for handling dates and
times, a file called "db.lib.php" which has my database stuff, etc etc.

You may also want to look into classes, which provide a neat way to
compartmentalise your code. Personally I don't find them very useful unless
the project is large or has many programmers, though.

Cheers
Jon

attached mail follows:


On Tue, Jul 22, 2003 at 04:08:35AM +0500, Haseeb wrote:
>
>i like keeping all the functions in one file and the
> include the file whenever i need any function.
...
>some programmer that prefer to use only one file as front end and place
> switch or if conditions and include other files depending on the condition.
...
>divide the functions into files. and then include only that file
> that has the function.

I do a little of all three, myself. But, it depends on the project.

If the project is small enough, a single function file will do. I start
to segregate functions by category when I see logical divisions between
the functions. (I.e. billing things, statistical things, etc.) Then I
choose which function libaries to call based on whatever criteria I have
on hand -- usually user input.

Often it's simpler than that -- a project could have a "billing.php"
script that calls "functions-billing.php", and "stats.php" that calls
"functions-stats.php". And if a particular billing function wants to
use something out of stats, it can simply include that library.

Another thing I've done from time to time (though I wouldn't recommend
it) is name your function library after a variable that's used to denote
the part of the program you're running in. For example:

  if (ereg('^[a-z]+$',$sect)) include("functions-" . $sect . ".php");

That way, you're basing your include on something that you're already
managing, perhaps as a form or session variable. YMMV. Don't forget to
do your sanity checking. This method may be prone to security problems.

--
  Paul Chvostek <paulit.ca>
  it.canada http://www.it.ca/
  Free PHP web hosting! http://www.it.ca/web/

attached mail follows:


hi,
why should I use constants?
thx for help

Michael

attached mail follows:


hi,
you can use constants whenever you want something whose value you don't want
changed accidently.for e.g. i use a constant to keep track of the path.
if i am at the root level then i store "./" in it. and if i am one folder
under the root then i store "../" in it. now as i tend to name variables
like this strPath (str for string) i often end up changing the value of
strPath to something else in the script. to stop this from happening i use
constants
 
HTH,
Haseeb

 
-------Original Message-------
 
From: Michael Müller
Date: Monday, July 21, 2003 04:22:03 PM
To: php-generallists.php.net
Subject: [PHP] constants
 
hi,
why should I use constants?
thx for help
 
Michael
 
 
 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 

attached mail follows:


Use imagecreatetruecolor() instead of imagecreate()

Jiøí Nìmec wrote:

> hello everyone,
>
> i have got a question about creating thumbnails from original JPG
> files. users upload their own pohotos in JPG format to server, and
> system makes a thumbnails.
>
> these thumbnails are sometime black. probably there is problem in
> uploaded image files, bacaues if I open and save "for web" this file
> in AP there is no problem.
>
> have somebody idea how to solve this problem??
>
> jiri nemec, ICQ: 114651500
> www.menea.cz - www stránky a aplikace
>
>

attached mail follows:


I would like to rewrite my scripts to work when register globals is off.
The problem is that my scripts encompass several thousand files. Does
anyone have any suggestions for an effective tool to help in this process?

Daryl Meese

attached mail follows:


a good editor with a good find and replace tool...

i know dreamweaver MX can do a find and replace for an entire site once
you've defined it.

----- Original Message -----
From: "Daryl Meese" <darylmmagiasoftware.com>
To: <php-generallists.php.net>
Sent: Monday, July 21, 2003 1:17 PM
Subject: [PHP] Register Globals

> I would like to rewrite my scripts to work when register globals is off.
> The problem is that my scripts encompass several thousand files. Does
> anyone have any suggestions for an effective tool to help in this process?
>
> Daryl Meese
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Hi,

include this code in your header file :
        // _GET
        if (isset($_GET))
                while (list($key, $val) = each($_GET))
                {
                        eval ("$".$key." = '".$val."';");
                }
        // _POST
        if (isset($_POST))
                while (list($key, $val) = each($_POST))
                {
                        eval ("$".$key." = '".$val."';");
                }
        // _SESSION
        if (isset($_SESSION))
                while (list($key, $val) = each($_SESSION))
                {
                        eval ("$".$key." = '".$val."';");
                }
It may works (I have not expirimence it)

Stf

-----Message d'origine-----
De : Daryl Meese [mailto:darylmmagiasoftware.com]
Envoyé : lundi 21 juillet 2003 14:18
À : php-generallists.php.net
Objet : [PHP] Register Globals

I would like to rewrite my scripts to work when register globals is off.
The problem is that my scripts encompass several thousand files. Does
anyone have any suggestions for an effective tool to help in this process?

Daryl Meese

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

attached mail follows:


a simple extract($_POST) or extract($_GET) would also work

On Mon, 2003-07-21 at 14:22, stfmoreau wrote:
> Hi,
>
> include this code in your header file :
> // _GET
> if (isset($_GET))
> while (list($key, $val) = each($_GET))
> {
> eval ("$".$key." = '".$val."';");
> }
> // _POST
> if (isset($_POST))
> while (list($key, $val) = each($_POST))
> {
> eval ("$".$key." = '".$val."';");
> }
> // _SESSION
> if (isset($_SESSION))
> while (list($key, $val) = each($_SESSION))
> {
> eval ("$".$key." = '".$val."';");
> }
> It may works (I have not expirimence it)
>
> Stf
>
> -----Message d'origine-----
> De : Daryl Meese [mailto:darylmmagiasoftware.com]
> Envoyé : lundi 21 juillet 2003 14:18
> À : php-generallists.php.net
> Objet : [PHP] Register Globals
>
>
> I would like to rewrite my scripts to work when register globals is off.
> The problem is that my scripts encompass several thousand files. Does
> anyone have any suggestions for an effective tool to help in this process?
>
> Daryl Meese
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


> -----Original Message-----
> From: stfmoreau [mailto:stfmoreauyahoo.fr]
> Sent: 21 July 2003 13:23
>
> include this code in your header file :
> // _GET
> if (isset($_GET))
> while (list($key, $val) = each($_GET))
> {
> eval ("$".$key." = '".$val."';");
> }

Whoa! Nasty and inefficient!!

I can understand if you decide initially to use a brute-force drop-in
replacement for register_globals, and leave modifying the rest of your code
until later, but really:

(i) Better:

        // _GET
        if (isset($_GET))
                foreach ($_GET as $key=>$val)
                {
                        $$key = $val;
                }

(ii) Even better:

        // _GET
        if (isset($_GET))
                extract($_GET);

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


OK, sorry, I tried to help... and finaly I learn (I didn't know extract...)

-----Message d'origine-----
De : Ford, Mike [LSS] [mailto:M.Fordlmu.ac.uk]
Envoyé : lundi 21 juillet 2003 14:35
À : 'stfmoreau'; Daryl Meese; php-generallists.php.net
Objet : RE: [PHP] Register Globals

> -----Original Message-----
> From: stfmoreau [mailto:stfmoreauyahoo.fr]
> Sent: 21 July 2003 13:23
>
> include this code in your header file :
> // _GET
> if (isset($_GET))
> while (list($key, $val) = each($_GET))
> {
> eval ("$".$key." = '".$val."';");
> }

Whoa! Nasty and inefficient!!

I can understand if you decide initially to use a brute-force drop-in
replacement for register_globals, and leave modifying the rest of your code
until later, but really:

(i) Better:

        // _GET
        if (isset($_GET))
                foreach ($_GET as $key=>$val)
                {
                        $$key = $val;
                }

(ii) Even better:

        // _GET
        if (isset($_GET))
                extract($_GET);

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

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

attached mail follows:


whoa, i didn't know that. i love this mailing list! :)

Petre Agenbag wrote:

>a simple extract($_POST) or extract($_GET) would also work
>
>

attached mail follows:


* Thus wrote stfmoreau (stfmoreauyahoo.fr):
> Hi,
>
> include this code in your header file :
> // _GET
> if (isset($_GET))
> while (list($key, $val) = each($_GET))
> {
> eval ("$".$key." = '".$val."';");
> }
> // _POST
> if (isset($_POST))
> while (list($key, $val) = each($_POST))
> {
> eval ("$".$key." = '".$val."';");
> }
> // _SESSION
> if (isset($_SESSION))
> while (list($key, $val) = each($_SESSION))
> {
> eval ("$".$key." = '".$val."';");
> }
> It may works (I have not expirimence it)

You can shorten it down a bit:
if (isset($_REQUEST) ) {
  foreach($_REQUEST as $key => $val) {
    $$key = $val;
  }
}

I'm not sure if session is there but I know the $_REQUEST has all GET,
POST and COOKIE vars. Of course this isn't completely compatible with
how register_globals works. There is GPC ordering of where to get the
variables from.

$GPC = "GPC"
for($i = 0; i < strlen($GPC); $i++) {
  switch($GPC{$i}) {
    case 'G': $VAR = '_GET'; break;
    case 'P': $VAR = '_POST'; break;
    case 'C': $VAR = '_COOKIES'; break;
  }
  if (isset($$VAR) ) {
    foreach($$VAR as $key => $val) {
      eval("global $$key"); //make it global if this is in a function
      $$key = $val; //set value
    }
  }
}

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Could someone advise me of a good news reader. I'm using MS Outlook at the
moment, and if I reply to any post it sends it to the users email and not to
the news server. Plus, its not that great in general terms.

Thanks

Dave

attached mail follows:


Hi David,

> Could someone advise me of a good news reader.

Agent is pretty good:
http://www.forteinc.com/agent/

Mozilla has a mail and news component, which you can download on its own if
you don't want the browser, IRC client, HTML editor, etc:
http://www.mozilla.org/projects/thunderbird/

Cheers
Jon

attached mail follows:


David Goodchild wrote:

> Could someone advise me of a good news reader. I'm using MS Outlook at the
> moment, and if I reply to any post it sends it to the users email and not to
> the news server. Plus, its not that great in general terms.

XNews, slrn, Fortitude and of course Thunderbird (Gecko client).

attached mail follows:


I need a function to create the dates of previous Fridays, in
21-JUL-2003 format.

I figure this has already been done, so I wanted to ask before I
continued writing my own.

Thanks, Elliot

=====

-[ Elliot Tobin, elliot_tobinyahoo.com ]-

"America has never been united by blood or birth or soil. We are bound by ideals that move us beyond our backgrounds, lift us above our interests and teach us what it means to be citizens. Every child must be taught these principles. Every citizen must uphold them. And every immigrant, by embracing these ideals, makes our country more, not less, American." -- President Bush

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

attached mail follows:


I'd settle for a function that will generate a date for this upcoming
friday. ;)

Elliot Tobin wrote:

>I need a function to create the dates of previous Fridays
>
>

attached mail follows:


Hi Elliot,

> I need a function to create the dates of previous
> Fridays, in 21-JUL-2003 format.

It'll be different depending on what you want to happen if you pass a Friday
timestamp to the function, but it should be something like:

function friday($ts)
{

  while (date("w", $ts) != 5)
    $ts -= 86400;

  return date("d-m-Y", $ts);

}

Cheers
Jon

attached mail follows:


Umm.

echo(date('U',strtotime('next Friday')));

Notice the strtotime part.

On Mon, 2003-07-21 at 09:25, John Manko wrote:
> I'd settle for a function that will generate a date for this upcoming
> friday. ;)
>
> Elliot Tobin wrote:
>
> >I need a function to create the dates of previous Fridays
> >
> >
--
Adam Voigt (adamcryptocomm.com)
Linux/Unix Network Administrator
The Cryptocomm Group

attached mail follows:


> -----Original Message-----
> From: Adam Voigt [mailto:adamcryptocomm.com]
> Sent: 21 July 2003 14:29
>
> echo(date('U',strtotime('next Friday')));

Actually, for this upcoming Friday, that'd just be

   echo(date('U',strtotime('Friday')));

Slightly confusingly, 'next Friday' would be the Friday after that (because
'next' is defined to be equivalent to '2nd' -- no, I don't understand why
either, I just know it is!!)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Ha. Not what I have in mind. :)

Adam Voigt wrote:

>Umm.
>
>echo(date('U',strtotime('next Friday')));
>
>Notice the strtotime part.
>
>
>On Mon, 2003-07-21 at 09:25, John Manko wrote:
>
>
>>I'd settle for a function that will generate a date for this upcoming
>>friday. ;)
>>
>>Elliot Tobin wrote:
>>
>>
>>
>>>I need a function to create the dates of previous Fridays
>>>
>>>
>>>
>>>

attached mail follows:


More like:

echo(date('Jennifer Lopez',strtotime('next Friday')));

John Manko wrote:

> Ha. Not what I have in mind. :)
>
> Adam Voigt wrote:
>
>> Umm.
>>
>> echo(date('U',strtotime('next Friday')));
>>
>> Notice the strtotime part.
>>
>>
>> On Mon, 2003-07-21 at 09:25, John Manko wrote:
>>
>>
>>> I'd settle for a function that will generate a date for this
>>> upcoming friday. ;)
>>>
>>> Elliot Tobin wrote:
>>>
>>>
>>>
>>>> I need a function to create the dates of previous Fridays
>>>>
>>>>
>>>>
>>>
>
>
>

attached mail follows:


> -----Original Message-----
> From: Elliot Tobin [mailto:elliot_tobinyahoo.com]
> Sent: 21 July 2003 14:08
>
>
> I need a function to create the dates of previous Fridays, in
> 21-JUL-2003 format.
>
> I figure this has already been done, so I wanted to ask before I
> continued writing my own.

Take a look at strtotime() -- http://www.php.net/strtotime

Some combination of words using the word 'Friday' should get you what you want -- try something like strtotime('last Friday') ('-2 Friday', '-3 Friday', etc.,) to see if it does what you want; if not, you may need something like 'last week Friday', '-2 weeks Friday', etc., or some other more complex combination.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


This is my problem:

I have a text in my DB in HTML format (with some tags, such as <br>, <ul>
and other). I need to include DB' text in .rtf file. And my question: is
there any beautifull way to convert my HTML text to a plain text (with
formatting).

Maybe someone can advise me a good converting php class???...

attached mail follows:


Hi John,

Thanks for your response.

Actually i am thinking on the same way except saving
the URL of the page. You gave me a really good tip of
storing the URL with all other information.
Additionally, i was thinking to implement the "Save"
feature of MS word. So user can keep saving his/her
work after some period of time..

There is still one problem. On so many forms on my
education intranet application, students are
submitting the final projects with the supporting
documents and images. Once they submit the final
project, my script is performing serveral error
checking for the file size, extension etc. What should
i have to do for those kind of stuff? Because if
someone submits a very large file then my script won't
be able to upload the file (because of PHP file upload
limit set into the php.ini)

Let me know if you have any suggestion for improving
this functionality a little bit more.

Thanks again for your positive reply.

Hardik
--- "John W. Holmes" <holmes072000charter.net> wrote:
> Hardik Doshi wrote:
>
> > Hi,
> >
> > I have implemented the Auto session timeout after
> the
> > specific period of time.
> >
> > What i am doing is..At the time of login to the
> > system, my script is storing the current unix time
> > into the session and later on at every user click,
> It
> > (my script) is checking the stored unix time with
> the
> > current time. So, if you want to auto logout the
> user
> > after 30 minutes of inactivity then you need to
> store
> > auto session timeout interval to 30 min.
> >
> > Algorith is..If session stored time + auto session
> > timeout interval > current time then my script
> > automatically logout the user from the system
> > otherwise my script stores the current unix time
> in
> > the session.
> >
> > My problem is.. If user is doing some work on the
> > particular page (Ex. user is writing some stuff on
> the
> > specific page) but my script is counting this
> thing to
> > inactive period.. so after 31 minutes if user is
> > completing the writing and hit submit button then
> he
> > is getting the session expired screen and he is
> > loosing all the contents on that particular page..
> > Please let me know if any one has solution for
> this.
>
> What you could do, at the point you realize the
> session has times out,
> is save the contents of $_GET, $_POST, or $_REQUEST
> (depending upon your
> script) and the current URL of the page in the
> session. Have the user
> log in again. The "login validation" page then
> checks for the saved
> values, and if they are there, redirects back to
> that page. Then the
> user doesn't lose anything. It'll require a little
> work, but short of
> increasing your time-out limit, that's the best
> option. There's no way
> to tell if a user is working on filling out a page
> or has left the
> browser open.
>
> --
> ---John Holmes...
>
> Amazon Wishlist:
> www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals –
> www.phparch.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

attached mail follows:


Hi.

I am trying to send two variables from login.wml to auth.php.
But auth.php gets empty variables.

here is the code for login.wml:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
 "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <card newcontext="true" title="Fuhrpark Login" id="login">
    <p>
      <fieldset title="name &amp; PIN">
        Name:
        <input name="name"
          type="text"/><br/>
        Password:
        <input name="pin"
          type="password"/>
      </fieldset>
      <anchor>
        Login
        <go method="post" href="auth.php" >
          <postfield name="name" value="$nameeingeben"/>
          <postfield name="pin" value="$pineingeben"/>
        </go>
      </anchor>
      <do type="accept"
        label="Login">
        <go method="post" href="auth.php" >
        <postfield name="name" value="$nameeingeben"/>
        <postfield name="pin" value="$pineingeben"/>
        </go>
      </do>
    </p>
  </card>
</wml>

and here is the code for auth.php:

<?php
echo ("Name $name");
echo ("Pin $pin");
?>

What do i wrong?
Please can you help me?

______________________________________________________________________________
ComputerBild (15-03) empfiehlt den besten Spam-Schutz:
WEB.DE FreeMail - Deutschlands beste E-Mail - http://s.web.de/?mc=021125

attached mail follows:


What I would like to do is to make an optional page that can print
information to a specified printer. Can PHP do this?
If so how???

Please help!!!

attached mail follows:


[snip]
What I would like to do is to make an optional page that can print
information to a specified printer. Can PHP do this?
If so how???
[/snip]

Start by RTFM at http://us3.php.net/printer

HTH!

attached mail follows:


"Ron Allen" <Ronald.Allenbondsteel2.areur.army.mil> wrote in message
news:20030721140801.72203.qmailpb1.pair.com...
> What I would like to do is to make an optional page that can print
> information to a specified printer. Can PHP do this?
> If so how???
>
> Please help!!!

Look in the manual under 'printer'..
http://www.php.net/manual/en/ref.printer.php

Printer functions are server-side and work on Windows operating systems
only.

- Kevin

attached mail follows:


Hi!

    I'm using PHP 4.3.2 and IIS 5.0. I'm using the PHP header to cause the
webserver to download the file to the web browser. Some of the time it work
and some of the other time, it doesnt. I haven't figured out why until I
looked in the error log which showed hte problem... See two clipping
below.

--snip--
      //Send Downloadable File(s) To Browsers...
    $total=$DownloadUpdateArray[$_REQUEST['dw_code']][0];
    header ("Content-Type: application/octet-stream");
    header ("Content-Length: ".filesize($total));
    header ("Content-Disposition: attachment;
filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
    readfile($total);
--snip--

--snip--
[21-Jul-2003 09:15:33] PHP Fatal error: Maximum execution time of 30
seconds exceeded in
D:\<<filepath>>\menu\tech_support.php on line 47
--snip

    So, how does the php header("content-disposition:attachment;
filename='***'") cause the php timeout in the first place, what seem to be
the problem?

Thanks,
 Scott

attached mail follows:


At 16:15 21-7-03, you wrote:
>Hi!
>
> I'm using PHP 4.3.2 and IIS 5.0. I'm using the PHP header to cause the
>webserver to download the file to the web browser. Some of the time it work
>and some of the other time, it doesnt. I haven't figured out why until I
>looked in the error log which showed hte problem... See two clipping
>below.
>
>--snip--
> //Send Downloadable File(s) To Browsers...
> $total=$DownloadUpdateArray[$_REQUEST['dw_code']][0];
> header ("Content-Type: application/octet-stream");
> header ("Content-Length: ".filesize($total));
> header ("Content-Disposition: attachment;
>filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
> readfile($total);
>--snip--
>
>--snip--
>[21-Jul-2003 09:15:33] PHP Fatal error: Maximum execution time of 30
>seconds exceeded in
>D:\<<filepath>>\menu\tech_support.php on line 47
>--snip
>
> So, how does the php header("content-disposition:attachment;
>filename='***'") cause the php timeout in the first place, what seem to be
>the problem?

It seems like $DownloadUpdateArray[$_REQUEST['dw_code']][1] takes so long.
Or the previous code alwyas takes 29.9 secs, who knows.

You can tell php.ini that scripts can take some time longer dan 30 secs, or
you can add a line to prolong the script time
(http://nl2.php.net/function.set-time-limit) or you can try to make that
function faster.

I have some extra headers to prevent several problems:

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in
the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always
modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0

header("Content-type: text/csv"); //adapt to
your file type
header('Content-Disposition: inline; filename="filename.ext"');

Note that internet explorer 5.5 does not accept the 'attachment' part so
for your header with 'attachement;' in it consider to add this conditional:
if (strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5.5")) {$att = "";} else {$att
= " attachment;";}

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

attached mail follows:


* Thus wrote Scott Fletcher (scottabcoa.com):
> Hi!
>
> I'm using PHP 4.3.2 and IIS 5.0. I'm using the PHP header to
> cause the webserver to download the file to the web browser. Some
> of the time it work and some of the other time, it doesnt. I
> haven't figured out why until I looked in the error log which
> showed hte problem... See two clipping below.
>
> --snip-- //Send Downloadable File(s) To Browsers...
> $total=$DownloadUpdateArray[$_REQUEST['dw_code']][0]; header
> ("Content-Type: application/octet-stream"); header ("Content-Length:
> ".filesize($total)); header ("Content-Disposition: attachment;
> filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
> readfile($total); --snip--
>
> --snip-- [21-Jul-2003 09:15:33] PHP Fatal error: Maximum execution
> time of 30 seconds exceeded in D:\<<filepath>>\menu\tech_support.php
> on line 47 --snip
>
> So, how does the php header("content-disposition:attachment;
> filename='***'") cause the php timeout in the first place, what
> seem to be the problem?

It doesn't. Your script is taking over 30 seconds to run you will need
to find out why and where its taking to long or extend your time-out
setting.

btw, also on the content-disposition, not only will some browsers not
honor that, they will just use the name of the script as the 'save-as'
filename.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Um, problem is I don't have any scripts before this sample header function.
So, something is up. Does the file size 49 MB have something to do with it?

Okay, saw both of the replies, so will check them out.

Thanks,
 Scott

"Curt Zirzow" <curtzirzow.dyndns.org> wrote in message
news:20030721145810.GF50131bagend.shire...
> * Thus wrote Scott Fletcher (scottabcoa.com):
> > Hi!
> >
> > I'm using PHP 4.3.2 and IIS 5.0. I'm using the PHP header to
> > cause the webserver to download the file to the web browser. Some
> > of the time it work and some of the other time, it doesnt. I
> > haven't figured out why until I looked in the error log which
> > showed hte problem... See two clipping below.
> >
> > --snip-- //Send Downloadable File(s) To Browsers...
> > $total=$DownloadUpdateArray[$_REQUEST['dw_code']][0]; header
> > ("Content-Type: application/octet-stream"); header ("Content-Length:
> > ".filesize($total)); header ("Content-Disposition: attachment;
> > filename=".$DownloadUpdateArray[$_REQUEST['dw_code']][1]);
> > readfile($total); --snip--
> >
> > --snip-- [21-Jul-2003 09:15:33] PHP Fatal error: Maximum execution
> > time of 30 seconds exceeded in D:\<<filepath>>\menu\tech_support.php
> > on line 47 --snip
> >
> > So, how does the php header("content-disposition:attachment;
> > filename='***'") cause the php timeout in the first place, what
> > seem to be the problem?
>
> It doesn't. Your script is taking over 30 seconds to run you will need
> to find out why and where its taking to long or extend your time-out
> setting.
>
> btw, also on the content-disposition, not only will some browsers not
> honor that, they will just use the name of the script as the 'save-as'
> filename.
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


> btw, also on the content-disposition, not only will some browsers not
> honor that, they will just use the name of the script as the 'save-as'
> filename.

That's okay with the 'save as' filename because no one know hte real
filename on the webserver because it is renamed when it is download anyway.

"Curt Zirzow" <curt