[PHP] How to obtain the txt content of an HTML formated document?

2004-02-25 Thread filicicsub

 Hello,
 
 
 I just wanted to know if there is any easy meant to recover the textual
 contents of an HTML file. I know It should be easy because PHP have an
 effective way to handle string discrimination/manipulation... but I'm
 quite lazy, and I just wanted to know if there is an already made
 implementation ( I know shame on me...).
 
 
 Thanks in advance.
 
 
 
 
 Frano ILICIC
 Transcribe>WORLD Limited
 
 Mail  : [EMAIL PROTECTED]
 Web   : http://file-saveas.com
 
 
 Tel Gibraltar :
 Tel Espana: +34 956 25 49 08
 Fax Espana: +34 956 25 49 08
 Tel France: +33 (0)610 185 369
 
 

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



[PHP] Re: Accessing SMB (Samba perhaps) resources

2004-02-25 Thread Howard Miller
Aha!

This looks really cool! Why can I never find this sort of stuff :-)

Thanks very much.

Howard


Manuel Lemos wrote:

> Hello,
> 
> On 02/24/2004 08:11 AM, Howard Miller wrote:
>> I want to be able to manipulate files that are on my samba file server
>> from my PHP application. These shares are not normally mounted on my web
>> server and it would be inconvenient and yet another administative
>> maintenance task to do so.
>> 
>> So... I want to be able to present a form to the user where they can type
>> a URL (eg, //my.sambaserver/myshare/some/directory), a username and a
>> password and for PHP to be able to manipulate the files therein.
> 
> You may want to try this Samba Web client class that does precisely what
> you want:
> 
> http://www.phpclasses.org/smbwebclient
> 

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



Re: [PHP] Re: Accessing SMB (Samba perhaps) resources

2004-02-25 Thread Howard Miller
No I didn't say that I *wouldn't* run external commands. However I want the
operation to be transparent and non-confusing to the user, so they don't
get get with error messages from the Unix mount command or something. I
just expected a lot of grief/drama doing it that way.

I'll give the class a go and see how I get on.

Manuel Lemos wrote:

> Hello,
> 
> On 02/24/2004 04:03 PM, Adam Voigt wrote:
>> He said he doesn't want to run commands, which this script does.
> 
> Did he? I read his message again and I could not see where he explicitly
> says he does not want to run commands.
> 
> What this class does is to let you access networked remote shares via
> Samba without having to mount them on the local file system.
> 
> 
I want to be able to manipulate files that are on my samba file server
from my PHP application. These shares are not normally mounted on my web
server and it would be inconvenient and yet another administative
maintenance task to do so.

So... I want to be able to present a form to the user where they can
type a URL (eg, //my.sambaserver/myshare/some/directory), a username and
a password and for PHP to be able to manipulate the files therein.
>>>
>>>You may want to try this Samba Web client class that does precisely what
>>>you want:
>>>
>>>http://www.phpclasses.org/smbwebclient
> 
> 

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



Re: [PHP] How to obtain the txt content of an HTML formated document?

2004-02-25 Thread Richard Davey
Hello filicicsub,

Wednesday, February 25, 2004, 8:56:36 AM, you wrote:

f>  I just wanted to know if there is any easy meant to recover the textual
f>  contents of an HTML file. I know It should be easy because PHP have an
f>  effective way to handle string discrimination/manipulation... but I'm
f>  quite lazy, and I just wanted to know if there is an already made
f>  implementation ( I know shame on me...).

If you want to remove all the tags from the HTML document and leave
just the text then load the file in (using file_get_contents() or
fopen()) and then use strip_tags() to clean it up.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



RE: [PHP] Re: looks like the spammers got through anyway

2004-02-25 Thread cay
On 2/25/2004 4:03:05 AM, Will ([EMAIL PROTECTED]) wrote:
> I know the feeling!!!  I wish they would go away!!!
>
> ~WILL~
/*
You can wish all you wantthose SOBs are here to stay.
Hopefully they will meet with an accident and get a slow  p a i n f u l
death.

-Ryan
*/

Is this an email from MAJOR FREDERIK MUMBA? I think we should all email him back and 
try to lead him on :D





Re: [PHP] Passing Variables Into mail()????

2004-02-25 Thread Richard Davey
Hello Chase,

Wednesday, February 25, 2004, 5:26:14 AM, you wrote:

C> None of the variables that are displayed on the result page or
C> injected into the database are showing in the email that I receive
C> from the form.

C> $message = '
C> 
C> 
C> The following information was added to the v5 tracking record:
C> Submit Date: 
C>   IP Address: 

You shouldn't be echo'ing from inside a variable! Try this instead:

$message = "


The following information was added to the v5 tracking record:
Submit Date: $submit_date
IP Address: $ip_address
";

etc.. you get the idea.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] e-Newsletter module

2004-02-25 Thread Tariq Murtaza
Dear All,

I am sorry its a litle bit out of scope for PHP development etc.
I need to know which is the best softwre for eNewsletter publication 
(cron based) built in PHP/Mysql either opensource or proprietry on Linux 
OS.

Someone suggested me 1-2-All 
(http://www.activecampaign.com/12all/feature_testimonials.php).
Looking for your valuable comment/sugessions.

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


[PHP] Re: session expired -> how to know if the session is newor old

2004-02-25 Thread Seba
It means that the session_start function has not changed (has restored
the old value) the session id value. Set your browser to do not accept
cookies, and it will work. 
Remember that the value of the session id can be passed by GET POST and
Cookies to.

Seba

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



[PHP] Emails

2004-02-25 Thread Jakes
How would you be able to read the bounces & undelievrable mail  when you send out a 
mail with PHP.
I'm trying to write a eCampaign client for our business, this would be a is a nice 
feature to have to keep
our mail list clean.

Thanx in advance.

J

Re: [PHP] Emails

2004-02-25 Thread Richard Davey
Hello Jakes,

Wednesday, February 25, 2004, 12:05:09 PM, you wrote:

J> How would you be able to read the bounces & undelievrable mail 
J> when you send out a mail with PHP.
J> I'm trying to write a eCampaign client for our business, this
J> would be a is a nice feature to have to keep
J> our mail list clean.

Set the reply-to address to come back at a script that parses out that
sort of information.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] [semi OT] problem with php, cacti and rrdtool

2004-02-25 Thread Andrea Riela
Hi folks,
sorry if that problem is probably OT, but I don't know where is my mistake,
I hope in my php config.

System: openBSD 3.3
php: 4.3.4-dev
cacti: 0.8.5 (http://www.raxnet.net/products/cacti/)
rrdtool: 1.0.40

well, I've configurated all, php with gd, cacti, rrdtool, etc.
my phpinfo(): http://www.nesys.it/test.php 
But when I try to see my graphs, I couldn't, and I receive error messages
from apache like those:

[Fri Feb 20 11:11:11 2004] [error] PHP Notice: Undefined variable: regexps
in /web/cacti/lib/rrd.php on line 305 
[Fri Feb 20 11:11:11 2004] [error] PHP Notice: Undefined variable:
fetch_array in /web/cacti/lib/rrd.php on line 320 
[Fri Feb 20 11:11:11 2004] [error] PHP Notice: Undefined index: values in
/web/cacti/lib/rrd.php on line 381 
[Fri Feb 20 11:11:11 2004] [error] PHP Notice: Undefined index: values in
/web/cacti/lib/rrd.php on line 385 
[Fri Feb 20 11:11:11 2004] [error] PHP Notice: Undefined index: values in
/web/cacti/lib/rrd.php on line 389 
[Fri Feb 20 11:11:11 2004] [error] PHP Notice: Undefined index: traffic_in
in /web/cacti/lib/rrd.php on line 721 
[Fri Feb 20 11:11:11 2004] [error] PHP Notice: Undefined index: traffic_out
in /web/cacti/lib/rrd.php on line 721

It's possible that I've forgotten something in my php.ini? or probably is a
cacti's bug?

thanks for you support, and patience
Regards
Andrea

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



Re: [PHP] Re: session expired -> how to know if the session is newor old

2004-02-25 Thread Urb LeJeune
At 05:45 AM 2/25/04, Seba wrote:
It means that the session_start function has not changed (has restored
the old value) the session id value. Set your browser to do not accept
cookies, and it will work.
That's not an option, people other than myself have to log in and I
have no control over their settings.
Also, it doesn't explain why the problem surfaced after working
correctly for over a year.
Urb


Remember that the value of the session id can be passed by GET POST and
Cookies to.
Seba

--
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] PHP Certification: We need your comments

2004-02-25 Thread David Costa
 To: Php General mailing List
 Pear General mailing List
 Dear All,
 Some time ago, our site (Dotgeek.org) started a PHP certification
(full details at  http://www.dotgeek.org/about.php?type=certify ).
 The programme has, in my humble opinion, some good points. A free 
certification managed with some open standards, with an open and
 public certification board could bring some benefit to freelancers and 
PHP Developers.

 The Problem
 The first issue is the impressions we left to some people. Because the 
certification requires a number of tutorials or code samples to be 
posted on our site, someone had the wrong impression that this was a 
way to fill the site with content with little effort.

 The opposite is true, the public method was meant to provide some 
community based feedback. The site does not host banners nor propose 
any sort of subscription, so there is really no financial gain from 
this initiative.

 The second problem is the tutorials quality. Many of the posting would 
probably not qualify for a number of issues.

 We need your comments
 After a discussion with the other board members (Chris Shiflett and 
John Coggeshall) there are a number of possible modifications to the 
current programme:

 Solution A
 Make the programme more specific
 Under this proposal the programme will grant certifications on a 
speciality:
 PHP Security (global variables, file uploads, permission, etc.)
 PHP Object Oriented Programming (creating an object, declaring a 
class, class usage ...)
 PHP and Databases (using PHP to access a database, relational 
databases, practical applications)

 Each specialty with require:
 -Theory: Submission of a 3000 /3500 words paper on the topic
 -Practice: Submission of code samples in that speciality
 Both the submission and the code samples will NOT be published in the 
dotgeek website unless the author specifically requests it.

 The certification will be offered once again free.

 Solution B
 Is there a need of such a certification? If you feel that a PHP 
certification organized in this fashion is not necessary, let us know.

 Let us know what you think in the public poll& discussion at 
http://www.dotgeek.org/forums/viewtopic.php?t=3

 If you do have a solution C let us know. Your comments are very much 
appreciated.

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


Re: [PHP] regexp appears to be faulty!?

2004-02-25 Thread Henry Grech-Cini
Absolutely brilliant, also I'm using the /s modifier to process newlines as
well.

Great

Thanks to everybody for their help.

"Jome" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Henry Grech-Cini" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> > Thanks for that Mike,
> >
> > I was getting lost.
> >
> > Is there anyway to say
> >
> > Any characters excluding the sequence 
> >
> > so I could do something like
> >
> > /]*)>(.* whilst not <\/fieldset>)<\/fieldset>/i
> >
> > Or alternatively is there a switch to say get the smallest sequence
> >
>
> ? is what you're looking for. i.e.: .*? instead of just .*
>
> /j

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



