|
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 16 Dec 2006 10:03:26 -0000 Issue 4517
php-general-digest-help
lists.php.net
Date: Sat Dec 16 2006 - 04:03:26 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 16 Dec 2006 10:03:26 -0000 Issue 4517
Topics (messages 245868 through 245911):
Re: google video like site
245868 by: siavash1979.telus.net
245869 by: bruce
imap_open('/path/to/mbox', '', '')
245870 by: Richard Lynch
245911 by: Jochem Maas
POST in Apache server
245871 by: Emiliano
245873 by: Emiliano
245877 by: Richard Lynch
245878 by: Emiliano
245890 by: Richard Lynch
245891 by: Casey Chu
245893 by: Emiliano
245895 by: Emiliano
245898 by: Casey Chu
245899 by: Richard Lynch
245906 by: Emiliano
245909 by: Casey Chu
Re: Curl and cookies
245872 by: Richard Lynch
Re: PDO::prepare deallocate & PDOStatement::closeCursor()
245874 by: Richard Lynch
Re: RegExp
245875 by: Richard Lynch
Re: learning classes not sure how to do this correctly
245876 by: Richard Lynch
Re: Having problem sending XML over HTTP
245879 by: Manuel Lemos
Re: How php works?
245880 by: Richard Lynch
Re: Varying session behavior between 2 nearly identical Apache/PHP setups
245881 by: Richard Lynch
Re: Whitespace in Emails
245882 by: Richard Lynch
Re: php redirection..
245883 by: Richard Lynch
245886 by: Richard Lynch
245887 by: Richard Lynch
245889 by: Casey Chu
245892 by: Richard Lynch
245897 by: Casey Chu
Re: Retransmiting post variables
245884 by: Richard Lynch
Re: Cookies & page refresh
245885 by: Richard Lynch
Re: Advice needed: implementing custom fields in tables
245888 by: Richard Lynch
Re: Problems with Zip+IE6
245894 by: Richard Lynch
245896 by: Richard Lynch
Re: filedownload and output buffering
245900 by: Richard Lynch
Re: Automating PHP email
245901 by: Richard Lynch
Re: $POST Q
245902 by: Richard Lynch
Re: Download adds ^M to beginning of file
245903 by: Richard Lynch
245904 by: Richard Lynch
Re: Havn't been on the list in a while
245905 by: Richard Lynch
Re: flash/php file uploader
245907 by: Richard Lynch
Re: Need help with RegEx
245908 by: Richard Lynch
Re: How to compile Delphi SC ?
245910 by: Richard Lynch
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:
Quoting Robert Cummings <robert
interjinn.com>:
> On Fri, 2006-12-15 at 09:30 +0100, Jochem Maas wrote:
> > Robert Cummings wrote:
> > > On Thu, 2006-12-14 at 23:40 +0100, Jochem Maas wrote:
> > > > I doubt they were stupid enough to shell out that kind of cash to on a
> php-nuke install,
> > >
> > > Why not? It's not the code they want, it's the traffic. You can have the
> > > best code in the world and if 0 people visit it, it's pretty worthless
> > > to anyone but you.
> >
> > you are right - I was implicitly thinking along the lines that there is no
> > way in hell a php-nuke install could stand up to amount of
> requests/processing
> > youtube must cope with.
>
> Definitely not on one computer, but if you offload to say 30 servers,
> you can probably process 100 million hits per day. Servers are probably
> cheap compared to their bandwidth costs.
>
> > there is a good reason that properties like Yahoo (which uses php of
> course) stick all
> > the heavy lifting code in php extensions written in C.
>
> True, but nothing stopping a site like youtube from taking a shoddy app
> and moving some of the heavy lifting into extensions themselves.
>
> > then there is the issue of differentiation - would *you* settle for some
> generic POS
> > piece of software if you had billions of dollar to invest in build a
> custom, killer app?
>
> Probably not, but I know that millions of people everyday settle for
> Microsoft ;) Some of these people probably have a few spare billion
> dollars... not me though :|
>
> > okay, sure, everything in software land is eventually comoditized and
> available as
> > open source eventually, but right now there are no google-video type
> applications out
> > there that can handle the amount of traffic the mentioned sites handle.
>
> Id on't think the code is the bottleneck, I think the bottle neck is the
> 200 to 400 terabytes of data youtube transfers everyday.
>
> > there is also the premise that youtube wouldn't be youtube if it were
> running on php-nuke,
> > for the simple fact it would have been hacked to death. no?
>
> Well, that's definitely a valid point, no argument from me there heheh.
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Thanks everyone. By the way I wasn't implying that any of these sites are being
run on php-nuke, I was wondering if they're however running on something similar
to php-nuke.
Just because you tube, google video, break.com and a few other sites all
basically look the same and function the same way, so I thought they might be
using the same backend code. I'm making a small site for a community that wants
the same idea, I was wondering if it's as easy as installing a software, or that
I have to write it all from scratch.
Thanks again for all your responses.
Siavash
attached mail follows:
siavish...
to write a site that handles a few 100 hits/day and has functionality to
upload/download/view videos isn't that hard to do. (not including the
look/feel, and not including the testing aspect) just throwing a site
together isn't that hard.
however, if you really want to have a robust/scalable/secure app, capable of
handling serious traffic, as well as all the monitoring functionality you
want to admin/run the site, and to move/track your data/videos.. .then it's
not a simple upload of an app/modify the app for a few weeks..
there is a skill to well designed/implemented sites that stand up to
traffic.
peace
-----Original Message-----
From: siavash1979
telus.net [mailto:siavash1979
telus.net]
Sent: Friday, December 15, 2006 11:49 AM
To: php-general
lists.php.net
Subject: Re: [PHP] google video like site
Quoting Robert Cummings <robert
interjinn.com>:
> On Fri, 2006-12-15 at 09:30 +0100, Jochem Maas wrote:
> > Robert Cummings wrote:
> > > On Thu, 2006-12-14 at 23:40 +0100, Jochem Maas wrote:
> > > > I doubt they were stupid enough to shell out that kind of cash to on
a
> php-nuke install,
> > >
> > > Why not? It's not the code they want, it's the traffic. You can have
the
> > > best code in the world and if 0 people visit it, it's pretty worthless
> > > to anyone but you.
> >
> > you are right - I was implicitly thinking along the lines that there is
no
> > way in hell a php-nuke install could stand up to amount of
> requests/processing
> > youtube must cope with.
>
> Definitely not on one computer, but if you offload to say 30 servers,
> you can probably process 100 million hits per day. Servers are probably
> cheap compared to their bandwidth costs.
>
> > there is a good reason that properties like Yahoo (which uses php of
> course) stick all
> > the heavy lifting code in php extensions written in C.
>
> True, but nothing stopping a site like youtube from taking a shoddy app
> and moving some of the heavy lifting into extensions themselves.
>
> > then there is the issue of differentiation - would *you* settle for some
> generic POS
> > piece of software if you had billions of dollar to invest in build a
> custom, killer app?
>
> Probably not, but I know that millions of people everyday settle for
> Microsoft ;) Some of these people probably have a few spare billion
> dollars... not me though :|
>
> > okay, sure, everything in software land is eventually comoditized and
> available as
> > open source eventually, but right now there are no google-video type
> applications out
> > there that can handle the amount of traffic the mentioned sites handle.
>
> Id on't think the code is the bottleneck, I think the bottle neck is the
> 200 to 400 terabytes of data youtube transfers everyday.
>
> > there is also the premise that youtube wouldn't be youtube if it were
> running on php-nuke,
> > for the simple fact it would have been hacked to death. no?
>
> Well, that's definitely a valid point, no argument from me there heheh.
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Thanks everyone. By the way I wasn't implying that any of these sites are
being
run on php-nuke, I was wondering if they're however running on something
similar
to php-nuke.
Just because you tube, google video, break.com and a few other sites all
basically look the same and function the same way, so I thought they might
be
using the same backend code. I'm making a small site for a community that
wants
the same idea, I was wondering if it's as easy as installing a software, or
that
I have to write it all from scratch.
Thanks again for all your responses.
Siavash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I'm having trouble with Windows imap_open.
I have the exact same mbox on a Linux box, with the exact same PHP
code opening it just fine.
I FTP (binary) to the Windows box (and a second time to be sure it
wasn't an FTP flake-out).
Opening the mbox in Windows yields a message like:
PHP Notice:
Unknown:
C:\\data\\mbox.excerpt (file C:\\data\\mbox.excerpt) is not in valid
mailbox format (errflg=2)
I can fopen and fread the same file just fine.
I've tried copying out just ONE email from the mbox.
I've been searching and reading quite a bit, but virtually all the
docs and examples are all about problems with connection to live IMAP
server, and very few even mention that one can open a local file mbox.
There is a User Contributed note at http://php.net/imap_open that says:
"...This specifies a mailbox in the default format (usually >Berkeley
format for most default library builds)..."
I now have 2 theories:
1. Windows IMAP is expecting a different newline in headers and/or
body of the mbox email. :-(
2. Windows build is not using "Berkeley format", whatever that is, and
I need to convert the mbox to "Berkeley format" or convince the DLL to
use whatever format it is that I have, which I have no idea what it
is...
Far as I can tell, the "format" of the mbox is just one raw email
message after another, with a blank line in between.
It was actually converted from MS Exchange .pst to mbox using the
(gasp) pst2mbox converter commonly known as readpst:
http://alioth.debian.org/projects/libpst/
Note that the resulting mbox works fine under Linux, so it seems
unlikely that the mbox itself is at fault.
So now to some questions:
There does not seem to be any choice with imap_open.
Is that because it can allegedly open *any* mailbox format, including
"Berkeley format" and mbox and whatever it is that I have?
Or is that because only an idiot like me would FTP an mbox from Un*x
to Windows and expect to open it, and I have to do something else to
it?
Is the mailbox format hard-wired into the PHP compilation?
I see no settings in php.ini for an [IMAP] section to change anything.
Would converting Un*x newlines to Windows on the entire mbox help?
Seems to me that the RFC is quite specific about the newlines of
headers and body, and converting the mbox in toto is unlikely to be
useful.
Guess I can try it on my tiny sample and find out, but even if it
worked, it would seem more like a bug than a feature, so I'm wanting
some input on this topic no matter how it pans out.
Can somebody point me to anything that would de-mystify (errflg = 2)
in the error message?
Obviously that '2' has SOME kind of meaning, but is that from PHP,
IMAP, Windows OS, File System, ...?
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Richard Lynch wrote:
> I'm having trouble with Windows imap_open.
>
> I have the exact same mbox on a Linux box, with the exact same PHP
> code opening it just fine.
>
> I FTP (binary) to the Windows box (and a second time to be sure it
> wasn't an FTP flake-out).
>
> Opening the mbox in Windows yields a message like:
> PHP Notice:
> Unknown:
> C:\\data\\mbox.excerpt (file C:\\data\\mbox.excerpt) is not in valid
> mailbox format (errflg=2)
LONG SHOT: the path is freaking imap_open out - maybe it can be tricked
by using a path like so '/data/mbox.excerpt' (which windows should swallow -
although it assumes C: is the default drive [I think])
other than that I can only think to switch the line-endings in the mbox file
(at least to rule out the line ending as the problem)?!
...
>
> Can somebody point me to anything that would de-mystify (errflg = 2)
> in the error message?
> Obviously that '2' has SOME kind of meaning, but is that from PHP,
> IMAP, Windows OS, File System, ...?
I think the errflg is coming from IMAP ... I have found several bits
of C code related to IMAP (and seemingly nothing to do with php)
that reference 'errflg' - I have also found
that a value of 2 for errflg can mean anything from 'invalid mbox format'
to 'authentication failed' (not very helpful!)
what do these functions return for you?:
imap_errors(), imap_alerts(), imap_last_error()
>
>
attached mail follows:
Hi all,
I'm new in the php world and I have a problem. I want to invoke a php scr=
ipt from a web page hosted on an Apache server. The php script writes and=
deletes a file but, to be able to do that, I have to make the user to be=
myself and not the Apache server. In order to do that below is the code =
I use in the html to invoke the php script:
<form action=3D"http://www.aa.dd.cc/cgi-bin/cgiwrap/user/script.php" meth=
od=3D"post">
value1 *: <input type=3D"text" name=3D"val1"><br>
value2 *: <input type=3D"text" name =3D "val2"><br>
</form>
where script.php is placed inside ~/user/public_html/cgi-bin
The problem is that when the script is launched, as soon as the html in v=
isited, I get this error:
PHP Notice: Undefined index: val1 in /net/people/user/public_html/cgi-b=
in/script.php on line 14
PHP Notice: Undefined index: val2 in /net/people/user/public_html/cgi-b=
in/script.php on line 16
In other words, the POST issued inside the html seems not to work because=
the values val1 and val2 are not found.
If instead I do the following in the html code:
<form action=3D"script.php" method=3D"post">
value1 *: <input type=3D"text" name=3D"val1"><br>
value2 *: <input type=3D"text" name =3D "val2"><br>
</form>
having placed script.php in the same directory where the html is, the POS=
T succeeds but of course the script is not able to delete the file it is =
supposed to work on because the owner becomes the apache server.
I need the first method (script.php inside cgi-bin) to work.
Does anybody know the way to solve the problem?
Any help will be appreciated,
thanks,
-emiliano
------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada16dic06
attached mail follows:
Hi all,
I'm new in the php world and I have a problem. I want to invoke a php script from a web page hosted on an Apache server. The php script writes and deletes a file but, to be able to do that, I have to make the user to be myself and not the Apache server. In order to do that below is the code
I use in the html to invoke the php script:
<form action="http://www.aa.dd.cc/cgi-bin/cgiwrap/user/script.php" method="post">
value1 *: <input type="text" name="val1"><br>
value2 *: <input type="text" name ="val2"><br>
</form>
where script.php is placed inside ~/user/public_html/cgi-bin
The problem is that when the script is launched, as soon as the html in visited, I get this error:
PHP Notice: Undefined index: val1 in /net/people/user/public_html/cgi-bin/script.php on line 14
PHP Notice: Undefined index: val2 in /net/people/user/public_html/cgi-bin/script.php on line 16
In other words, the POST issued inside the html seems not to work because the values val1 and val2 are not found.
If instead I do the following in the html code:
<form action="script.php" method="post">
value1 *: <input type="text" name="val1"><br>
value2 *: <input type="text" name="val2"><br>
</form>
having placed script.php in the same directory where the html is, the POST succeeds but of course the script is not able to delete the file it is supposed to work on because the owner becomes the apache server.
I need the first method (script.php inside cgi-bin) to work.
Does anybody know the way to solve the problem?
Any help will be appreciated,
thanks,
-emiliano
attached mail follows:
On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> PHP Notice: Undefined index: val1 in
> /net/people/user/public_html/cgi-b=
> in/script.php on line 14
> PHP Notice: Undefined index: val2 in
> /net/people/user/public_html/cgi-b=
> in/script.php on line 16
http://php.net/isset
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Hi Richard,
sorry for bothering you, but can you please give me few more details about how to use isset to solve my problem?
-e
> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> > PHP Notice: Undefined index: val1 in
> > /net/people/user/public_html/cgi-b=
> > in/script.php on line 14
> > PHP Notice: Undefined index: val2 in
> > /net/people/user/public_html/cgi-b=
> > in/script.php on line 16
>
> http://php.net/isset
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>
------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada16dic06
attached mail follows:
>> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
>> > PHP Notice: Undefined index: val1 in
>> > /net/people/user/public_html/cgi-b=
>> > in/script.php on line 14
>>
>> http://php.net/isset
>>
On Fri, December 15, 2006 8:15 pm, Emiliano wrote:
> sorry for bothering you, but can you please give me few more details
> about how to use isset to solve my problem?
Well, in line 14, where you start using $_GET['val1'] or
$_POST['val1'] or $_REQUEST['val1'] without bothering to check if it
exists or not, put in a check to see if it exists before you try to
use it.
Something like:
<?php
if (isset($_POST['val1']){
//do something with val1 now that we know it's here
}
//don't do anything with 'val1' cuz she's not there
?>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Did you add a submit button to the page?
On 12/15/06, Richard Lynch <ceo
l-i-e.com> wrote:
> >> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> >> > PHP Notice: Undefined index: val1 in
> >> > /net/people/user/public_html/cgi-b=
> >> > in/script.php on line 14
>
> >>
> >> http://php.net/isset
> >>
>
>
> On Fri, December 15, 2006 8:15 pm, Emiliano wrote:
> > sorry for bothering you, but can you please give me few more details
> > about how to use isset to solve my problem?
>
> Well, in line 14, where you start using $_GET['val1'] or
> $_POST['val1'] or $_REQUEST['val1'] without bothering to check if it
> exists or not, put in a check to see if it exists before you try to
> use it.
>
> Something like:
> <?php
> if (isset($_POST['val1']){
> //do something with val1 now that we know it's here
> }
> //don't do anything with 'val1' cuz she's not there
> ?>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
oh ok, I understand that. However, my problem is different: I need those values that instead are not found. The question is: why the POST in the chunck of code inside the html doesn't work? Why is the php script not finding the values posted in the html?
Thanks,
-emiliano
> >> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> >> > PHP Notice: Undefined index: val1 in
> >> > /net/people/user/public_html/cgi-b=
> >> > in/script.php on line 14
>
> >>
> >> http://php.net/isset
> >>
>
>
> On Fri, December 15, 2006 8:15 pm, Emiliano wrote:
> > sorry for bothering you, but can you please give me few more details
> > about how to use isset to solve my problem?
>
> Well, in line 14, where you start using $_GET['val1'] or
> $_POST['val1'] or $_REQUEST['val1'] without bothering to check if it
> exists or not, put in a check to see if it exists before you try to
> use it.
>
> Something like:
> <?php
> if (isset($_POST['val1']){
> //do something with val1 now that we know it's here
> }
> //don't do anything with 'val1' cuz she's not there
> ?>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>
------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada16dic06
attached mail follows:
Yes Casey, I'm using the submit button
-emiliano
> >> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> >> > PHP Notice: Undefined index: val1 in
> >> > /net/people/user/public_html/cgi-b=
> >> > in/script.php on line 14
>
> >>
> >> http://php.net/isset
> >>
>
>
> On Fri, December 15, 2006 8:15 pm, Emiliano wrote:
> > sorry for bothering you, but can you please give me few more details
> > about how to use isset to solve my problem?
>
> Well, in line 14, where you start using $_GET['val1'] or
> $_POST['val1'] or $_REQUEST['val1'] without bothering to check if it
> exists or not, put in a check to see if it exists before you try to
> use it.
>
> Something like:
> <?php
> if (isset($_POST['val1']){
> //do something with val1 now that we know it's here
> }
> //don't do anything with 'val1' cuz she's not there
> ?>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>
------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada16dic06
attached mail follows:
On your script page, add
echo "<pre>";
print_r($_REQUEST);
echo "</pre>";
and tell us the result.
On 12/15/06, Emiliano <emi.mi
libero.it> wrote:
> Yes Casey, I'm using the submit button
>
> -emiliano
>
>
>
> > >> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> > >> > PHP Notice: Undefined index: val1 in
> > >> > /net/people/user/public_html/cgi-b=
> > >> > in/script.php on line 14
> >
> > >>
> > >> http://php.net/isset
> > >>
> >
> >
> > On Fri, December 15, 2006 8:15 pm, Emiliano wrote:
> > > sorry for bothering you, but can you please give me few more details
> > > about how to use isset to solve my problem?
> >
> > Well, in line 14, where you start using $_GET['val1'] or
> > $_POST['val1'] or $_REQUEST['val1'] without bothering to check if it
> > exists or not, put in a check to see if it exists before you try to
> > use it.
> >
> > Something like:
> > <?php
> > if (isset($_POST['val1']){
> > //do something with val1 now that we know it's here
> > }
> > //don't do anything with 'val1' cuz she's not there
> > ?>
> >
> > --
> > Some people have a "gift" link here.
> > Know what I want?
> > I want you to buy a CD from some starving artist.
> > http://cdbaby.com/browse/from/lynch
> > Yeah, I get a buck. So?
> >
> >
>
>
> ------------------------------------------------------
> Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
> http://click.libero.it/infostrada16dic06
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Fri, December 15, 2006 10:48 pm, Emiliano wrote:
> oh ok, I understand that. However, my problem is different: I need
> those values that instead are not found. The question is: why the POST
> in the chunck of code inside the html doesn't work? Why is the php
> script not finding the values posted in the html?
It's hard to say without surfing to your site and trying it, and
looking at the PHP source and HTML source.
The most common answers, in order of usage, are:
#1
You spelled the name="val1" and the $_POST['val1'] differently.
Spelling counts. :-)
#2
You don't understand the HTTP interaction, and are expecting it to do
things in a way it just plain does not work. This is the hardest one
to diganose and treat, as it's difficult to figure out what beginners
THINK the web is doing, much less convince them that they're wrong.
:-)
The best solution here is to get Firefox, install the LiveHTTPHeaders
extension to Firefox turn it on, visit a few simple/example sites that
do what your site does to see how they work, and then visit your site
to see what it does.
#3
A distant third, but possible, cause, is various PHP settings such as
GPC order and register_globals and that one about populating the long
names can be different than one expects.
Review your php.ini settings and search for "GPC" "register_globals"
and, errr, "long_name" or "long_var_name" or something like that.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
ok, this is what I get:
<pre>Array
(
)
</pre>
PHP Notice: Undefined index: val1 in /net/people/user/public_html/cgi-bin/mail.php on line 18
PHP Notice: Undefined index: val2 in /net/people/user/public_html/cgi-bin/mail.php on line 20
-emiliano
> On your script page, add
>
> echo "<pre>";
> print_r($_REQUEST);
> echo "</pre>";
>
> and tell us the result.
>
> On 12/15/06, Emiliano <emi.mi
libero.it> wrote:
> > Yes Casey, I'm using the submit button
> >
> > -emiliano
> >
> >
> >
> > > >> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> > > >> > PHP Notice: Undefined index: val1 in
> > > >> > /net/people/user/public_html/cgi-b=
> > > >> > in/script.php on line 14
> > >
> > > >>
> > > >> http://php.net/isset
> > > >>
> > >
> > >
> > > On Fri, December 15, 2006 8:15 pm, Emiliano wrote:
> > > > sorry for bothering you, but can you please give me few more details
> > > > about how to use isset to solve my problem?
> > >
> > > Well, in line 14, where you start using $_GET['val1'] or
> > > $_POST['val1'] or $_REQUEST['val1'] without bothering to check if it
> > > exists or not, put in a check to see if it exists before you try to
> > > use it.
> > >
> > > Something like:
> > > <?php
> > > if (isset($_POST['val1']){
> > > //do something with val1 now that we know it's here
> > > }
> > > //don't do anything with 'val1' cuz she's not there
> > > ?>
> > >
> > > --
> > > Some people have a "gift" link here.
> > > Know what I want?
> > > I want you to buy a CD from some starving artist.
> > > http://cdbaby.com/browse/from/lynch
> > > Yeah, I get a buck. So?
> > >
> > >
> >
> >
> > ------------------------------------------------------
> > Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
> > http://click.libero.it/infostrada16dic06
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada16dic06
attached mail follows:
Hmmm... there's something wrong with the form sending its values.
Try
echo "<pre>";
print_r($GLOBALS);
echo "</pre>";
On 12/15/06, Emiliano <emi.mi
libero.it> wrote:
> ok, this is what I get:
>
> <pre>Array
> (
> )
> </pre>
> PHP Notice: Undefined index: val1 in /net/people/user/public_html/cgi-bin/mail.php on line 18
> PHP Notice: Undefined index: val2 in /net/people/user/public_html/cgi-bin/mail.php on line 20
>
> -emiliano
>
>
> > On your script page, add
> >
> > echo "<pre>";
> > print_r($_REQUEST);
> > echo "</pre>";
> >
> > and tell us the result.
> >
> > On 12/15/06, Emiliano <emi.mi
libero.it> wrote:
> > > Yes Casey, I'm using the submit button
> > >
> > > -emiliano
> > >
> > >
> > >
> > > > >> On Fri, December 15, 2006 7:39 pm, Emiliano wrote:
> > > > >> > PHP Notice: Undefined index: val1 in
> > > > >> > /net/people/user/public_html/cgi-b=
> > > > >> > in/script.php on line 14
> > > >
> > > > >>
> > > > >> http://php.net/isset
> > > > >>
> > > >
> > > >
> > > > On Fri, December 15, 2006 8:15 pm, Emiliano wrote:
> > > > > sorry for bothering you, but can you please give me few more details
> > > > > about how to use isset to solve my problem?
> > > >
> > > > Well, in line 14, where you start using $_GET['val1'] or
> > > > $_POST['val1'] or $_REQUEST['val1'] without bothering to check if it
> > > > exists or not, put in a check to see if it exists before you try to
> > > > use it.
> > > >
> > > > Something like:
> > > > <?php
> > > > if (isset($_POST['val1']){
> > > > //do something with val1 now that we know it's here
> > > > }
> > > > //don't do anything with 'val1' cuz she's not there
> > > > ?>
> > > >
> > > > --
> > > > Some people have a "gift" link here.
> > > > Know what I want?
> > > > I want you to buy a CD from some starving artist.
> > > > http://cdbaby.com/browse/from/lynch
> > > > Yeah, I get a buck. So?
> > > >
> > > >
> > >
> > >
> > > ------------------------------------------------------
> > > Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
> > > http://click.libero.it/infostrada16dic06
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
>
>
> ------------------------------------------------------
> Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
> http://click.libero.it/infostrada16dic06
>
>
>
attached mail follows:
On Fri, December 15, 2006 8:06 am, Fernando M. M. wrote:
> I have just started using curl and i have some question about
> cookies.
>
> The website i'm logging in controls everything using cookies (from
> login to the actions inside it).
>
> Is there a way to store the cookie values
> into a php session variable ($_SESSION['cookie'])?
>
> How do i make curl receive
> the cookie and store in this variable?
>
> How do i make curl send it?
Option #1.
Use the HEADER option in curl to get all the headers, and you can see
the cookies, parse them, send them back with more header options.
Option #2.
Use the COOKIE_FILE and COOKIE_JAR option and let curl accept/send the
cookies for you, automatically.
Last time I tried it, these were mutually exclusive. You could
automate the cookies and get no headers, or you could get headers and
do all the cookies for yourself, but not get the headers and have curl
handle the cookies while you did something interesting with the other
headers.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Fri, December 15, 2006 7:49 am, Yonatan Ben-Nes wrote:
> 1. Let's say that I create the following prepared statement:
> $PDOStatement = $DB_Conn->prepare("INSERT INTO test (name) values
> (?)");
> And after 50,000 inserts (with
> $PDOStatement->execute(array('somevalue'));)
> I want the database to analyze, compile and optimize it's plan again
> so it
> will be more efficient for it's next inserts (actually is that true at
> all?!?), does repeating the same command will deallocate the prepared
> statement at the database & replace it with the new prepared
> statement? (new
> plan).
> If not, how can I deallocate it then?
I *think* you will find that the change in plan for an insert will not
change drastically as you insert -- Rather, the change in plan will
change for a SELECT if you optimize/analyze/etc.
Based on the $PDOStatement being a result object, I would *expect* it
to survive an analysis query on the same connection, but you'll have
to test to be sure.
> 2. At the PHP manual of PDOStatement::closeCursor it's written that
> "This
> method is useful for database drivers that do not support executing a
> PDOStatement object when a previously executed PDOStatement object
> still has
> unfetched rows. If your database driver suffers from this limitation,
> the
> problem may manifest itself in an out-of-sequence error.".
> Anyone know if the PostgreSQL suffer from this problem or not?
The PostgreSQL developers will probably answer this one way more faster.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Thu, December 14, 2006 11:47 pm, WeberSites LTD wrote:
> I'm trying to limit the text someone can submit in a text area with :
>
>
> Code:
> if(!preg_match("/^[à-úA-Za-z0-9_():,
\/\.\s\-\" ]*$/i",$FieldValue)) {
>
> }
>
>
> It works well but I'm having problems with the " (double quote).
> If there is a double quote (") it fails.
Fails in what way?
Are you sure you are remembering to do http://php.net/htmlentities on
the data you send out for the TEXTAREA to pre-populate it?
Does PCRE need " escaped inside the [] bit? I think not, but I
suppose \\" instead of \" couldn't hurt.
You may also want to move the - to the end of [] character set and
lose the \, just to keep it simpler.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
I think you are assuming that the stuff you do in test.php carries
over to test2.php
It doesn't.
The ONLY stuff connected between test.php and test2.php is the POST
data being sent by the FORM submission.
Your $keclass needs to be re-built from scratch in test2.php, somehow.
You can cram it into a $_SESSION or just re-build it, but it won't
magically transfer.
On Thu, December 14, 2006 7:26 pm, Macha wrote:
> I'm not sure if it matters or not, but this is happening on the page
> that you are sent to from hitting the submit button from the other
> page...test.php is a form that sends you to test2.php after hitting
> the
> submit button and its test2.php page that is having this issue with
> the
> $keclass.
>
> with that on test2.php if i use var_dump($keclass) i get *'Notice*:
> Undefined variable: keclass' and *'Fatal error*: Call to a member
> function on a non-object' on any $keclass -> function call witch makes
> since, but if i try to declare the class in test2.php with
> var_dump($keclass) i get object(keclass)(0) but i get *Fatal error*:
> Cannot redeclare class keclass. so i guess that information changes
> the
> question down to why is it saying that i am redeclaring $keclass when
> it
> hasnt been declared in that page before? is it something do to with
> test.php when u hit submit and being redirected to test2.php?
>
> If this dosnt really make any sense let me know..i have been told
> serveal times in the past i dont really explain my self well hehe
>
> Richard Lynch wrote:
>> var_dump($keclass);
>>
>> It's not an object...
>>
>>
>> On Thu, December 14, 2006 9:16 am, macha
kingdomsend.com wrote:
>>
>>> just starting to get used to classes, trying to figure out what i
>>> am
>>> doing wrong, i know its going to be something stupid on my part,
>>> probably really shouldn't be using a if statement or something heh
>>>
>>> just doing a basic email verification to make sure its looks like
>>> email
>>> addy
>>>
>>> so i take the post to a var
>>>
>>> PHP Code:
>>> $email_address = $_POST['email_address'];
>>>
>>>
>>> run it through this function in my class
>>>
>>> PHP Code:
>>> function check_email($address){
>>> if
>>> (ereg('^[a-zA-Z0-9_\.\-]+
[a-zA-Z0-9\-]+.[a-zA-Z0-9\-\.]+$',
>>> $address))
>>> return true;
>>> else
>>> return false;
>>> }
>>>
>>>
>>> and then if true i want it to continue on with the script or error
>>> out
>>> and quit back to the other page and display the error. so i have
>>> tried
>>> something like this and stuff similar but get a error
>>> Fatal error: Call to a member function on a non-object in
>>>
>>> PHP Code:
>>> if (!$keclass->check_email($email_address)) {
>>> $keclass->seterr(555);
>>> include('test.php');
>>> exit();
>>> }
>>>
>>> $keclass->seterr(000);
>>> include('test.php');
>>> exit();
>>>
>>>
>>> the seterr is just a simple thing that takes the number and puts in
>>> a
>>> session var for latter display...
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>
>>
>>
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Hello,
on 12/14/2006 06:32 PM Nauman Akbar said the following:
> I picked up an example from Curl section on php.net. I am able to access the
> remote page fine with a custom header. Unfortunately, I am not able to
> retrieve the XML I am sending at the remote end. I have tried both
> $HTTP_RAW_POST_DATA and php://input but neither of them returns anything. I
> am putting my code below just in case anyone can point out the problem in
> there.
I don't think you need to wrap your XML in a multipart/mixed container.
Just send it as text/xml. That is how SOAP and other protocols work and
PHP can handle it.
You can also emulate submission of a form with files. That is more
complicated but works better with PHP as you do not need to tweak php.ini .
I use this HTTP client class that has either an example of sending a XML
document like your want or using form submission emulation. Take a
look in particular at examples test_http_post.php and test_http_soap.php .
http://www.phpclasses.org/formsgeneration
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
On Fri, December 15, 2006 3:32 am, Kai Xiang wrote:
> Oh, that's interesting to know, is that from certain test of design
> goals? I
> suspect this for I thought the most time-consuming work in PHP should
> be
> compiling.
The most time consuming work in PHP isn't in PHP at all. :-)
It's in the database, the file system, the network congestion...
It's true, that for the core of PHP, for what little time is spent by
PHP doing anything at all, compiling the code to opcode takes longer
than ripping through those opcodes and dispatching the function call
to some external library, not counting the time spent outside of PHP
core actually executing whatever that extension library does.
That still doesn't mean that the actual process of converting PHP
"echo" to opcode #42 takes any large chunk of time. It's very tiny.
> Refer to the early descussion, because all the thread share the same
> opcode, so it could save memory usage at the same time, is that true?
> say if
> there is a lot of requests at the same time, that could be a lot of
> memories. is that the design goal? or why not just implement a PHP
> file
> cache.
Because if you just did the file cache, it would be an equal amount of
work to doing the opcode cache, so you might as well go ahead and
cache the opcode, and save that extra 1% performance.
Caching the parser output as opcodes instead of raw PHP input is like
free gravy. :-)
It's a question of inserting your cache calls in line 1470 or line
1530, and you either cache the PHP source at 1470, or the opcode
output at 1530. So you do it at 1530 and save those lines of code in
between that do the opcode translation.
[line numbers used for illustrative purposes, and are not actual line
numbers, nor even realistic range between them]
>> > 2. Is there some alternative choise except zend engineen, why need
>> a
>> > zend
>> > engine? for performance advantage or just easy for porting to
>> > different
>> > platform?
You could, in theory, take PHP, rip out its guts (aka the Zend Engine)
and replace it with some other compiler/parser/engine that did much
the same thing, if you had nothing better to do with your life for the
next several years...
The Zend Engine is what translates:
if (...){
myfunction(...);
}
into something that the computer can actually execute.
That's pretty much all it is.
Note that the Zend Engine is OPEN SOURCE and it will always be OPEN
SOURCE and it will never not be OPEN SOURCE and it is FREE and it will
always be FREE and it will never not be FREE (*) for PHP.
But, sure, if you feel strongly enough about it, go ahead and fork the
PHP project to rip out the Zend Engine and write your own.
[shrug]
That's why it's Open Source, to give you the freedom to do that.
Seems like an awful lot of work to no real purpose to this naive
reader, but to each their own.
(*)
Actually, if somebody wants to embed the ZE inside of something other
than PHP, then I think Zend expects to get paid for that. I do know
they had a deal or two on the table when I worked for them, back in
2000 or so, but I dunno if they came to fruition or not. ZE may well
be embedded in some telecom gear somewhere, as it would be a good fit
for a simple scripting language that is small enough (without
extensions) to fit in that niche market. And the telco industry can
afford whatever Zend charged them for that, most likely.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Just to be sure...
You've double-checked that page setup code isn't somehow triggering an
ini_set('session.use_trans_id') or other session parameters, right?
I'd also examine any kind of code that is supposed to do something
"different" for the dev/production environment.
Inevitably, there ends up being *SOME* kind of #ifdef in there that
does some configuration thing in dev server to connect to different db
or whatever...
On Tue, December 12, 2006 3:17 pm, Matthew North wrote:
> Hello All,
>
> I have an odd situation that I wonder if someone might have some
> insight on. The scenario is this:
>
> - Two FreeBSD systems running Apache+mod_php+others. We use one for
> development and the other for testing.
>
> - Each system is running PHP 5.2.0 with identical php.ini files.
>
> - On each system we have identical PHP code (confirmed to be identical
> by comparing cksum output) that looks essentially like this:
>
> === snip ===
> <?php
> .
> . [page setup code]
> .
> trigger_error('['.session_id().']');
> if (needSession && !session_id())
> session_start();
> trigger_error('['.session_id().']');
> .
> . [page output code]
> .
> ?>
> === snip ===
>
> Errors are logged to file rather than the page, so the trigger_error()
> calls above result in entries similar to:
>
> [08-Dec-2006 16:59:23] PHP Notice: [] in /path/to/file.php on line
> 178
>
> [08-Dec-2006 16:59:23] PHP Notice: [GmQidWwShpRpHCGDiQrBr-Lk4ib] in
> /path/to/file.php on line 181
>
> So it appears a session is started.
>
> However, on the test system a session cookie is never sent back to the
> browser so the session cannot be restored, while on the development
> system everything works as it should (session cookie is set and
> session is therefore restored on each page load).
>
> Using 'wget -S', here are the response headers sent by the development
> system:
>
> $ wget -S http://dev/ajax/shopping_list.php\?action=add\&SKU=ABC
> --15:48:41-- http://dev/ajax/shopping_list.php?action=add&SKU=ABC
> => `shopping_list.php?action=add&SKU=ABC.1'
> Resolving dev... 192.168.0.30
> Connecting to dev|192.168.0.30|:80... connected.
> HTTP/1.1 200 OK
> Date: Mon, 11 Dec 2006 23:48:41 GMT
> Server: Apache/2.2.3 (FreeBSD) mod_ssl/2.2.3 OpenSSL/0.9.7e-p1 DAV/2
> PHP/5.2.0 with Suhosin-Patch mod_ruby/1.2.5 Ruby/1.8.5(2006-08-25)
> SVN/1.4.2
> mod_jk/1.2.15
> X-Powered-By: PHP/5.2.0
> Set-Cookie: PHPSESSID=WJ33PpO,nphiPAVxrbrWrQEnO5a; path=/
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
> Pragma: no-cache
> Content-Length: 103
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: application/xml
> Length: 103 [application/xml]
>
>
> And on the live server:
>
>
> $ wget -S http://test/ajax/shopping_list.php\?action=add\&SKU=ABC
> --15:48:26-- http://test/ajax/shopping_list.php?action=add&SKU=ABC
> => `shopping_list.php?action=add&SKU=ABC'
> Resolving test... 192.168.0.31
> Connecting to test|192.168.0.31|:80... connected.
> HTTP request sent, awaiting response...
> HTTP/1.1 200 OK
> Date: Mon, 11 Dec 2006 23:48:26 GMT
> Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1
> SVN/1.3.2
> PHP/5.2.0 DAV/2
> X-Powered-By: PHP/5.2.0
> Content-Length: 103
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: application/xml
> Length: 103 [application/xml]
>
>
> No session cookie! Note that the bodies of these two responses are
> identical as determined using diff. Also note that we have other sets
> of code on the test system which call session_start(), and a session
> cookie _is_ set, as it should be, and everything works fine. So it's
> not simply that the session module is broken or mis-configured on the
> test machine. Under most circumstances sessions work fine on both
> systems. This implies that there is something specific about the code
> that is running in the [page setup code] and/or [page output code]
> (refer to snippet above) that is causing session_start() to behave
> unusually. But again, the PHP code is identical, so it must be the
> code *in combination with* some other external difference between the
> two systems.
>
> The only differences between the two systems that could conceivably
> make sense (to my mind) in terms of this differing behavior are:
> Apache 2.0.59 and no Suhosin patch on the test machine, vs Apache
> 2.2.3 _with_ Suhosin patch on the development system (and I mention
> Suhosin only because it makes some cookie-related changes). There are
> other differences, but none that would appear that they should have
> this effect. Here are the configure commands used for each system:
>
> test system:
> =======
> './configure' '--with-mysql=/usr/local/mysql'
> '--with-pgsql=/usr/local/pgsql'
> '--with-gettext' '--with-xml' '--with-imap' '--with-imap-ssl'
> '--with-pspell'
> '--with-zlib' '--with-zlib-dir=/usr' '--with-bz2' '--with-ndbm'
> '--enable-dba'
> '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local'
> '--with-jpeg-dir=/usr/local' '--with-tiff-dir=/usr/local'
> '--with-png-dir=/usr/local' '--with-tidy' '--with-openssl'
> '--enable-sysvsem'
> '--enable-sysvshm' '--enable-dbase' '--enable-ftp'
> '--enable-memory-limit'
> '--enable-inline-optimization' '--disable-debug'
> '--with-apxs2=/usr/local/apache2/bin/apxs' '--prefix=/usr/local/php'
> '--with-config-file-path=/usr/local/php'
>
> development system:
> ============
> './configure' '--enable-versioning' '--enable-memory-limit'
> '--with-layout=GNU'
> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> '--enable-spl' '--program-prefix=' '--disable-path-info-check'
> '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php'
> '--with-zend-vm=CALL'
> '--prefix=/usr/local'
>
> I acknowledge that these aren't particularly similar, but they do not
> differ in any way that should cause this difference in behavior (do
> they?).
>
> The PHP modules loaded match between the two systems, with the
> exception of tidy which is enabled on the test machine and not enabled
> on the development system.
>
> And again, php.ini are identical between the systems.
>
> What could explain this difference in behavior?
>
>
> Thanks,
>
> Matthew H. North
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Tue, December 12, 2006 2:23 pm, jennifer
hooksbooks.com wrote:
> I'm experiencing a strange problem and difficult to diagnose because
> it's random. I have built an application that sends out an email with
> a nice amount of text (don't have exact char count, but could get it).
>
> On the html email, a random whitespace appears in the content, but
> always toward the end pointing to a possible character count issue.
>
> See below for examples of how the space wanders and is random:
>
> 1- "Th ere are several things being discussed in this email."
> 2- "There are se veral things being discussed in this email."
> 3- "There are severa l things being discussed in this email."
>
> This whitepace issue happens after the email is sent.
>
> Anybody have any ideas?
If you have confirmed that it's happening AFTER php sends the email,
then you can be pretty sure it's not PHP doing it...
Also, sending html enhanced (cough, cough) email is probably the First
Problem. :-) :-) :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
The "old school" HTTP-EQUIV of a refresh with a time and URL would
probably be suitable for this.
YMMV
And it's still not PHP. :-)
On Thu, December 14, 2006 11:08 am, bruce wrote:
> all these are solid posts...
>
> however, the original posting, was not to do a redirect on the page
> being
> presented.
>
> the original post, was to display some content rolling down the page,
> wait
> some time, and 'then' redirect the user to another page. i wanted to
> be able
> to accomplish this without having the user hitting some 'submit'
> button.
>
> thanks!
>
>
> -----Original Message-----
> From: Brad Fuller [mailto:bfuller
cpacampaigns.com]
> Sent: Thursday, December 14, 2006 8:40 AM
> To: 'PHP General List'
> Subject: RE: [PHP] php redirection..
>
>
>
> Better to do this on the client side with JS
>
> <html>
> <head>
> <title>Redirect Test</title>
> <script language="JavaScript">
> function redirect() {
> location.href='http://www.google.com/';
> }
> </script>
> </head>
> <body onLoad="setTimeout('redirect()', 3000);">
> <p>You will be redirected in 3 seconds...</p>
> </body>
> </html>
>
>
>> -----Original Message-----
>> From: Youri LACAN-BARTLEY [mailto:ylacan
teicam.com]
>> Sent: Thursday, December 14, 2006 10:44 AM
>> To: PHP General List
>> Subject: Re: [PHP] php redirection..
>>
>> Budi Setiawan wrote:
>> >> basically:
>> >>
>> >> cat.php
>> >> -echo " test content<br>"
>> >> -echo " more test content<br>"
>> >>
>> >> //redirect user
>> >> echo"
>> >> <script>
>> >> location.href='foo.php';
>> >> </script>
>> >> ";
>> >>
>> >
>> >
>> > Hi , im a new too..
>> >
>> > but you can try with this to delay your script running for some
>> seconds
>> :
>> > echo " test content<br>"
>> > echo " more test content<br>"
>> >
>> > // you can add :
>> > sleep(2);
>> > // this will cause your script delayed for 2 seconds
>> >
>> > //redirect user
>> > echo"
>> > <script>
>> > location.href='foo.php';
>> > </script>
>> > ";
>> >
>>
>> This would work providing you don't use output buffering, otherwise
>> the
>> user won't see any data whatsoever that has been sent prior to the
>> sleep() call.
>>
>> >
>> > // hhaha..
>> > // im just trying to help...
>> > //
>> >
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Tue, December 12, 2006 12:51 pm, Stut wrote:
> bruce wrote:
>> hey stut...
>
> Please don't reply to me directly, always include the mailing list.
>
>> thanks for the reply... i did get some output...
>>
>> i also have a question as to why i couldn't get it to work when i
>> used
>> 'header (foo.php)'
>
> 1) The correct way to redirect using the header function is
> header('Location: http://domain.com/foo.php'); Note the absolute URL.
> 2) Using header will definitely not display any output from the page.
You actually need to put in an exit; if you want to guarantee that PHP
won't send more data, and that the browser won't process it and show
it before doing the re-direct...
*MOST* of the time the Location: header gets processed so fast, you
don't see any following data, but if you pound on it enough, you'll
see that the browser *can* show the data after the re-direct, if it
feels particularly Orange at that moment in time.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Wed, December 13, 2006 9:41 pm, Casey Chu wrote:
> Search Engines don't like the META tag.
>
> Use
>
> <script>location.href='foobar.php';</script><a href='foobar.php'>Foo
> Bar</a>
If the search engine authors are not smart enough to make the META tag
and this JS snippet the same in their evaluation of the page, maybe
that search engine is a pretty bad one...
I don't *KNOW* but I suspect that the search engines care equally
about the META re-direct and a JS re-direct, if the search engines are
any good at what they do.
We already have enough mis-information, mostly just out-dated
information, about search engines. Let's either provide references or
be clear that we are only guessing.
I'm only guessing.
:-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Actually... Search engines don't have a JavaScript interpreter.
On 12/15/06, Richard Lynch <ceo
l-i-e.com> wrote:
> On Tue, December 12, 2006 12:51 pm, Stut wrote:
> > bruce wrote:
> >> hey stut...
> >
> > Please don't reply to me directly, always include the mailing list.
> >
> >> thanks for the reply... i did get some output...
> >>
> >> i also have a question as to why i couldn't get it to work when i
> >> used
> >> 'header (foo.php)'
> >
> > 1) The correct way to redirect using the header function is
> > header('Location: http://domain.com/foo.php'); Note the absolute URL.
> > 2) Using header will definitely not display any output from the page.
>
> You actually need to put in an exit; if you want to guarantee that PHP
> won't send more data, and that the browser won't process it and show
> it before doing the re-direct...
>
> *MOST* of the time the Location: header gets processed so fast, you
> don't see any following data, but if you pound on it enough, you'll
> see that the browser *can* show the data after the re-direct, if it
> feels particularly Orange at that moment in time.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Fri, December 15, 2006 10:28 pm, Casey Chu wrote:
> Actually... Search engines don't have a JavaScript interpreter.
Actually...
You don't know for sure that Google isn't using Perl's javascript
interpreter.
Unless you work for Google, have just told us something they would
consider double-secret proprietary, and are about to get fired.
:-) :-) :-)
It would not be Rocket Science for a search engine to execute the
javascript on a page in a sandbox, to analyze it for abuses, viruses,
and other things they wanted to take away "points" for.
I know I could almost manage that with a ton of work.
And I figure the Google engineers are probably a heck of a lot smarter
than I am, and for sure they are way more experienced.
So I'm going to assume that any "dodge" in JS I could come up with to
game their system, will be detected and defeated as soon as they want
to bother doing that.
But, hey, feel free to get Google to issue a statement that they do
not now nor ever will check the JS on sites as they index them, and
point to it as a reference.
:-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Well... They skip all <!-- -->'s, so they skip <script><!-- //--></script>'s.
On 12/15/06, Richard Lynch <ceo
l-i-e.com> wrote:
> On Fri, December 15, 2006 10:28 pm, Casey Chu wrote:
> > Actually... Search engines don't have a JavaScript interpreter.
>
> Actually...
>
> You don't know for sure that Google isn't using Perl's javascript
> interpreter.
>
> Unless you work for Google, have just told us something they would
> consider double-secret proprietary, and are about to get fired.
> :-) :-) :-)
>
> It would not be Rocket Science for a search engine to execute the
> javascript on a page in a sandbox, to analyze it for abuses, viruses,
> and other things they wanted to take away "points" for.
>
> I know I could almost manage that with a ton of work.
>
> And I figure the Google engineers are probably a heck of a lot smarter
> than I am, and for sure they are way more experienced.
>
> So I'm going to assume that any "dodge" in JS I could come up with to
> game their system, will be detected and defeated as soon as they want
> to bother doing that.
>
> But, hey, feel free to get Google to issue a statement that they do
> not now nor ever will check the JS on sites as they index them, and
> point to it as a reference.
> :-)
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Tue, December 12, 2006 9:45 am, Fernando M. M. wrote:
> I have a script called redir.php that is used only for redirecting
> using the following code:
>
> header('Location: ', $_GET['url']);
So, you have a one-line script do accomplish a one-line task?
Okaaaaay.
> But
> now i need to redirect post varibles too. Example:
>
> If someone access
> redir.php?url=my_page.php and post:
>
> &a=1&b=2
>
> I need to
> send this post string (as post) to my_page.php.
If you need to re-post data from PHP, you can Google for "Rasmus
Lerdorf posttohost function" and do that, or you can use
http://php.net/curl or you can use any of a few hundred functions
similar to the one Rasmus wrote a dozen years ago, or...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
A cookie is sent BACK to the server after the server sends it to the
browser. Period.
It's kind of like when you go to a movie, and you buy your ticket from
one person, and then you hand it to another, and they hand it back,
and then you have to be prepared to show it to prove you aren't
sitting through a second movie.
Walking back out front to the ticket sales window, you don't show them
your ticket again...
Maybe that's not such a good analogy...
Anyway, when you hit the back button, back to the first page, there is
no cookie, because there was no cookie in that request, because you
hadn't sent it.
If you reload, you get back the cookie, because the browser has it, so
it can send it now.
On Tue, December 12, 2006 9:28 am, William Stokes wrote:
> Hello,
>
> I have a page that uses session cookies for deciding what content to
> show to
> a visitor. User also has 2 form objecks to apply filters to the
> content SQL
> queries. So at the beginning of the script I set 2 cookies based on
> user
> selections(or defaults) and after that make DB query based on user
> selections. I wanted to use cookies because there also "back - up -
> forward" links for pagination.
>
> Problem is that in order to get the cookie based system to work the
> page
> needs a refresh to read the cookies and display content corretly. Is
> this
> because the page loads faster than the server set's the cookies to
> client
> browser? If so what's the "corrert" / best way to implement the
> filters and
> page navigation if there's 2 form select lists and 3 links to navigate
> the
> page.
>
> Thanks
> -Will
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Tue, December 12, 2006 8:23 am, Denis Gerasimov wrote:
> I am in a need of implementing custom/used-defined fields mechanism.
> What I
> need is adding new fileds to a db table on-the-fly.
>
> There are 2 possible options I know:
>
> 1. Add a fixed set of text columns named custom_01, custom_02,
> etc.
>
> 2. Alter db tables dynamically by adding/dropping a column of
> appropriate type and creating/dropping helper tables if needed (e.g.
> values
> for select lists)
The "usual" answer is to create a single table of user-defined fields,
and put the field_name -> field_data relationship into that.
You have an extra table to JOIN to all your queries, but it works
tolerably well for most usage.
You may want to find out if there is a Joomla approved approach or
something as well, by posting in a Joomla forum.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Tue, December 12, 2006 4:34 am, Javier Ruiz wrote:
> damn! that's a pretty good article, thanks a lot.
>
> unfortunatelly, it's not mentioning about zip files concretely, I
> didn't
> find a solution for my problem with them.
> I tried playing a bit with the Content-type, but it seems that
> Internet
> Explorer doesn't really care about "Content-type"... it uses the
> extention
> of the file to determine the type (microsoft's way...) so it doesn't
> matter
> if I use "application/octet-stream" or even
> "application/force-download" or
> "application/makethisdownload-or-ikillyou" :-D as long as I name the
> file "
> whatever.zip", IE6 shows the "open with" dialog and if I use "open"
> with an
> application, it fails :(
It does matter on real browsers...
Use the correct content type for a download: application/octet-stream
> thanks again Richard for the answer and for the article :)
>
> anybody with a miracle for the ZIP+IE problem??
You're going to HAVE to open the Zip file with some kind of unzip
application such as WinZip, pkunzip, or, possibly, that goofball
Windows unzip thingie that lets you pretend zip archives are
directories, even though they aren't, but only up to a certain point,
as you can't do some things with files in the zip archive that you can
do with normal files, so it's just a very confusing Human Interface...
Sort of like Windows in a microcosm.
If you were hoping that somehow IE would magically unzip the item, and
then let you open the contents within the zip file with a chosen
application... Even MS Windows isn't THAT stupid. Yet.
What if there are 2 things in the zip archive?
For that matter, if there aren't 2 things, why is it even zipped?
>> > 1 - To change the mimetype (when writting http headers) from
>> > "application/zip" that I used before to
>> "application/x-zip-compressed"
>> > 2 - To not use MOD_DEFLATE in apache2 (I was not using it
>> > really...)
I now am beginning to wonder if you are trying to send your HTML as
gzip'ed data for the browser to surf to your site, to save on
bandwidth... If so, none of the above has any bearing on this at
all...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Tue, December 12, 2006 11:04 am, Frank M. Kromann wrote:
> if you use:
>
> header("Content-Type: application/zip");
> header("Content-Disposition: attachment; filename=\"somefile.zip\"");
>
> That works for me with IE 6/7 and other browsers.
Argggggh.
Please read this:
http://richardlynch.blogspot.com/
Go test with MORE browsers and MORE OSes, because you haven't yet hit
the ones where your Content-Disposition does not work, and they are
out there somewhere.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
An HTTP response can only do ONE of these two things:
output HTML
start a download
If you see sites such as SourceForge that *seem* to do this in one
page, and analyze their HTML and their headers, you will find that
they are using a META refresh tag or some JavaScript to cause the
original HTML to re-direct to another URL, which then does the
download.
So, really, you are visiting the HTML output page, and then in that
page, some browser-side hack is forcing the download.
I personally find this annoying rather than useful, frankly, but there
it is. It obviously works for SourceForge and they have a lot of
users, so I must be the exceptional surfer who is annoyed by this.
[Just gimme the download link -- don't make me surf to a page to get
to the page that gives me the page to get the download. Sheesh!]
On Tue, December 12, 2006 3:37 am, viraj wrote:
> hi all,
> i have a small script which shows some information inside a html table
> and then pushes a file to save on to users desktop.
>
> but with the following code it download the file and stay without
> outputting the html table to browser.
>
> i tried with out put buffering functions, but still no luck (it seems
> i'm not clear about those functions yet..). could somebody please help
> me on this?
>
> many thanks
>
>
> ~viraj
>
>
>
> <?php
>
> function my_callback($content) {
> header('Content-type: application/binary;
> charset=iso-8859-1');
> header("Expires: 0");
> header("Cache-Control: must-revalidate,
> post-check=0,pre-check=0");
> header("Pragma: public");
> header("Content-Disposition: attachment; filename=\"Test.url\"");
> $content .= "[InternetShortcut]\r\n" .
> "URL=http://192.168.1.71/\r\n" .
> "IDList=" .
> "IconFile=http://192.168.1.71/favicon.ico\r\n" .
> "IconIndex=1\r\n" .
> "[{000214A0-0000-0000-C000-000000000046}]\r\n" .
> "Prop3=19,2\r\n";
>
> return $content;
> }