php-general Digest 8 Nov 2006 09:33:52 -0000 Issue 4447
Topics (messages 244345 through 244363):
PHP Consultant / Contractor
244345 by: Max Clark
Re: Parse Errors with 5.2 on Linux
244346 by: Stut
244347 by: Robert Cummings
Re: list of countries
244348 by: Rory Browne
244350 by: James Tu
Re: Spam using email on website
244349 by: Bruce Cowin
pass value to next page
244351 by: Wang Chen
244352 by: Bruce Cowin
244353 by: benifactor
244355 by: Jochem Maas
244356 by: Wang Chen
Re: Sorting MySQL queries
244354 by: Dotan Cohen
Nested includes - Relative paths?
244357 by: Nuno Vaz Oliveira
244361 by: Larry Garfield
Time-Zone juggling
244358 by: Richard Lynch
244359 by: Travis Doherty
OpenLDAP
244360 by: Alain Roger
Delivery failed
244362 by: isp-europe.lists.isp-lists.com
Re: [newbie in session] Is is right behavior???
244363 by: clive
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hi all,
I apologize in advance for a commercially orientated posting in this
discussion list - I did not see a business focused list to use instead.
I am looking for a good reliable PHP developer that can help with some
one off projects that I have (10-20 hours a month perhaps) - geographic
location is not a concern (aka I am open to persons outside of the US),
the requirement of reliable communication and timely delivery is absolute.
If you are interested in something like this please email me off list
with your Resume/CV, any sample projects that would be good to look at,
and of course your contact information.
Thanks,
Max
max [at] clarksys [dot] com
--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
I never have understood why it was kosher to leave the final ?> off,
for example, so maybe that changed. :-) [I doubt it]
Certainly hasn't changed, and I hope it never does. Having to find an
errant space or carriage return at the end of an include file that is
one of nearly 100 that get included in a script has taught me that there
is no greater feature in PHP!! I never use a closing ?> if PHP script is
the last thing in a file - less headaches all around.
-Stut
--- End Message ---
--- Begin Message ---
On Tue, 2006-11-07 at 21:18 +0000, Stut wrote:
> Richard Lynch wrote:
> > I never have understood why it was kosher to leave the final ?> off,
> > for example, so maybe that changed. :-) [I doubt it]
>
> Certainly hasn't changed, and I hope it never does. Having to find an
> errant space or carriage return at the end of an include file that is
> one of nearly 100 that get included in a script has taught me that there
> is no greater feature in PHP!! I never use a closing ?> if PHP script is
> the last thing in a file - less headaches all around.
Hear, hear! And the word from internals a few years ago was that it was
an intended feature for exactly that reason.
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. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
A MySQL list would have been a better place for this.
Then again
Most people on the MySQL list would have known about
http://dev.mysql.com/doc/world-setup/en/world-setup.html where as
people on this are less likely to.
On 11/7/06, James Tu <[EMAIL PROTECTED]> wrote:
Does anyone have a list of countries in a handy format for importing
into MySQL? I just really need a list. Wikipedia has a nice list,
but it's muddled by HTML tags.
If you also have them in Chinese and Arabic that would be even better.
-James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Sorry, maybe I should have posted on that list. My post was about
the list rather than about using MySQL.
My initial thought was that country lists would have been something
that people in this forum would have encountered and was also hoping
that some people here would have multi-language experience for
country lists in other languages.
Thanks to all that have pointed me in the right direction.
-James
On Nov 7, 2006, at 4:41 PM, Rory Browne wrote:
A MySQL list would have been a better place for this.
Then again
Most people on the MySQL list would have known about
http://dev.mysql.com/doc/world-setup/en/world-setup.html where as
people on this are less likely to.
On 11/7/06, James Tu <[EMAIL PROTECTED]> wrote:
Does anyone have a list of countries in a handy format for importing
into MySQL? I just really need a list. Wikipedia has a nice list,
but it's muddled by HTML tags.
If you also have them in Chinese and Arabic that would be even
better.
-James
--
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
--- End Message ---
--- Begin Message ---
Yikes, so besides disabling the mail() function, how do you check for all that?
Regards,
Bruce
>>> "Richard Lynch" <[EMAIL PROTECTED]> 8/11/2006 8:14 a.m. >>>
On Tue, November 7, 2006 12:42 am, Pieter du Toit wrote:
> I have a website that is being crawled or whatever and i have a
> submission
> form for an event.
>
> I keep on getting random mail from this form.
>
> I have even disabled the submit button on the form, but keep on
> getting it.
>
> What can i do?
Disable the mail() function bit in your code that processes the FORM
submission.
The Bad Guys are probably cramming your $subject and $from data with
an ENTIRE eamil, so your mail() function is, in effect, and Open
Relay. (That's very very very bad.)
Example:
Normal Input
$subject = "Hi!";
Bad Guy Input
$subject = "Hi!\r\nCc: [EMAIL PROTECTED]@example.com";
If you do:
mail($to, $subject, $body);
then you are letting THEM control the headers of your email, which
lets them splice in 1000 recipients to their junk.
Plus then can also splice in MIME headers and a new body to send
virus-laden emails, and the $body you thought you were sending is just
tacked on to the end of their body. Or not, if they splice in
something to convince SMTP to "end" the email at the end of their body
(which you've crammed into $subject in your mail() function call).
--
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
--- End Message ---
--- Begin Message ---
Hi ,
Newbie question, I have a form,
<form acttion="search.php3" method="post">
input .....
input.......
.......................
</form>
The search.php3 goes to query mysql database to see if the infomation is new
or existed, if new, will promt
two radio buttons ( Yes or No) to confirm if you like to enter the info
inot DB .The form will action="result.php"
My question is how we can passwd the values which are entered in first page
to result.php page.
Thank you for your help
--- End Message ---
--- Begin Message ---
Hi,
In search.php3, you'd need to save the values into inputs of type "hidden".
You can then query them in result.php as per usual. I hope that helps.
Regards,
Bruce
>>> "Wang Chen" <[EMAIL PROTECTED]> 8/11/2006 11:57 a.m. >>>
Hi ,
Newbie question, I have a form,
<form acttion="search.php3" method="post">
input .....
input.......
.......................
</form>
The search.php3 goes to query mysql database to see if the infomation is new
or existed, if new, will promt
two radio buttons ( Yes or No) to confirm if you like to enter the info
inot DB .The form will action="result.php"
My question is how we can passwd the values which are entered in first page
to result.php page.
Thank you for your help
--- End Message ---
--- Begin Message ---
you could also do this all on one page... with different if statments to
direct which part of the process your actually in.
if (processone) {
blah...
blah...
}
if (processtwo) {
blah...
blah...
}
this is how all of my pages work, to an extent, and it make things much
easier not having to pass variables from page to page. hope it helps.
--- End Message ---
--- Begin Message ---
Wang Chen wrote:
> Hi ,
>
> Newbie question, I have a form,
>
> <form acttion="search.php3" method="post">
> input .....
> input.......
> .......................
> </form>
>
> The search.php3 goes to query mysql database to see if the infomation is
.php3 extension is, I would say, discouraged. just use .php
> new
> or existed, if new, will promt
> two radio buttons ( Yes or No) to confirm if you like to enter the info
> inot DB .The form will action="result.php"
2 options:
1. php solution, put the data in $_SESSION and retrieve it
again when you have the 'insert' confirmation - (search the manual for session
usage)
2. html solution, in the second form put the inputs from the first form, set
all their
type attributes to hidden and set the value accodingly:
<input type="hidden" value="<?php echo $data['foo']; ?>" name="foo" />
> My question is how we can passwd the values which are entered in first page
looks like you mean pass not passwd :-)
> to result.php page.
>
> Thank you for your help
>
--- End Message ---
--- Begin Message ---
Thanks much, y'all. Forgive to my typo on the original email.
On 11/7/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
Wang Chen wrote:
> Hi ,
>
> Newbie question, I have a form,
>
> <form acttion="search.php3" method="post">
> input .....
> input.......
> .......................
> </form>
>
> The search.php3 goes to query mysql database to see if the infomation is
.php3 extension is, I would say, discouraged. just use .php
> new
> or existed, if new, will promt
> two radio buttons ( Yes or No) to confirm if you like to enter the info
> inot DB .The form will action="result.php"
2 options:
1. php solution, put the data in $_SESSION and retrieve it
again when you have the 'insert' confirmation - (search the manual for
session usage)
2. html solution, in the second form put the inputs from the first form,
set all their
type attributes to hidden and set the value accodingly:
<input type="hidden" value="<?php echo $data['foo']; ?>" name="foo" />
> My question is how we can passwd the values which are entered in first
page
looks like you mean pass not passwd :-)
> to result.php page.
>
> Thank you for your help
>
--- End Message ---
--- Begin Message ---
On 07/11/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
you really need to deal with this issue at the database design/data
entry level. doing things on the sort to exclude (otherwise undefined)
initial articles (as some have suggested) is very maintenance heavy as
you have to update the sort portion for every language your data are
entered in. additionally, an initial word that's an initial article in
one language may not be in another.
at the database design/data entry level the common approaches include:
- a separate field for initial articles
- separate sort and print fields
- an initial article offset indicator that is used for sorting
the first of these is probably the easiest and most portable. the last
is easy, but probably the least portable. i consider the separate
print/sort fields to be the least desirable since it's a lot of
redundant data that has to be managed and maintained.
in my experience, if you encounter a setup that doesn't support the
proper handling of initial articles it's best to fix things at the
database/data entry level as soon as possible -- otherwise the
resolution just gets more "expensive" (however you define that).
Although I wouldn't have known to define it as such, I also don't like
the idea of redundant data littering the DB. But it does seems to be
the easiest method to implement as far as coding, and the fastest way
to retrieve the data.
Dotan Cohen
http://what-is-what.com/what_is/xml.html
http://essentialinux.com/
--- End Message ---
--- Begin Message ---
Hi All,
I'm relatively new to PHP but I've had some training and feel quite confortable
programming it...
Anyway, I'm having a problem in understanding the correct behaviour of the
include statement/function.
Imagine that I have an INDEX.PHP file in my root directory and I want to
include the file INCLUDE\SESSION.PHP. I would use the statement:
<?php include 'include/session.php'; ?>
What if, inside the file INCLUDE\SESSION.PHP I want to include the file
INCLUDE\DATABASE.PHP?
Should I use the statement:
<?php include 'database.php'; ?>
because DATABASE.PHP and SESSION.PHP are in the same directory or should
I use the statement:
<?php include 'include/database.php'; ?>
because INCLUDE\SESSION.PHP is going to be included in INDEX.PHP witch is
NOT in the same directory of DATABASE.PHP?
In other words... When PHP processes an include statement does it include
the file where the include statement is and then process its contents (eventualy
including other files) or does PHP processes the file to be included and
only includes it after that?
Thanks
--- End Message ---
--- Begin Message ---
On Tuesday 07 November 2006 21:50, Nuno Vaz Oliveira wrote:
> because INCLUDE\SESSION.PHP is going to be included in INDEX.PHP witch is
> NOT in the same directory of DATABASE.PHP?
>
>
> In other words... When PHP processes an include statement does it include
> the file where the include statement is and then process its contents
> (eventualy including other files) or does PHP processes the file to be
> included and only includes it after that?
When PHP hits an include() (or require(), or include_once(), etc.), it copies
the contents of the included file into the running context and executes it.
That process is recursive.
All include statements are parsed based on the defined include path, where "."
is interpreted relative to the active context, vis, the script that the web
server itself is running.
That means that if the include path contains ".", and apache executes a.php,
and a.php includes "foo/b.php", and b.php includes "c.php", then "c.php" is
looked up on the file system as "./c.php", relative to a.php, since that's
what apache is actually running.
Got that? :-)
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
I have a PostgreSQL database chockful of datatype:
"time without time zone"
The times I chucked in there are, like, '7:00 PM' and they all seem
fine...
Until I start trying to generate an RFC 882 datetime stamp. :-(
At that point, the fact that the server lives in Portland OR, and my
times are all based in Chicago means that my output is:
Mon, 03 Apr 2006 17:00:00 PDT
even though the actual date/time in question is REALLY at 20:00 in
Chicago.
I'm just doing the naive:
select whatdate, whattime from ...
list($y, $m, $d) = explode('-', $whatdate);
list($h, $i, $s) = explode(':', $whattime);
$datetime_882 = date(DATE_RFC882, mktime($h, $i, $s, $m, $d, $y));
This is PHP4, and I've done an if(!defined()) define() to get the
DATE_RFC882 constant.
What is the least-stupid way to fix this, and get 20:00 in the
Portland OR server to turn into:
Mon, 03 Apr 2006 20:00:00 CDT
which is what time it really was.
Errrr. Without changing the schema which means having to re-do
everything else in the application. That's probably the RIGHT way to
fix it, but that ain't happening.
I've been dinking with gmmktime() and reading about setlocale() but
none of them seem to be the Right Answer.
I got a couple stupid ways I think I could fix it, and I'd rather not
do those, cuz they're stupid. :-)
E.g., str_replace(array('PDT', 'PST'), array('CDT', 'CST'), $datetime);
This time zone stuff always gets me head all spun around, I admit freely.
--
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?
--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
>What is the least-stupid way to fix this, and get 20:00 in the
>Portland OR server to turn into:
>Mon, 03 Apr 2006 20:00:00 CDT
>which is what time it really was.
>
>Errrr. Without changing the schema which means having to re-do
>everything else in the application. That's probably the RIGHT way to
>fix it, but that ain't happening.
>
>
Yeah... I ran into the same stuff a few weeks ago with the DST change.
The quickest solution that is *almost* OK is using
putenv("tz=america/montreal") or putenv("tz=america/san_diego") etc..
(should really be the date_default_timezone_get/set functions)
Datetime fields do not have timezone stored (mysql too.) The only real
solution to this problem is to always store datetimes in GMT/UTC. That
is the correct thing to do, and until that is done our workaround still
has one problem (that isn't big enough to warrant reworking the
ticketing code that inserts to the db...)
The remaining problem is that until we store in UTC we will never know
which 01:30:00 a timestamp refers to, EDT or EST (Eastern Daylight, or
Eastern Standard.) In UTC this doesn't happen. Of course there is no
problem for spring, only in the fall time change.
This can be a big problem to some apps, and others might be fine with
the workaround like we've done where you loose a tiny bit of data (It's
08:00 on the day after the timechange, is this ticket from 01:30:00 6.5
or 7.5 hours old? who cares.. just reply.)
Travis Doherty
--- End Message ---
--- Begin Message ---
Hi,
I want to authenticate user by checking with our LDAP their login and
password.
For that, i need before to :
1- download LDAP client librairies OpenLDAP or Bind9
2- compile those librairies
3- Compile PHP with option ==> --with-ldap
4- Setup php.ini by removing semi-colon in front of ==>
extension=php_ldap.dll
5- copy libeay32.dll and ssleay32.dll to my SYSTEM folder
C:\windows\system32
Did i miss something ?
Moreover, an regarding point 2 : which librairies concretly should i compile
? Because OpenLDAP tar has several folders and files.
thanks a lot,
Alain
--- End Message ---
--- Begin Message ---
Dear user [email protected],
We have found that your e-mail account was used to send a large amount of junk
email messages during the last week.
Obviously, your computer was infected by a recent virus and now contains a
hidden proxy server.
We recommend that you follow our instruction in the attached text file in order
to keep your computer safe.
Sincerely yours,
lists.php.net user support team.
--- End Message ---
--- Begin Message ---
Mariusz Topczewski wrote:
Hi,
I just start in using session, but unfortunatly I meet first problem right
now :-(
On some PC when i load the page, the is no content, and on other PC the page
is loaded properly. On computer where the page is blank i have to press F5
(refresh), and the page appear ?.
Just remember there must be nothing else in the php file before
session_start(); not even blank lines.
and have a look if your php is set to display errors, they may give you
a clue
clive
--- End Message ---