|
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-help_at_lists.php.net
Date: Mon Oct 07 2002 - 15:06:10 CDT
php-general Digest 7 Oct 2002 20:06:10 -0000 Issue 1630
Topics (messages 119049 through 119131):
Getting fully qualified host name
119049 by: Spongle
sysvshm examples?
119050 by: Spongle
Signal handling
119051 by: Spongle
Re: formatting / beautifying PHP code
119052 by: Tony Crockford
join() , can do that fast?
119053 by: lallous
119058 by: John W. Holmes
119059 by: lallous
119061 by: Erwin
119062 by: lallous
119065 by: Philipp Lutz
Re: sessions without cookies *or* URLs
119054 by: David T-G
119057 by: David T-G
119060 by: Justin French
119064 by: John W. Holmes
Re: page expires
119055 by: Justin French
119056 by: John W. Holmes
Re: need help for a where clause
119063 by: Philipp Lutz
Doubt on using header and setcookie functions
119066 by: Balaji Ankem
Includes
119067 by: Rick Beckman
119069 by: Andy Woolley
119103 by: Bryan Koschmann - GKT
119106 by: . Edwin
PDF and EPS? How to?
119068 by: Johan Holst Nielsen
Re: PHPDoc?
119070 by: Matt
File download doesn't work with SSL
119071 by: John W. Holmes
119076 by: Rasmus Lerdorf
119091 by: John W. Holmes
119092 by: John W. Holmes
119094 by: Rasmus Lerdorf
119113 by: Rouvas Stathis
119121 by: John W. Holmes
119131 by: Rouvas Stathis
Using '/' instead of '?' in url querystring
119072 by: Kenni Graversen
119073 by: Johan Holst Nielsen
119079 by: Nicole Lallande
119085 by: Kenni Graversen
Re: Does anyone knows File Maker
119074 by: Andrew Hill
Re: what is the best way to handle connectivity
119075 by: salamander
119084 by: Jeff Bluemel
Re: recent encrpyt decrypt code... (problems)
119077 by: Scott Fletcher
119080 by: Scott Fletcher
Prevent certain cachingheaders sent by sessionssytem
119078 by: Eric Persson
quert problems
119081 by: Kurth Bemis (List Monkey)
119082 by: Phillip Erskine
119083 by: Stuart Dallas
running slow on Win2k
119086 by: Support . Fourthrealm.com
119087 by: Gerard Samuel
119088 by: . Edwin
119090 by: Support . Fourthrealm.com
119102 by: . Edwin
Re: session & cookies
119089 by: Scott Fletcher
eregi_replace help
119093 by: Jennifer Swofford
119095 by: Jennifer Swofford
119099 by: Marco Tabini
parsing variables through webpages
119096 by: Edgard Berendsen
119101 by: Marco Tabini
PHP & Informix & Win
119097 by: Juraj Hasko
MAIL taking 60 seconds to send... (too long)
119098 by: Negretti, John (CCI-San Diego)
119100 by: Marco Tabini
119104 by: . Edwin
119105 by: Brad Pauly
uploading files
119107 by: Donahue Ben
119109 by: Jason Young
119110 by: Kevin Stone
119111 by: John W. Holmes
Source files (.phps) cutting off prematurely
119108 by: Jason Young
Chat with php
119112 by: Oliver Witt
119114 by: Robert Cummings
119115 by: Marco Tabini
119116 by: Oliver Witt
119117 by: Brad Dameron
119118 by: Marco Tabini
119120 by: Oliver Witt
119123 by: Marco Tabini
119125 by: Robert Cummings
119126 by: Oliver Witt
Sockets
119119 by: Asmodean
119122 by: Marco Tabini
edit simple text file
119124 by: Hitesh Aidasani
Re: Chat with php]
119127 by: Marco Tabini
119129 by: Oliver Witt
Grabbing auto_increment during insert?
119128 by: Jason Young
119130 by: Marco Tabini
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I need to get the fully qualified host name of the local machine, like
"server.somewhere.com". Sounds simple, right? Seems not.
I'm running a CLI script in PHP 4.3-cvs (on OpenBSD) so I have no HTTP
or other global vars to look at, and it doesn't seem to be lying about
in my environment (not that I want to rely on that anyway).
The posix_uname command doesn't include the domain on non-GNU OSs. I
can get the hostname, but not the domain. Can I get it through some
other PHP command?
I'd really prefer not to resort to platform-specifics like rummaging in
/etc and parsing config files or doing something silly like a reverse
DNS lookup...
On some OS, this will give me the hostname:
$hostname = `/bin/hostname`;
However, it doesn't give me the domain, and it's highly platform
specific (i.e. it won't work on Win).
This seems like a pretty fundamental function that should be a
built-in, but it doesn't seem to be possible to do this in a
platform-independent way.
Have I missed some php_fqdn() function?
Any better ideas?
attached mail follows:
Can anyone point me at some examples of using sysv shared memory,
particularly for passing values between a mod_php script and a PHP CLI
process?
attached mail follows:
Is signal handling broken in PHP 4.3-cvs? I've set up some handlers as
per the docs, but nothing happens when I send appropriate signals.
attached mail follows:
> Is there a utility that formats / beautifies PHP code like
> indent does for C
> code?
something like this?
http://tools.phpedit.net/phpCodeBeautifier/
HTH
Tony
attached mail follows:
Hello,
I have:
$x = array('str1','str2','str3');
I want to convert that array to a valid javascript syntax as:
var x = ['str1','str2','str3']
I can do this in PHP:
echo sprintf("x=[%s]", join(',', $x));
but that would produce:
x = [str1, str2, str3]
is there is a fast way (other than doing a loop) to have join put quote
around each array value before joining? so final result looks like:
['str1','str2',...
Thanks,
Elias
attached mail follows:
> -----Original Message-----
> From: lallous [mailto:phplist
lgwm.org]
> Sent: Monday, October 07, 2002 6:09 AM
> To: php-general
lists.php.net
> Subject: [PHP] join() , can do that fast?
>
> Hello,
>
>
> I have:
> $x = array('str1','str2','str3');
>
> I want to convert that array to a valid javascript syntax as:
>
> var x = ['str1','str2','str3']
>
> I can do this in PHP:
>
> echo sprintf("x=[%s]", join(',', $x));
echo sprintf("x=['%s']", join("','", $x));
> but that would produce:
> x = [str1, str2, str3]
>
> is there is a fast way (other than doing a loop) to have join put
quote
> around each array value before joining? so final result looks like:
> ['str1','str2',...
---John Holmes...
attached mail follows:
John, what you said would simply produce:
var x = ['str1,str2,str3']
and not as I want:
var x = ['str1','str2','str3']
Elias,
"John W. Holmes" <holmes072000
charter.net> wrote in message
news:002101c26de2$982bf7d0$7c02a8c0
coconut...
>
>
> > -----Original Message-----
> > From: lallous [mailto:phplist
lgwm.org]
> > Sent: Monday, October 07, 2002 6:09 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] join() , can do that fast?
> >
> > Hello,
> >
> >
> > I have:
> > $x = array('str1','str2','str3');
> >
> > I want to convert that array to a valid javascript syntax as:
> >
> > var x = ['str1','str2','str3']
> >
> > I can do this in PHP:
> >
> > echo sprintf("x=[%s]", join(',', $x));
>
> echo sprintf("x=['%s']", join("','", $x));
>
> > but that would produce:
> > x = [str1, str2, str3]
> >
> > is there is a fast way (other than doing a loop) to have join put
> quote
> > around each array value before joining? so final result looks like:
> > ['str1','str2',...
>
> ---John Holmes...
>
>
attached mail follows:
Lallous wrote:
> John, what you said would simply produce:
> var x = ['str1,str2,str3']
> and not as I want:
> var x = ['str1','str2','str3']
Elias,
did you actually tried that? Because it does produce what you want...
<?
$x = Array( 'str1', 'str2', 'str3' );
echo sprintf("x=['%s']", join("','", $x));
?>
produces:
x=['str1','str2','str3']
Grtz Erwin
attached mail follows:
Thanks John,
sorry I didn't see the new join()'s parameters you provided, I only noticed
the new '%s' .
Elias,
attached mail follows:
Read closely ! There are extra apostrophes inside the quotes !!
Phil
"Lallous" <phplist
lgwm.org> schrieb im Newsbeitrag
news:20021007093026.34229.qmail
pb1.pair.com...
> John, what you said would simply produce:
> var x = ['str1,str2,str3']
> and not as I want:
> var x = ['str1','str2','str3']
>
>
> Elias,
>
> "John W. Holmes" <holmes072000
charter.net> wrote in message
> news:002101c26de2$982bf7d0$7c02a8c0
coconut...
> >
> >
> > > -----Original Message-----
> > > From: lallous [mailto:phplist
lgwm.org]
> > > Sent: Monday, October 07, 2002 6:09 AM
> > > To: php-general
lists.php.net
> > > Subject: [PHP] join() , can do that fast?
> > >
> > > Hello,
> > >
> > >
> > > I have:
> > > $x = array('str1','str2','str3');
> > >
> > > I want to convert that array to a valid javascript syntax as:
> > >
> > > var x = ['str1','str2','str3']
> > >
> > > I can do this in PHP:
> > >
> > > echo sprintf("x=[%s]", join(',', $x));
> >
> > echo sprintf("x=['%s']", join("','", $x));
> >
> > > but that would produce:
> > > x = [str1, str2, str3]
> > >
> > > is there is a fast way (other than doing a loop) to have join put
> > quote
> > > around each array value before joining? so final result looks like:
> > > ['str1','str2',...
> >
> > ---John Holmes...
> >
> >
>
>
attached mail follows:
John, et al --
...and then John W. Holmes said...
%
% You can pass the session ID in a form, too. Just use POST, and make it a
% hidden element passed to the next page.
Yeah, I figured that.
%
% <input type="hidden" name="PHPSESSID" value="<?=$PHPSESSID?>">
%
% It's no different than passing it in the URL. I hope you're not thinking
Except the URL is cleaner :-)
% that it's more secure by doing it this way. Either way the data is
% coming from the user and it can't be trusted and it can be modified.
Agreed.
%
% I don't know what this phobia is about passing something in the URL...
First, it's just plain cluttered :-) Second, though, it would be nice to
not put the user's password right in the URL to then hang out in his
browser goto cache, so we have to change *sometthing*, and if we can
clean up the URL while we're at it that would be nice.
%
% ---John Holmes...
Thanks & HAND
:-D
-- David T-G * It's easier to fight for one's principles (play) davidtgjustpickone.org * than to live up to them. -- fortune cookie (work) davidtgwork
justpickone.org http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE9oVBgGb7uCXufRwARArRYAJ9oqQDO+/HV7vcdyTEMHclM20k5DQCg2wS/ 4qHaZ/FqCtc1ETmJ6lCbRaY= =/FGD -----END PGP SIGNATURE-----
attached mail follows:
Justin, et al --
...and then Justin French said...
%
% on 07/10/02 11:32 AM, David T-G (davidtg-php
justpickone.org) wrote:
%
% > It's a start; it confirms some of what I think I understand about
% > sessions. Now if only I can get the session ID out of the URL without
% > using any cookies... Any ideas, anyone?
%
%
% I Thought I made it clear, but I'll try again :)
Thanks :-)
% % You have three options for maintaining state: % % - Cookies % - URL % - POSTed forms
OK. I was afraid of that...
% % The most common method is plain cookies. But if you want guaranteed state,
Sure, but I know that cookies won't work, so that rules them out.
% then URL is the answer. My main problem with the URL method is that it % requires the writer(s) to be careful when typing links... ensuring that they
Exactly. It's cluttered and you have to be sure to get it right if you're typing it in.
% have the session ID in them. Impossible for a CMS. The answer is % enabel_trans_sid.
Well, sorta :-)
% % More and more hosts are compiling with enable_trans_sid... what this does % is: attempt to pass the SID around in a cookie. If this fails, it will
Right.
% re-write any relative URLs in your pages to include the session ID... it's
So I can code without having to put the ID on the URLs myself? So the "transparent"-ness is for the programmer? Well, I do like that...
% the best of both worlds... transparent cookies if possible, otherwise the % SID is passed around in a URL.
Right.
% % % So, this rules out a complaint about complicated URLs, because you don't % have to type them.
I may not have to type it as a programmer, but the user might have to type it as a surfer.
% % % I urge you to look around all the big sites... if they need to maintain % state (a session) they do so with URLs... amazon.com, whatever -- they all % do it.
Yeah, I know.
% % Why do you not wish to use URLs?
Because they're cluttered and it puts the session ID also in the user's goto cache.
% % % Justin
Thanks & HAND
:-D
-- David T-G * It's easier to fight for one's principles (play) davidtgjustpickone.org * than to live up to them. -- fortune cookie (work) davidtgwork
justpickone.org http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE9oVFTGb7uCXufRwARAhMIAJwIuIa5/rGg4zT2VIdfhGlQ9kkgDwCeO1un ubq3a+SBDEfYM+3Sy9I2D5U= =0ydB -----END PGP SIGNATURE-----
attached mail follows:
on 07/10/02 7:18 PM, David T-G (davidtg-php
justpickone.org) wrote:
> % re-write any relative URLs in your pages to include the session ID... it's > > So I can code without having to put the ID on the URLs myself? So the > "transparent"-ness is for the programmer? Well, I do like that...
Yes.
> % So, this rules out a complaint about complicated URLs, because you don't > % have to type them. > > I may not have to type it as a programmer, but the user might have to > type it as a surfer.
Nope. Why would they type it? The session is managed by PHP's session functions... if 'page.php' has a session_start() call, it will assign a PHPSESSID.
Yes, they may acidently "bookmark" or "favourite" a session ID, and you'd have to read up / test on the implications of this, but given there are only three options, you have to work through them.
If they work for amazon, they can work for you... If you rule out cookies and POST, then guess what you're left with :)
Justin
attached mail follows:
> % The most common method is plain cookies. But if you want guaranteed > state, > > Sure, but I know that cookies won't work, so that rules them out.
Won't work, or you don't want to use them?
> % So, this rules out a complaint about complicated URLs, because you don't > % have to type them. > > I may not have to type it as a programmer, but the user might have to > type it as a surfer.
Why would the user have to type in a URL with a session id? Your session ids are only good while the user is active and they will expire after a certain amount of time.
> % Why do you not wish to use URLs? > > Because they're cluttered and it puts the session ID also in the user's > goto cache.
Again, why does that matter because that ID is only good while the user is active. When they log out, it's worthless, or after a certain amount of inactive time, it's worthless...
---John Holmes...
attached mail follows:
It's a browser issue, not a PHP issue to the best of my knowledge.
Justin
on 07/10/02 5:47 PM, Wilbert Enserink (wilbert
pdd.nl) wrote:
> Hi all
>
>
> I'm using a lot of php in my website. Especially forms. but Aftre a form
> submit I get this message from IE that the page is expired and I have to push
> Refresh. Does anybody know why this is happening and is there a way to avoid
> this message??
>
> thx. Wilbert
>
>
> Warning: Page has Expired
> The page you requested was created using information you submitted in a form.
> This page is no longer available. As a security precaution, Internet Explorer
> does not automatically resubmit your information for you.
>
> To resubmit your information and view this Web page, click the Refresh button.
>
> -------------------------
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> info
pdd.nl
> -------------------------
attached mail follows:
Use GET instead of POST. It's a browser issue and it's been discussed on here plenty of times. Do a search.
---John Holmes...
> -----Original Message-----
> From: Wilbert Enserink [mailto:wilbert
pdd.nl]
> Sent: Monday, October 07, 2002 3:48 AM
> To: php-general
lists.php.net
> Subject: [PHP] page expires
>
> Hi all
>
>
> I'm using a lot of php in my website. Especially forms. but Aftre a
form
> submit I get this message from IE that the page is expired and I have
to
> push Refresh. Does anybody know why this is happening and is there a
way
> to avoid this message??
>
> thx. Wilbert
>
>
> Warning: Page has Expired
> The page you requested was created using information you submitted in
a
> form. This page is no longer available. As a security precaution,
Internet
> Explorer does not automatically resubmit your information for you.
>
> To resubmit your information and view this Web page, click the Refresh
> button.
>
> -------------------------
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> info
pdd.nl
> -------------------------
attached mail follows:
If you are using MySQL you may want to look at the CASE statement in the "Control flow functions for use with SELECT Statements" it would look like SELECT CASE A.Afn WHEN 1 THEN B.Bfn1 WHEN 2 THEN B.Bfn2 WHEN 3 THEN B.Bfn3 FROM A,B IN MySQL Hope That Helps.. Phil
"Alex Shi" <chpshi
eol.ca> schrieb im Newsbeitrag
news:20021006234217.96557.qmail
pb1.pair.com...
> Thanks! This is what I need!
>
> Alex Shi
>
>
>
> "Sascha Cunz" <Sascha
GaNoAn.org> ??????
> :200210070121.21657.Sascha
GaNoAn.org...
> A solution on that depends strongly on how much values A.Afn would take.
For
> 3, it's still okay. But i wouldn't do more.
>
> Against what shall the B.Bfn* be checked? What Data do you want to be
> returned
> from the query?
>
> try:
>
> SELECT ### FROM A, B WHERE
> ((A.Afn=1) AND (B.Bfn1 = ...)) OR
> ((A.Afn=2) AND (B.Bfn2 = ...)) OR
> ((A.Afn=3) AND (B.Bfn3 = ...))
>
> where you should replace ### with things you want to select and ... with
the
> things you want to check.
>
> On more than 3 different values for A.Afn, you should use a more
normalized
> version of B.
>
> i.e.: B contains only one Bfn field and a Reference to A.Afn.
> -> SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ...
>
> Sascha
>
> Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi:
> > Hi,
> >
> > I need a where clause in following situation:
> >
> > Say I want to query two tables: A and B. In table A there is field
> > Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want
> > to do a query, in which the where clause must do these things:
> >
> > if A.Afn=1, then check value of B.Bfn1;
> > if A.Afn=2, then check value of B.Bfn2;
> > if A.Afn=3, then check value of B.Bfn3.
> >
> > So how can I create such a where clause to do this?
> > Thanks in advance!
> >
> > Alex Shi
>
attached mail follows:
Hi
How to set cookies using header() function and using setcookie function?
Setcookie('testcookie','Balaji',time()+3600,'/','10.145.0.1',1);
If I want to write same thing with header function how can I do that?
Is it like
header("Set-Cookie: name=testcookie,value=Balaji,domain=10.145.0.1,secure=1")
or
header("Set-Cookie: testcookie,Balaji,10.145.0.1,1")
Thanks in Advance Balaji
- text/plain attachment: Wipro_Disclaimer.txt
attached mail follows:
I'm wanting to use PHP to make updating an entire site easier by using include() [I think that's the function] to include navigation bars, notices, etc. on multiple pages. What's the best way to do that, and is it possible to keep the included files from being indexed/viewed on their own (possibly by password protecting [htaccess] the directory they are in)? Thanks in advance for any help.
-- Kyrie Eleison, Rick Beckman www.spiritsword.com/
attached mail follows:
Hi,
The best way to do this (it's only my opinion, I'm sure there are many other ways but this way works for me) is to create a .php file and fill it with your most commonly used functions. You can use a .inc file, which is probably recommended, but you will need to tell the server not to display this file. You can do this in php.ini but it will complicate things right now.
For a header, use a function name like drawHeader() or something and then put all your database connection, navigation, page formatting etc in that function.
Then, on all your pages, you just need to add the following at the top.
<? include("yourincfile.php"); drawHeader(); ?>
This will draw you header the same on all pages that you include the above with. If someone navigates to yourincudefile.php all they should see is an empty page because all the code is inside functions.
Hope this helps Andy.
----- Original Message -----
From: "Rick Beckman" <romans1423
hotmail.com>
To: <php-general
lists.php.net>
Sent: Monday, October 07, 2002 11:12 AM
Subject: [PHP] Includes
> I'm wanting to use PHP to make updating an entire site easier by using > include() [I think that's the function] to include navigation bars, notices, > etc. on multiple pages. What's the best way to do that, and is it possible > to keep the included files from being indexed/viewed on their own (possibly > by password protecting [htaccess] the directory they are in)? Thanks in > advance for any help. > > -- > Kyrie Eleison, > Rick Beckman > www.spiritsword.com/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Yes that is the proper usage.
Maybe you could check the referrer and only display if from the webserver? I can't remember if a .htaccess would work with that sort of thing, as password protecting would of course require a password :) Unless this isn't a public site and you want a password.
Bryan
On Mon, 7 Oct 2002, Rick Beckman wrote:
|I'm wanting to use PHP to make updating an entire site easier by using |include() [I think that's the function] to include navigation bars, notices, |etc. on multiple pages. What's the best way to do that, and is it possible |to keep the included files from being indexed/viewed on their own (possibly |by password protecting [htaccess] the directory they are in)? Thanks in |advance for any help. | |
attached mail follows:
Yes, you can use .htacess for that purpose though you don't need to password protect the folder. I'm sure if you check the archives you'll find a way to do it.
Something like this: (Thanks to Justin)
http://marc.theaimsgroup.com/?l=php-general&m=103266066416399&w=2
- E
On Tuesday, October 8, 2002 1:40 AM Bryan Koschmann - GKT wrote: > Yes that is the proper usage. > > Maybe you could check the referrer and only display if from the webserver? > I can't remember if a .htaccess would work with that sort of thing, as > password protecting would of course require a password :) Unless this > isn't a public site and you want a password. > > Bryan > > > On Mon, 7 Oct 2002, Rick Beckman wrote: > > |I'm wanting to use PHP to make updating an entire site easier by using > |include() [I think that's the function] to include navigation bars, notices, > |etc. on multiple pages. What's the best way to do that, and is it possible > |to keep the included files from being indexed/viewed on their own (possibly > |by password protecting [htaccess] the directory they are in)? Thanks in > |advance for any help. > | > | > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi people,
Well, I have a little problem... i tries to include an EPS file in a PDF file (using PDFLib). But I cant find any function that can help me regarding this problem? Anyone have a solution?
I have to add multiply EPS file to all PDF pages?
Anyone can help me? Maybe with some tutorials or codesamples?
Regards, Johan
attached mail follows:
I know of the following...
www.phpdoc.de - used by PEAR, scattered documentation http://phpdocu.sourceforge.net - lots more documentation, hate the framed output http://www.ez.no/article/articlestatic/35/1/42/ - eZ phpdoc, from the people who make the eZ CMS
I'm interested in hearing from anyone who uses these - how widely are they used/supported, how buggy, how well do they follow JavaDoc?
"Scott Houseman" <scotth
jamwarehouse.com> wrote in message
news:3D99B267.5030604
jamwarehouse.com...
> www.phpdoc.de is one I know of.
> I'm not surewhat the current development activity is, but I think it's
still in beta.
> The front page states 'Last update: 2000/12/03' - so I don't know what's
happening there.
>
> Regards
>
> Scott
>
> On 10/1/2002 4:18 PM, Francis wrote:
> > Is their any comparable tool/util whatever to automaticly create
> > documentation from your PHP Code (like java's JavaDoc)?
> >
> >
> >
>
>
> --
> //--------------------------------------------//
> // Scott Houseman //
> // Jam Warehouse http://www.jamwarehouse.com/ //
> // Smart Business Innovation //
> // +27 21 4477440 / +27 82 4918021 //
> //--------------------------------------------//
>
attached mail follows:
Everyone,
I've had a simple download script working where a user would click on a link and the program would send word or excel headers instead of HTML. The file would then be opened in the appropriate program and the user could save/edit it.
Now that we've loaded everything under SSL, it doesn't work.
Here are the headers I send:
header("content-type: application/vnd.ms-excel; name='excel'"); header("content-disposition: attachment; filename=" . $filename . ".xls");
Now, the pages in question are just regular HTML tables. If there is a export2=excel in the URL, then these two additional headers will be sent. The dialog to save/open the file pops up, but when you try to open/save the file, IE says it cannot be found. If I put in a echo before these two headers (or comment them out), the page is shown correctly as HTML, so the code is correct.
Are there any special headers I have to send to enable this file download while under SSL, or is it something else I'm overlooking?
Thanks for any help.
---John Holmes...
attached mail follows:
Date: Mon, 7 Oct 2002 07:08:02 -0700 (PDT) From: Rasmus Lerdorf <rasmus
php.net>
To: "1LT John W. Holmes" <holmes072000
charter.net>
cc: php-general
lists.php.net
Message-ID: <Pine.LNX.4.44.0210070707500.32660-100000
www.lerdorf.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: Re: [PHP] File download doesn't work with SSL
Does it work with a different browser? Smells like an IE bug to me.
On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> Everyone, > > I've had a simple download script working where a user would click on a link and the program would send word or excel headers instead of HTML. The file would then be opened in the appropriate program and the user could save/edit it. > > Now that we've loaded everything under SSL, it doesn't work. > > Here are the headers I send: > > header("content-type: application/vnd.ms-excel; name='excel'"); > header("content-disposition: attachment; filename=" . $filename . ".xls"); > > Now, the pages in question are just regular HTML tables. If there is a export2cel in the URL, then these two additional headers will be sent. The dialog to save/open the file pops up, but when you try to open/save the file, IE says it cannot be found. If I put in a echo before these two headers (or comment them out), the page is shown correctly as HTML, so the code is correct. > > Are there any special headers I have to send to enable this file download while under SSL, or is it something else I'm overlooking? > > Thanks for any help. > > ---John Holmes...
attached mail follows:
> Does it work with a different browser? Smells like an IE bug to me.
Doesn't everything with IE smell like a bug?
Anyhow, it works fine with Netscape. Opera will not open the file, but will save-as just fine when prompted.
I'm off to search MS...<deity of choice> help me...
---John Holmes...
> > Everyone, > > > > I've had a simple download script working where a user would click on a link and the program would send word or excel headers instead of HTML. The file would then be opened in the appropriate program and the user could save/edit it. > > > > Now that we've loaded everything under SSL, it doesn't work. > > > > Here are the headers I send: > > > > header("content-type: application/vnd.ms-excel; name='excel'"); > > header("content-disposition: attachment; filename=" . $filename . ".xls"); > > > > Now, the pages in question are just regular HTML tables. If there is a export2=excel in the URL, then these two additional headers will be sent. The dialog to save/open the file pops up, but when you try to open/save the file, IE says it cannot be found. If I put in a echo before these two headers (or comment them out), the page is shown correctly as HTML, so the code is correct. > > > > Are there any special headers I have to send to enable this file download while under SSL, or is it something else I'm overlooking? > > > > Thanks for any help. > > > > ---John Holmes... >
attached mail follows:
I believe in miracles. I have searched Microsoft and the first link was actually related to my problem...
Okay, I found an IE issue where downloads over SSL will choke when you send a no-cache header. It says to use a no-store cache-control header, instead. I tried this:
header("cache-control: no-store"); header("content-type: application/vnd.ms-excel; name='excel'"); header("content-disposition: attachment; filename=" . $filename . ".xls");
and I'm still getting the same thing. Is the no-cache cache-control header sent automatically by PHP at all? I don't have one set explicitly in my code.
Any help is appreciated.
---John Holmes...
----- Original Message -----
From: "Rasmus Lerdorf" <rasmus
php.net>
To: "1LT John W. Holmes" <holmes072000
charter.net>
Cc: <php-general
lists.php.net>
Sent: Monday, October 07, 2002 10:08 AM
Subject: Re: [PHP] File download doesn't work with SSL
> Does it work with a different browser? Smells like an IE bug to me. > > On Mon, 7 Oct 2002, 1LT John W. Holmes wrote: > > > Everyone, > > > > I've had a simple download script working where a user would click on a link and the program would send word or excel headers instead of HTML. The file would then be opened in the appropriate program and the user could save/edit it. > > > > Now that we've loaded everything under SSL, it doesn't work. > > > > Here are the headers I send: > > > > header("content-type: application/vnd.ms-excel; name='excel'"); > > header("content-disposition: attachment; filename=" . $filename . ".xls"); > > > > Now, the pages in question are just regular HTML tables. If there is a export2=excel in the URL, then these two additional headers will be sent. The dialog to save/open the file pops up, but when you try to open/save the file, IE says it cannot be found. If I put in a echo before these two headers (or comment them out), the page is shown correctly as HTML, so the code is correct. > > > > Are there any special headers I have to send to enable this file download while under SSL, or is it something else I'm overlooking? > > > > Thanks for any help. > > > > ---John Holmes... >
attached mail follows:
Nope, PHP does not send that.
On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> I believe in miracles. I have searched Microsoft and the first link was
> actually related to my problem...
>
> Okay, I found an IE issue where downloads over SSL will choke when you send
> a no-cache header. It says to use a no-store cache-control header, instead.
> I tried this:
>
> header("cache-control: no-store");
> header("content-type: application/vnd.ms-excel; name='excel'");
> header("content-disposition: attachment; filename=" . $filename .
> ".xls");
>
> and I'm still getting the same thing. Is the no-cache cache-control header
> sent automatically by PHP at all? I don't have one set explicitly in my
> code.
>
> Any help is appreciated.
>
> ---John Holmes...
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <rasmus
php.net>
> To: "1LT John W. Holmes" <holmes072000
charter.net>
> Cc: <php-general
lists.php.net>
> Sent: Monday, October 07, 2002 10:08 AM
> Subject: Re: [PHP] File download doesn't work with SSL
>
>
> > Does it work with a different browser? Smells like an IE bug to me.
> >
> > On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> >
> > > Everyone,
> > >
> > > I've had a simple download script working where a user would click on a
> link and the program would send word or excel headers instead of HTML. The
> file would then be opened in the appropriate program and the user could
> save/edit it.
> > >
> > > Now that we've loaded everything under SSL, it doesn't work.
> > >
> > > Here are the headers I send:
> > >
> > > header("content-type: application/vnd.ms-excel; name='excel'");
> > > header("content-disposition: attachment; filename=" . $filename .
> ".xls");
> > >
> > > Now, the pages in question are just regular HTML tables. If there is a
> export2=excel in the URL, then these two additional headers will be sent.
> The dialog to save/open the file pops up, but when you try to open/save the
> file, IE says it cannot be found. If I put in a echo before these two
> headers (or comment them out), the page is shown correctly as HTML, so the
> code is correct.
> > >
> > > Are there any special headers I have to send to enable this file
> download while under SSL, or is it something else I'm overlooking?
> > >
> > > Thanks for any help.
> > >
> > > ---John Holmes...
> >
>
attached mail follows:
John,
problem is broken HTTP/1.1 implementation of Internet Exploder. Make your server downgrade to HHTP/1.0. e.g. for apache:
<example> <IfModule mod_setenvif.c>
# # The following directives modify normal HTTP response behavior. # The first directive disables keepalive for Netscape 2.x and browsers that # spoof it. There are known problems with these browser implementations. # The second directive is for Microsoft Internet Explorer 4.0b2 # which has a broken HTTP/1.1 implementation and does not properly # support keepalive when it is used on 301 or 302 (redirect) responses. # BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE" nokeepalive downgrade-1.0 force-response-1.0
# # The following directive disables HTTP/1.1 responses to browsers which # are in violation of the HTTP/1.0 spec by not being able to grok a # basic 1.1 response. # BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule> </example>
copy BrowserMatch line in SSL virtual server section too.
-Stathis.
Rasmus Lerdorf wrote:
>
> Nope, PHP does not send that.
>
> On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
>
> > I believe in miracles. I have searched Microsoft and the first link was
> > actually related to my problem...
> >
> > Okay, I found an IE issue where downloads over SSL will choke when you send
> > a no-cache header. It says to use a no-store cache-control header, instead.
> > I tried this:
> >
> > header("cache-control: no-store");
> > header("content-type: application/vnd.ms-excel; name='excel'");
> > header("content-disposition: attachment; filename=" . $filename .
> > ".xls");
> >
> > and I'm still getting the same thing. Is the no-cache cache-control header
> > sent automatically by PHP at all? I don't have one set explicitly in my
> > code.
> >
> > Any help is appreciated.
> >
> > ---John Holmes...
> >
> > ----- Original Message -----
> > From: "Rasmus Lerdorf" <rasmus
php.net>
> > To: "1LT John W. Holmes" <holmes072000
charter.net>
> > Cc: <php-general
lists.php.net>
> > Sent: Monday, October 07, 2002 10:08 AM
> > Subject: Re: [PHP] File download doesn't work with SSL
> >
> >
> > > Does it work with a different browser? Smells like an IE bug to me.
> > >
> > > On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> > >
> > > > Everyone,
> > > >
> > > > I've had a simple download script working where a user would click on a
> > link and the program would send word or excel headers instead of HTML. The
> > file would then be opened in the appropriate program and the user could
> > save/edit it.
> > > >
> > > > Now that we've loaded everything under SSL, it doesn't work.
> > > >
> > > > Here are the headers I send:
> > > >
> > > > header("content-type: application/vnd.ms-excel; name='excel'");
> > > > header("content-disposition: attachment; filename=" . $filename .
> > ".xls");
> > > >
> > > > Now, the pages in question are just regular HTML tables. If there is a
> > export2=excel in the URL, then these two additional headers will be sent.
> > The dialog to save/open the file pops up, but when you try to open/save the
> > file, IE says it cannot be found. If I put in a echo before these two
> > headers (or comment them out), the page is shown correctly as HTML, so the
> > code is correct.
> > > >
> > > > Are there any special headers I have to send to enable this file
> > download while under SSL, or is it something else I'm overlooking?
> > > >
> > > > Thanks for any help.
> > > >
> > > > ---John Holmes...
> > >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- Rouvas Stathis rouvasdi.uoa.gr http://www.di.uoa.gr/~rouvas
attached mail follows:
Stathis,
Thanks for the tip. Any idea how to fix IIS regarding this issue?
---John Holmes...
----- Original Message -----
From: "Rouvas Stathis" <rouvas
di.uoa.gr>
To: <php-general
lists.php.net>
Cc: "1LT John W. Holmes" <holmes072000
charter.net>
Sent: Monday, October 07, 2002 2:00 PM
Subject: Re: [PHP] File download doesn't work with SSL
> John,
>
> problem is broken HTTP/1.1 implementation of Internet Exploder.
> Make your server downgrade to HHTP/1.0.
> e.g. for apache:
>
> <example>
> <IfModule mod_setenvif.c>
>
> #
> # The following directives modify normal HTTP response behavior.
> # The first directive disables keepalive for Netscape 2.x and
> browsers that
> # spoof it. There are known problems with these browser
> implementations.
> # The second directive is for Microsoft Internet Explorer 4.0b2
> # which has a broken HTTP/1.1 implementation and does not properly
> # support keepalive when it is used on 301 or 302 (redirect)
> responses.
> #
> BrowserMatch "Mozilla/2" nokeepalive
> BrowserMatch "MSIE" nokeepalive downgrade-1.0 force-response-1.0
>
> #
> # The following directive disables HTTP/1.1 responses to browsers
> which
> # are in violation of the HTTP/1.0 spec by not being able to grok a
> # basic 1.1 response.
> #
> BrowserMatch "RealPlayer 4\.0" force-response-1.0
> BrowserMatch "Java/1\.0" force-response-1.0
> BrowserMatch "JDK/1\.0" force-response-1.0
>
> </IfModule>
> </example>
>
> copy BrowserMatch line in SSL virtual server section too.
>
> -Stathis.
>
> Rasmus Lerdorf wrote:
> >
> > Nope, PHP does not send that.
> >
> > On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> >
> > > I believe in miracles. I have searched Microsoft and the first link
was
> > > actually related to my problem...
> > >
> > > Okay, I found an IE issue where downloads over SSL will choke when you
send
> > > a no-cache header. It says to use a no-store cache-control header,
instead.
> > > I tried this:
> > >
> > > header("cache-control: no-store");
> > > header("content-type: application/vnd.ms-excel; name='excel'");
> > > header("content-disposition: attachment; filename=" . $filename .
> > > ".xls");
> > >
> > > and I'm still getting the same thing. Is the no-cache cache-control
header
> > > sent automatically by PHP at all? I don't have one set explicitly in
my
> > > code.
> > >
> > > Any help is appreciated.
> > >
> > > ---John Holmes...
> > >
> > > ----- Original Message -----
> > > From: "Rasmus Lerdorf" <rasmus
php.net>
> > > To: "1LT John W. Holmes" <holmes072000
charter.net>
> > > Cc: <php-general
lists.php.net>
> > > Sent: Monday, October 07, 2002 10:08 AM
> > > Subject: Re: [PHP] File download doesn't work with SSL
> > >
> > >
> > > > Does it work with a different browser? Smells like an IE bug to me.
> > > >
> > > > On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> > > >
> > > > > Everyone,
> > > > >
> > > > > I've had a simple download script working where a user would click
on a
> > > link and the program would send word or excel headers instead of HTML.
The
> > > file would then be opened in the appropriate program and the user
could
> > > save/edit it.
> > > > >
> > > > > Now that we've loaded everything under SSL, it doesn't work.
> > > > >
> > > > > Here are the headers I send:
> > > > >
> > > > > header("content-type: application/vnd.ms-excel;
name='excel'");
> > > > > header("content-disposition: attachment; filename=" .
$filename .
> > > ".xls");
> > > > >
> > > > > Now, the pages in question are just regular HTML tables. If there
is a
> > > export2=excel in the URL, then these two additional headers will be
sent.
> > > The dialog to save/open the file pops up, but when you try to
open/save the
> > > file, IE says it cannot be found. If I put in a echo before these two
> > > headers (or comment them out), the page is shown correctly as HTML, so
the
> > > code is correct.
> > > > >
> > > > > Are there any special headers I have to send to enable this file
> > > download while under SSL, or is it something else I'm overlooking?
> > > > >
> > > > > Thanks for any help.
> > > > >
> > > > > ---John Holmes...
> > > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> Rouvas Stathis
> rouvas
di.uoa.gr
> http://www.di.uoa.gr/~rouvas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
John,
sorry, don't know zip about IIS. I got the info from <URL:http://www.squirrelmail.org/wiki/InternetExplorerVersusSSL> though. Maybe they have more to say...
-Stathis.
"1LT John W. Holmes" wrote:
>
> Stathis,
>
> Thanks for the tip. Any idea how to fix IIS regarding this issue?
>
> ---John Holmes...
>
> ----- Original Message -----
> From: "Rouvas Stathis" <rouvas
di.uoa.gr>
> To: <php-general
lists.php.net>
> Cc: "1LT John W. Holmes" <holmes072000
charter.net>
> Sent: Monday, October 07, 2002 2:00 PM
> Subject: Re: [PHP] File download doesn't work with SSL
>
> > John,
> >
> > problem is broken HTTP/1.1 implementation of Internet Exploder.
> > Make your server downgrade to HHTP/1.0.
> > e.g. for apache:
> >
> > <example>
> > <IfModule mod_setenvif.c>
> >
> > #
> > # The following directives modify normal HTTP response behavior.
> > # The first directive disables keepalive for Netscape 2.x and
> > browsers that
> > # spoof it. There are known problems with these browser
> > implementations.
> > # The second directive is for Microsoft Internet Explorer 4.0b2
> > # which has a broken HTTP/1.1 implementation and does not properly
> > # support keepalive when it is used on 301 or 302 (redirect)
> > responses.
> > #
> > BrowserMatch "Mozilla/2" nokeepalive
> > BrowserMatch "MSIE" nokeepalive downgrade-1.0 force-response-1.0
> >
> > #
> > # The following directive disables HTTP/1.1 responses to browsers
> > which
> > # are in violation of the HTTP/1.0 spec by not being able to grok a
> > # basic 1.1 response.
> > #
> > BrowserMatch "RealPlayer 4\.0" force-response-1.0
> > BrowserMatch "Java/1\.0" force-response-1.0
> > BrowserMatch "JDK/1\.0" force-response-1.0
> >
> > </IfModule>
> > </example>
> >
> > copy BrowserMatch line in SSL virtual server section too.
> >
> > -Stathis.
> >
> > Rasmus Lerdorf wrote:
> > >
> > > Nope, PHP does not send that.
> > >
> > > On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> > >
> > > > I believe in miracles. I have searched Microsoft and the first link
> was
> > > > actually related to my problem...
> > > >
> > > > Okay, I found an IE issue where downloads over SSL will choke when you
> send
> > > > a no-cache header. It says to use a no-store cache-control header,
> instead.
> > > > I tried this:
> > > >
> > > > header("cache-control: no-store");
> > > > header("content-type: application/vnd.ms-excel; name='excel'");
> > > > header("content-disposition: attachment; filename=" . $filename .
> > > > ".xls");
> > > >
> > > > and I'm still getting the same thing. Is the no-cache cache-control
> header
> > > > sent automatically by PHP at all? I don't have one set explicitly in
> my
> > > > code.
> > > >
> > > > Any help is appreciated.
> > > >
> > > > ---John Holmes...
> > > >
> > > > ----- Original Message -----
> > > > From: "Rasmus Lerdorf" <rasmus
php.net>
> > > > To: "1LT John W. Holmes" <holmes072000
charter.net>
> > > > Cc: <php-general
lists.php.net>
> > > > Sent: Monday, October 07, 2002 10:08 AM
> > > > Subject: Re: [PHP] File download doesn't work with SSL
> > > >
> > > >
> > > > > Does it work with a different browser? Smells like an IE bug to me.
> > > > >
> > > > > On Mon, 7 Oct 2002, 1LT John W. Holmes wrote:
> > > > >
> > > > > > Everyone,
> > > > > >
> > > > > > I've had a simple download script working where a user would click
> on a
> > > > link and the program would send word or excel headers instead of HTML.
> The
> > > > file would then be opened in the appropriate program and the user
> could
> > > > save/edit it.
> > > > > >
> > > > > > Now that we've loaded everything under SSL, it doesn't work.
> > > > > >
> > > > > > Here are the headers I send:
> > > > > >
> > > > > > header("content-type: application/vnd.ms-excel;
> name='excel'");
> > > > > > header("content-disposition: attachment; filename=" .
> $filename .
> > > > ".xls");
> > > > > >
> > > > > > Now, the pages in question are just regular HTML tables. If there
> is a
> > > > export2=excel in the URL, then these two additional headers will be
> sent.
> > > > The dialog to save/open the file pops up, but when you try to
> open/save the
> > > > file, IE says it cannot be found. If I put in a echo before these two
> > > > headers (or comment them out), the page is shown correctly as HTML, so
> the
> > > > code is correct.
> > > > > >
> > > > > > Are there any special headers I have to send to enable this file
> > > > download while under SSL, or is it something else I'm overlooking?
> > > > > >
> > > > > > Thanks for any help.
> > > > > >
> > > > > > ---John Holmes...
> > > > >
> > > >
> > >
-- Rouvas Stathis rouvasdi.uoa.gr http://www.di.uoa.gr/~rouvas
attached mail follows:
Hi,
I wonder if any of you have experience, sending variables in the url without using the ? character.
When sending variables this is the normal way to do it: /foo.php?id=12
But I have read that the following URL should work: /foo.php/12/
and then fetch the id in this way: $id = ereg_replace('[^0-9]', '', $PATH_INFO);
I have even seen it in function but the problem is that I can't get it to work on my local apache server. When I try to write /foo.php/12/ I get a '500 Internal Server Error' and in the apache error-log I can read that 'Premature end of script headers: c:/php/php.exe'. Does anyone know what could cause this error and why the url isn't working??
thanks
Kenni Graversen
attached mail follows:
> When sending variables this is the normal way to do it: > /foo.php?id=12 > > But I have read that the following URL should work: > /foo.php/12/ > > and then fetch the id in this way: > $id = ereg_replace('[^0-9]', '', $PATH_INFO); > > I have even seen it in function but the problem is that I can't get it to > work on my local apache server. > When I try to write /foo.php/12/ I get a '500 Internal Server Error' and in > the apache error-log I can read that 'Premature end of script headers: > c:/php/php.exe'. Does anyone know what could cause this error and why the > url isn't working??
Try mod_rewrite to apache... http://httpd.apache.org/docs/mod/mod_rewrite.html Else try http://www.phpbuilder.com/columns/tim20000526.php3
Regards, Johan
attached mail follows:
Kenni,
I asked a similar question several months ago and got a lot of terrific info from the list. First some links:
See this related link:
Q "How can I pass variables to a script in the url like /script/var1/var2?"
http://www.faqts.com/knowledge_base/view.phtml/aid/124
Includes tutorials for doing it in PHP, mod_rewrite and/or mod_mime.
and
Search Engine Friendly URLs with PHP and Apache http://www.evolt.org/article/Search_Engine_Friendly_URLs_with_PHP_and_Ap ache/17/15049/index.html
Search Engine Friendly URLs (Part II) http://www.evolt.org/article/Search_Engine_Friendly_URLs_Part_II/17/1717 1/index.html
and finally:
http://httpd.apache.org/docs/mod/mod_rewrite.html
The approach I used was the Apache web server's mod_rewrite (rewrite engine) and then apply the appropriate rules to an htaccess file. If you have the rewrite engine installed (and loaded in your httpd.conf file), then try the following in your .htaccess file:
RewriteEngine On RewriteRule ^foo\.php(./*) $ http://your domainname.com/foo.php?id=$1 [R]
The '.' is a concactenator in the rules so it must be escaped unless used as such. If you wanted to add an ending forward slash for foo.php/12/ then perhaps use (./*/) HTH,
Nicole PS - many thanks once again to all who helped answer this question for me!
Kenni Graversen wrote:
>Hi, > >I wonder if any of you have experience, sending variables in the url without >using the ? character. > >When sending variables this is the normal way to do it: >/foo.php?id=12 > >But I have read that the following URL should work: >/foo.php/12/ > >and then fetch the id in this way: >$id = ereg_replace('[^0-9]', '', $PATH_INFO); > >I have even seen it in function but the problem is that I can't get it to >work on my local apache server. >When I try to write /foo.php/12/ I get a '500 Internal Server Error' and in >the apache error-log I can read that 'Premature end of script headers: >c:/php/php.exe'. Does anyone know what could cause this error and why the >url isn't working?? > >thanks > >Kenni Graversen > > > > >
-- ######################## Nicole Lallande nicolenmlconsulting.com 760.753.6766 ########################
attached mail follows:
Thanks,
These links will help me out for sure.
regards Kenni
"Nicole Lallande" <nicole
nmlconsulting.com> skrev i en meddelelse
news:3DA19C4C.6050008
nmlconsulting.com...
> Kenni,
>
> I asked a similar question several months ago and got a lot of terrific
> info from the list. First some links:
>
> See this related link:
>
> Q "How can I pass variables to a script in the url
> like /script/var1/var2?"
>
> http://www.faqts.com/knowledge_base/view.phtml/aid/124
>
> Includes tutorials for doing it in PHP, mod_rewrite
> and/or mod_mime.
>
> and
>
>
> Search Engine Friendly URLs with PHP and Apache
> http://www.evolt.org/article/Search_Engine_Friendly_URLs_with_PHP_and_Ap
> ache/17/15049/index.html
>
> Search Engine Friendly URLs (Part II)
> http://www.evolt.org/article/Search_Engine_Friendly_URLs_Part_II/17/1717
> 1/index.html
>
> and finally:
>
> http://httpd.apache.org/docs/mod/mod_rewrite.html
>
>
>
> The approach I used was the Apache web server's mod_rewrite (rewrite
> engine) and then apply the appropriate rules to an htaccess file. If
> you have the rewrite engine installed (and loaded in your httpd.conf
> file), then try the following in your .htaccess file:
>
> RewriteEngine On
> RewriteRule ^foo\.php(./*) $ http://your domainname.com/foo.php?id=$1 [R]
>
> The '.' is a concactenator in the rules so it must be escaped unless
> used as such. If you wanted to add an ending forward slash for
> foo.php/12/ then perhaps use (./*/)
>
> HTH,
>
> Nicole
> PS - many thanks once again to all who helped answer this question for me!
>
> Kenni Graversen wrote:
>
> >Hi,
> >
> >I wonder if any of you have experience, sending variables in the url
without
> >using the ? character.
> >
> >When sending variables this is the normal way to do it:
> >/foo.php?id=12
> >
> >But I have read that the following URL should work:
> >/foo.php/12/
> >
> >and then fetch the id in this way:
> >$id = ereg_replace('[^0-9]', '', $PATH_INFO);
> >
> >I have even seen it in function but the problem is that I can't get it to
> >work on my local apache server.
> >When I try to write /foo.php/12/ I get a '500 Internal Server Error' and
in
> >the apache error-log I can read that 'Premature end of script headers:
> >c:/php/php.exe'. Does anyone know what could cause this error and why the
> >url isn't working??
> >
> >thanks
> >
> >Kenni Graversen
> >
> >
> >
> >
> >
>
> --
> ########################
> Nicole Lallande
> nicole
nmlconsulting.com
> 760.753.6766
> ########################
>
>
>
attached mail follows:
Elliot,
PHP works just fine with ODBC, using the iODBC Driver Manager as per the HOWTO at http://www.iodbc.org. This should work against FMPro under Windows as well.
Best regards, Andrew Hill Director of Technology Evangelism - OpenLink Software Universal Data Access and the Virtuoso Universal Server http://www.openlinksw.com/virtuoso/whatis.htm
On Thursday, October 3, 2002, at 11:23 AM, Webmaster MBTRADINGCO wrote:
> I ran yesterday into a company that wants me to implement a solution > with PHP and File Maker. I don't even know if it is possible, so I was > wondering: > > A) Does anyone has any experience with filemaker? > b) Can PHP save data from internet via ODBC to a database (other than > the ones it supports) in a windows server? > c) Does anyone knows if PHP supports file maker? > > Thanks in advance. > > > Elliot J. Balanza > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
Jeff,
ODBC should work just fine - you can just link --with-iodbc as per the HOWTOs on www.iodbc.org. If you use a native driver than the Informix client needs to be installed on the same box.
Best regards, Andrew Hill Director of Technology Evangelism - OpenLink Software Universal Data Access and the Virtuoso Universal Server http://www.openlinksw.com/virtuoso/whatis.htm
On Saturday, October 5, 2002, at 11:44 PM, Jeff Bluemel wrote:
> I've got informix on a sco open server box, and my webserver has php > 4.2.3 > with apache. I'm wondering what the best way to handle the > connectivity > into the sco box is (not concerned with how difficult this is to > setup, but > rather pure speed) > > do I try to use a native driver? if I use the native driver does > informix > have to be installed on the same box? do I just try to use odbc? > > -- > Jeff Bluemel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
thanks for the FYI... this is what I as assuming the answer was going to be, but I wanted to make sure.
Jeff
"Salamander" <andrew
salamander.net> wrote in message
news:DD7DFEAA-D9FD-11D6-BF91-0003939A1066
salamander.net...
> Jeff,
>
> ODBC should work just fine - you can just link --with-iodbc as per the
> HOWTOs on www.iodbc.org.
> If you use a native driver than the Informix client needs to be
> installed on the same box.
>
> Best regards,
> Andrew Hill
> Director of Technology Evangelism - OpenLink Software
> Universal Data Access and the Virtuoso Universal Server
> http://www.openlinksw.com/virtuoso/whatis.htm
>
>
> On Saturday, October 5, 2002, at 11:44 PM, Jeff Bluemel wrote:
>
> > I've got informix on a sco open server box, and my webserver has php
> > 4.2.3
> > with apache. I'm wondering what the best way to handle the
> > connectivity
> > into the sco box is (not concerned with how difficult this is to
> > setup, but
> > rather pure speed)
> >
> > do I try to use a native driver? if I use the native driver does
> > informix
> > have to be installed on the same box? do I just try to use odbc?
> >
> > --
> > Jeff Bluemel
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
attached mail follows:
You got to be kidding me!!!! I use similar code and a sample of yours and I got just about the same error message as what Jeff Bluemel got. I checked the PHP Info and it showed that I had the libmcrypt accepted but no supported ciphers. Then I posted two seperate unanswered posting until I stumpled onto this.
I did not understand why mcrypt is required along with the libmcrypt. Libmcrypt is just an combination of mcrypt and extra stuffs. The url, php.net/mcrypt said to use libmcrypt and it mentioned of no mcrypt. So, it was no wonder I had problem. Now I know I did not ask the right question in the PHP newsgroup. I am glad to see a solution to this problem. Thank you for the responses and your solution to the problem as it help with Jeff Bluemel, it now helped me too. Thank you!
FletchSOD
P.S. Do I compile mcrypt before libmcrypt or is it the other way around?
"Tom Rogers" <trogers
kwikin.com> wrote in message
news:974715720.20021004174620
kwikin.com...
> Hi,
>
> Friday, October 4, 2002, 3:01:53 PM, you wrote:
> JB> I've seen a few other post on this, and it sounds like there is more
then
> JB> one of use that is trying this script. I've got it so that I can use
the
> JB> commands, but I still get errors on the page...
>
> JB> here is what I have done.
>
> JB> I downloaded libmycrpt from
> JB> ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt and configured it
with
> JB> the following options;
>
> JB> ./configure \
> JB> --with-included-algos="rijndael-128 arcfour stream cbc cfb"\
> JB> --disable-posix-threads
>
> That is a class I put together. I use libmcrypt-2.5.2 configured with:
>
> configure --prefix=/usr --enable-ltdl-install=no
>
> and mcrypt-2.6.2 configured with:
>
> configure --prefix=/usr
>
> and in php configure:
>
> --with-mcrypt=/usr/src/mcrypt-2.6.2 (thats where it was untarred)
>
> and it works like a dream :)
>
> --
> regards,
> Tom
>
attached mail follows:
Never mind that! I found the answer when I did the Google search. It said mHash come first, then libmcrypt then mcrypt. So, that's what it should be. Yea, it can also be libmcrypt 1st then mhash then mcrypt. I got what I need to know which is that libmcrypt should come before mcrypt. So, it fit with what Tom Rogers said.
"Scott Fletcher" <scott
abcoa.com> wrote in message
news:20021007143131.80071.qmail
pb1.pair.com...
> You got to be kidding me!!!! I use similar code and a sample of yours and
I
> got just about the same error message as what Jeff Bluemel got. I checked
> the PHP Info and it showed that I had the libmcrypt accepted but no
> supported ciphers. Then I posted two seperate unanswered posting until I
> stumpled onto this.
>
> I did not understand why mcrypt is required along with the libmcrypt.
> Libmcrypt is just an combination of mcrypt and extra stuffs. The url,
> php.net/mcrypt said to use libmcrypt and it mentioned of no mcrypt. So,
it
> was no wonder I had problem. Now I know I did not ask the right question
in
> the PHP newsgroup. I am glad to see a solution to this problem. Thank
you
> for the responses and your solution to the problem as it help with Jeff
> Bluemel, it now helped me too. Thank you!
>
> FletchSOD
>
> P.S. Do I compile mcrypt before libmcrypt or is it the other way around?
>
> "Tom Rogers" <trogers
kwikin.com> wrote in message
> news:974715720.20021004174620
kwikin.com...
> > Hi,
> >
> > Friday, October 4, 2002, 3:01:53 PM, you wrote:
> > JB> I've seen a few other post on this, and it sounds like there is more
> then
> > JB> one of use that is trying this script. I've got it so that I can
use
> the
> > JB> commands, but I still get errors on the page...
> >
> > JB> here is what I have done.
> >
> > JB> I downloaded libmycrpt from
> > JB> ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt and configured it
> with
> > JB> the following options;
> >
> > JB> ./configure \
> > JB> --with-included-algos="rijndael-128 arcfour stream cbc cfb"\
> > JB> --disable-posix-threads
> >
> > That is a class I put together. I use libmcrypt-2.5.2 configured with:
> >
> > configure --prefix=/usr --enable-ltdl-install=no
> >
> > and mcrypt-2.6.2 configured with:
> >
> > configure --prefix=/usr
> >
> > and in php configure:
> >
> > --with-mcrypt=/usr/src/mcrypt-2.6.2 (thats where it was untarred)
> >
> > and it works like a dream :)
> >
> > --
> > regards,
> > Tom
> >
>
>
attached mail follows:
I'm using the builtin sessionssystem in some soloutions I've made but I'm not totally satisfied with the headers sent from it. Especially I dont like the following line: Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
The header above causes me some problems and I would like to exclude this on "some" pages. I read that its maybe possible to remove the whole line completely, but I just want to do this in certain phpfiles. Is this possible?
Thankful for any input.. Eric
attached mail follows:
what the hell i wrong in this query?
$q = "UPDATE userpref WHERE username='kurth' AND preference=required_hits SET preference=$HTTP_POST_VARS[required_hits]";
mysql_error() returns this...You have an error in your SQL syntax near 'WHERE username='kurth' AND preference=required_hits SET preference=5' at line 1
what gives?
~kurth
attached mail follows:
"SET" comes before "WHERE"
$q = "UPDATE userpref SET preference=$HTTP_POST_VARS[required_hits] WHERE username='kurth' AND preference=required_hits";
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
attached mail follows:
Kurth Bemis (List Monkey) wrote:
> what the hell i wrong in this query? > > $q = "UPDATE userpref WHERE username='kurth' AND > preference=required_hits SET preference=$HTTP_POST_VARS[required_hits]"; > > mysql_error() returns this...You have an error in your SQL syntax near > 'WHERE username='kurth' AND preference=required_hits SET preference=5' > at line 1 > > what gives?
1) This is a PHP list, not an SQL help list
2) The SET clause goes before the WHERE clause
-- Stuart
attached mail follows:
Hi everyone, I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even slower when accessing a mySQL database. It's a PIII-800 with 256MB RAM. It is otherwise a great machine, and fast.
Any suggestions?
Peter
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
pbechard
fourthrealm.com
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -
attached mail follows:
I have a dev setup running IIS/MSSQL & Apache/MySQL on a w2k box with 800PIII/128M Ram. It flies for me. php 4.2.2 as isapi
Support
Fourthrealm.com wrote:
> Hi everyone,
> I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and
> even slower when accessing a mySQL database. It's a PIII-800 with
> 256MB RAM. It is otherwise a great machine, and fast.
>
> Any suggestions?
>
> Peter
>
>
> - - - - - - - - - - - - - - - - - - - - -
> Fourth Realm Solutions
> pbechard
fourthrealm.com
> http://www.fourthrealm.com
> Tel: 519-739-1652
> - - - - - - - - - - - - - - - - - - - - -
>
>
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
attached mail follows:
Hello,
On Tuesday, October 8, 2002 12:19 AM
Support
Fourthrealm.com wrote:
> Hi everyone,
> I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even
> slower when accessing a mySQL database. It's a PIII-800 with 256MB
> RAM. It is otherwise a great machine, and fast.
>
> Any suggestions?
>
Perhaps, you can increase your RAM. Better yet, take Win2k and IIS off and install Linux and Apache. I'm sure next time you'll ask, "why is it faster?"
- E
> Peter
>
>
> - - - - - - - - - - - - - - - - - - - - -
> Fourth Realm Solutions
> pbechard
fourthrealm.com
> http://www.fourthrealm.com
> Tel: 519-739-1652
> - - - - - - - - - - - - - - - - - - - - -
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Edwin, I have no interest in getting into a Win2K/Linux debate. There are strengths and reasons for using both systems.
I run other applications (ASP, .NET, iHTML, MSSQL) without any problems, and they all work very quickly. Win2K is my primary development environment as it matches the systems my clients use.
So, I just need to know if there are some tweaks I should be considering to speed up PHP?
Peter
At 12:31 AM 10/8/2002 +0900,
Edwin wrote:
>Hello,
>
>On Tuesday, October 8, 2002 12:19 AM
>Support
Fourthrealm.com wrote:
> > Hi everyone,
> > I notice that my PHP runs really slow on Win2k Server w/ IIS 5, and even
> > slower when accessing a mySQL database. It's a PIII-800 with 256MB
> > RAM. It is otherwise a great machine, and fast.
> >
> > Any suggestions?
> >
>
>Perhaps, you can increase your RAM. Better yet, take Win2k and IIS off and
>install Linux and Apache. I'm sure next time you'll ask, "why is it faster?"
>
>- E
>
> > Peter
> >
> >
> > - - - - - - - - - - - - - - - - - - - - -
> > Fourth Realm Solutions
> > pbechard
fourthrealm.com
> > http://www.fourthrealm.com
> > Tel: 519-739-1652
> > - - - - - - - - - - - - - - - - - - - - -
> >
> >
> > --
> > 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
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
pbechard
fourthrealm.com
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -
attached mail follows:
Peter,
On Tuesday, October 8, 2002 12:40 AM
Support
Fourthrealm.com wrote:
> Edwin,
> I have no interest in getting into a Win2K/Linux debate. There are
> strengths and reasons for using both systems.
>
Of course... Most of the time I code on my Windoze machine. (Besides, I use it most of the time for writing to the ML :) But the only test server I have is a linux box.
> I run other applications (ASP, .NET, iHTML, MSSQL) without any problems, > and they all work very quickly. Win2K is my primary development > environment as it matches the systems my clients use.
...also I use Windoze browsers for testing...
> So, I just need to know if there are some tweaks I should be considering to > speed up PHP?
I see. (Sorry about my first comment.)
Well, I'm not really aware of any (ini) settings that would drastically change the speed PHP. However, there are some programming techniques (already discussed in the list) that would "speed up" your scripts. (e.g., "caching" the results of your sql query on a text file and calling that file later on perhaps, etc.) But if you're already doing something similar, I guess, the bottleneck would be the hardware.
Add more RAMs if possible, change to a faster harddisk (SCSI or use RAID), get another PIII-800 and upgrade your motherboard to dual CPU, etc.--I'm sure your boss (if you have one and if you can convince him/her that it's necessary) will even be happy to get you a new workstation. You're running a lot of other applications so I'm pretty sure you'll benefit from a faster machine.
Why do the other app run faster? I don't really know. But, maybe, IIS is just friendlier with its relatives...
Just my opinion...
- E
[snip]
attached mail follows:
Hi Jeff,
I manage the website for the credit report reseller. We don't normally use cookie but we use session only. You were expressing some concern about someone knowing the session id. What we normally use is we used the encrypted session id and use use long aphanumeric number. This make it hard for someone to crack the code. We also use certain features that check the session id and if it is a mismatch, we logged the user out. The only problem we had is that when the user closed the browser, the session was not destroyed but we have a work around to it. That is when the user logged in again, we can tell if it is the same user or not and issue a new session id. We also use the feature like logging the user out if the user is idle for 15 mintues.
If you want a copy of the sample code and analyze it then give me a holler! Then I'll post it here. By the way, I enjoyed your other posting about the encryption problem with libmcrypt. I had the same problem as yours until I read it and found out that I need to install the mcrypt too. So, I filed the PHP bug making a request that the documentation be updated to include more information about mcrypt.
FletchSOD
"Jeff Bluemel" <jeff
domintcom.com> wrote in message
news:20020924230126.50791.qmail
pb1.pair.com...
> I put this block of code in, and all of the array's they should send back
> are 100% blank. I will try the protoscope to see what I can turn up on
> this.
>
>
> "Chris Shiflett" <shiflett
php.net> wrote in message
> news:3D900414.2010101
php.net...
> > Jeff,
> >
> > One quick thought ...
> >
> > Is your cookie domain the same domain as the URL domain you are using to
> > test this? If not, the browser will not send the cookie, so that is a
> > potential reason for this behavior.
> >
> > If the domain is the same, I see no reason why this shouldn't work, but
> > I have two ideas you can try.
> >
> > 1. Rather than using the name of the cookie, try this on the receiving
> page:
> >
> > <pre>
> > <?
> > print_r($_COOKIE);
> > ?>
> > </pre>
> >
> > This should dump the entire array to the screen and would reveal any
> > naming problems.
> >
> > 2. View the HTTP transactions themselves to make sure the proper
> > Set-Cookie and Cookie headers are being used. There are several
> > utilities that can help do this, and I recently wrote one in PHP (it's a
> > quick hack though) you can get at http://protoscope.org/. The messages
> > of interest are the original HTTP response from your Web server (which
> > should contain the Set-Cookie header) and any future HTTP request (which
> > should contain the Cookie header). This is the most reliable way to
> > really analyze these types of problems.
> >
> > Hopefully these ideas will help uncover something.
> >
> > Chris
> >
> > Jeff Bluemel wrote:
> >
> > >ok - no cookie exists... I have Netscape set to accept all cookies.
> > >
> >
>
>
attached mail follows:
Hello all,
I am trying to use php to read through an html file and replace all image paths, like such:
Change "images/firstimage.gif" to "http://www.blah.com/firstimage.gif" ... Change "somesuch/images/secondimage.jpg" to "http://www.blah.com/secondimage.jpg"
So I am going through the file and matching the image path strings, stripping them down to just the image name using "basename", and then adding "http://www.blah.com/" onto the beginning of them. Except it's not working, and I'm not sure where my logic has gone awry. Instead of replacing each image path with its respective image name, it is replacing all image paths with the *same* image name.
Here is the code. (Yes I'm new, I apologize for the mess, there are a few lines in there I'm using for debugging purposes, to show me what it's doing.)
<? $filename = "newexample.html"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename));
while (preg_match('{(")([A-z0-9_/-](\/))*[A-z0-9_/-]+(.gif|.jpg)}', $contents, $matches)) {
echo "<b>MATCHED:</b> ".$matches[0]."<br>\n";
$base = basename($matches[0]); $newimage = "http://www.blah.com/".$base; echo "<br>base: ".$base."<br>"; echo "new image: ".$newimage."<br>"; echo "<hr>";
$contents = eregi_replace('\/*[A-z0-9_/-]+(.gif|.jpg)', $newimage, $contents);
print $contents;
}
fclose ($fd);
?>
When I run it, I get:
~~~~~ MATCHED: "blah/images/first.gif
base: first.gif new image: http://www.blah.com/first.gif ------------------------------------------------------------------------ <Here it prints the contents of the html file, except all images look like "http://www.blah.com/first.gif" (when there are supposed to be lots of other images, such as second.jpg, etc).> ~~~~~
Where have I gone wrong? Thanks to all, as usual, for your hints and help.
Jen
attached mail follows:
BTW - I have found errors in the regular expression that I was matching so don't bother to point those out. ;) That shouldn't affect the nature of the problem I was asking about.
--- Jennifer Swofford <jen
littleduck.com> wrote:
> Hello all,
>
> I am trying to use php to read through an html file
> and replace all image
> paths, like such:
<snip>
attached mail follows:
Jennifer--
A couple of things. eregi_replace does not have a limitation parameter, which means that if you use it *all* the strings that match your pattern will be replace with the new pattern. In your case, if I read your code correctly (and I may not--I'm doing this from memory), the eregi replacement you perform will change *all* the paths you have in your file, and not just the first one, which, I believe, is what you're looking for.
Also, there shouldn't be any need to make the replacements one by one. A single replacement should be enough if all the original paths have to be transformed into the same URL.
For example:
ereg_replace ("{/images/}{test.(jpg|gif)}", "http://www.microsoft.com/images/\\2", $t);
This would replace any occurrence of "/images/*.gif" and "/images/*.jpg" to "http://www.microsoft.com/images/*.gif" or *.jpg respectively (once again, double check my regex...doing this from memory). If you *do* need to change each occurrence individually, then you should use preg() instead, which uses Perl syntax and has a limitation parameter.
Also--a minor thing and I'm sure you thought of it, but you're not saving the file at the end :-)
Hope this helps.
Cheers,
Marco
On Mon, 2002-10-07 at 20:01, Jennifer Swofford wrote: > Hello all, > > I am trying to use php to read through an html file and replace all image > paths, like such: > > Change "images/firstimage.gif" to "http://www.blah.com/firstimage.gif" ... > Change "somesuch/images/secondimage.jpg" to > "http://www.blah.com/secondimage.jpg" > > So I am going through the file and matching the image path strings, > stripping them down to just the image name using "basename", and then adding > "http://www.blah.com/" onto the beginning of them. Except it's not working, > and I'm not sure where my logic has gone awry. Instead of replacing each > image path with its respective image name, it is replacing all image paths > with the *same* image name. > > Here is the code. (Yes I'm new, I apologize for the mess, there are a few > lines in there I'm using for debugging purposes, to show me what it's > doing.) > > <? > $filename = "newexample.html"; > $fd = fopen ($filename, "r"); > $contents = fread ($fd, filesize ($filename)); > > while (preg_match('{(")([A-z0-9_/-](\/))*[A-z0-9_/-]+(.gif|.jpg)}', > $contents, $matches)) { > > echo "<b>MATCHED:</b> ".$matches[0]."<br>\n"; > > $base = basename($matches[0]); > $newimage = "http://www.blah.com/".$base; > echo "<br>base: ".$base."<br>"; > echo "new image: ".$newimage."<br>"; > echo "<hr>"; > > $contents = eregi_replace('\/*[A-z0-9_/-]+(.gif|.jpg)', $newimage, > $contents); > > print $contents; > > } > > fclose ($fd); > > ?> > > When I run it, I get: > > ~~~~~ > MATCHED: "blah/images/first.gif > > base: first.gif > new image: http://www.blah.com/first.gif > ------------------------------------------------------------------------ > <Here it prints the contents of the html file, except all images look like > "http://www.blah.com/first.gif" (when there are supposed to be lots of other > images, such as second.jpg, etc).> > ~~~~~ > > Where have I gone wrong? Thanks to all, as usual, for your hints and help. > > Jen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I send hidden variables from a form to a php. In the php I have the following code to convert the global vars sent:
If (isset($_GET['foo'])) $foo = $_GET['foo'] else $foo = 0;
But this only works using the "GET" method!
Thanks for your answer.
attached mail follows:
You can use $_POST in a similar fashion to retrieve values from form that have been posted with the POST method.
Also, you can use $_REQUEST to catch both at the same time. In this case, you may have a problem if the same variable is passed through both GET and POST, in that one will override the other depending on how your php.ini is set up.
On Mon, 2002-10-07 at 12:19, Edgard Berendsen wrote: > I send hidden variables from a form to a php. In the php > I have the following code to convert the global vars sent: > > If (isset($_GET['foo'])) > $foo = $_GET['foo'] > else > $foo = 0; > > But this only works using the "GET" method! > > Thanks for your answer. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello,
I would like to know if someone uses PHP (on Win[9x,2k,xp]) connection to Informix server in other way than trough ODBC. I'm trying do it, but without any success. Thank you in advance.
Juraj Hasko
attached mail follows:
Hello All,
I have a script which is using mail() to send an e-mail message. It seems to be working, yet taking as long as 60-65 seconds just to send the e-mail. The e-mail has no attachments and only has one line in it. Does anyone have experience with this issue. I am using "PHP/4.0.6" on "Linux Redhat" with "Apache/1.3.22". Also, not to mention when I test it with IIS, I get a "Failed to Receive" error. Thanks for any help.
John Negretti
attached mail follows:
Hey John--
Couple of ideas:
1) Is your sendmail configured as a relay? As such your PHP process may have to wait for the e-mail to be relayed before returning, which might explain why it's taking so long. The same might happen if your machine is very busy (although that has never happened to me)
2) Under IIS, you must configure a mail server in order for mail() to work, because Windows does not have an MTA similar to sendmail installed by default. You can do so in your php.ini file. Note that the MTA doesn't have to be on a separate computer--if you use Windows SMTP and configure it properly it should do just fine to use localhost as your mail host.
Hope this helps.
Marco
On Mon, 2002-10-07 at 12:25, Negretti, John (CCI-San Diego) wrote: > Hello All, > > I have a script which is using mail() to send an e-mail message. It seems to be working, yet taking as long as 60-65 seconds just to send the e-mail. The e-mail has no attachments and only has one line in it. Does anyone have experience with this issue. I am using "PHP/4.0.6" on "Linux Redhat" with "Apache/1.3.22". Also, not to mention when I test it with IIS, I get a "Failed to Receive" error. Thanks for any help. > > John Negretti > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello,
Perhaps, a DNS setting problem?
- E
On Tuesday, October 08, 2002 1:25 AM Negretti, John (CCI-San Diego) wrote:
Hello All,
I have a script which is using mail() to send an e-mail message. It seems to be working, yet taking as long as 60-65 seconds just to send the e-mail. The e-mail has no attachments and only has one line in it. Does anyone have experience with this issue. I am using "PHP/4.0.6" on "Linux Redhat" with "Apache/1.3.22". Also, not to mention when I test it with IIS, I get a "Failed to Receive" error. Thanks for any help.
John Negretti
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Maybe your /etc/hosts file.
What does you maillog say?
# tail /var/log/maillog
Brad
On Mon, 2002-10-07 at 10:52,
Edwin wrote:
> Hello,
>
> Perhaps, a DNS setting problem?
>
> - E
>
> On Tuesday, October 08, 2002 1:25 AM
> Negretti, John (CCI-San Diego) wrote:
>
>
> Hello All,
>
> I have a script which is using mail() to send an e-mail message. It seems
> to be working, yet taking as long as 60-65 seconds just to send the e-mail.
> The e-mail has no attachments and only has one line in it. Does anyone have
> experience with this issue. I am using "PHP/4.0.6" on "Linux Redhat" with
> "Apache/1.3.22". Also, not to mention when I test it with IIS, I get a
> "Failed to Receive" error. Thanks for any help.
>
> John Negretti
>
>
> --
> 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 uploading a gif file using is_upload_file($filename) function. I save the file with a file name img1.gif. It seems to work fine. But when I delete the file img1.gif then upload a different gif file and save it as img1.gif, it displays the first image i uploaded not the most recent one, why is this? Is there a way to get around it?
Ben
__________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com
attached mail follows:
How are you handling the transfer of files between its temporary area and where it's going to be stored?
If you're copying instead of moving, I would imagine the file in the temp directory would still be present.
-Jason
Donahue Ben wrote: > I am uploading a gif file using > is_upload_file($filename) function. > I save the file with a file name img1.gif. It seems > to work fine. But when I delete the file img1.gif > then upload a different gif file and save it as > img1.gif, it displays the first image i uploaded not > the most recent one, why is this? Is there a way to > get around it? > > Ben > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com
attached mail follows:
Possibly. But temp files created during execution should be destroyed when the script exists. So either copying or moving shouldn't make any difference. Besides that I think the difference is strictly semantic. Another possibility is that this is a browser cache issue. -Kevin
----- Original Message -----
From: "Jason Young" <jason1
erols.com>
To: <php-general
lists.php.net>
Sent: Monday, October 07, 2002 11:24 AM
Subject: [PHP] Re: uploading files
> How are you handling the transfer of files between its temporary area > and where it's going to be stored? > > If you're copying instead of moving, I would imagine the file in the > temp directory would still be present. > > -Jason > > > Donahue Ben wrote: > > I am uploading a gif file using > > is_upload_file($filename) function. > > I save the file with a file name img1.gif. It seems > > to work fine. But when I delete the file img1.gif > > then upload a different gif file and save it as > > img1.gif, it displays the first image i uploaded not > > the most recent one, why is this? Is there a way to > > get around it? > > > > Ben > > > > __________________________________________________ > > Do you Yahoo!? > > Faith Hill - Exclusive Performances, Videos & More > > http://faith.yahoo.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
How are you deleting the file? How are you moving the temp file to the permanent area? Are you sure it's not a browser cache issue?
---John Holmes...
----- Original Message -----
From: "Donahue Ben" <fun23_us
yahoo.com>
To: <php-general
lists.php.net>
Sent: Monday, October 07, 2002 1:22 PM
Subject: [PHP] uploading files
> I am uploading a gif file using > is_upload_file($filename) function. > I save the file with a file name img1.gif. It seems > to work fine. But when I delete the file img1.gif > then upload a different gif file and save it as > img1.gif, it displays the first image i uploaded not > the most recent one, why is this? Is there a way to > get around it? > > Ben > > __________________________________________________ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hey guys and gals...
I'm not sure if this is Apache, PHP, or a browser issue.. but..
.phps files get cut off while trying to access them in a browser.. anyone ever have a problem with this?
I can't exactly calculate where in any particular file its doing this, but refreshing the page causes it to stop in the same place, so its not random..
Any help would be appreciated -Jason
attached mail follows:
I attempted to write a oage that you can chat on with php. It ended up being a page that reloads itself all the time which isn't really what I wanted. But I didn't know how to do it differently. Is there another way? I heard something about flush()? Kind regards, Oliver
attached mail follows:
You can have your script enter a loop to check for data in a database. If data output it then calls the flush() function to output to the browser. Then sleep for some time, then wakeup and repeat. You may have issues with some browsers using this technique, but generally it does work. The key is that you never close the connection to the browser. You'll also want to occasionally output some invisible content, otherwise the connection_status() stuff never give the right value (at least not in 4.1.2) It struck me that these functions update their flags on output only. Which means you need to output something to the browser to detect that the user has hit stop, or has disconnected.
Cheers, Rob.
Oliver Witt wrote: > > I attempted to write a oage that you can chat on with php. It ended up > being a page that reloads itself all the time which isn't really what I > wanted. But I didn't know how to do it differently. Is there another > way? I heard something about flush()? > Kind regards,
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
But, Robert, doesn't this technique leave a connection open on the server--and, won't it cause the server to run out of resources after a very finite number of connections has been established?
Marco
On Mon, 2002-10-07 at 14:07, Robert Cummings wrote:
> You can have your script enter a loop to check for data in a database.
> If data output it then calls the flush() function to output to the browser.
> Then sleep for some time, then wakeup and repeat. You may have issues
> with some browsers using this technique, but generally it does work.
> The key is that you never close the connection to the browser. You'll
> also want to occasionally output some invisible content, otherwise the
> connection_status() stuff never give the right value (at least not in
> 4.1.2) It struck me that these functions update their flags on output
> only. Which means you need to output something to the browser to detect
> that the user has hit stop, or has disconnected.
>
> Cheers,
> Rob.
>
> Oliver Witt wrote:
> >
> > I attempted to write a oage that you can chat on with php. It ended up
> > being a page that reloads itself all the time which isn't really what I
> > wanted. But I didn't know how to do it differently. Is there another
> > way? I heard something about flush()?
> > Kind regards,
>
> --
> .-----------------.
> | Robert Cummings |
> :-----------------`----------------------------.
> | Webdeployer - Chief PHP and Java Programmer |
> :----------------------------------------------:
> | Mail : mailto:robert.cummings
webmotion.com |
> | Phone : (613) 731-4046 x.109 |
> :----------------------------------------------:
> | Website : http://www.webmotion.com |
> | Fax : (613) 260-9545 |
> `----------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Robert Cummings schrieb:
> You can have your script enter a loop to check for data in a database. > If data output it then calls the flush() function to output to the browser. > Then sleep for some time, then wakeup and repeat. You may have issues > with some browsers using this technique, but generally it does work. > The key is that you never close the connection to the browser. You'll > also want to occasionally output some invisible content, otherwise the > connection_status() stuff never give the right value (at least not in > 4.1.2) It struck me that these functions update their flags on output > only. Which means you need to output something to the browser to detect > that the user has hit stop, or has disconnected. > > Cheers, > Rob. >
Thanks for the answer, but that was a little bit too complicated for me. I know more about javascript. How do I do such a loop? Something similar like set_interval in javascript? What invisible content do I have to output? And what do I have to output to the browser to detect if the user's still active? Olli
attached mail follows:
Another way is to use javascript with PHP to pull the database every so many seconds. I have seen this in I think it was PHPChat. Been a long time however.
--- Brad Dameron Network Account Executive TSCNet Inc. www.tscnet.com Silverdale, WA. 1-888-8TSCNET> -----Original Message----- > From: robert.cummings
webmotion.com > [mailto:robert.cummings
webmotion.com] > Sent: Monday, October 07, 2002 11:07 AM > To: Oliver Witt > Cc: php-general
lists.php.net > Subject: Re: [PHP] Chat with php > > > You can have your script enter a loop to check for data in a database. > If data output it then calls the flush() function to output to > the browser. > Then sleep for some time, then wakeup and repeat. You may have issues > with some browsers using this technique, but generally it does work. > The key is that you never close the connection to the browser. You'll > also want to occasionally output some invisible content, otherwise the > connection_status() stuff never give the right value (at least not in > 4.1.2) It struck me that these functions update their flags on output > only. Which means you need to output something to the browser to detect > that the user has hit stop, or has disconnected. > > Cheers, > Rob. > > Oliver Witt wrote: > > > > I attempted to write a oage that you can chat on with php. It ended up > > being a page that reloads itself all the time which isn't really what I > > wanted. But I didn't know how to do it differently. Is there another > > way? I heard something about flush()? > > Kind regards, > > -- > .-----------------. > | Robert Cummings | > :-----------------`----------------------------. > | Webdeployer - Chief PHP and Java Programmer | > :----------------------------------------------: > | Mail : mailto:robert.cummings
webmotion.com | > | Phone : (613) 731-4046 x.109 | > :----------------------------------------------: > | Website : http://www.webmotion.com | > | Fax : (613) 260-9545 | > `----------------------------------------------' > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Simple trick (well, not so simple, but kind of a Columbus' Egg):
1) Create an <img> tag in your web page that is hidden
2) Point the img tag to a php script that returns:
1) An image with a pixel width of 1 if there is new data to pick up from the server 2) An image with a pixel width of 0 otherwise
3) Create a javascript that refreshes the image every second (or every two seconds, or however often you feel necessary--the more often, the more responsive and "real time" your chat system will be).
4) Add an OnLoad event to the img tag that points to a Javascript that checks the width of the newly reloaded image. If the width is one, then you reload your chat text content (which you may want to put in an iframe to avoid having to reload the whole page).
I don't have a script to show unfortunately, as it would probably be too complicated and long for the list (and I have no time to write it...<sigh>), but hopefully, this will give you the gist of it.
Cheers,
Marco
On Mon, 2002-10-07 at 13:43, Oliver Witt wrote: > I attempted to write a oage that you can chat on with php. It ended up > being a page that reloads itself all the time which isn't really what I > wanted. But I didn't know how to do it differently. Is there another > way? I heard something about flush()? > Kind regards, > Oliver > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Brad Dameron schrieb:
> Another way is to use javascript with PHP to pull the database every so many > seconds. I have seen this in I think it was PHPChat. Been a long time > however. >
Well, that's pretty much how I've done it. And it is pretty crappy... Olli
attached mail follows:
Oliver--
I'm afraid I wasn't too clear! If you do it the way I'm suggesting, your page will look like it's reloading ONLY when there is new data available, and not continuously. PHPChat is an example--it looks really good and doesn't do any of the annoying things that reloading the page usually does (like the stupid click click click in IE).
Marco
On Mon, 2002-10-07 at 14:25, Oliver Witt wrote: > Brad Dameron schrieb: > > > Another way is to use javascript with PHP to pull the database every so many > > seconds. I have seen this in I think it was PHPChat. Been a long time > > however. > > > > Well, that's pretty much how I've done it. And it is pretty crappy... > Olli > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
It sure does. I didn't say it was perfect :) But at least it doesn't constantly reload, which is fine if you have a limitted number of poeple entering the room. Otherwise the invis pixel things sounds a lot superior, even though you sit there polling the machine. For 1x1 pixels :)
Cheers, Rob. ------------------------------------------------------------------------
Marco Tabini wrote: > > But, Robert, doesn't this technique leave a connection open on the > server--and, won't it cause the server to run out of resources after a > very finite number of connections has been established? > > Marco > > On Mon, 2002-10-07 at 14:07, Robert Cummings wrote: > > You can have your script enter a loop to check for data in a database. > > If data output it then calls the flush() function to output to the browser. > > Then sleep for some time, then wakeup and repeat. You may have issues > > with some browsers using this technique, but generally it does work. > > The key is that you never close the connection to the browser. You'll > > also want to occasionally output some invisible content, otherwise the > > connection_status() stuff never give the right value (at least not in > > 4.1.2) It struck me that these functions update their flags on output > > only. Which means you need to output something to the browser to detect > > that the user has hit stop, or has disconnected. > > > > Cheers, > > Rob. > > > > Oliver Witt wrote: > > > > > > I attempted to write a oage that you can chat on with php. It ended up > > > being a page that reloads itself all the time which isn't really what I > > > wanted. But I didn't know how to do it differently. Is there another > > > way? I heard something about flush()? > > > Kind regards,
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
Marco Tabini schrieb:
> Simple trick (well, not so simple, but kind of a Columbus' Egg): > > 1) Create an <img> tag in your web page that is hidden > > 2) Point the img tag to a php script that returns: > > 1) An image with a pixel width of 1 if there is new data to pick > up from the server > 2) An image with a pixel width of 0 otherwise > > 3) Create a javascript that refreshes the image every second (or every > two seconds, or however often you feel necessary--the more often, the > more responsive and "real time" your chat system will be). > > 4) Add an OnLoad event to the img tag that points to a Javascript that > checks the width of the newly reloaded image. If the width is one, then > you reload your chat text content (which you may want to put in an > iframe to avoid having to reload the whole page). > > I don't have a script to show unfortunately, as it would probably be too > complicated and long for the list (and I have no time to write > it...<sigh>), but hopefully, this will give you the gist of it. > > Cheers, > > Marco >
Okay, that sounds like something i can do, i just need to know how to hide and how to point the img tag at something. Olli
attached mail follows:
Hey everyone,
Does anybody know what the current support / functionality for PHP with sockets is? According to the documentation, all the socket_ functions should be included in PHP >= 4.1.0. I'm currently running 4.2.1 and PHP doesn't seem to recognize these functions (socket_send, socket_write, etc).
Anybody know if there's anything special I have to do to get it working?
// Asmodean
attached mail follows:
Yep, if you're using UNIX and compiling from source, you must add this switch to the command line when you're configuring and compiling PHP:
--enable-sockets
(e.g.: ./configure --enable-sockets). If you're using a prepackaged version (RPM or Windows) then you should look into the documentation for your version to see if this extension was included when the package was compiled from the source.
Cheers,
Marco
On Mon, 2002-10-07 at 14:22, Asmodean wrote: > Hey everyone, > > Does anybody know what the current support / functionality for PHP > with sockets is? According to the documentation, all the socket_ > functions should be included in PHP >= 4.1.0. I'm currently running > 4.2.1 and PHP doesn't seem to recognize these functions (socket_send, > socket_write, etc). > > Anybody know if there's anything special I have to do to get it > working? > > // Asmodean > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello, I have a question that I was hoping somebody here could answer or atleast point me in the right direction.
I maintain a series of mailing lists for our organization. Currently, I edit the distribution lists myself, but I would like to offload this administration to the departments themselves. Ideally, I could set up a web site that would let them edit the dist file themselves, and then save the changes. The php file would simply load up a text file from a fixed location, and then display it in a form. The user could then edit and save the file to the same location from where it was opened. Basically, I need a very simple text editor done in PHP. Unfortunately, when I search for “PHP text editor” I get development tools. Any help would be greatly appreciated, -Hitesh
attached mail follows:
From: Marco Tabini <marcot
inicode.com>
To: php-general
lists.php.net
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Date: 07 Oct 2002 15:18:23 -0400
Message-Id: <1034018308.3385.105.camel
localhost.localdomain>
Mime-Version: 1.0
Subject: [Fwd: Re: [PHP] Chat with php]
Ok, off the top of my head (please don't be upset if it doesn't work right off, because I'm doing this from memory):
Web page:
<script language=javascript>
function checkimage() { if (document.all.image1.width = 1) { document.all.fr1.src="http://www.mysite.com/chat.php"; } }
function reloadimg() { document.all.image1.src="http://www.mysite.com/img.php"; setInterval ("reloadimg()", 2000); // every 2 secs }
</script>
<body> <iframe name="fr1" src="chat.php">
<img style="display=none" src="http://www.mysite.com/chat.php" onLoad="javascript:checkimage();"> </body>
In chat.php you simply push out whatever is in the database (the whole thing--or you come up with some method of just printing out what has changed since the last poll, which is trivial and beyond the point here).
In img.php:
<?
function checkdb() { // This returns true if new data is available }
$filename = (checkdb() ? '1pixel.gif' : '2pixel.gif');
header ("Content-type: image/gif"); readfile ($filename);
?>
1pixel.gif is a one-pixel wide image, while 2pixel.gif is two pixels wide (it just occurred to me that you can't have a zero-pixels wide image, which would be quite pointless). The script basically reads in either file and spits it out after setting the content type.
Once more, this script, as is, probably won't work because it was programmed in my messy head rather than in a proper PHP environment, but it should give you an idea of what needs to be done. In particular, remember to use the "display" CSS attribute rather than visibility so that the image will not take up any space on your page.
Also, an apology--I seem to have mailed some messages twice by mistake. I was checking e-mail between eating my lunch and trying to get a tie on and things might have gotten a bit out of hand ;-)
Let me know how it turns out!
----Forwarded Message-----
> From: Oliver Witt <oliverwitt
t-online.de>
> To: php-general
lists.php.net, Marco Tabini <marcot
tabini.ca>
> Subject: Re: [PHP] Chat with php
> Date: 07 Oct 2002 20:44:08 +0200
>
> Marco Tabini schrieb:
>
> > Simple trick (well, not so simple, but kind of a Columbus' Egg):
> >
> > 1) Create an <img> tag in your web page that is hidden
> >
> > 2) Point the img tag to a php script that returns:
> >
> > 1) An image with a pixel width of 1 if there is new data to pick
> > up from the server
> > 2) An image with a pixel width of 0 otherwise
> >
> > 3) Create a javascript that refreshes the image every second (or every
> > two seconds, or however often you feel necessary--the more often, the
> > more responsive and "real time" your chat system will be).
> >
> > 4) Add an OnLoad event to the img tag that points to a Javascript that
> > checks the width of the newly reloaded image. If the width is one, then
> > you reload your chat text content (which you may want to put in an
> > iframe to avoid having to reload the whole page).
> >
> > I don't have a script to show unfortunately, as it would probably be too
> > complicated and long for the list (and I have no time to write
> > it...<sigh>), but hopefully, this will give you the gist of it.
> >
> > Cheers,
> >
> > Marco
> >
>
> Okay, that sounds like something i can do, i just need to know how to hide
> and how to point the img tag at something.
> Olli
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Marco Tabini schrieb:
> Ok, off the top of my head (please don't be upset if it doesn't work > right off, because I'm doing this from memory): > > Web page: > > <script language=javascript> > > function checkimage() > { > if (document.all.image1.width == 1) > { > document.all.fr1.src="http://www.mysite.com/chat.php"; > } > } > > function reloadimg() > { > document.all.image1.src="http://www.mysite.com/img.php"; > setInterval ("reloadimg()", 2000); // every 2 secs > } > > </script> > > <body> > <iframe name="fr1" src="chat.php"> > > <img style="display=none" src="http://www.mysite.com/chat.php" > onLoad="javascript:checkimage();"> > </body> > > In chat.php you simply push out whatever is in the database (the whole > thing--or you come up with some method of just printing out what has > changed since the last poll, which is trivial and beyond the point > here). > > In img.php: > > <? > > function checkdb() > { > // This returns true if new data is available > } > > $filename = (checkdb() ? '1pixel.gif' : '2pixel.gif'); > > header ("Content-type: image/gif"); > readfile ($filename); > > ?> > > 1pixel.gif is a one-pixel wide image, while 2pixel.gif is two pixels > wide (it just occurred to me that you can't have a zero-pixels wide > image, which would be quite pointless). The script basically reads in > either file and spits it out after setting the content type. > > Once more, this script, as is, probably won't work because it was > programmed in my messy head rather than in a proper PHP environment, but > it should give you an idea of what needs to be done. In particular, > remember to use the "display" CSS attribute rather than visibility so > that the image will not take up any space on your page. > > Also, an apology--I seem to have mailed some messages twice by mistake. > I was checking e-mail between eating my lunch and trying to get a tie on > and things might have gotten a bit out of hand ;-) > > Let me know how it turns out! >
Thanks, I will try that script as soon as I find some time, probably tomorrow. But it seems to do the same thing as reloading would do: clicking all the time. But I'll try it tomorrow. Kind regards, Oliver
attached mail follows:
Apologies for what's probably an extremely newbie question..
Is there any way to have a database return its auto_increment field during insert? I have two different tables, when one inserts, I'd like to be able to assign the value of the new auto_increment field to another field in another table.
I guess I COULD go and make the second table auto_increment along with it, but that would require a complete rewrite, and I'd like to avoid that...
Anyone have ideas, suggestions, or preferably.. an answer to my question? :)
Thanks -Jason
attached mail follows:
If you're using MySQL:
mysql_insert_id
If you're using MSSQL, you need to execute SELECT 
IDENTITY right after
your insertion operation. The result will give you the ID of your last
insertion. This won't work well if you're doing a bulk insert, though.
On Mon, 2002-10-07 at 15:46, Jason Young wrote: > Apologies for what's probably an extremely newbie question.. > > Is there any way to have a database return its auto_increment field > during insert? I have two different tables, when one inserts, I'd like > to be able to assign the value of the new auto_increment field to > another field in another table. > > I guess I COULD go and make the second table auto_increment along with > it, but that would require a complete rewrite, and I'd like to avoid that... > > Anyone have ideas, suggestions, or preferably.. an answer to my question? :) > > Thanks > -Jason > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]