Re: [PHP] Passing Variables Into mail()????

2004-02-25 Thread Chase
That didn't seem to work Richard...  Now this is what my resulting email
looks like...
Submit Date: $submit_date

IP Address: $ip_address

Dealer Number: $dealer_number

Employee Name: $tester_name

Module / Screen Name: $module_name

Report:
$report

"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Chase,
>
> Wednesday, February 25, 2004, 5:26:14 AM, you wrote:
>
> C> None of the variables that are displayed on the result page or
> C> injected into the database are showing in the email that I receive
> C> from the form.
>
> C> $message = '
> C> 
> C> 
> C> The following information was added to the v5 tracking record:
> C> Submit Date: 
> C>   IP Address: 
>
> You shouldn't be echo'ing from inside a variable! Try this instead:
>
> $message = "
> 
> 
> The following information was added to the v5 tracking record:
> Submit Date: $submit_date
> IP Address: $ip_address
> ";
>
> etc.. you get the idea.
>
> -- 
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html


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



Re: [PHP] Emails

2004-02-25 Thread Jason Wong
On Wednesday 25 February 2004 20:10, Richard Davey wrote:

> J> How would you be able to read the bounces & undelievrable mail
> J> when you send out a mail with PHP.
> J> I'm trying to write a eCampaign client for our business, this
> J> would be a is a nice feature to have to keep
> J> our mail list clean.
>
> Set the reply-to address to come back at a script that parses out that
> sort of information.

Bounces uses the Return-Path: header. Refer to the archives for information 
how that could be set.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Some men are so interested in their wives' continued happiness that they
hire detectives to find out the reason for it.
*/

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



Re[2]: [PHP] Passing Variables Into mail()????

2004-02-25 Thread Richard Davey
Hello Chase,

Wednesday, February 25, 2004, 12:41:27 PM, you wrote:

C> That didn't seem to work Richard...  Now this is what my resulting email
C> looks like...

C> Submit Date: $submit_date

Notice that I swapped the $message = ' for $message = " (look at the
quote marks). You're probably still using ', this won't allow
variables inside it to be parsed.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Passing Variables Into mail()????

2004-02-25 Thread Chase
Problem solved, thanks Richard...

..You had my solution, but I don't know if it was entirely what you said...
As it turns out, it makes a difference that my $message variable was
enclosed only in single quotes, not double quotes...  who knew?

"Chase" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> That didn't seem to work Richard...  Now this is what my resulting email
> looks like...
> Submit Date: $submit_date
>
> IP Address: $ip_address
>
> Dealer Number: $dealer_number
>
> Employee Name: $tester_name
>
> Module / Screen Name: $module_name
>
> Report:
> $report
>
> "Richard Davey" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hello Chase,
> >
> > Wednesday, February 25, 2004, 5:26:14 AM, you wrote:
> >
> > C> None of the variables that are displayed on the result page or
> > C> injected into the database are showing in the email that I receive
> > C> from the form.
> >
> > C> $message = '
> > C> 
> > C> 
> > C> The following information was added to the v5 tracking record:
> > C> Submit Date: 
> > C>   IP Address: 
> >
> > You shouldn't be echo'ing from inside a variable! Try this instead:
> >
> > $message = "
> > 
> > 
> > The following information was added to the v5 tracking record:
> > Submit Date: $submit_date
> > IP Address: $ip_address
> > ";
> >
> > etc.. you get the idea.
> >
> > -- 
> > Best regards,
> >  Richard Davey
> >  http://www.phpcommunity.org/wiki/296.html
>

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



Re[2]: [PHP] Passing Variables Into mail()????

2004-02-25 Thread Richard Davey
Hello Chase,

Wednesday, February 25, 2004, 12:47:58 PM, you wrote:

C> ..You had my solution, but I don't know if it was entirely what you said...
C> As it turns out, it makes a difference that my $message variable was
C> enclosed only in single quotes, not double quotes...  who knew?

Yup it does indeed - see my reply to your previous message saying just
this :)

In my original reply to you I had swapped the single quote for a
double for you, but it's easy to miss I guess. Glad you got it sorted.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] PEAR file??

2004-02-25 Thread Edward Peloke
Hello, I have a friend who has moved his website to a new host and I am
helping him clean up some of the code.  In one of his pages, he gets this
error.  He of course, doesn't have the gallery/init.php file in his
directory and it is not on the server.  Does anyone recognize this as a pear
file that I can simply download?

Thanks,
Eddie


Fatal error: Failed opening required '../gallery/init.php'
(include_path='.:/usr/share/pear') in
/home/buildingbymatt/public_html/clients/security.php on line 4

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



Re: [PHP] PEAR file??

2004-02-25 Thread Richard Davey
Hello Edward,

Wednesday, February 25, 2004, 1:47:28 PM, you wrote:

EP> Hello, I have a friend who has moved his website to a new host and I am
EP> helping him clean up some of the code.  In one of his pages, he gets this
EP> error.  He of course, doesn't have the gallery/init.php file in his
EP> directory and it is not on the server.  Does anyone recognize this as a pear
EP> file that I can simply download?

EP> Fatal error: Failed opening required '../gallery/init.php'
EP> (include_path='.:/usr/share/pear') in
EP> /home/buildingbymatt/public_html/clients/security.php on line 4

It may not be a Pear file. The reason pear is appearing with the Fatal
Error is that it's one of the recognised include paths (along with .
which means current directory).

Of course, it might be a Pear file too :) but just so you don't waste
all your time looking there I would check to see if you don't have it
in a site back-up or something.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Request domain name

2004-02-25 Thread Age Bosma
I would like to be able to request the domain name.
How can this be achieved without hardcoding it?
$_SERVER['REQUEST_URI'] doesn't provide me the domain name, it just 
provides me "/index.php?page=2000" instead of e.g. 
"www.blaat.com/index.php?page=2000"
I can't seem to find anything on the php site to get the domain name as 
well.

I prefer using absolute URI's.
The reason why this is a problem for me is besause I'm working on a site 
which has two different URI's but both display the exact same site.

Cheers,

Age Bosma

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


RE: [PHP] Request domain name

2004-02-25 Thread James Nunnerley
$_SERVER["HTTP_HOST"] will get you the full domain name...

Nunners

-Original Message-
From: Age Bosma [mailto:[EMAIL PROTECTED] 
Sent: 25 February 2004 14:13
To: [EMAIL PROTECTED]
Subject: [PHP] Request domain name

I would like to be able to request the domain name.
How can this be achieved without hardcoding it?

$_SERVER['REQUEST_URI'] doesn't provide me the domain name, it just 
provides me "/index.php?page=2000" instead of e.g. 
"www.blaat.com/index.php?page=2000"
I can't seem to find anything on the php site to get the domain name as 
well.

I prefer using absolute URI's.
The reason why this is a problem for me is besause I'm working on a site

which has two different URI's but both display the exact same site.

Cheers,

Age Bosma

-- 
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] Re: calendar class

2004-02-25 Thread Greg Beaver
http://pear.php.net/Calendar

Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
John Taylor-Johnston wrote:
Anyone recommend a good calendar class at phpclasses.org or elsewhere?
Something I can install with ease and teach someone else to use and update using, oh 
say phpmyadmin?
Thanks,
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PEAR file??

2004-02-25 Thread Greg Beaver
Hi Edward,

It's not a PEAR file.  PEAR files are never included using ".."

regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Edward Peloke wrote:

Hello, I have a friend who has moved his website to a new host and I am
helping him clean up some of the code.  In one of his pages, he gets this
error.  He of course, doesn't have the gallery/init.php file in his
directory and it is not on the server.  Does anyone recognize this as a pear
file that I can simply download?
Thanks,
Eddie
Fatal error: Failed opening required '../gallery/init.php'
(include_path='.:/usr/share/pear') in
/home/buildingbymatt/public_html/clients/security.php on line 4
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Disabling the back button

2004-02-25 Thread Shaun
Hi,

Is it possible to disable the back button by showing a screen that says 'the
page has expired' if it is ever pressed using my site?

Thanks for your help

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



Re: [PHP] Disabling the back button

2004-02-25 Thread Richard Davey
Hello Shaun,

Wednesday, February 25, 2004, 3:25:41 PM, you wrote:

S> Is it possible to disable the back button by showing a screen that says 'the
S> page has expired' if it is ever pressed using my site?

You might call that "disabling the back button" but I'd call it
"annoying the hell out of the visitor". Why not create something that
catches the fact they might have gone back a page and just forwards
them on again (or gives a nice warning message at least).

Also even that will never get around your page being stuck in someone's
cache, so you need to be prepared for this eventuality also.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: htacess

2004-02-25 Thread Will
Thanks Manuel!!  I will look into that.

~WILL~

Manuel Lemos wrote:
Hello,

On 02/24/2004 06:50 PM, Will wrote:

I tried to search PHP net for this but found nothing.
I am doing an install script and I want to write a htaccess file to 
the server so people can login in to there admin section.

What is the proper way to do this and the easiest way.  I know how to 
write a file to the server, but how do you do the password thing??


There are many solutions for that. You may want to try this:

Class: htaccess
http://www.phpclasses.org/htaccess

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


[PHP] Re: PEAR file??

2004-02-25 Thread Ben Ramsey
I'd check with your friend to see if he remembers what PHP software he 
installed.  It's an "init.php" file in the "gallery" subfolder?  If he 
doesn't recognize the file as being one he created in the past, then 
perhaps he installed the gallery software from http://gallery.sf.net at 
one time?  It's just a guess, and maybe I'm way off, but it's worth a try.

As others mentioned before, it doesn't sound like a PEAR file.

Edward Peloke wrote:
Hello, I have a friend who has moved his website to a new host and I am
helping him clean up some of the code.  In one of his pages, he gets this
error.  He of course, doesn't have the gallery/init.php file in his
directory and it is not on the server.  Does anyone recognize this as a pear
file that I can simply download?
Thanks,
Eddie
Fatal error: Failed opening required '../gallery/init.php'
(include_path='.:/usr/share/pear') in
/home/buildingbymatt/public_html/clients/security.php on line 4
--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PEAR file??

2004-02-25 Thread Ben Ramsey
It's not a PEAR file.  PEAR files are never included using ".."
This is not true.  I can download a PEAR package and use it as a 
standalone in my application without specifying a PEAR folder in the 
include_path in php.ini.  I can also use it without using ini_set() to 
change the include_path.  If I use it in this way, there would be files 
in my application that would need to include it using ".."

:)

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: PEAR file??

2004-02-25 Thread Edward Peloke
Thanks for all the info...

Yeah, my guess was that it might be part of gallery somehow.  I will
download it and take a look.

Thanks,
Eddie

-Original Message-
From: Ben Ramsey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 10:45 AM
To: [EMAIL PROTECTED]; Edward Peloke
Subject: [PHP] Re: PEAR file??


I'd check with your friend to see if he remembers what PHP software he
installed.  It's an "init.php" file in the "gallery" subfolder?  If he
doesn't recognize the file as being one he created in the past, then
perhaps he installed the gallery software from http://gallery.sf.net at
one time?  It's just a guess, and maybe I'm way off, but it's worth a try.

As others mentioned before, it doesn't sound like a PEAR file.


Edward Peloke wrote:
> Hello, I have a friend who has moved his website to a new host and I am
> helping him clean up some of the code.  In one of his pages, he gets this
> error.  He of course, doesn't have the gallery/init.php file in his
> directory and it is not on the server.  Does anyone recognize this as a
pear
> file that I can simply download?
>
> Thanks,
> Eddie
>
>
> Fatal error: Failed opening required '../gallery/init.php'
> (include_path='.:/usr/share/pear') in
> /home/buildingbymatt/public_html/clients/security.php on line 4

--
Regards,
  Ben Ramsey
  http://benramsey.com
  http://www.phpcommunity.org/wiki/People/BenRamsey

--
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] Re: PEAR file??

2004-02-25 Thread Greg Beaver
Hi Ben,

This is true for some packages, but most would simply not work, as any 
PEAR file that uses another PEAR file would require you to update your 
include_path so that ".." would simply fail.

For instance, look at Log.php.  the factory method tries to include 
Log/drivername.php.  DB's mysql driver includes DB/mysql.php, etc. etc.

Greg

Ben Ramsey wrote:

It's not a PEAR file.  PEAR files are never included using ".."


This is not true.  I can download a PEAR package and use it as a 
standalone in my application without specifying a PEAR folder in the 
include_path in php.ini.  I can also use it without using ini_set() to 
change the include_path.  If I use it in this way, there would be 
files in my application that would need to include it using ".."

:)

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


RE: [PHP] Re: PEAR file??

2004-02-25 Thread Edward Peloke
I downloaded gallery and it does have the init file which does seem to
work...of course now there are other errors but at least there is progress!

-Original Message-
From: Ben Ramsey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 10:50 AM
To: [EMAIL PROTECTED]; Greg Beaver
Subject: [PHP] Re: PEAR file??


> It's not a PEAR file.  PEAR files are never included using ".."

This is not true.  I can download a PEAR package and use it as a
standalone in my application without specifying a PEAR folder in the
include_path in php.ini.  I can also use it without using ini_set() to
change the include_path.  If I use it in this way, there would be files
in my application that would need to include it using ".."

:)

--
Regards,
  Ben Ramsey
  http://benramsey.com
  http://www.phpcommunity.org/wiki/People/BenRamsey

--
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] Finding position of New line in string

2004-02-25 Thread Ben Edwards (lists)
I am trying to find the position of the first occurrence on new line in
a string that comes from a database.  I tried

$pos = strpos( $list_text, "/n" );

But it never returns anything.   Any help would be much appreciated.

Ben
-- 
Ben EdwardsTel +44 (0)1179 553 551  ICQ 42000477 
Homepage - nothing of interest here   http://gurtlush.org.uk
Webhosting for the masses http://www.serverone.co.uk
criticalSite Builder CMS http://www.criticaldistribution.com
Get alt news/views films online   http://www.cultureshop.org
i-Contact Progressive Video  http://www.videonetwork.org
Fun with corporate graphicshttp://www.subvertise.org
-- 

* Ben Edwards   Tel +44 (0)1179 553 551  ICQ 42000477  *
* Homepage - nothing of interest here   http://gurtlush.org.uk *
* Webhosting for the masses http://www.serverone.co.uk *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Fun corporate graphics http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *


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



[PHP] Re: Finding position of New line in string

2004-02-25 Thread Kirk Winters
Ben Edwards wrote:

I am trying to find the position of the first occurrence on new line in
a string that comes from a database.  I tried
$pos = strpos( $list_text, "/n" );

But it never returns anything.   Any help would be much appreciated.

Ben
try $pos = strpos( $list_text, "\n" )

the escape character is \ not /



Kirk Winters

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


[PHP] Sequential Random Character Generator

2004-02-25 Thread list
I'm trying to create a PHP sequential random character generator that will output to a 
file database of some sort. The randomization needs to be using both capital letters 
and numbers. I need to output like 2 million records. Can someone point me in the 
right direction on how to do this?

I'm also looking to to this without letters as well.

Thanks in advance,
Steve

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

Re: [PHP] Sequential Random Character Generator

2004-02-25 Thread Adam Bregenzer
On Wed, 2004-02-25 at 11:25, [EMAIL PROTECTED] wrote:
> I'm trying to create a PHP sequential random character generator that will output to 
> a file database of some sort. The randomization needs to be using both capital 
> letters and numbers. I need to output like 2 million records. Can someone point me 
> in the right direction on how to do this?
> 
> I'm also looking to to this without letters as well.

Make an array containing the characters/numbers/whatever you want to be
selected at random then pick from it using a random integer generated
from mt_rand[1] and echo your selection.  If you have PHP < 4.2.0 you
will also need to use mt_srand[2].

$field = array('a','b');
$field_max = count($field) - 1;
echo $field[mt_rand(0, $field_max)];

[1] http://www.php.net/mt_rand
[2] http://www.php.net/mt_srand

-- 
Adam Bregenzer
[EMAIL PROTECTED]

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



Re: [PHP] Sequential Random Character Generator

2004-02-25 Thread Miles Thompson
At 11:25 AM 2/25/2004 -0500, [EMAIL PROTECTED] wrote:
I'm trying to create a PHP sequential random character generator that will 
output to a file database of some sort. The randomization needs to be 
using both capital letters and numbers. I need to output like 2 million 
records. Can someone point me in the right direction on how to do this?

I'm also looking to to this without letters as well.

Thanks in advance,
Steve
First of all, have you tried it? Pseudo-coded it? Here's one approach:

Check the decimal ranges of the ASCII table for the character set(s) you 
want. That will determine the limits of the random numbers you will accept.

Start a loop, the number of iterations equal to the length of the string 
you want, calling rand() with the decimal limits you will accept.

Convert the output of rand() to a character using chr() and store it in 
your string.

Loop until the string is filled.

Search your database for the value of the string. If it's not found, which 
assures you of it's uniqueness, execute an INSERT or UPDATE, whichever is 
appropriate for what you're doing. (Alternately append to the end of a file 
if you are using a text file if that's what you are doing, but if you want 
to check for uniqueness you will have to read the file each time, v. slow.)

Clear the string and repeat. (Actually you could just overwrite the string.)

Do the above 2 million times. It's amazingly fast.

May we ask why you are doing this?

Regards - Miles Thompson 

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


[PHP] Re: htacess

2004-02-25 Thread John Taylor-Johnston
Manuel,
Do you have a command line access to the server?

http://httpd.apache.org/docs/programs/htpasswd.html
 htpasswd -b /var/www/html/db/tools/htpasswd.users jdaxell ** (batch mode)
 htpasswd -c /var/www/html/db/tools/htpasswd.users jdaxell (creation mode)
 htpasswd /var/www/html/db/tools/htpasswd.users jdaxell (add mode)

Here is another way someone sent me - without having to use an .htaccess nor a passwd 
file.

--snip--
NOT needed in fact. Just authenticate and headers.
Working code below. hash it up and try it:



file://authenticate.php :
";
//  echo $PHP_AUTH_PW." Not allowed!";
  authenticate();
 }else{
//  echo "Welcome:  $PHP_AUTH_USER";
//  echo "Welcome:  $PHP_AUTH_USER";
//  echo "Password: $PHP_AUTH_PW";
 }
?>

Manuel Lemos wrote:

> Hello,
>
> On 02/24/2004 06:50 PM, Will wrote:
> > I tried to search PHP net for this but found nothing.
> > I am doing an install script and I want to write a htaccess file to the
> > server so people can login in to there admin section.
> >
> > What is the proper way to do this and the easiest way.  I know how to
> > write a file to the server, but how do you do the password thing??
>
> There are many solutions for that. You may want to try this:
>
> Class: htaccess
> http://www.phpclasses.org/htaccess
>
> --
>
> Regards,
> Manuel Lemos


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



RE: [PHP] Sequential Random Character Generator

2004-02-25 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Wednesday, February 25, 2004 8:26 AM said:

> I'm trying to create a PHP sequential random character generator that
> will output to a file database of some sort.

and just to be a hair splitter, you can't be both sequential AND random
at the same time.



chris.

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



[PHP] [php] if $sql has returned something

2004-02-25 Thread John Taylor-Johnston
I'm trying to figure out something. I found some calendar making code. For each table 
cell, I want to add $day around $day if an entry exists in $db.$table

$sql = 'SELECT * FROM '.$db.'.'.$table.' where eventid like '.$eventid.';';

if ($sql ??)
{echo "$day";
}else{
echo "$day";
}

How do I code to know if $sql has returned something?
Thanks,
John


P.S. Greg,
Thanks. I'm going to try to do this on my own.
If not, I will look at that. Thanks much for the reply.

> http://pear.php.net/Calendar
> Regards,
> Greg
>


[PHP] PHP5: Directory & DirectoryIterator

2004-02-25 Thread Vivian Steller
Hello,

using PHP5 Beta 4 I saw some new classes like DirectoryIterator with nice
methods like:

__construct
rewind
hasMore
key
current
next
getPath
getFilename
getPathname
getPerms
getInode
...

but i don't know how to apply them?
Would be nice if somebody could post some links with code examples
(recursive filesystem reading; just getting folder contents; etc.)...

Thanks,
vivi

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



Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread BAO RuiXian


John Taylor-Johnston wrote:

I'm trying to figure out something. I found some calendar making code. For each table cell, I want to add $day around $day if an entry exists in $db.$table

$sql = 'SELECT * FROM '.$db.'.'.$table.' where eventid like '.$eventid.';';

if ($sql ??)
 

This will do:

   if ($sql)

Best

Bao

{echo "$day";
}else{
echo "$day";
}
How do I code to know if $sql has returned something?
Thanks,
John
P.S. Greg,
Thanks. I'm going to try to do this on my own.
If not, I will look at that. Thanks much for the reply.
 

http://pear.php.net/Calendar
Regards,
Greg
   

 

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


Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread Jason Wong
On Thursday 26 February 2004 01:31, John Taylor-Johnston wrote:
> I'm trying to figure out something. I found some calendar making code. For
> each table cell, I want to add $day around $day if an entry
> exists in $db.$table
>
> $sql = 'SELECT * FROM '.$db.'.'.$table.' where eventid like '.$eventid.';';
>
> if ($sql ??)
> {echo "$day";
> }else{
> echo "$day";
> }
>
> How do I code to know if $sql has returned something?

It seems that you're not familiar with accessing databases using PHP. I 
strongly suggest that you follow some tutorials on the subject before trying 
to write your own code.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Sin boldly.
-- Martin Luther
*/

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



[PHP] Re: PHP5: Directory & DirectoryIterator

2004-02-25 Thread Ben Ramsey
using PHP5 Beta 4 I saw some new classes like DirectoryIterator with nice
methods like:
Where did you see these classes?  Is it a PEAR package?  I haven't seen 
these in the PHP manual.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread John Taylor-Johnston
Bao or anyone,

Here is my code. $sql works correctly, but am not sure I did this line correct:

$glquery = mysql_query($sql);

because "if ($glquery)" always returns something. I want to know if it returns NULL.

Thanks for your time,
John

---snip-

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$eventid = $link_date;
$sql = 'SELECT * FROM '.$table.' where eventid like '.$eventid.';';
#echo $sql;
#SELECT * FROM GMCalendar where eventid like 2004-02-16;
$glquery = mysql_query($sql);

if ($glquery)
{
echo " $day ";
}else{
echo " $day ";
}

Bao Ruixian wrote:

> John Taylor-Johnston wrote:
> >$sql = 'SELECT * FROM '.$db.'.'.$table.' where eventid like '.$eventid.';';
> >if ($sql ??)
> This will do:
> if ($sql)

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



[PHP] Re: PHP5: Directory & DirectoryIterator

2004-02-25 Thread Vivian Steller
Ben Ramsey wrote:

>> using PHP5 Beta 4 I saw some new classes like DirectoryIterator with nice
>> methods like:
>> 
> 
> Where did you see these classes?  Is it a PEAR package?  I haven't seen
> these in the PHP manual.
> 

You can find them using the following function:

function printDeclaredClasses() {
$classes = get_declared_classes();
foreach($classes as $class) {
print("\n" . $class . "\n");
$methods = get_class_methods($class);
foreach($methods as $method) {
print("\t" . $method . "\n");
}
}
}

make a printDeclaredClasses(), search for "DirectoryIterator" and you can
see available methods for that class..

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



[PHP] Re: PHP5: Directory & DirectoryIterator

2004-02-25 Thread Ben Ramsey
That's some pretty helpful information there.  I didn't know about that. 
 Thanks!

-Ben

Vivian Steller wrote:

Ben Ramsey wrote:


using PHP5 Beta 4 I saw some new classes like DirectoryIterator with nice
methods like:
Where did you see these classes?  Is it a PEAR package?  I haven't seen
these in the PHP manual.


You can find them using the following function:

function printDeclaredClasses() {
$classes = get_declared_classes();
foreach($classes as $class) {
print("\n" . $class . "\n");
$methods = get_class_methods($class);
foreach($methods as $method) {
print("\t" . $method . "\n");
}
}
}
make a printDeclaredClasses(), search for "DirectoryIterator" and you can
see available methods for that class..
--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread BAO RuiXian


John Taylor-Johnston wrote:

Bao or anyone,

Here is my code. $sql works correctly, but am not sure I did this line correct:

$glquery = mysql_query($sql);

because "if ($glquery)" always returns something. I want to know if it returns NULL.
 

Gee, I was goofed up by your last $sql:) Now you can check if it returns 
NULL by

   if (!$glquery)

Best

Bao

Thanks for your time,
John
---snip-

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$eventid = $link_date;
$sql = 'SELECT * FROM '.$table.' where eventid like '.$eventid.';';
#echo $sql;
#SELECT * FROM GMCalendar where eventid like 2004-02-16;
$glquery = mysql_query($sql);
if ($glquery)
{
echo " $day ";
}else{
echo " $day ";
}
Bao Ruixian wrote:

 

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


Re[2]: [PHP] [php] if $sql has returned something

2004-02-25 Thread Richard Davey
Hello John,

Wednesday, February 25, 2004, 5:53:13 PM, you wrote:

JTJ> Here is my code. $sql works correctly, but am not sure I did this line correct:
JTJ> $glquery = mysql_query($sql);
JTJ> because "if ($glquery)" always returns something. I want to know if it returns 
NULL.

mysql_query will return FALSE if the query is invalid.

If the query is perfectly valid SQL, but just doesn't return
anything, then you need to use mysql_num_rows() instead - if this is
equal to nothing then nothing was returned.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread Jason Wong
On Thursday 26 February 2004 01:53, John Taylor-Johnston wrote:

> Here is my code. $sql works correctly, but am not sure I did this line
> correct:

Your query ($sql) is incorrect and will not work. See manual for why.

> $glquery = mysql_query($sql);
>
> because "if ($glquery)" always returns something. I want to know if it
> returns NULL.

It will never return NULL. See manual for why.

Your logic of using "if ($glquery)" for your purpose is incorrect.  See manual 
for why.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The more beautiful the woman is who loves you, the easier it is to leave her 
with no hard feeling
-- Murphy's Laws on Sex n1
*/

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



RE: [PHP] Sequential Random Character Generator

2004-02-25 Thread list
First I know that sequential and random cannot co-exist. Let me explain what I'm 
attempting to use this for. 

I'm printing tags that will be used in the same way you win Pepsi stuff online. You 
will get a randomly generated code on the tag to check to see if you won at a website. 
The data needs to be usable by both the printer and the web server so I thought PHP 
and a comma delimited database structure might be a good choice.

One data setup I thought would work is something like this:

1 D56ER48 3
2 IU89S33 0
3 A8W7E95 0
4 5554SSR 1

The first column being a key, which the printer requested, the second being the random 
tag, and the third being what prize package they get, or don't get.

The third column could be randomly assigned as well but it would be nice to say of the 
X number of records make 100,000 winners for package 1, 50,000 for package 2, etc. 

As was mentioned I don't want this script to take ten years to output 2 million 
records and I wasn't sure if there are size constraints with comma delimited files. 

Hope this clarifies things a little more.

Steve

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

[PHP] Re: PHP5: Directory & DirectoryIterator

2004-02-25 Thread Ben Ramsey
When I was looking for information regarding get_declared_classes(), I 
came across these links in the manual.  I hope they help.

http://us4.php.net/manual/en/reserved.classes.php
http://us4.php.net/manual/en/class.dir.php
Still, I don't think the manual has any documentation yet on 
directoryIterator, and I didn't see it when I used your function on beta 
3 (which is what I'm running at present).  So, it must be brand new.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] looks like the spammers got through anyway

2004-02-25 Thread Shoan Motwani
* jimbo ([EMAIL PROTECTED]) wrote:
> I've just received a 419 scam email to the email address I setup for posting
> to this forum.  Looks like the safeguards have failed :-(
> 

All I can say is get spam assassin.

Peace,
Shoan.

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



Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread John Taylor-Johnston
Bao,

I have only one entry where eventid = 2004-02-28. if (!$glquery) does not result in 
anything either.

Jason,
Where in the manual would I look? I looked at 
http://www.php.net/manual/en/function.mysql-query.php but don't find anything 
inspiring.
It does not die, so I can't check if it is false or true this way.

$sql = 'SELECT * FROM '.$table.' where eventid like \''.$eventid.'\';';

$glquery = mysql_query($sql) or die("Invalid query: " . mysql_error());
#echo $sql;

if (!$glquery)
{
echo ".. $day ";
}else{
echo " $day ";
}



> >Here is my code. $sql works correctly, but am not sure I did this line correct:
> >$glquery = mysql_query($sql);
> >because "if ($glquery)" always returns something. I want to know if it returns NULL.
> Gee, I was goofed up by your last $sql:) Now you can check if it returns
> NULL by
> if (!$glquery)
>
> >Thanks for your time,
> >John
> >
> >---snip-
> >
> >$myconnection = mysql_connect($server,$user,$pass);
> >mysql_select_db($db,$myconnection);
> >
> >$eventid = $link_date;
> >$sql = 'SELECT * FROM '.$table.' where eventid like '.$eventid.';';
> >#echo $sql;
> >#SELECT * FROM GMCalendar where eventid like 2004-02-16;
> >$glquery = mysql_query($sql);
> >
> >if ($glquery)
> >{
> >echo " $day ";
> >}else{
> >echo " $day ";
> >}
> >
> >Bao Ruixian wrote:
> >
> >
> >

--
John Taylor-Johnston
-
"If it's not Open Source, it's Murphy's Law or broken."

  ' ' '   Collège de Sherbrooke
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke
  http://compcanlit.ca/
  819-569-2064

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



RE: [PHP] Sequential Random Character Generator

2004-02-25 Thread Adam Bregenzer
On Wed, 2004-02-25 at 12:56, [EMAIL PROTECTED] wrote:
> The first column being a key, which the printer requested, the second
> being the random tag, and the third being what prize package they get,
> or don't get.

Verifying you have unique records as well as generating the prize
information are part of the tasks you need to solve in writing the
application.  You may want to store the information in a database and
use it to verify the uniqueness of the keys, also you can then easily
batch process the application so it can be stopped and started.

> As was mentioned I don't want this script to take ten years to output
> 2 million records and I wasn't sure if there are size constraints with
> comma delimited files. 

I would recommend splitting the application into pieces, first generate
the keys, then assign the prizes, this way you have more control.  Also,
I would run this through the cli, not as a web page.  As for how long it
will take, that's anybody's guess and greatly depends on the speed of
the system you run it on.

> Hope this clarifies things a little more.

If you have a particular problem please ask about that, mostly I see
here a request for someone to design your application for you.

-- 
Adam Bregenzer
[EMAIL PROTECTED]

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



Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread John Taylor-Johnston
Richard,
Thanks. Should I still include the die ?

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$eventid = $link_date;
$sql = 'SELECT * FROM '.$table.' where eventid like \''.$eventid.'\';';

$glquery = mysql_query($sql) or die("Invalid query: " . mysql_error());
$num_rows = mysql_num_rows($glquery);

if ($num_rows > 0)
{
echo " $day ";
}else{
echo " $day ";
}


Richard Davey wrote:

> mysql_query will return FALSE if the query is invalid.
> If the query is perfectly valid SQL, but just doesn't return
> anything, then you need to use mysql_num_rows() instead - if this is
> equal to nothing then nothing was returned.

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



Re: [PHP] frameset und php-script in frame

2004-02-25 Thread joe-at
Thanks for the hint, but the frames are wide enough.
I also tried it on my test server and on a real web server with the same
result.

"Sam Masiello" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]

I am afraid that I don't get the same problem that you do.  If I request
frameset.html in my browser I get the text that you are echoing in your
PHP statement in the top frame.

Is it possible that your resolution is such that you need to scroll in
the top frame to see it?  Try viewing the source of the top frame to see
if the contents of your echo statement is in there.

--Sam



joe-at wrote:
> hi pleas help me,
>
> when I try to use php in a frame of a frameset it dos not work. what
> is wrong with my files?
>
>
>
> fameset.html:
>
>
>
> 
>
> 
>
> frameset
>
> 
>
> 
>
>   
>
>   
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> test.php:
>
>
>
> 
>
> 
>
> test
>
> 
>
> 
>
> Jetzt sollt ein PHP-Skript erscheinen:
>
> 
>
> 
>
> 
>
>
>
> result of the top frame (test.php):
>
> Jetzt soll ein PHP-Skript erscheinen:
>
>
>
> test.php works without frameset:
>
> Jetzt sollt ein PHP-Skript erscheinen:
>
> Wer fersteht das noch?
>
>
>
>
>
> Thanks for help
>
> joe-at

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



[PHP] pleas help me with frameset and php

2004-02-25 Thread joe-at
hi pleas help me,
when I try to use php in a frame of a frameset it dos not work. what is
wrong with my files?
I tried it on my test server and on a real web server with the same result.

fameset.html:



frameset


  
  






test.php:



test


Jetzt sollt ein PHP-Skript erscheinen:




result of the top frame (test.php):
Jetzt soll ein PHP-Skript erscheinen:

test.php works without frameset:
Jetzt sollt ein PHP-Skript erscheinen:
Wer fersteht das noch?


Thanks for help
joe-at

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



Re[2]: [PHP] [php] if $sql has returned something

2004-02-25 Thread Richard Davey
Hello John,

Wednesday, February 25, 2004, 6:26:41 PM, you wrote:

JTJ> Richard,
JTJ> Thanks. Should I still include the die ?

JTJ> $glquery = mysql_query($sql) or die("Invalid query: " . mysql_error());

It's up to you, I never do. It won't give you a very clean exit if an
error occurs.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: looks like the spammers got through anyway

2004-02-25 Thread Jeff Schwartz
I use this Yahoo account primarily for the PHP list. I use GoodbyeSpam.com as a filter 
and no spam whatsoever gets through. You mentioned that the safeguards aren't working. 
How are you trying to block spam?
 
Jeff


-
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

[PHP] making 1 pdf file from 2

2004-02-25 Thread Steve Buehler
I hope someone here can help me because for some reason I can't receive any 
mail from the pdflib mailing list.  I have PDFlib + PDI 5 using php to 
create my pages.  This is the first time that I have had to do this and 
just can't figure it out.  I have two files:
ChurchCalendarFrontPage.pdf
Church.pdf
What I am trying to do is to have a page (cal.php) that someone goes to and 
it will create just one pdf document output with the two pdf documents.  I 
can do it if I designate which page(s) that I want to display from each 
document, but they don't always have the same amount of pages.  At the 
moment, the ChurchCalendarFrontPage.pdf has only one page and the 
Church.pdf has 13 pages to it.  Hopefully someone here will know what I am 
asking for and be able to help me by either showing me where to go for 
examples, or show me the code for this.  I am pretty new to PDFlib.

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


RE: [PHP] frameset und php-script in frame

2004-02-25 Thread Sam Masiello

Yes, they are wide enough...i was speaking of long enough.  In other
words, be sure the top frame doesn't scroll.  The code as you posted it
works fine, but on my display it barely fits in the top frame.  On a
lower resolution you might not see the text in the top frame.

Have you tried making your top frame bigger (change the 83 to 200) to
see if you can see the text?

--Sam


joe-at wrote:
> Thanks for the hint, but the frames are wide enough.
> I also tried it on my test server and on a real web server with the
> same result. 
> 
> "Sam Masiello" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
>
news:[EMAIL PROTECTED]
.
> 
> I am afraid that I don't get the same problem that you do.  If I
> request frameset.html in my browser I get the text that you are
> echoing in your PHP statement in the top frame.  
> 
> Is it possible that your resolution is such that you need to scroll
> in the top frame to see it?  Try viewing the source of the top frame
> to see if the contents of your echo statement is in there.  
> 
> --Sam
> 
> 
> 
> joe-at wrote:
>> hi pleas help me,
>> 
>> when I try to use php in a frame of a frameset it dos not work. what
>> is wrong with my files? 
>> 
>> 
>> 
>> fameset.html:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> frameset
>> 
>> 
>> 
>> 
>> 
>>   
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> test.php:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> test
>> 
>> 
>> 
>> 
>> 
>> Jetzt sollt ein PHP-Skript erscheinen:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> result of the top frame (test.php):
>> 
>> Jetzt soll ein PHP-Skript erscheinen:
>> 
>> 
>> 
>> test.php works without frameset:
>> 
>> Jetzt sollt ein PHP-Skript erscheinen:
>> 
>> Wer fersteht das noch?
>> 
>> 
>> 
>> 
>> 
>> Thanks for help
>> 
>> joe-at

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



Re: [PHP] [php] if $sql has returned something

2004-02-25 Thread John Taylor-Johnston
Very helpful & much appreciated.

Richard Davey wrote:

> Hello John,
>
> Wednesday, February 25, 2004, 6:26:41 PM, you wrote:
>
> JTJ> Richard,
> JTJ> Thanks. Should I still include the die ?
>
> JTJ> $glquery = mysql_query($sql) or die("Invalid query: " . mysql_error());
>
> It's up to you, I never do. It won't give you a very clean exit if an
> error occurs.

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



[PHP] DOM appendChild question

2004-02-25 Thread Dan Phiffer
I'm getting an error from the following code, but the error message 
hasn't given me many leads:

$doc = new DomDocument();
$doc->loadXML('');
$hello = new DomDocument();
$hello->loadXML('Hello world!');
$xp = new DomXPath($doc);
$body = $xp->query('/html/body')->item(0);
$body->appendChild($hello->firstChild); // <-- Exception thrown here
echo $doc->saveHTML();

Here's the error message I'm getting:

Fatal error: Uncaught exception 'domexception' with message 'Wrong 
Document Error' in ... Stack trace: #0 {main} thrown in ... on line 18

I'm running PHP 5 beta 4 on Apache 1.3.29.

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


Re: [PHP] frameset und php-script in frame

2004-02-25 Thread joe-at
Sorry I wanted to say, that the original frame was long inough.

But I tried it again, and it does not work! 
joe

"Sam Masiello" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]

Yes, they are wide enough...i was speaking of long enough.  In other
words, be sure the top frame doesn't scroll.  The code as you posted it
works fine, but on my display it barely fits in the top frame.  On a
lower resolution you might not see the text in the top frame.

Have you tried making your top frame bigger (change the 83 to 200) to
see if you can see the text?

--Sam


joe-at wrote:
> Thanks for the hint, but the frames are wide enough.
> I also tried it on my test server and on a real web server with the
> same result.
>
> "Sam Masiello" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
>
news:[EMAIL PROTECTED]
.
>
> I am afraid that I don't get the same problem that you do.  If I
> request frameset.html in my browser I get the text that you are
> echoing in your PHP statement in the top frame.
>
> Is it possible that your resolution is such that you need to scroll
> in the top frame to see it?  Try viewing the source of the top frame
> to see if the contents of your echo statement is in there.
>
> --Sam
>
>
>
> joe-at wrote:
>> hi pleas help me,
>>
>> when I try to use php in a frame of a frameset it dos not work. what
>> is wrong with my files?
>>
>>
>>
>> fameset.html:
>>
>>
>>
>> 
>>
>> 
>>
>> frameset
>>
>> 
>>
>> 
>>
>>   
>>
>>   
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>>
>>
>> test.php:
>>
>>
>>
>> 
>>
>> 
>>
>> test
>>
>> 
>>
>> 
>>
>> Jetzt sollt ein PHP-Skript erscheinen:
>>
>> 
>>
>> 
>>
>> 
>>
>>
>>
>> result of the top frame (test.php):
>>
>> Jetzt soll ein PHP-Skript erscheinen:
>>
>>
>>
>> test.php works without frameset:
>>
>> Jetzt sollt ein PHP-Skript erscheinen:
>>
>> Wer fersteht das noch?
>>
>>
>>
>>
>>
>> Thanks for help
>>
>> joe-at

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



Re: [PHP] To Separate, or Not to Separate

2004-02-25 Thread Monty
Thanks to everyone that responded to my question, it was very helpful!

I've decided to keep all the fields together rather than split them into two
tables. I understand normalization and I've avoided redundancies in my DB.
After a user logs in, what I do is load all preferences into session vars so
that I don't have to continually call the DB for prefs every time a page is
loaded. So, for that reason, I think it would be more convenient to keep all
the member fields in one table. Member billing info, such as billing address
and credit card info, is already stored into a separate table (which has
very limited access with a separate user/password in MySQL). The Member DB I
was asking about holds stuff like username, password, e-mail, membership
expire date and various preferences.

Thanks for all the input!

- Monty


> From: [EMAIL PROTECTED] (Chris W. Parker)
> Newsgroups: php.general
> Date: Mon, 23 Feb 2004 15:34:41 -0800
> To: "Monty" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Subject: RE: [PHP] To Separate, or Not to Separate
> 
> Monty 
> on Monday, February 23, 2004 2:35 PM said:
> 
>> I'm wondering if I will see any noticeable speed increase if I were
>> to split the 20+ fields that hold preferences (nearly all are
>> single-digit 1/0 fields) out from the other fields that hold general
>> member data, and put them into their own table? Or maybe there's some
>> other good reason for doing this that I'm not aware of?
>> 
>> I'd actually prefer to keep it all together, because it's a lot
>> easier to update a single table in MySQL than several if a member
>> makes changes to their account or preferences.
>> 
>> What do you think?
> 
> what do *i* think?? well, i'll tell you.
> 
> i'd say you should definitely keep them in the same table. once you move
> them to another table you'll need some way of keeping track of each
> users corresponding settings and the way to do that is to have some kind
> of unique identifying field that is the same between both tables. this
> is usually done with an auto-incrementing ID field.
> 
> you will likely not see any performance increase if you split the
> tables. in fact you'll probably see a decrase as you'll have to do a
> join to get data from two tables at once.
> 
> and just to let you know (in case you don't already):
> 
> 1. don't select the entire table with "SELECT * FROM user_data". instead
> you should explicitly list each and every field you want to grab (even
> if it's all of them).
> 
> 2. in case you are not meaning to select the entire table but you are
> still doing SELECT *, you'd be much better off following tip #1 because
> the database won't be doing as much work.
> 
> 
> 
> hth,
> chris.

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



[PHP] Re: pleas help me with frameset and php

2004-02-25 Thread joe-at
Pleas change the line 5 in my frameset file.



The original line makes a too short top frame.

But this does not solve my problem.



"Joe-At" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> hi pleas help me,
> when I try to use php in a frame of a frameset it dos not work. what is
> wrong with my files?
> I tried it on my test server and on a real web server with the same
result.
>
> fameset.html:
>
> 
> 
> frameset
> 
> 
>   
>   
> 
> 
> 
> 
> 
>
> test.php:
>
> 
> 
> test
> 
> 
> Jetzt sollt ein PHP-Skript erscheinen:
> 
> 
> 
>
> result of the top frame (test.php):
> Jetzt soll ein PHP-Skript erscheinen:
>
> test.php works without frameset:
> Jetzt sollt ein PHP-Skript erscheinen:
> Wer fersteht das noch?
>
>
> Thanks for help
> joe-at

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



[PHP] function.date.php

2004-02-25 Thread John Taylor-Johnston
Is there a way to reverse engineer http://www.php.net/manual/en/function.date.php ?

I want to feed in 2003-02-28 and extract February 28, 2003. I can substr it out ...

$eventid = "2003-02-28";

$year = substr($eventid, 0,4);
$month = substr($eventid, 5,7);
$year = substr($eventid, 8,10);

But there must be a function that would do it? Everything else exists :)

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



[PHP] Re: function.date.php

2004-02-25 Thread Kirk Winters
John Taylor-Johnston wrote:

Is there a way to reverse engineer http://www.php.net/manual/en/function.date.php ?

I want to feed in 2003-02-28 and extract February 28, 2003. I can substr it out ...

$eventid = "2003-02-28";

$year = substr($eventid, 0,4);
$month = substr($eventid, 5,7);
$year = substr($eventid, 8,10);
But there must be a function that would do it? Everything else exists :)
not sure what you mean exactly, but you're simply trying to turn 
2003-02-28 into  February 28, 2003 the following statement will work

echo date("F d, Y", strtotime("2003-02-28"));

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


Re: [PHP] function.date.php

2004-02-25 Thread Jochem Maas
John Taylor-Johnston wrote:

Is there a way to reverse engineer http://www.php.net/manual/en/function.date.php ?

I want to feed in 2003-02-28 and extract February 28, 2003. I can substr it out ...

$eventid = "2003-02-28";

$year = substr($eventid, 0,4);
$month = substr($eventid, 5,7);
$year = substr($eventid, 8,10);
But there must be a function that would do it? Everything else exists :)

yes there is: take a look at the strtotime() and strftime() functions in 
the manual.

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


Re: [PHP] function.date.php

2004-02-25 Thread Adam Bregenzer
On Wed, 2004-02-25 at 15:58, John Taylor-Johnston wrote:
> I want to feed in 2003-02-28 and extract February 28, 2003. I can substr it out ...

Use strtotime[1] then date[2].

[1] http://www.php.net/strtotime
[2] http://www.php.net/date

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



RE: [PHP] function.date.php

2004-02-25 Thread Sam Masiello

Actually, your use of substr is incorrect.  The third parameter is how
many characters you want to go from your offset, not the ending
character.  Also, your last variable shouldn't be year...it should be
day (or whatever you want to name it...anything but year or month :) ),
otherwise you will overwrite your previously set year with the day of
the month :)

Aside from that, you can use the date function once you fix your code a
bit:

$mynewdate = date("F d, Y", mktime(0, 0, 0, $month, $day, $year) ;

HTH!

--Sam



John Taylor-Johnston wrote:
> Is there a way to reverse engineer
> http://www.php.net/manual/en/function.date.php ? 
> 
> I want to feed in 2003-02-28 and extract February 28, 2003. I can
> substr it out ... 
> 
> $eventid = "2003-02-28";
> 
> $year = substr($eventid, 0,4);
> $month = substr($eventid, 5,7);
> $year = substr($eventid, 8,10);
> 
> But there must be a function that would do it? Everything else exists
> :) 

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



[PHP] Re: frameset und php-script in frame one part solved!

2004-02-25 Thread joe-at
Thanks for help,
only my testserver has a problem with my skripts.
It seems that I have not actually tested it on the server.
joe

"Joe-At" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Sorry I wanted to say, that the original frame was long inough.
> 
> But I tried it again, and it does not work! 
> joe
>
> "Sam Masiello" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
>
> Yes, they are wide enough...i was speaking of long enough.  In other
> words, be sure the top frame doesn't scroll.  The code as you posted it
> works fine, but on my display it barely fits in the top frame.  On a
> lower resolution you might not see the text in the top frame.
>
> Have you tried making your top frame bigger (change the 83 to 200) to
> see if you can see the text?
>
> --Sam
>
>
> joe-at wrote:
> > Thanks for the hint, but the frames are wide enough.
> > I also tried it on my test server and on a real web server with the
> > same result.
> >
> > "Sam Masiello" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> >
> news:[EMAIL PROTECTED]
> .
> >
> > I am afraid that I don't get the same problem that you do.  If I
> > request frameset.html in my browser I get the text that you are
> > echoing in your PHP statement in the top frame.
> >
> > Is it possible that your resolution is such that you need to scroll
> > in the top frame to see it?  Try viewing the source of the top frame
> > to see if the contents of your echo statement is in there.
> >
> > --Sam
> >
> >
> >
> > joe-at wrote:
> >> hi pleas help me,
> >>
> >> when I try to use php in a frame of a frameset it dos not work. what
> >> is wrong with my files?
> >>
> >>
> >>
> >> fameset.html:
> >>
> >>
> >>
> >> 
> >>
> >> 
> >>
> >> frameset
> >>
> >> 
> >>
> >> 
> >>
> >>   
> >>
> >>   
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >>
> >>
> >> test.php:
> >>
> >>
> >>
> >> 
> >>
> >> 
> >>
> >> test
> >>
> >> 
> >>
> >> 
> >>
> >> Jetzt sollt ein PHP-Skript erscheinen:
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >>
> >>
> >> result of the top frame (test.php):
> >>
> >> Jetzt soll ein PHP-Skript erscheinen:
> >>
> >>
> >>
> >> test.php works without frameset:
> >>
> >> Jetzt sollt ein PHP-Skript erscheinen:
> >>
> >> Wer fersteht das noch?
> >>
> >>
> >>
> >>
> >>
> >> Thanks for help
> >>
> >> joe-at

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



[PHP] Re: pleas help me with frameset and php, party solved

2004-02-25 Thread joe-at
Thanks for help,
only my lokal testserver has a problem with my skripts.
It seems that I have not actually tested it on the webserver bevore posting.
joe

"Joe-At" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> hi pleas help me,
> when I try to use php in a frame of a frameset it dos not work. what is
> wrong with my files?
> I tried it on my test server and on a real web server with the same
result.
>
> fameset.html:
>
> 
> 
> frameset
> 
> 
>   
>   
> 
> 
> 
> 
> 
>
> test.php:
>
> 
> 
> test
> 
> 
> Jetzt sollt ein PHP-Skript erscheinen:
> 
> 
> 
>
> result of the top frame (test.php):
> Jetzt soll ein PHP-Skript erscheinen:
>
> test.php works without frameset:
> Jetzt sollt ein PHP-Skript erscheinen:
> Wer fersteht das noch?
>
>
> Thanks for help
> joe-at

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



Re: [PHP] function.date.php

2004-02-25 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
the other 3 answers were more appropriate

what newsreader are you ppl using?
is anyone else getting anoyed with posts out of chain? :p
Sam Masiello wrote:

Actually, your use of substr is incorrect.  The third parameter is how
many characters you want to go from your offset, not the ending
character.  Also, your last variable shouldn't be year...it should be
day (or whatever you want to name it...anything but year or month :) ),
otherwise you will overwrite your previously set year with the day of
the month :)
Aside from that, you can use the date function once you fix your code a
bit:
$mynewdate = date("F d, Y", mktime(0, 0, 0, $month, $day, $year) ;

HTH!

--Sam



John Taylor-Johnston wrote:

Is there a way to reverse engineer
http://www.php.net/manual/en/function.date.php ? 

I want to feed in 2003-02-28 and extract February 28, 2003. I can
substr it out ... 

$eventid = "2003-02-28";

$year = substr($eventid, 0,4);
$month = substr($eventid, 5,7);
$year = substr($eventid, 8,10);
But there must be a function that would do it? Everything else exists
:) 


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAPRNIaxdA/5C8vH8RAqFqAKDaNQy1l9K+tbk+XL3xziBu4tRjfQCfdbRZ
S8E8OnaA4FmrPKGxio2hRjE=
=NZZO
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] function.date.php

2004-02-25 Thread Jay Blanchard
[snip]
what newsreader are you ppl using?
is anyone else getting anoyed with posts out of chain? :p
[/snip]

Yes...and top posting and failure to snip.all annoying

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



[PHP] Re: Request domain name

2004-02-25 Thread Kim Steinhaug
Try this one :
$_SERVER["HTTP_HOST"]

It will do the trick for you, it will give you the root domain
in the URI of your browser.

-- 
-- 
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--


"Age Bosma" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I would like to be able to request the domain name.
> How can this be achieved without hardcoding it?
>
> $_SERVER['REQUEST_URI'] doesn't provide me the domain name, it just
> provides me "/index.php?page=2000" instead of e.g.
> "www.blaat.com/index.php?page=2000"
> I can't seem to find anything on the php site to get the domain name as
> well.
>
> I prefer using absolute URI's.
> The reason why this is a problem for me is besause I'm working on a site
> which has two different URI's but both display the exact same site.
>
> Cheers,
>
> Age Bosma

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



[PHP] HELP with "headers already being sent error?

2004-02-25 Thread DAvid Jackson
Howdy --
header already send error.
Cannot modify header information - headers already sent by (output
started at /u242/rumc1636/warehouse/scrapbook/config.php:8) in 
/u242/rumc1636/warehouse/scrapbook/login.php on line 47 and 48.

Here's lines 42 is if($action == "login")
Could it be related to the form actons i.e. Should that be a $PHP_SELF 
tingie?


Finaly, plese note this code isn't mine, i'm just trying to tweak it 
alittle.

TIA,
David
-- open of config.php: Lines 1-8 




  
RUMC Youth Ministry


--- Login.php
$errors = "";
require "config.php";
if($action == "logout"){

   $query = "UPDATE scrapbook_users set loggedin='N' Where 
recno='$myuser'";
   $mydatabase->sql_query($query);
   if($logins > 6){
 $query = "UPDATE scrapbook_config set logins='3'";
 $mydatabase->sql_query($query);
   }
   setcookie("mypass","", time() - 3600);
   setcookie("myuser","", time() - 3600);
   $query = "UPDATE scrapbook_config set loggedin='N'";
   $mydatabase->sql_query($query);
   print "You have been logged out";?>

 
function gothere(){
window.parent.location.replace("index.php?section=");
}
setTimeout("gothere();",200);
print "if you are still here reading this click this link"; exit; } if($action == "login"){ $loginok = false; $myusername = strtolower($myusername); if(($myusername == "admin") && ($mypassword == $password_admin_t)){ $loginok = true; setcookie("myuser","admin"); setcookie("mypass","$mypassword"); $logins++; $query = "UPDATE scrapbook_config set loggedin='Y',logins='$logins'"; $mydatabase->sql_query($query); } else { $query_d = "SELECT * FROM scrapbook_users WHERE myusername='$myusername' AND mypassword='$mypassword'"; $myrow_d = $mydatabase->select($query_d); if(count($myrow_d) != 0){ $loginok = true; $myrow = $myrow_d[0]; setcookie("myuser","$myrow[recno]"); setcookie("mypass","$mypassword"); $query = "UPDATE scrapbook_users set loggedin='Y' WHERE recno='$myrow[recno]'"; $mydatabase->sql_query($query); } } if($loginok == true){ print "You have been Logged In"; ?>
function details(theURL,winName,features) {//v1.0
window.open(theURL,winName,features);
}
function gothere(num){
if(num < 5){
window.parent.location.replace("index.php?section=");
} else {
document.mine.submit();
setTimeout("gothere(2);",200);
}
}
setTimeout("gothere();",600);
http://craftysyntax.com/myscrapbook/abouts.php Method=GET name=mine TARGET=_blank> > > print "if you are still here reading this click this link"; exit; } else { $errors = "Invalid Password or username"; } } if ($tablewidth == ""){ $tablewidth = 250; } if ($section == ""){ $section = "thoughts"; } if ($page == ""){ $page = 1; } $nextpage = $page + 1; // // // Log in // ?> Logging in gives you greater permissions to ADD/EDIT/VIEW chapters of this scrapbook. If do not have a user account please send a email to :The Youth Cordinator PLEASE VISIT THE SUPPORT PAGE $errors "; } ?> function details(theURL,winName,features) {//v1.0 window.open(theURL,winName,features); }

// onmouseovers
r_about = new Image;
h_about = new Image;
r_about.src = 'images/about_pro.gif';
h_about.src = 'images/about_pro2.gif';

r_about2 = new Image;
h_about2 = new Image;
r_about2.src = 'images/about_web.gif';
h_about2.src = 'images/about_web2.gif';

Username:"> Password:"> Lost your password? http://craftysyntax.com/myscrapbook/abouts.php?v=&p= onmouseover="document.about.src=h_about.src" onmouseout="document.about.src=r_about.src"> http://www.hotscripts.com/cgi-bin/rate.cgi"; method="POST" target=_blank>Rate MyScrapbook Script @ http://www.hotscripts.com";>HotScripts.comSelectExcellent!Very GoodGoodFairPoor Powered by http://craftysyntax.com/myscrapbook/?v=&p= target=_blank>Myscrapbook -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: HELP with "headers already being sent error?

David Jackson wrote:

Howdy --
header already send error.
Cannot modify header information - headers already sent by (output
started at /u242/rumc1636/warehouse/scrapbook/config.php:8) in 
/u242/rumc1636/warehouse/scrapbook/login.php on line 47 and 48.

Here's lines 42 is if($action == "login")
Could it be related to the form actons i.e. Should that be a $PHP_SELF 
tingie?


Finaly, plese note this code isn't mine, i'm just trying to tweak it 
alittle.

TIA,
David
-- open of config.php: Lines 1-8 




  
RUMC Youth Ministry


--- Login.php
$errors = "";
require "config.php";
if($action == "logout"){

   $query = "UPDATE scrapbook_users set loggedin='N' Where 
recno='$myuser'";
   $mydatabase->sql_query($query);
   if($logins > 6){
 $query = "UPDATE scrapbook_config set logins='3'";
 $mydatabase->sql_query($query);
   }
   setcookie("mypass","", time() - 3600);
   setcookie("myuser","", time() - 3600);
   $query = "UPDATE scrapbook_config set loggedin='N'";
   $mydatabase->sql_query($query);
   print "You have been logged out";?>

 
function gothere(){
window.parent.location.replace("index.php?section=");
}
setTimeout("gothere();",200);
print "if you are still here reading this click this link"; exit; } if($action == "login"){ $loginok = false; $myusername = strtolower($myusername); if(($myusername == "admin") && ($mypassword == $password_admin_t)){ $loginok = true; setcookie("myuser","admin"); setcookie("mypass","$mypassword"); $logins++; $query = "UPDATE scrapbook_config set loggedin='Y',logins='$logins'"; $mydatabase->sql_query($query); } else { $query_d = "SELECT * FROM scrapbook_users WHERE myusername='$myusername' AND mypassword='$mypassword'"; $myrow_d = $mydatabase->select($query_d); if(count($myrow_d) != 0){ $loginok = true; $myrow = $myrow_d[0]; setcookie("myuser","$myrow[recno]"); setcookie("mypass","$mypassword"); $query = "UPDATE scrapbook_users set loggedin='Y' WHERE recno='$myrow[recno]'"; $mydatabase->sql_query($query); } } if($loginok == true){ print "You have been Logged In"; ?>
function details(theURL,winName,features) {//v1.0
window.open(theURL,winName,features);
}
function gothere(num){
if(num < 5){
window.parent.location.replace("index.php?section=");
} else {
document.mine.submit();
setTimeout("gothere(2);",200);
}
}
setTimeout("gothere();",600);
http://craftysyntax.com/myscrapbook/abouts.php Method=GET name=mine TARGET=_blank> > > print "if you are still here reading this click this link"; exit; } else { $errors = "Invalid Password or username"; } } if ($tablewidth == ""){ $tablewidth = 250; } if ($section == ""){ $section = "thoughts"; } if ($page == ""){ $page = 1; } $nextpage = $page + 1; // // // Log in // ?> Logging in gives you greater permissions to ADD/EDIT/VIEW chapters of this scrapbook. If do not have a user account please send a email to :The Youth Cordinator PLEASE VISIT THE SUPPORT PAGE $errors "; } ?> function details(theURL,winName,features) {//v1.0 window.open(theURL,winName,features); }

// onmouseovers
r_about = new Image;
h_about = new Image;
r_about.src = 'images/about_pro.gif';
h_about.src = 'images/about_pro2.gif';

r_about2 = new Image;
h_about2 = new Image;
r_about2.src = 'images/about_web.gif';
h_about2.src = 'images/about_web2.gif';

Username:"> Password:"> Lost your password? http://craftysyntax.com/myscrapbook/abouts.php?v=&p= onmouseover="document.about.src=h_about.src" onmouseout="document.about.src=r_about.src"> http://www.hotscripts.com/cgi-bin/rate.cgi"; method="POST" target=_blank>Rate MyScrapbook Script @ http://www.hotscripts.com";>HotScripts.comSelectExcellent!Very GoodGoodFairPoor Powered by http://craftysyntax.com/myscrapbook/?v=&p= target=_blank>Myscrapbook Those errors are happening because something is being output to the browser before the calls to setcookie(). The output is happening on config.php at the beginning. You need to do all of your header stuff before ANY output. This includes calls to print and echo and HTML outside of the . You can do one of the following: 1) Move the header stuff (cookie stuff) up before all output. 2) Add conditionals aruond output before the cookie calls 3) Set up output buffering. This will take the least amount of work, but it will also make your pages load all at once (no incremental output). You could always do output buffering only when the user is logging in.. To do 3) just put ob_start() up above the very first output (probably on config.php). --

Re: [PHP] Sequential Random Character Generator

Here's a function I made for random string generation:

http://www.ircphp.com/users/imho/?file=function.randstr.php

randstr(len, seeds);

so, echo randstr(10, "abc123"); would result in a 10 letter string made up
of a,b,c,1,2,3

Hoep this helps.


"Miles Thompson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> At 11:25 AM 2/25/2004 -0500, [EMAIL PROTECTED] wrote:
> >I'm trying to create a PHP sequential random character generator that
will
> >output to a file database of some sort. The randomization needs to be
> >using both capital letters and numbers. I need to output like 2 million
> >records. Can someone point me in the right direction on how to do this?
> >
> >I'm also looking to to this without letters as well.
> >
> >Thanks in advance,
> >Steve
>
> First of all, have you tried it? Pseudo-coded it? Here's one approach:
>
> Check the decimal ranges of the ASCII table for the character set(s) you
> want. That will determine the limits of the random numbers you will
accept.
>
> Start a loop, the number of iterations equal to the length of the string
> you want, calling rand() with the decimal limits you will accept.
>
> Convert the output of rand() to a character using chr() and store it in
> your string.
>
> Loop until the string is filled.
>
> Search your database for the value of the string. If it's not found, which
> assures you of it's uniqueness, execute an INSERT or UPDATE, whichever is
> appropriate for what you're doing. (Alternately append to the end of a
file
> if you are using a text file if that's what you are doing, but if you want
> to check for uniqueness you will have to read the file each time, v.
slow.)
>
> Clear the string and repeat. (Actually you could just overwrite the
string.)
>
> Do the above 2 million times. It's amazingly fast.
>
> May we ask why you are doing this?
>
> Regards - Miles Thompson
>

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



Re: [PHP] Re: looks like the spammers got through anyway

OOOh ooh i got one from him too! :) lets do it ;)

-- 
Luke


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On 2/25/2004 4:03:05 AM, Will ([EMAIL PROTECTED]) wrote:
> I know the feeling!!!  I wish they would go away!!!
>
> ~WILL~
/*
You can wish all you wantthose SOBs are here to stay.
Hopefully they will meet with an accident and get a slow  p a i n f u l
death.

-Ryan
*/

Is this an email from MAJOR FREDERIK MUMBA? I think we should all email him
back and try to lead him on :D

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



[PHP] Access DNS record

Does anyone know how to access a DNS record? Can it be done with fopen?
 
Jeff


-
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

[PHP] Re: Access DNS record

Jeff Schwartz wrote:

Does anyone know how to access a DNS record? Can it be done with fopen?
 
Jeff

-
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
I would suggest PEAR's Net_DNS.
http://pear.php.net/package/Net_DNS
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Apache/IE hangs with PHP

Hi,

I have this strange problem. I have Apache 1.3.28 on Windows XP Home SP1
with PHP 4.3.4 as a module:

httpd.conf
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

//After a list of modules
AddModule mod_php4.c

Let's say I have test.php that does nothing more than sleeping for 30
seconds:


content


When I open up this script in IE with http://localhost/test.php and within
the 30 seconds sleep I try to load another file with .php extension
(regardless of whether there are some php statements or not in the file) on
the same localhost server with another IE window, IE or Apache hangs until
the first script is done and then gives output of the second script.

The thing is that when I connect to Apache manually with Telnet during the
same 30 seconds and I request a PHP script, I get the answer immediately.

I've tried almost everything, Apache 2.0, PHP5, disabling Keep-Alive in
Apache, nothing works.

What am I doing wrong? Is that a natural behaviour.

Thanks for your help,
Vincent

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



[PHP] Question about CGI binary

I've run into situation where my PHP script, (which loads records into a
database) gets timed out after 30 seconds, terminating the script execution.
I understand that PHP, on my hosting system, is installed as a CGI binary.
I've even included set_time_limit which seems to have no effect. Is is
possible that the timeout is being caused by a cgi script execution limit?
Or may something else be afoot?

Chris

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



[PHP] pg_query

Hi There,
I have a small question about sending PostgreSQL
commands/statements. I noticed that there's a function
pg_insert that can insert rows, but I have also seen
codes that use pg_query(pg_exec, actually) to do the
same job(in phpBB). Since 'query' is defined to
'retrieve' data, is it more preferred to use pg_insert
when inserting rows? Maybe more generally, do I just
send whatever through pg_query, or it's more
adequate/efficient to use specific functions. Thank
you.

Moo


-
每天都 Yahoo!奇摩
海的顏色、風的氣息、愛你的溫度,盡在信紙底圖
http://tw.promo.yahoo.com/mail_premium/stationery.html

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



Re: [PHP] pg_query

>I have a small question about sending PostgreSQL commands/statements. I
>noticed that there's a function pg_insert that can insert rows, but I
>have also seen codes that use pg_query(pg_exec, actually) to do the same
>job(in phpBB). Since 'query' is defined to 'retrieve' data, is it more
>preferred to use pg_insert when inserting rows? Maybe more generally, do
>I just send whatever through pg_query, or it's more adequate/efficient to
>use specific functions. Thank you.

pg_insert() is more limited than pg_query(), in terms of the input it will
accept. I imagine it exists to provide a convenient shorthand for the sort
of wrapper functions that everyone writes at one time or another.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



[PHP] apostrophe ( ' ) on a form, adding \; How can i fix this?

I have a user/form that client enters data. And one of my clients have an
apostrophe on his name

eg: Ero's

Now, this page has a confirmation page that the client would see first
before his form will be directed into my system. Now its shows "Ero\'s" how
come this is happening? I dont have any filters for this?

Any help is much appreciated! Thank you!

-- -
Louie Miranda
http://www.axishift.com

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



Re: [PHP] Re: session timeout?

yes, please do

Thanks,
Jake


- Original Message - 
From: "Phillip Jackson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 24, 2004 2:37 PM
Subject: [PHP] Re: session timeout?


> i accomplish this with javascript and the current logout script that i had
> written - Javascript calls a countdown and after 10 m inutes of viewing
the
> same page it pops a window and resets the counter; the window it pops asks
> is the user would like to continue or if they would like to be logged out;
> an inactive user will not make a selection so after 60 seconds, that popup
> redirects the parent page to the logout page and closes itself.  if the
user
> chose to keep working then  no problem, the link to "keep me logged in"
just
> calls the self-close function.
>
> i'll post code if you're interested.
>
> ~phillip jackson
>
>
> "Catalin Trifu" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> >
> > You have to make the code yourself,
> >
> > After session_start you should check the session for some
> > variable you use to check if the user is logged in
> >
> > eg:
> >  > session_start();
> > if( !isset($_SESSION['logged_in']) || $_SESSION['logged_in'] ==
0)
> {
> > //u'r busted go to login
> > } else {
> > //u'r the good guy, come in
> > }
> > ?>
> >
> > C.
> >
> >
> > "Jake McHenry" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > How can I make my site auto log out a user like I've seen on many sites?
> > Right now, the users session never expires unless manually logging out
or
> > the browser is closed. Also, should I change anything to cover any
> security
> > issues? I havn't changed much from the default, only enough to get it
> > running for my site.
> >
> > Here is what I have in my php.ini file:
> >
> > [Session]
> > session.save_handler = files
> > session.save_path = /var/www/sessions
> > session.use_cookies = 1
> > session.name = NittanyTravelSessionCookie
> > session.auto_start = 0
> > session.cookie_lifetime = 0
> > session.cookie_path = /
> > session.cookie_domain =
> > session.serialize_handler = php
> > session.gc_probability = 1
> > session.gc_maxlifetime = 1440
> > session.referer_check =
> > session.entropy_length = 0
> > session.entropy_file =
> > ;session.entropy_length = 16
> > ;session.entropy_file = /dev/urandom
> > session.cache_limiter = nocache
> > session.cache_expire = 180
> > session.use_trans_sid = 1
> > url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeentry"
> >
> >
> > Thanks,
> > Jake
>
> -- 
> 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



Re: [PHP] apostrophe ( ' ) on a form, adding \; How can i fix this?

On Thu, 2004-02-26 at 00:19, Louie Miranda wrote:
> I have a user/form that client enters data. And one of my clients have an
> apostrophe on his name
> 
> eg: Ero's
> 
> Now, this page has a confirmation page that the client would see first
> before his form will be directed into my system. Now its shows "Ero\'s" how
> come this is happening? I dont have any filters for this?

Check php.ini, you probably have magic_quotes_gpc[1] enabled, disable
this to remove the backslashes.  If you can not edit php.ini or you are
distributing your application and can not control PHP's settings search
the archives for code based solutions to this.

Welcome to the most annoying PHP feature ever. :)

Regards,
Adam

[1] http://www.php.net/ref.info#ini.magic-quotes-gpc

-- 
Adam Bregenzer
[EMAIL PROTECTED]

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



Re: [PHP] apostrophe ( ' ) on a form, adding \; How can i fix this?

Hey
Your magic_quotes_gpc is onswitch it off and your problem will go away,
or read up on it.

You might also want to use a function which will make quotes and apostrophes
etc safe...check the manual as there are a few.

Cheers,
-Ryan

On 2/26/2004 6:19:02 AM, Louie Miranda ([EMAIL PROTECTED]) wrote:
> I have a user/form that client enters data. And one of my clients have an
> apostrophe on his name
>
> eg:
> Ero's
>
> Now, this page has a confirmation page that the client would see first
> before his form will be directed into my system. Now its shows "Ero\'s"
how
> come this is happening? I dont have any filters for this?
>
> Any help is much appreciated! Thank you!
>
> -- -
> Louie Miranda
> http://www.axishift.com
>
> --
> 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] Re: date functions

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi,
> 
> You might already be fed up with my posts but I'm a complete PHP newbie and find 
> these groups are the best way to learn! Anyway I have the database date in the 
> format: -mm-dd hh:mm:ss e.g. 2004-02-24 07:57:59 but when in some situations I 
> only want to show the user the date in the format dd-mm- what is the correct / 
> best php function to use for this purpose ?
> 
> Cheers.
> 
> Matt

If you are pulling the dates from mysql, you could use the DATE_FORMAT in 
mysql to present them in the required format.

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP] apostrophe ( ' ) on a form, adding \; How can i fix this?

Ok thanks, will check the manual also. Right now its working!~


-- -
Louie Miranda
http://www.axishift.com

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



[PHP] Re: Apache/IE hangs with PHP

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
i think ie suck hehe
a friend had a similar problem, it was ie's fault


Vincent Bouret wrote:
Hi,

I have this strange problem. I have Apache 1.3.28 on Windows XP Home SP1
with PHP 4.3.4 as a module:
httpd.conf
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
//After a list of modules
AddModule mod_php4.c
Let's say I have test.php that does nothing more than sleeping for 30
seconds:


content

When I open up this script in IE with http://localhost/test.php and within
the 30 seconds sleep I try to load another file with .php extension
(regardless of whether there are some php statements or not in the file) on
the same localhost server with another IE window, IE or Apache hangs until
the first script is done and then gives output of the second script.
The thing is that when I connect to Apache manually with Telnet during the
same 30 seconds and I request a PHP script, I get the answer immediately.
I've tried almost everything, Apache 2.0, PHP5, disabling Keep-Alive in
Apache, nothing works.
What am I doing wrong? Is that a natural behaviour.

Thanks for your help,
Vincent
- -- 
André Cerqueira
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAPZooaxdA/5C8vH8RAlPRAKC0rWq5pgp1uQjhxIZ1PEOjdxFl8wCghiPI
5GdpbYgIWQQQBDWVuNqXXOw=
=D3lA
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Question about CGI binary

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
http://www.php.net/set_time_limit

[snip]
> Warning
>
> set_time_limit() has NO EFFECT when PHP is running in safe mode. There
> is NO workaround other than turning off safe mode or changing the time
> limit in the php.ini.
[/snip]
most servers do that



Chris wrote:

I've run into situation where my PHP script, (which loads records into a
database) gets timed out after 30 seconds, terminating the script execution.
I understand that PHP, on my hosting system, is installed as a CGI binary.
I've even included set_time_limit which seems to have no effect. Is is
possible that the timeout is being caused by a cgi script execution limit?
Or may something else be afoot?
Chris
- -- 
André Cerqueira
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAPZvSaxdA/5C8vH8RAgXiAJ0Y7lBzXZmAtQI9kssLrO08fcmtOgCdHgwu
uJtKL+MjART6lvCYzHu5JqY=
=s+B1
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Image resize on upload

Hello all,
I looked at the PHP manual and found a lot of things to do with images 
but I did not seem to find out how to resize an image on upload.
Can anyone help??

Thanks in advance,
~WILL~
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Image resize on upload

I forgot to mention what I was trying to do.
There is a web page that pulls the image file name from the database 
then  reads the URL to the directory where the image is.  Is it possible 
to just resize it when the web page is brought up in the browser?

Like I said I am not sure which one to use.

~WILL~

Will wrote:

Hello all,
I looked at the PHP manual and found a lot of things to do with images 
but I did not seem to find out how to resize an image on upload.
Can anyone help??

Thanks in advance,
~WILL~
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Crypt code


I want to know if you know a tool to crypt the code, all, i mean a file
php, so when i open it i only see some characters without order, like
zend, but free or where can i get zend or a similar tool.

thanks.

Carlos A. Castillo.
Ingeniero de desarrollo
[EMAIL PROTECTED]


Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia 

- Soluciones web para Internet e Intranet
- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico


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