[PHP] The LFReD Project goes open source.

2002-03-30 Thread Terry Brownell

Hello all,

The LFReD Project has gone open source.  LFReD is the award winning language
processing intelligent agent.

First release is a PHP conceptual knowledge base.

https://sourceforge.net/projects/lfred/

http://www.LFReD.com

Terry Brownell



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




[PHP] <<

2002-03-30 Thread Sebastian A.

I am trying to use <

Re: [PHP] <<

2002-03-30 Thread Miguel Cruz

On Sat, 30 Mar 2002, Sebastian A. wrote:
> I am trying to use << problems. << << what could be causing this error? I can give you a sample of my code if it
> would help...

What you can't indent is the

anytext

line, because it has to be exactly identical to what's after the <<<, and 
spaces or tabs at the beginning make it not identical.

miguel


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




[PHP] changing the color from black to blue on an image. Help on imagecolorset.

2002-03-30 Thread Andy

Hi there,

I would like to change the color on a png file from black to blue. This png
file is
transparent and contains only a spot which is black. It is needed to stay
transparent
because I am gonna merge it later on with a jpeg.

I tryed imagecolorset but anyhow I do not understand the syntax.

Here is my try:

  # set home color
  $farbe_b = imagecolorallocate($country_image,0,0,0);  // create index for
the black color
  imagecolorset($country_image,$farbe_b,51,51,204); // darker blue

Can anybody help on this.


Thanx in advance,

Andy




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




Re: [PHP] changing the color from black to blue on an image. Helpon imagecolorset.

2002-03-30 Thread bvr


first:


$col = imagecolorallocate($im, 51, 51, 204);

then:

ImageFill ($im, $x, 
$y, $col);

or

ImageSetPixel($im, $x, $y, $col);

bvr.



Andy wrote:

>Hi there,
>
>I would like to change the color on a png file from black to blue. This png
>file is
>transparent and contains only a spot which is black. It is needed to stay
>transparent
>because I am gonna merge it later on with a jpeg.
>
>I tryed imagecolorset but anyhow I do not understand the syntax.
>
>Here is my try:
>
>  # set home color
>  $farbe_b = imagecolorallocate($country_image,0,0,0);  // create index for
>the black color
>  imagecolorset($country_image,$farbe_b,51,51,204); // darker blue
>
>Can anybody help on this.
>
>
>Thanx in advance,
>
>Andy
>
>
>
>



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




[PHP] .::. THIS IS WHAT YOU'VE ALL BEEN WAITING FOR .::.

2002-03-30 Thread Vins

1 Dollar = 10 South African Rands
for the best prices in the world
www.auction4sale.co.za

CHECK IT.

Stand a chance to win a new cell phone when you register and sell something.
Once you've added your auction, tell all your friend about it.
You are also added to the competition when you bid on an item.



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




[PHP] www.auction4sale.co.za

2002-03-30 Thread Vins

www.auction4sale.co.za



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




[PHP] Qmail Question

2002-03-30 Thread Vins

I have qmail on my server.
I've set up and email address to send all incoming mail to a php script.

How would I break down the message and read the to field and the from field
etc.

where can i find information on that ?



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




[PHP] class extends

2002-03-30 Thread caspar kennerdale

can you use class extends feature to refernce more than one class-

so a class called contnet could call functions fromone called html and one
called db?

thanks in advance


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




RE: [PHP] Qmail Question

2002-03-30 Thread caspar kennerdale

after your last two spams I'd be surprised if anyone would be will to answer
your questions

-Original Message-
From: Vins [mailto:[EMAIL PROTECTED]]
Sent: 30 March 2002 10:15
To: [EMAIL PROTECTED]
Subject: [PHP] Qmail Question


I have qmail on my server.
I've set up and email address to send all incoming mail to a php script.

How would I break down the message and read the to field and the from field
etc.

where can i find information on that ?



--
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 configs in the apache config file?

2002-03-30 Thread Robert Montgomery

Supposedly, in your apache httpd.conf file you can
specify php config values.  I'm trying to shore up
security on a new box by setting the following 
within  tags:

php_value open_basedir /path/to/virtualhost/

However, it doesnt work.  If I set the values in the
php.ini file, it DOES work...  What am I missing??
Are there any restrictions to setting these php values
in an httpd.conf file?  The doc's dont really mention
anything...  I'm baffled!

I'm running apache_1.3.23 + php-4.1.2 on a linux box.

Thanks,
Rob

__
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

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




Re: [PHP] php configs in the apache config file?

2002-03-30 Thread bvr

It doesn't work with CGI installations of PHP.

bvr.

Robert Montgomery wrote:

>Supposedly, in your apache httpd.conf file you can
>specify php config values.  I'm trying to shore up
>security on a new box by setting the following 
>within  tags:
>
>php_value open_basedir /path/to/virtualhost/
>
>However, it doesnt work.  If I set the values in the
>php.ini file, it DOES work...  What am I missing??
>Are there any restrictions to setting these php values
>in an httpd.conf file?  The doc's dont really mention
>anything...  I'm baffled!
>
>I'm running apache_1.3.23 + php-4.1.2 on a linux box.
>
>Thanks,
>Rob
>
>__
>Do You Yahoo!?
>Yahoo! Greetings - send holiday greetings for Easter, Passover
>http://greetings.yahoo.com/
>



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




Re: [PHP] Qmail Question

2002-03-30 Thread bvr



This is what you've been waiting for:

F@#$@CK OFF!

bvr.

Vins wrote:

>I have qmail on my server.
>I've set up and email address to send all incoming mail to a php script.
>
>How would I break down the message and read the to field and the from field
>etc.
>
>where can i find information on that ?
>
>
>



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




Re: [PHP] class extends

2002-03-30 Thread bvr

Read  http://www.php.net/manual/language.oop.php

bvr.


caspar kennerdale wrote:

>can you use class extends feature to refernce more than one class-
>
>so a class called contnet could call functions fromone called html and one
>called db?
>
>thanks in advance
>
>



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




Re: [PHP] Security hole using cookies for sessions. Workaround?

2002-03-30 Thread bvr


Three tips:

- Let the session expire after X secs.
- Use BODY's ONUNLOAD attribute/JS event handler
- Provide a 'Logout' button.

bvr.




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




[PHP] SPAM

2002-03-30 Thread Vins

Lets define that

Large quantities of email sent to large ammounts of email address at one
time.
I posted 2 messages.

You people take everything too seriously.
I'm sure you've also doen it once in you life before.

And a message for bvr and caspe kennerdale.
You are obviousely Americans



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




[PHP] Has anyone written such a function?

2002-03-30 Thread Boaz Yahav

Hi

I need a function that will get a date in the past and return how much
time has passed since that date till now.
The input to the function is a MySQL DATETIME format and the output
should be something like :

2 Years, 36 Days, 7 hours , 25 minutes 

I would write it but I'm pretty sure it has been done.

thanks

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


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




[PHP] Not to harp the subject Vins

2002-03-30 Thread anti-blank

But actually be it one email, two emails or 1000 emails what you did really is 
considered spam.

spam 
1.  (From Hormel's Spiced Ham, via the Monty Python "Spam" song) To post 
irrelevant or inappropriate messages to one or more Usenet newsgroups, mailing lists, 
or other messaging system in deliberate or accidental violation of netiquette. 
http://www.dictionary.com/search?q=spam


In all actualality what I am doing right now is considered Spam as well, and yet I 
will apologize for it.
But it's best not to start a flame war with people which is very well the route you 
are starting to take with this.
This is suppose to be a list for coding, for PHP to be specific, and no your post 
about your auction site to the
list is inappropriate material for the list.  So yes, it was Spam.  Your best bet 
really would have been to drop it,
let everyone chalk it up as a mistake on your part and move on, not:

> You people take everything too seriously.
> I'm sure you've also doen it once in you life before.
> 
> And a message for bvr and caspe kennerdale.
> You are obviousely Americans


1. I know very few people that have resorted to Spam, I run several pay sites and I 
won't do it, because it is bothersome
to people, and that isn't the way to attract clients/users.
2. What really is the relevance of your statement about how they must obviously be 
Americans?  This is the point I was
making about taking the wrong path and inciting a flame war.  It serves no purpose, 
undermines the list, and wastes 
people's email box space with useless mail.  

Again as I've admited this message itself can be considered Spam and it very well is.  
But I apologize for it, since it is not
in the topic of the list, but I for one prefer to see emails about code, not 'What 
I've always been waiting for'.

Thanks and my apologies for being off topic to the list.


Anti-Blank
Sr. Designer/Developer
Site Administrator
[EMAIL PROTECTED]




RE: [PHP] banner ads

2002-03-30 Thread Boaz Yahav

What about phpAdsNew?
http://www.phpadsnew.com

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-Original Message-
From: tom hilton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 11:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] banner ads


Hi, does anyone know of a simple banner ad rotation script that can
rotate
animated gifs.



-- 
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] Exec command problems

2002-03-30 Thread Georgie Casey

when i try to execute a program, PHP just stalls there for ages, my page
doesnt load or anything. the program is a dos pogram, i pass variables thru
d command line and when the program runs it just returns 1 line of output
and stops.

WHATS D PROBLEM?
btw, i first get PHP to write a text file and then get the program to open
this text file and yes, i closed the file before trying to exec the program

--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Online Film Production Directory
***



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




[PHP] SPAM or ADVERTISING

2002-03-30 Thread Alienator

once apon a time there was a South African online company called
EasyInfo.co.za.
have a look, www.easyinfo.co.za, the pulled a stunt and stoll all the
unlisted numbers from the local telephone company telkomsa www.telkom.co.za.
turns out, after the big court case they are now getting 3 times more hit
and generating a shit load more of money that ever were in the past !

so, what is advertising(SPAM)...
a big fat stunt that someone pulls off to generate website traffic.
for the 700 of so hits that i got alon from this news group i generated a
couple of thousand rands in just 2days.





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




RE: [PHP] Dynamic Web Navigation

2002-03-30 Thread Boaz Yahav

http://www.weberdev.com
Check out the Articles / Tutorials

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-Original Message-
From: Omland Christopher m [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 12, 2002 6:43 PM
To: Daniel Negron/KBE
Cc: [EMAIL PROTECTED]
Subject: [PHP] Dynamic Web Navigation


Does anyone have a good link to a tutorial, or a book suggestion that
will
help me learn more about making dynamic web pages with MySQL/PHP. Mainly
things like loading navigation menues, and pics and what not?
Thanks.
-Chris



-- 
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] Qmail Question

2002-03-30 Thread bvr


I'm west-european, and I don't want to fuck with you and I don't know 
what it's like..

THANKS AGAIN.

bvr.

Vins wrote:

>Listen here.
>I'm south african.
>You wouldn't want to fuck with.
>I'm sure you know what we all are like.
>
>Watch what you say
>
>
>- Original Message -
>From: "bvr" <[EMAIL PROTECTED]>
>To: "Vins" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>Sent: Saturday, March 30, 2002 2:24 PM
>Subject: Re: [PHP] Qmail Question
>


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




Re: [PHP] SPAM

2002-03-30 Thread bvr


Yeah, pretty obvious .. you must have figured that from the .NL
extension to my e-mail address..

Lemme guess, .ZA that's Japan nie waar nie ??

You are obviously not an expert so don't make us filthen this list with
(anti-)SPAM messages and stupid off-topic definitions.

THANKS!

bvr.


Vins wrote:

 >Lets define that
 >
 >Large quantities of email sent to large ammounts of email address at one
 >time.
 >I posted 2 messages.
 >
 >You people take everything too seriously.
 >I'm sure you've also doen it once in you life before.
 >
 >And a message for bvr and caspe kennerdale.
 >You are obviousely Americans
 >
 >
 >




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




Re: [PHP] SPAM

2002-03-30 Thread vins

oh dam
and American that can actually speak some Traditional Afrikaans that makes
absolutely no sense.
listen check the south african afrikaans gramma website before trying to
message me with shit like that



"Bvr" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Yeah, pretty obvious .. you must have figured that from the .NL
> extension to my e-mail address..
>
> Lemme guess, .ZA that's Japan nie waar nie ??
>
> You are obviously not an expert so don't make us filthen this list with
> (anti-)SPAM messages and stupid off-topic definitions.
>
> THANKS!
>
> bvr.
>
>
> Vins wrote:
>
>  >Lets define that
>  >
>  >Large quantities of email sent to large ammounts of email address at one
>  >time.
>  >I posted 2 messages.
>  >
>  >You people take everything too seriously.
>  >I'm sure you've also doen it once in you life before.
>  >
>  >And a message for bvr and caspe kennerdale.
>  >You are obviousely Americans
>  >
>  >
>  >
>
>
>



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




RE: [PHP] SPAM

2002-03-30 Thread caspar kennerdale



And a message for bvr and caspe kennerdale.
You are obviousely Americans

setting the record straight- this is a huge assumption- and I'm not
american, and you didnt even spell my name correctly!



--
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] SPAM

2002-03-30 Thread vins

well, lets just clasify that as a dis to your name

"Caspar Kennerdale" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> And a message for bvr and caspe kennerdale.
> You are obviousely Americans
>
> setting the record straight- this is a huge assumption- and I'm not
> american, and you didnt even spell my name correctly!
>
>
>
> --
> 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] Qmail Question

2002-03-30 Thread vins

well.
just a small translation...
i will climb through my monitor and out yours and beat the living shit out
of you


"Bvr" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I'm west-european, and I don't want to fuck with you and I don't know
> what it's like..
>
> THANKS AGAIN.
>
> bvr.
>
> Vins wrote:
>
> >Listen here.
> >I'm south african.
> >You wouldn't want to fuck with.
> >I'm sure you know what we all are like.
> >
> >Watch what you say
> >
> >
> >- Original Message -
> >From: "bvr" <[EMAIL PROTECTED]>
> >To: "Vins" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> >Sent: Saturday, March 30, 2002 2:24 PM
> >Subject: Re: [PHP] Qmail Question
> >
>



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




Re: [PHP] SPAM

2002-03-30 Thread bvr


WHEN DOES IT GET TO YOUR BRAIN that i'm not American..

grammatica hulp is niet nodig, ik spreek *echt* nederlands ;)

bvr.


 >oh dam
 >and American that can actually speak some Traditional Afrikaans that makes
 >absolutely no sense.
 >listen check the south african afrikaans gramma website before trying to
 >message me with shit like that


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




[PHP] RE: oh no

2002-03-30 Thread caspar kennerdale

and what of it
  -Original Message-
  From: Vincent Kruger [mailto:[EMAIL PROTECTED]]
  Sent: 30 March 2002 14:08
  To: caspar kennerdale
  Subject: oh no


  you a fucking pommy.

  god dam



Re: [PHP] banner ads

2002-03-30 Thread vins

phpadsnew is good.
well developed program
and it's making me tons of cash





"Boaz Yahav" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
What about phpAdsNew?
http://www.phpadsnew.com

Sincerely

  berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: tom hilton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 11:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] banner ads


Hi, does anyone know of a simple banner ad rotation script that can
rotate
animated gifs.



--
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] SPAM SPAM SPAM

2002-03-30 Thread vins

SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM

love it.

cheerz all



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




Re: [PHP] SPAM SPAM SPAM

2002-03-30 Thread Duncan Hill

On Sat, 30 Mar 2002, vins wrote:

> SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM

*plonk*



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




RE: [PHP] SPAM or ADVERTISING

2002-03-30 Thread Matt Friedman

So the end justifies the means is what you are saying. Using an example
of someone who got what they wanted through devious and dishonest
actions as a justification for your actions is a demonstration of your
warped ideas of what is ok and what is not.

Spammers do not get it. They're only out for their own selfish ends, as
you have clearly demonstrated, and they don't care about anyone else. 

You should be ashamed, but I'm certain that you are not.

Matt Friedman
Web Applications Developer


-Original Message-
From: Alienator [mailto:[EMAIL PROTECTED]] 
Sent: Saturday March 30, 2002 8:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] SPAM or ADVERTISING

once apon a time there was a South African online company called
EasyInfo.co.za.
have a look, www.easyinfo.co.za, the pulled a stunt and stoll all the
unlisted numbers from the local telephone company telkomsa
www.telkom.co.za.
turns out, after the big court case they are now getting 3 times more
hit
and generating a shit load more of money that ever were in the past !

so, what is advertising(SPAM)...
a big fat stunt that someone pulls off to generate website traffic.
for the 700 of so hits that i got alon from this news group i generated
a
couple of thousand rands in just 2days.





-- 
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] please /ignore childish spammer (Auction for sale)

2002-03-30 Thread bvr


I'm sorry,
I made a mistake even responding to this person and with that annoyed
lots of people on this list and wasted my time.
Now we're running the risk that he will turn into a spoiler which can be
pretty bad on an unmoderated list..
Therefore I'll stop replying to his messages (including 'spammish' PHP
questions), and I hope others will do the same thing, .

bvr.



Duncan Hill wrote:

 >On Sat, 30 Mar 2002, vins wrote:
 >
 >>SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM
 >>
 >
 >*plonk*
 >
 >
 >




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




[PHP] GOOD, now that we've all stopped our pettiness including me, back to qmail

2002-03-30 Thread vins

I need help with qmail
could anyone help me?



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




[PHP] Not a valid MySQL resource?

2002-03-30 Thread Brian Waskiewicz

Can anyone tell me what is causing the following error:

Warning: Supplied argument is not a valid MySQL result resource in
/ip/sums/www/test/admin/mailing_list.phtml on line 123

The page will work fine one time, then I'll come back later and get the
error.  I won't change anything, but the page will work later on anyway.  I
know there's nothing wrong with the database server, and the query should
return results.

Thanks.



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




php-general Digest 30 Mar 2002 16:50:10 -0000 Issue 1257

2002-03-30 Thread php-general-digest-help


php-general Digest 30 Mar 2002 16:50:10 - Issue 1257

Topics (messages 90744 through 90791):

Re: Processing Code created on the fly
90744 by: Jason Wong
90745 by: Jonathan Duncan
90749 by: Miguel Cruz
90750 by: Jason Wong

Re: gettext functionality needs configuration flag
90746 by: CC Zona

global vars in a function
90747 by: Justin French
90748 by: CC Zona

MySQL ID
90751 by: Mantas Kriauciunas
90754 by: Miguel Cruz

Some Problems that Newman has with PHP since reinstall.
90752 by: Philip J. Newman

problems trying to use PHP to choose CSS
90753 by: Timothy J. Luoma

The LFReD Project goes open source.
90755 by: Terry Brownell

<<
--- Begin Message ---

On Saturday 30 March 2002 11:16, Jonathan Duncan wrote:

>  These variables are populated and assigned in a function:
> (This is just an example.  In actuality these variables
> are populated using other means.)
> -
> $othervars = " $service = $sqlresult['service'];
>  $m_amount = $sqlresult['m_amount'];
>  $paidthru = $sqlresult['paidthru'];
>  $amountdue = $sqlresult['amountdue'];";
>
> $tabledata = " $account
>$service";
>
>
>
> This is file that calls the above function:
> (The lines with the *s are supposed to take
> the data from the variables and then process
> them as if they were part of the code.)
> 
> while ($sqlresult = mysql_fetch_array($result)) {
>  $id = $sqlresult['id'];
>  $account = $sqlresult['account'];
> *$thefunction->othervars;
>  $email = $sqlresult['email'];
>  $terms = $sqlresult['terms'];
>  $account_list .= "
> HREF=\"editaccount.php?id=$id&edit=yes\">image
> *  $thefunction->tabledata;
>\$$m_amount
>$paidthru
>\$$amountdue
>mailto:$email\"; $oelinkstyle>$email
>$terms";
> ?>

You need to check out the eval() function.



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
The real trouble with reality is that there's no background music.
*/

--- End Message ---
--- Begin Message ---

Yeah, I have played with the eval function a bit, but it didn't seem to help
much.  Then again, I haven't ever used the eval function before so I may not
know how to properly implement it.  I have read the page for eval on php.net
several times as well as the very helpful examples, but whenever I use eval,
it just prints out the same stuff.  By same stuff I mean wether I use eval
or just the variable by itself it just prints out the contents of the
variable.  In the web page source it looks as if the contents were merely
echoed because it still has the $'s and variable names.  Any other ideas or
examples on how to implement eval on this?

Thanks for the help,
Jonathan Duncan


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Saturday 30 March 2002 11:16, Jonathan Duncan wrote:
>
> >  > These variables are populated and assigned in a function:
> > (This is just an example.  In actuality these variables
> > are populated using other means.)
> > -
> > $othervars = " $service = $sqlresult['service'];
> >  $m_amount = $sqlresult['m_amount'];
> >  $paidthru = $sqlresult['paidthru'];
> >  $amountdue = $sqlresult['amountdue'];";
> >
> > $tabledata = " $account
> >$service";
> >
> >
> >
> > This is file that calls the above function:
> > (The lines with the *s are supposed to take
> > the data from the variables and then process
> > them as if they were part of the code.)
> > 
> > while ($sqlresult = mysql_fetch_array($result)) {
> >  $id = $sqlresult['id'];
> >  $account = $sqlresult['account'];
> > *$thefunction->othervars;
> >  $email = $sqlresult['email'];
> >  $terms = $sqlresult['terms'];
> >  $account_list .= "
> > > HREF=\"editaccount.php?id=$id&edit=yes\">image
> > *  $thefunction->tabledata;
> >\$$m_amount
> >$paidthru
> >\$$amountdue
> >mailto:$email\"; $oelinkstyle>$email
> >$terms";
> > ?>
>
> You need to check out the eval() function.
>
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> The real trouble with reality is that there's no background music.
> */



--- End Message ---
--- Begin Message ---

On Fri, 29 Mar 2002, Jonathan Duncan wrote:
> Yeah, I have played with the eval function a bit, but it didn't seem to
> help much.  Then again, I haven't ever used the eval function before so
> I may not know how to properly implement it.  I have read the page for
> eval on php.net several times as well as the very helpful examples, but
> whenever I use eval, it just prints out the same stuff.  By same stuff I
> mean wether I use eval or just the variable by itself it just prints out
> the conten

Re: [PHP] Not a valid MySQL resource?

2002-03-30 Thread Rasmus Lerdorf

Always always always check your queries for errors before trying to use
the result set.

ie.

  $result = mysql_query($sql) or die(mysql_error());

(assuming you want a query failure to be a fatal error)

-Rasmus

On Sat, 30 Mar 2002, Brian Waskiewicz wrote:

> Can anyone tell me what is causing the following error:
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /ip/sums/www/test/admin/mailing_list.phtml on line 123
>
> The page will work fine one time, then I'll come back later and get the
> error.  I won't change anything, but the page will work later on anyway.  I
> know there's nothing wrong with the database server, and the query should
> return results.
>
> Thanks.
>
>
>
> --
> 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 4.2.ORC1 - SID gets deleted

2002-03-30 Thread Carsten Saathoff

Hi,

I'm not sure where to post this, neither if I should report this as a
bug, because I'm not sure if it is one at all.

I installed php 4.2 ORC1 lately and encountered a strange session
problem. The following script reproduces this problem:

Link";

echo ''. SID."";

echo session_id();

?>

As you can see, the script starts a session and then generates a link to
itself. When I call this script the first time, the session gets created
as expected. Also the link is generated correctly, if I block the
session cookie. But when I click on that link, SID is empty on the
following page (that's the same script again, of course), although the
session still exists. So the output gives me an empty SID, but a correct
session id. The same script does work with 4.1.2.

Does any explanantion for this behaviour exist? Or is it a bug?
trans-sid is disabled and not even compiled in. But that shouldn't be a
problem I think, because SID is the alternative to trans-sid.

Can anybody confirm this behaviour? Or should I submit a bug report?

Greetings

Carsten

-- 
Carsten Saathoff  ...powered by Linux  ICQ #52558095
  
The gods are great, I am the greatest! 
 (Borknagar)

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




Re: [PHP] Not a valid MySQL resource?

2002-03-30 Thread Brian Waskiewicz

My page works fine from other computers - it just doesn't work from mine.  I
think it could be that the page is caching and IE6 isn't getting a new copy.
How can I prevent it frlom caching? I've tried clearing my history, but I
still get the error.

Thanks.

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Always always always check your queries for errors before trying to use
> the result set.
>
> ie.
>
>   $result = mysql_query($sql) or die(mysql_error());
>
> (assuming you want a query failure to be a fatal error)
>
> -Rasmus
>
> On Sat, 30 Mar 2002, Brian Waskiewicz wrote:
>
> > Can anyone tell me what is causing the following error:
> >
> > Warning: Supplied argument is not a valid MySQL result resource in
> > /ip/sums/www/test/admin/mailing_list.phtml on line 123
> >
> > The page will work fine one time, then I'll come back later and get the
> > error.  I won't change anything, but the page will work later on anyway.
I
> > know there's nothing wrong with the database server, and the query
should
> > return results.
> >
> > Thanks.
> >
> >
> >
> > --
> > 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] Some Problems that Newman has with PHP since reinstall.

2002-03-30 Thread Jason Wong

On Saturday 30 March 2002 14:26, Philip J. Newman wrote:
> Hi People,
> I just installed PHP again, and am having some problems with a few things.
> When Posting to a form, veriables do not travel across the pages.  I have
> checked the PHP.INI for something but nothing seems to change this.

Is it vanity that prompts you include your name in every post you send?

If you're using PHP > 4.0.6 then the default behaviour regarding GET, POST & 
COOKIES vars has changed. Either refer to them through $_POST[] or (not 
recommended) set 

register_globals = on 

in php.ini

> ... ALSO ...
>
> My redirect scripts have stoped responding.
> Any Ideas??

No.

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




Re: [PHP] Not a valid MySQL resource?

2002-03-30 Thread Jason Wong

On Sunday 31 March 2002 02:02, Brian Waskiewicz wrote:
> My page works fine from other computers - it just doesn't work from mine. 
> I think it could be that the page is caching and IE6 isn't getting a new
> copy. How can I prevent it frlom caching? I've tried clearing my history,
> but I still get the error.
>
> Thanks.
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Always always always check your queries for errors before trying to use
> > the result set.
> >
> > ie.
> >
> >   $result = mysql_query($sql) or die(mysql_error());
> >
> > (assuming you want a query failure to be a fatal error)

Hmmm, Rasmus has given you some very good advice. Please follow it. No point 
speculating on how to correct the problem if you don't know what the problem 
is. 



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
The trouble with computers is that they do what you tell them, not what
you want.
-- D. Cohen
*/

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




[PHP] Re: Has anyone written such a function?

2002-03-30 Thread Hugh Bothwell

(shrug) convert to unixtime, subtract, and reformat

In fact, you could do the conversion and subtraction in your SQL query,
returning just 'elapsed seconds since date', and reformat from there.

> I need a function that will get a date in the past and return how much
> time has passed since that date till now.
> The input to the function is a MySQL DATETIME format and the output
> should be something like :
>
> 2 Years, 36 Days, 7 hours , 25 minutes
>
> I would write it but I'm pretty sure it has been done.




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




[PHP] Re: changing the color from black to blue on an image. Help on imagecolorset.

2002-03-30 Thread Hugh Bothwell


"Andy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> I would like to change the color on a png file from black
> to blue. This png file is transparent and contains only a
> spot which is black. It is needed to stay transparent
> because I am gonna merge it later on with a jpeg.

... why are you trying to do this in PHP?  Why not use
Photoshop to edit the original .png graphic?



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




[PHP] Re: problems trying to use PHP to choose CSS

2002-03-30 Thread Hugh Bothwell

> I am trying this method: Register a global variable ($CSS) using a FORM.
> [snip]
> I wonder if I am not doing something stupid/overlooking something obvious,
> but I am very new @ PHP so that is possible.
>
> // in my global PHP file
>
> // Now what I am trying to do here is set a default that should ONLY be
> // used if the $CSS variable is NOT already set
>
> if (!isset($CSS))
> {
> // if it is not set, then and only then set it and define it
> session_start();
> session_register("CSS");
> $CSS="global";
> }


1.  session_start() should called every time,
ie not inside a conditional clause.

2.  I'm not sure that giving the form-return value
and the session value the same name is a good idea.

3.  I think a lot of the double-quotes in your echoed
text were screwing things up.


Try something like:









Choose style:


Default
Smaller
Tamer Colors
Print




Current style is: 





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




[PHP] Re: Nead Help With A Php Script

2002-03-30 Thread Hugh Bothwell

> I need a php script that checks if the there is a
> cookie set with the users username and if not it
> brings you to an other page and telling you that
> you are not loged in!


(a)  Don't cross-post all over.


(b)  Cookies 'automagically' become global variables, so
a simple version is

if(!isset($username)) {
header("Location: http://www.mysite.com/login.php";);
exit;
}


(c)  Obviously, this won't prevent someone from
faking a username via the querystring, so you have to
specify that it's a cookie:

if(!isset($_COOKIE["username"])) {
header("Location: http://www.mysite.com/login.php";);
exit;
}


(d)  Doesn't work?  What do you mean, doesn't work?
OK, if you are using pre-4.1.0, it won't work
(you would have to look in $HTTP_COOKIE_VARS[]
instead)  BUT note that there are known security
flaws so you should be running 4.1.2 anyway.


(e)  It's kind of irrelevant anyway - because unless you
are really always positively certain your users are
cookiefied, you should be using sessions, in which case
what you really want is

session_start();

if(!session_is_registered("username")) "])) {
header("Location: http://www.mysite.com/login.php";);
exit;
}




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




Re: [PHP] php configs in the apache config file?

2002-03-30 Thread Robert Montgomery

OK, I've figured it out.  Apparantly when setting php
vars in an apache config file, you HAVE to use the
form
"php_admin_value" as opposed to just "php_value". 
Some of the php documentation is vague or even
misleading, such as this example from the online docs,
which does not use the form php_admin_value but is
obviously used in the apache config file:


   php_value include_path ".:/usr/local/lib/php"
   php_flag safe_mode on


Also, the docs say:

php_value name value

 This sets the value of the specified variable.

php_admin_value name value

 This sets the value of the specified variable.
"Admin" configuration settings can only be set from
within the main Apache configuration files, and not
from .htaccess files.

So it makes it sound as if you CAN use the php_value
form in the apache config, but that it is
over-rideable
via htaccess files... However it doesnt work, at least
with the 4.1.2...  Maybe the functionality has been
changed recently, for security reasons.  I figure if
you go to the trouble to set a value in apache for
a particular virtualhost, you dont want to allow it to
be overridden via htaccess, which isnt possible when
they force you to use the php_admin_value form. I
actually prefer it that way, the docs just need
updating!

Thanks for the responses.

Rob


--- bvr <[EMAIL PROTECTED]> wrote:
> It doesn't work with CGI installations of PHP.
> 
> bvr.
> 
> Robert Montgomery wrote:
> 
> >Supposedly, in your apache httpd.conf file you can
> >specify php config values.  I'm trying to shore up
> >security on a new box by setting the following 
> >within  tags:
> >
> >php_value open_basedir /path/to/virtualhost/
> >
> >However, it doesnt work.  If I set the values in
> the
> >php.ini file, it DOES work...  What am I missing??
> >Are there any restrictions to setting these php
> values
> >in an httpd.conf file?  The doc's dont really
> mention
> >anything...  I'm baffled!
> >
> >I'm running apache_1.3.23 + php-4.1.2 on a linux
> box.
> >
> >Thanks,
> >Rob
> >
> >__
> >Do You Yahoo!?
> >Yahoo! Greetings - send holiday greetings for
> Easter, Passover
> >http://greetings.yahoo.com/
> >
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

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




[PHP] Re: Nead Help With A Php Script

2002-03-30 Thread Hugh Bothwell

Aaargh!   typo...

> if(!session_is_registered("username")) "])) {

should be

if(!session_is_registered("username")) {



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




Re: [PHP] Some Problems that Newman has with PHP since reinstall.

2002-03-30 Thread Philip J. Newman

Still didn't work, found the problem thoe. it was a file I never put into my
system32 folder (o;  Thanks for your help.s

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 31, 2002 6:10 AM
Subject: Re: [PHP] Some Problems that Newman has with PHP since reinstall.


> On Saturday 30 March 2002 14:26, Philip J. Newman wrote:
> > Hi People,
> > I just installed PHP again, and am having some problems with a few
things.
> > When Posting to a form, veriables do not travel across the pages.  I
have
> > checked the PHP.INI for something but nothing seems to change this.
>
> Is it vanity that prompts you include your name in every post you send?
>
> If you're using PHP > 4.0.6 then the default behaviour regarding GET, POST
&
> COOKIES vars has changed. Either refer to them through $_POST[] or (not
> recommended) set
>
> register_globals = on
>
> in php.ini
>
> > ... ALSO ...
> >
> > My redirect scripts have stoped responding.
> > Any Ideas??
>
> No.
>
> --
> 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] Any easy way to go from MySQL Dates to PHP dates?

2002-03-30 Thread David Johansen

I was just wondering if there's any way to work with dates returned from a
MySQL query in PHP. Right now I do all of different stuff in my MySQL query
but it's really cumbersome, so I would like to be able to do it all with
PHP. Is there any way to do that? Thanks,
Dave

Here's my MySQL query:

$result = mysql_query("SELECT *, WEEKDAY(time0_name) AS day,
DATE_FORMAT(time0_name,'%m/%d/%y') AS print_date, DATE_FORMAT(time0_name,
'%l:%i %p') AS begin_time0, DATE_FORMAT(DATE_ADD(time0_name, INTERVAL 2
HOUR), '%l:%i %p') AS end_time0, DATE_FORMAT(time1_name, '%l:%i %p') AS
begin_time1, DATE_FORMAT(DATE_ADD(time1_name, INTERVAL 2 HOUR), '%l:%i %p')
AS end_time1, DATE_FORMAT(time2_name, '%l:%i %p') AS begin_time2,
DATE_FORMAT(DATE_ADD(time2_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time2,
DATE_FORMAT(time3_name, '%l:%i %p') AS begin_time3,
DATE_FORMAT(DATE_ADD(time3_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time3,
DATE_FORMAT(time4_name, '%l:%i %p') AS begin_time4,
DATE_FORMAT(DATE_ADD(time4_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time4,
DATE_FORMAT(time5_name, '%l:%i %p') AS begin_time5,
DATE_FORMAT(DATE_ADD(time5_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time5
FROM pickup_times",$dbh);

I could do it a lot easier if in PHP I think, so I was just wondering if
anyone could point me to a thing that talked about converting MySQL DATETIME
to PHP date stuff.



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




Re: [PHP] Image manipulation with PHP on RHLinux 7.1

2002-03-30 Thread Dale & Lora Marshall


Ok, I've been looking at the image functions, and found that I needed
to recompile PHP with exif support and load GD and other functions.
I've done all of that and now I get the following:

Source: /home/jamboimages/images/uploads/alamoarea_97_round_sm.jpg
600 : /images/patches/1997/1997R15.jpg
300 : /images/patches/1997/1997R15_sm.jpg
Width = 600
Height = 580
Fatal error: Call to undefined function: exif_imagetype() in
/home/jamboimages/admin/review_patches.php on line 69

The partial code in my webpage is (code borrowed from the PHP site, and 
modified).
Any help is appreciated.  If you want to see the phpinfo, go to:

http://dreamer.propagation.net/phpinfo.php


Here's the code...

/* resize_to_file resizes a picture and writes it to the harddisk
  *
  * $sourcefile = the filename of the picture that is going to be resized
  * $six_file   = File name of the 600-pixel-wide file
  * $three_file = File name of the 300-pixel wide file
  */

function resize_to_file ($sourcefile, $six_file, $three_file) {

print "Source: $sourcefile";
print "600 : $six_file";
print "300 : $three_file";

$picsize = getimagesize("$sourcefile");

$width  = $picsize[0];
$height = $picsize[1];
print "Width = $width";
print "Height = $height";

$image_type = exif_imagetype("$sourcefile");
print "Image: $image_type";

... more code here to resize the image file ...
... and write it to a new location on disk  ...

}




-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Dale & Lora MarshallInternet Marketing Services
http://lonestar.texas.net/~marshal1 http://www.internet-ms.com
[EMAIL PROTECTED][EMAIL PROTECTED]
 [EMAIL PROTECTED]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


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




Re: [PHP] Any easy way to go from MySQL Dates to PHP dates?

2002-03-30 Thread Jason Wong

On Sunday 31 March 2002 04:04, David Johansen wrote:
> I was just wondering if there's any way to work with dates returned from a
> MySQL query in PHP. Right now I do all of different stuff in my MySQL query
> but it's really cumbersome, so I would like to be able to do it all with
> PHP. Is there any way to do that? Thanks,
> Dave

>
> Here's my MySQL query:

In MySQL return the date through a UNIX_TIMESTAMP() then in PHP you can 
manipulate any which way you want.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Those aren't WINOS -- that's my JUGGLER, my AERIALIST, my SWORD
SWALLOWER, and my LATEX NOVELTY SUPPLIER!!
*/

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




[PHP] Tracking impressions

2002-03-30 Thread David Duong

Hello, I need a script that can track impressions through PHP.

I know you load a php script from  tags than some how the image is
loaded or redirected.

Is their a way I can record impressions and environment variables like IP,
Browser, referrer, etc.



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




[PHP] time question

2002-03-30 Thread anders nawroth

How do I get the current time() for Central European Time
(= GMT +01:00).
I want it to work wherever the server stands.
How can I get the difference between server time
and GMT, for instance?

A. Nawroth



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




RE: [PHP] time question

2002-03-30 Thread J. Scott Johnson

Why wouldn't you use gmdate: 

http://www.php.net/manual/en/function.gmdate.php

and then increment it yourself by an offset?

Scott

-Original Message-
From: anders nawroth [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 30, 2002 5:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] time question


How do I get the current time() for Central European Time
(= GMT +01:00).
I want it to work wherever the server stands.
How can I get the difference between server time
and GMT, for instance?

A. Nawroth



-- 
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.ini

2002-03-30 Thread Chris Kay


Question I have is,

Is it possible to specify a php.ini in each virtual host?
That way allowing each website to run a different configuration.

Cause I have a website that I want to use
Session_set_save_handler = user but I want another website to use the
default php
Files handle. 

Also for things like session auto start ect

Just a thought that it would make it easier.

Thanks in advance.

---
Chris Kay, Eleet Internet Services
[EMAIL PROTECTED]
---


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




Re: [PHP] Re: Nead Help With A Php Script

2002-03-30 Thread Rasmus Lerdorf

> (c)  Obviously, this won't prevent someone from
> faking a username via the querystring, so you have to
> specify that it's a cookie:
>
> if(!isset($_COOKIE["username"])) {
> header("Location: http://www.mysite.com/login.php";);
> exit;
> }

Note that nothing prevents users from faking a username via their own
cookie either.

-Rasmus


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




Re: [PHP] php configs in the apache config file?

2002-03-30 Thread Rasmus Lerdorf

> OK, I've figured it out.  Apparantly when setting php
> vars in an apache config file, you HAVE to use the
> form
> "php_admin_value" as opposed to just "php_value".
> Some of the php documentation is vague or even
> misleading, such as this example from the online docs,
> which does not use the form php_admin_value but is
> obviously used in the apache config file:
>
> 
>php_value include_path ".:/usr/local/lib/php"
>php_flag safe_mode on
> 
>
> Also, the docs say:
>
> php_value name value
>
>  This sets the value of the specified variable.
>
> php_admin_value name value
>
>  This sets the value of the specified variable.
> "Admin" configuration settings can only be set from
> within the main Apache configuration files, and not
> from .htaccess files.
>
> So it makes it sound as if you CAN use the php_value
> form in the apache config, but that it is
> over-rideable
> via htaccess files... However it doesnt work, at least
> with the 4.1.2...

Sure it works.  It depends on the directive.  Obviously safe_mode is not
something that can be overridden by users in a .htaccess file, so
safe_mode is set via php_admin_flag whereas something like include_path is
not an admin value and is set via php_value.


> Maybe the functionality has been changed recently, for security reasons.
> I figure if you go to the trouble to set a value in apache for a
> particular virtualhost, you dont want to allow it to be overridden via
> htaccess, which isnt possible when they force you to use the
> php_admin_value form. I actually prefer it that way, the docs just need
> updating!

No, the docs are actually correct.  None admin flags can be overridden in
.htaccess files assuming you enable it via the appropriate AlloveOverride
Options.  If you don't set "Options" on AllowOverride then none of this
stuff can be overridden in the .htaccess files.

-Rasmus


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




[PHP] register_globals

2002-03-30 Thread Liam

31/03/2002 9:05:53 AM

Hi all,
I'm running a webhosting service and I'm looking at security issues.

at the moment I have register_globals set to "on"
Is there any reason I should turn it off?

What are the security risks of having them on?

Cheers,
Liam



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




Re: [PHP] Image manipulation with PHP on RHLinux 7.1

2002-03-30 Thread Rasmus Lerdorf

exif_imagetype() is new function only available in PHP 4.2 (not released
yet) and above.  Use GetImageSize() for now.

-Rasmus

On Sat, 30 Mar 2002, Dale & Lora Marshall wrote:

>
> Ok, I've been looking at the image functions, and found that I needed
> to recompile PHP with exif support and load GD and other functions.
> I've done all of that and now I get the following:
>
> Source: /home/jamboimages/images/uploads/alamoarea_97_round_sm.jpg
> 600 : /images/patches/1997/1997R15.jpg
> 300 : /images/patches/1997/1997R15_sm.jpg
> Width = 600
> Height = 580
> Fatal error: Call to undefined function: exif_imagetype() in
> /home/jamboimages/admin/review_patches.php on line 69
>
> The partial code in my webpage is (code borrowed from the PHP site, and
> modified).
> Any help is appreciated.  If you want to see the phpinfo, go to:
>
> http://dreamer.propagation.net/phpinfo.php
>
>
> Here's the code...
>
> /* resize_to_file resizes a picture and writes it to the harddisk
>   *
>   * $sourcefile = the filename of the picture that is going to be resized
>   * $six_file   = File name of the 600-pixel-wide file
>   * $three_file = File name of the 300-pixel wide file
>   */
>
> function resize_to_file ($sourcefile, $six_file, $three_file) {
>
> print "Source: $sourcefile";
> print "600 : $six_file";
> print "300 : $three_file";
>
> $picsize = getimagesize("$sourcefile");
>
> $width  = $picsize[0];
> $height = $picsize[1];
> print "Width = $width";
> print "Height = $height";
>
> $image_type = exif_imagetype("$sourcefile");
> print "Image: $image_type";
>
> ... more code here to resize the image file ...
> ... and write it to a new location on disk  ...
>
> }
>
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Dale & Lora MarshallInternet Marketing Services
> http://lonestar.texas.net/~marshal1 http://www.internet-ms.com
> [EMAIL PROTECTED][EMAIL PROTECTED]
>  [EMAIL PROTECTED]
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
> --
> 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: Why?

2002-03-30 Thread Michael Kimsal

Alberto Wagner wrote:
> Why everyone uses $foo or $foobar as examples?
> 
> 
> 

Why not?  They are relatively benign words that are simply to
type and aren't terribly language centric.

$moo and $moocow would work just as well, or $asdf or $qwerty
or others.

As far as I know, they have no specific connotation,
but they've been used as placement holder names since
at least the early 80's when I started programming.



Michael Kimsal
http://www.phphelpdesk.com
PHP support when you need it
734-480-9961


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




[PHP] ZaireWeb

2002-03-30 Thread Liam

31/03/2002 9:26:46 AM

You tool!
Stop spying on my emails!



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




[PHP] Re: Php.ini

2002-03-30 Thread Jason Sheets

Look at chapter 3 of the PHP manual, it covers specifying PHP configuration
in your http.conf or .htaccess files, you can do this per virtual host, per
directory or however else you want to do it.

Jason

"Chris Kay" <[EMAIL PROTECTED]> wrote in message
01c1d83c$9c334e50$8b6712cb@iceberg">news:01c1d83c$9c334e50$8b6712cb@iceberg...
>
> Question I have is,
>
> Is it possible to specify a php.ini in each virtual host?
> That way allowing each website to run a different configuration.
>
> Cause I have a website that I want to use
> Session_set_save_handler = user but I want another website to use the
> default php
> Files handle.
>
> Also for things like session auto start ect
>
> Just a thought that it would make it easier.
>
> Thanks in advance.
>
> ---
> Chris Kay, Eleet Internet Services
> [EMAIL PROTECTED]
> ---
>



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




[PHP] For Loop going too long

2002-03-30 Thread David Johansen

I have a question about something weird that I've noticed Here's some code
that I have that loads up

   $sql = "SELECT * FROM pickup_times WHERE DAYOFMONTH(time0_name) =
$dayofmonth";

   $result = mysql_query($sql, $dbh);
   $day = mysql_fetch_array($result);
   for ($i=0; $i";

When I do this it prints out 2 times the number of columns that I actually
have plus 1. All of the ones past the actual number of columns are just
empty, but is there something that I'm doing wrong? Thanks,
Dave



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




[PHP] $HTTP_USER_AGENT

2002-03-30 Thread Sean Kennedy

Hello,

Im making a small php script, but I need to know how to do something.

My problem is: I have a script thats like this:



Do you know what I mean? Thanks,

-Sean
Kennedy


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




Re: [PHP] $HTTP_USER_AGENT

2002-03-30 Thread eric.coleman

Why not echo $HTTP_USER_AGENT and find out?

- Original Message - 
From: "Sean Kennedy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 30, 2002 11:43 AM
Subject: [PHP] $HTTP_USER_AGENT


> Hello,
> 
> Im making a small php script, but I need to know how to do something.
> 
> My problem is: I have a script thats like this:
> 
>  if ($HTTP_USER_AGENT == "WHAT GOES HERE FOR IE AND NS?") {
>echo "You have Internet Explorer";
> } else {
>echo "You have Netscape";
> }
> ?>
> 
> Do you know what I mean? Thanks,
> 
> -Sean
> Kennedy
> 
> 
> -- 
> 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: RE: $HTTP_USER_AGENT

2002-03-30 Thread Sean Kennedy

It prints out Mozilla/4.74 [en]C-CCK-MCD NS4xx/Winxx/EZN (Win95; U). Which part 
of that do i use?

Thanks,
-Sean
Kennedy


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




[PHP] BUG in recursion

2002-03-30 Thread Uros Gruber

Hi!

This is a code

function Test()
{
static $count = 0;

$count++;
echo $count;
if ($count < 10) {
Test ();
}
echo "j";
}
test();

Output is

12345678910jj

Why is there 10 j at the and. If this would work it can be
only one. If $count is grater than 10 it does not call itself
but end. Is this maybe a bug or what.
  

-- 
lp,
 Uros  mailto:[EMAIL PROTECTED]


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




[PHP] Re: BUG in recursion

2002-03-30 Thread David Johansen

No it's right. Because $count will equal 10 and it'll print it out, the test
will fail and then it'll trace the recursion back and print the j's. It
would be a bug if it printed an 11, but it's right the way it is.
Dave

"Uros Gruber" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
> This is a code
>
> function Test()
> {
> static $count = 0;
>
> $count++;
> echo $count;
> if ($count < 10) {
> Test ();
> }
> echo "j";
> }
> test();
>
> Output is
>
> 12345678910jj
>
> Why is there 10 j at the and. If this would work it can be
> only one. If $count is grater than 10 it does not call itself
> but end. Is this maybe a bug or what.
>
>
> --
> lp,
>  Uros  mailto:[EMAIL PROTECTED]
>



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




Re: [PHP] RE: RE: $HTTP_USER_AGENT

2002-03-30 Thread eric.coleman

try

if( eregi("NS", $HTTP_USER_AGENT) )
{
 echo('You are using Netscape!');
}
elseif( eregi('IE', $HTTP_USER_AGENT) )
{
 echo('Your using IE');
}
else
{
 echo('No Clue what the hell your using');
}
- Original Message -
From: "Sean Kennedy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 30, 2002 11:52 AM
Subject: [PHP] RE: RE: $HTTP_USER_AGENT


> It prints out Mozilla/4.74 [en]C-CCK-MCD NS4xx/Winxx/EZN (Win95; U). Which
part
> of that do i use?
>
> Thanks,
> -Sean
> Kennedy
>
>
> --
> 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] BUG in recursion

2002-03-30 Thread Lars Torben Wilson

On Sat, 2002-03-30 at 15:59, Uros Gruber wrote:
> Hi!
> 
> This is a code
> 
> function Test()
> {
> static $count = 0;
> 
> $count++;
> echo $count;
> if ($count < 10) {
> Test ();
> }
> echo "j";
> }
> test();
> 
> Output is
> 
> 12345678910jj
> 
> Why is there 10 j at the and. If this would work it can be
> only one. If $count is grater than 10 it does not call itself
> but end. Is this maybe a bug or what.

No, there should be 10 of them, since every time Test() returns,
the function carries on executing. If you only want one 'j'
printed then put a return statement after the call to Test():

function Test()
{
static $count = 0;

$count++;
echo $count;
if ($count < 10) {
Test();
return;
}
echo "j";
}
Test();


Cheers!

Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re[2]: [PHP] BUG in recursion

2002-03-30 Thread Uros Gruber

Hi!

This I simply don't understand why this code executes that
way. So there is only inportant to put return after recursive
call and it works like i wan't. I sometimes write small C
programs and I don't remeber that code like this have to work
that way Hm.



-- 
bye,
 Urosmailto:[EMAIL PROTECTED]


Sunday, March 31, 2002, 1:10:30 AM, you wrote:

LTW> On Sat, 2002-03-30 at 15:59, Uros Gruber wrote:
>> Hi!
>> 
>> This is a code
>> 
>> function Test()
>> {
>> static $count = 0;
>> 
>> $count++;
>> echo $count;
>> if ($count < 10) {
>> Test ();
>> }
>> echo "j";
>> }
>> test();
>> 
>> Output is
>> 
>> 12345678910jj
>> 
>> Why is there 10 j at the and. If this would work it can be
>> only one. If $count is grater than 10 it does not call itself
>> but end. Is this maybe a bug or what.

LTW> No, there should be 10 of them, since every time Test() returns,
LTW> the function carries on executing. If you only want one 'j'
LTW> printed then put a return statement after the call to Test():

LTW> function Test()
LTW> {
LTW> static $count = 0;

LTW> $count++;
LTW> echo $count;
LTW> if ($count < 10) {
LTW> Test();
LTW> return;
LTW> }
LTW> echo "j";
LTW> }
LTW> Test();


LTW> Cheers!

LTW> Torben


LTW> -- 
LTW>  Torben Wilson <[EMAIL PROTECTED]>
LTW>  http://www.thebuttlesschaps.com
LTW>  http://www.hybrid17.com
LTW>  http://www.inflatableeye.com
LTW>  +1.604.709.0506


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




[PHP] Pulling data into an array and sorting

2002-03-30 Thread rdkurth


I need to pull data into and array from a mysql database and then sort
that data according to one of the fields and then print it to the
screen.

Hear is an example of the data in the database

username Pnumber sec2 sec3 sec4 sec5 sec6
 Gary  123.345.122YES  YES   NO  YES  YES
 Fred  123.345.123YES  YES   NO  YES  YES
 Jone  123.345.124YES  YES   YES  NO  YES
 Tom   123.345.124YES  YES   NO  YES  YES
 Frank 123.345.123YES  YES   NO  YES  YES

 If you will notice the Pnumber for some are the same and some are
 different. I what to be able to sort on this number and then when they
 are printed they would be printed according to this number in groups

  

-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


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




[PHP] Disabling the Back Button?

2002-03-30 Thread David Johansen

OK, I basically just want to make it so that the user can't go back once
they're done with an application form that I'm working on. I don't case if
they go back in the middle and my page handles that just fine, but I want
them to not be able to go back when they're all done. Is there some way that
I can do this? Thanks,
Dave



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




RE: [PHP] Pulling data into an array and sorting

2002-03-30 Thread Demitrious S. Kelly

Run a while loop on your data and pull it into an array

Heres an example (though this pulls from a text file the idea is the
same...) Hope this helps...



";
}
?>


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 30, 2002 4:22 PM
To: php
Subject: [PHP] Pulling data into an array and sorting


I need to pull data into and array from a mysql database and then sort
that data according to one of the fields and then print it to the
screen.

Hear is an example of the data in the database

username Pnumber sec2 sec3 sec4 sec5 sec6
 Gary  123.345.122YES  YES   NO  YES  YES
 Fred  123.345.123YES  YES   NO  YES  YES
 Jone  123.345.124YES  YES   YES  NO  YES
 Tom   123.345.124YES  YES   NO  YES  YES
 Frank 123.345.123YES  YES   NO  YES  YES

 If you will notice the Pnumber for some are the same and some are
 different. I what to be able to sort on this number and then when they
 are printed they would be printed according to this number in groups

  

-- 
Best regards,
 rdkurth  mailto:[EMAIL PROTECTED]


-- 
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] Disabling the Back Button?

2002-03-30 Thread Demitrious S. Kelly

You could use sessions for the script... store a variable in the session
when the page has been completed and make sure the script does not
execute if the current session has the appropriate variable...

-Original Message-
From: David Johansen [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 30, 2002 4:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Disabling the Back Button?

OK, I basically just want to make it so that the user can't go back once
they're done with an application form that I'm working on. I don't case
if
they go back in the middle and my page handles that just fine, but I
want
them to not be able to go back when they're all done. Is there some way
that
I can do this? Thanks,
Dave



-- 
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] Another ?

2002-03-30 Thread Sean Kennedy

Hello,

Whats the HTTP_USER_AGENT for opera?
Thanks,

-Sean
Kennedy


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




Re: Re[2]: [PHP] BUG in recursion

2002-03-30 Thread Lars Torben Wilson

On Sat, 2002-03-30 at 16:16, Uros Gruber wrote:
> Hi!
> 
> This I simply don't understand why this code executes that
> way. So there is only inportant to put return after recursive
> call and it works like i wan't. I sometimes write small C
> programs and I don't remeber that code like this have to work
> that way Hm.

Well, that's how it's supposed to work. Look at it like this:

1: function test() {
2:static $count = 0;
3:$count++;
4:echo $count;
5:if ($count < 10) {
6:test();
7:}
8:echo 'j';
9: }


So the first thing that happens is you call test(). It executes
its lines in order, including function calls. When it hits the
call to test() on line 6, it calls test(), waits for it to 
return, and then continues on to line 8, echoing 'j'. 

This happens every time through, so when you get up to $i == 10, you
have 10 test()s stacked up, each of them waiting on line 6 for the
function call to test() to return. As each test() call returns,
execution continues on to line 8, echos j, then returns.

I'm in a hurry so I don't have too much time to make this much 
clearer (and my brain is not so good today anyway). If this still
doesn't make sense then Google gives a zillion hits for 'introduction
to recursion'.


Hope this helps,

Torben

> -- 
> bye,
>  Urosmailto:[EMAIL PROTECTED]
> 
> 
> Sunday, March 31, 2002, 1:10:30 AM, you wrote:
> 
> LTW> On Sat, 2002-03-30 at 15:59, Uros Gruber wrote:
> >> Hi!
> >> 
> >> This is a code
> >> 
> >> function Test()
> >> {
> >> static $count = 0;
> >> 
> >> $count++;
> >> echo $count;
> >> if ($count < 10) {
> >> Test ();
> >> }
> >> echo "j";
> >> }
> >> test();
> >> 
> >> Output is
> >> 
> >> 12345678910jj
> >> 
> >> Why is there 10 j at the and. If this would work it can be
> >> only one. If $count is grater than 10 it does not call itself
> >> but end. Is this maybe a bug or what.
> 
> LTW> No, there should be 10 of them, since every time Test() returns,
> LTW> the function carries on executing. If you only want one 'j'
> LTW> printed then put a return statement after the call to Test():
> 
> LTW> function Test()
> LTW> {
> LTW> static $count = 0;
> 
> LTW> $count++;
> LTW> echo $count;
> LTW> if ($count < 10) {
> LTW> Test();
> LTW> return;
> LTW> }
> LTW> echo "j";
> LTW> }
> LTW> Test();
> 
> 
> LTW> Cheers!
> 
> LTW> Torben
> 
> 
> LTW> -- 
> LTW>  Torben Wilson <[EMAIL PROTECTED]>
> LTW>  http://www.thebuttlesschaps.com
> LTW>  http://www.hybrid17.com
> LTW>  http://www.inflatableeye.com
> LTW>  +1.604.709.0506
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] For Loop going too long

2002-03-30 Thread Lars Torben Wilson

On Sat, 2002-03-30 at 15:40, David Johansen wrote:
> I have a question about something weird that I've noticed Here's some code
> that I have that loads up
> 
>$sql = "SELECT * FROM pickup_times WHERE DAYOFMONTH(time0_name) =
> $dayofmonth";
> 
>$result = mysql_query($sql, $dbh);
>$day = mysql_fetch_array($result);
>for ($i=0; $i   echo "I: $i Result: $day[$i]";
> 
> When I do this it prints out 2 times the number of columns that I actually
> have plus 1. All of the ones past the actual number of columns are just
> empty, but is there something that I'm doing wrong? Thanks,
> Dave

Yup. ;) Give http://www.php.net/mysql_fetch_array a thorough beating.
The function returns the results both in associatively-indexed elements
and in indexed ones, so you get each one twice. Try the following and it
should become clearer:


$result = mysql_query($sql, $dbh);
// Try both of the following lines and notice the difference.
//$day = mysql_fetch_array($result);
$day = mysql_fetch_array($result, MYSQL_ASSOC);
foreach ($day as $colname => $value) {
echo "Column name: $colname; Value: $value\n";
}


Cheers!

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re[2]: [PHP] Pulling data into an array and sorting

2002-03-30 Thread rdkurth


Thank you for the response to my question unfortunately your answer just
confused me even more.

Saturday, March 30, 2002, 4:25:40 PM, you wrote:

DSK> Run a while loop on your data and pull it into an array

DSK> Heres an example (though this pulls from a text file the idea is the
DSK> same...) Hope this helps...

DSK>   // READING THE DATA
DSK> function read_data($datafile) {
DSK> $data=file($datafile);
DSK> foreach ( $data as $line ) {
DSK> $temp=explode(':', $line);
DSK> $cp=$temp[4];
DSK> $return[$cp][]=$line;
DSK> }
DSK> if ( is_array($return) ) {
DSK> return($return);
DSK> } else {
DSK> return("NULL");
DSK> }
DSK> }
?>>

DSK>   // USING THE DATA  
DSK> $hosts=read_data('./hosts.dat');
DSK> if ( $hosts != 'NULL' ) {
DSK> $count=0;
DSK> foreach ( $hosts as $host ) {
DSK> $temp=explode(':', $host[0]);
DSK> $hostss.=str_replace("%%COMPANY%%",
DSK> decode($company=$temp[4]),$template_company_begin);
DSK> foreach ( $host as $hst ) {
DSK> $temp=explode(':', $hst);
DSK> $h_names[]=$temp[0];
DSK> $hostss.=str_replace("%%DISPLAY%%",
DSK> display_host($hst, $count),
DSK> $template_company_mid);
DSK> $count++;
DSK> }
DSK> $hostss.=$template_company_end;
DSK> }
DSK> } else { 
DSK> $hosts="No Hosts In Database...";
DSK> }
?>>


DSK> -Original Message-
DSK> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
DSK> Sent: Saturday, March 30, 2002 4:22 PM
DSK> To: php
DSK> Subject: [PHP] Pulling data into an array and sorting


DSK> I need to pull data into and array from a mysql database and then sort
DSK> that data according to one of the fields and then print it to the
DSK> screen.

DSK> Hear is an example of the data in the database

DSK> username Pnumber sec2 sec3 sec4 sec5 sec6
DSK>  Gary  123.345.122YES  YES   NO  YES  YES
DSK>  Fred  123.345.123YES  YES   NO  YES  YES
DSK>  Jone  123.345.124YES  YES   YES  NO  YES
DSK>  Tom   123.345.124YES  YES   NO  YES  YES
DSK>  Frank 123.345.123YES  YES   NO  YES  YES

DSK>  If you will notice the Pnumber for some are the same and some are
DSK>  different. I what to be able to sort on this number and then when they
DSK>  are printed they would be printed according to this number in groups

  




-- 
Best regards,
 rdkurthmailto:[EMAIL PROTECTED]


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




Re[4]: [PHP] BUG in recursion

2002-03-30 Thread Uros Gruber

Hi,

Ok, no I understand why. So this explains why every function
must have return. But how can i program for example one
recursion or where to put return so that test would not be
waiting for return but at the end of this recursion i would
like to do something with that $count for example.

Hmm i wrote this very strange i hope you understand.

I tell it simpler.

I would like something is executed x many times (for such
long if sentence is true) and thene do sometnihg else and
continue with program, not looping here.

-- 
tia,
 Urosmailto:[EMAIL PROTECTED]


Sunday, March 31, 2002, 1:34:20 AM, you wrote:

LTW> On Sat, 2002-03-30 at 16:16, Uros Gruber wrote:
>> Hi!
>> 
>> This I simply don't understand why this code executes that
>> way. So there is only inportant to put return after recursive
>> call and it works like i wan't. I sometimes write small C
>> programs and I don't remeber that code like this have to work
>> that way Hm.

LTW> Well, that's how it's supposed to work. Look at it like this:

LTW> 1: function test() {
LTW> 2:static $count = 0;
LTW> 3:$count++;
LTW> 4:echo $count;
LTW> 5:if ($count < 10) {
LTW> 6:test();
LTW> 7:}
LTW> 8:echo 'j';
LTW> 9: }


LTW> So the first thing that happens is you call test(). It executes
LTW> its lines in order, including function calls. When it hits the
LTW> call to test() on line 6, it calls test(), waits for it to 
LTW> return, and then continues on to line 8, echoing 'j'. 

LTW> This happens every time through, so when you get up to $i == 10, you
LTW> have 10 test()s stacked up, each of them waiting on line 6 for the
LTW> function call to test() to return. As each test() call returns,
LTW> execution continues on to line 8, echos j, then returns.

LTW> I'm in a hurry so I don't have too much time to make this much 
LTW> clearer (and my brain is not so good today anyway). If this still
LTW> doesn't make sense then Google gives a zillion hits for 'introduction
LTW> to recursion'.


LTW> Hope this helps,

LTW> Torben

>> -- 
>> bye,
>>  Urosmailto:[EMAIL PROTECTED]
>> 
>> 
>> Sunday, March 31, 2002, 1:10:30 AM, you wrote:
>> 
>> LTW> On Sat, 2002-03-30 at 15:59, Uros Gruber wrote:
>> >> Hi!
>> >> 
>> >> This is a code
>> >> 
>> >> function Test()
>> >> {
>> >> static $count = 0;
>> >> 
>> >> $count++;
>> >> echo $count;
>> >> if ($count < 10) {
>> >> Test ();
>> >> }
>> >> echo "j";
>> >> }
>> >> test();
>> >> 
>> >> Output is
>> >> 
>> >> 12345678910jj
>> >> 
>> >> Why is there 10 j at the and. If this would work it can be
>> >> only one. If $count is grater than 10 it does not call itself
>> >> but end. Is this maybe a bug or what.
>> 
>> LTW> No, there should be 10 of them, since every time Test() returns,
>> LTW> the function carries on executing. If you only want one 'j'
>> LTW> printed then put a return statement after the call to Test():
>> 
>> LTW> function Test()
>> LTW> {
>> LTW> static $count = 0;
>> 
>> LTW> $count++;
>> LTW> echo $count;
>> LTW> if ($count < 10) {
>> LTW> Test();
>> LTW> return;
>> LTW> }
>> LTW> echo "j";
>> LTW> }
>> LTW> Test();
>> 
>> 
>> LTW> Cheers!
>> 
>> LTW> Torben
>> 
>> 
>> LTW> -- 
>> LTW>  Torben Wilson <[EMAIL PROTECTED]>
>> LTW>  http://www.thebuttlesschaps.com
>> LTW>  http://www.hybrid17.com
>> LTW>  http://www.inflatableeye.com
>> LTW>  +1.604.709.0506
>> 
>> 
>> -- 
>> 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] Another ?

2002-03-30 Thread eric.coleman

Probably Opera

- Original Message - 
From: "Sean Kennedy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 30, 2002 12:28 PM
Subject: [PHP] Another ?


> Hello,
> 
> Whats the HTTP_USER_AGENT for opera?
> Thanks,
> 
> -Sean
> Kennedy
> 
> 
> -- 
> 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] For Loop going too long

2002-03-30 Thread Demitrious S. Kelly

Try a foreach... it works well...

-Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] On Behalf Of Lars
Torben Wilson
Sent: Saturday, March 30, 2002 4:38 PM
To: David Johansen
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] For Loop going too long

On Sat, 2002-03-30 at 15:40, David Johansen wrote:
> I have a question about something weird that I've noticed Here's some
code
> that I have that loads up
> 
>$sql = "SELECT * FROM pickup_times WHERE DAYOFMONTH(time0_name) =
> $dayofmonth";
> 
>$result = mysql_query($sql, $dbh);
>$day = mysql_fetch_array($result);
>for ($i=0; $i   echo "I: $i Result: $day[$i]";
> 
> When I do this it prints out 2 times the number of columns that I
actually
> have plus 1. All of the ones past the actual number of columns are
just
> empty, but is there something that I'm doing wrong? Thanks,
> Dave

Yup. ;) Give http://www.php.net/mysql_fetch_array a thorough beating.
The function returns the results both in associatively-indexed elements
and in indexed ones, so you get each one twice. Try the following and it
should become clearer:


$result = mysql_query($sql, $dbh);
// Try both of the following lines and notice the difference.
//$day = mysql_fetch_array($result);
$day = mysql_fetch_array($result, MYSQL_ASSOC);
foreach ($day as $colname => $value) {
echo "Column name: $colname; Value: $value\n";
}


Cheers!

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


-- 
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: Re[2]: [PHP] Pulling data into an array and sorting

2002-03-30 Thread Demitrious S. Kelly

Take a look at this:

";
foreach ( $ourdata as $data ) {
foreach ( $data as $array ) {
echo "Username: ".$array[0]."";
echo "Pnumber:  ".$array[1]."";
echo "sec2: ".$array[2]."";
echo "sec3: ".$array[3]."";
echo "sec4: ".$array[4]."";
echo "sec5: ".$array[5]."";
echo "sec5: ".$array[6]."";
echo "";
}
}
echo "";
?>



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 30, 2002 4:49 PM
To: php-general
Subject: Re[2]: [PHP] Pulling data into an array and sorting


Thank you for the response to my question unfortunately your answer just
confused me even more.

Saturday, March 30, 2002, 4:25:40 PM, you wrote:

DSK> Run a while loop on your data and pull it into an array

DSK> Heres an example (though this pulls from a text file the idea is
the
DSK> same...) Hope this helps...

DSK>   // READING THE DATA
DSK> function read_data($datafile) {
DSK> $data=file($datafile);
DSK> foreach ( $data as $line ) {
DSK> $temp=explode(':', $line);
DSK> $cp=$temp[4];
DSK> $return[$cp][]=$line;
DSK> }
DSK> if ( is_array($return) ) {
DSK> return($return);
DSK> } else {
DSK> return("NULL");
DSK> }
DSK> }
?>>

DSK>   // USING THE DATA  
DSK> $hosts=read_data('./hosts.dat');
DSK> if ( $hosts != 'NULL' ) {
DSK> $count=0;
DSK> foreach ( $hosts as $host ) {
DSK> $temp=explode(':', $host[0]);
DSK> $hostss.=str_replace("%%COMPANY%%",
DSK> decode($company=$temp[4]),$template_company_begin);
DSK> foreach ( $host as $hst ) {
DSK> $temp=explode(':', $hst);
DSK> $h_names[]=$temp[0];
DSK> $hostss.=str_replace("%%DISPLAY%%",
DSK> display_host($hst, $count),
DSK> $template_company_mid);
DSK> $count++;
DSK> }
DSK> $hostss.=$template_company_end;
DSK> }
DSK> } else { 
DSK> $hosts="No Hosts In Database...";
DSK> }
?>>


DSK> -Original Message-
DSK> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
DSK> Sent: Saturday, March 30, 2002 4:22 PM
DSK> To: php
DSK> Subject: [PHP] Pulling data into an array and sorting


DSK> I need to pull data into and array from a mysql database and then
sort
DSK> that data according to one of the fields and then print it to the
DSK> screen.

DSK> Hear is an example of the data in the database

DSK> username Pnumber sec2 sec3 sec4 sec5 sec6
DSK>  Gary  123.345.122YES  YES   NO  YES  YES
DSK>  Fred  123.345.123YES  YES   NO  YES  YES
DSK>  Jone  123.345.124YES  YES   YES  NO  YES
DSK>  Tom   123.345.124YES  YES   NO  YES  YES
DSK>  Frank 123.345.123YES  YES   NO  YES  YES

DSK>  If you will notice the Pnumber for some are the same and some are
DSK>  different. I what to be able to sort on this number and then when
they
DSK>  are printed they would be printed according to this number in
groups

  




-- 
Best regards,
 rdkurthmailto:[EMAIL PROTECTED]


-- 
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] A way to use WWW-Autorization

2002-03-30 Thread Alberto Wagner

I need a good autorizating script that works in any browser an apache server

Alberto
Tkz





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




[PHP] mail() function.

2002-03-30 Thread Birtch, James

When I email using this function, the email which is received has the following 
content at the top of it...

From: [EMAIL PROTECTED]
Return-Path: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
X-OriginalArrivalTime: 31 Mar 2002 01:14:57.0786 (UTC) FILETIME=[790BEDA0:01C1D851]

Any ideas on how to get rid of it??


"Were not satisfied until you are"
James Birtch
Compaq Canada OTTAWA Consumer Advisory Support

*   Email - [EMAIL PROTECTED]
*   Voice - (613) 721-3050 x 4516
*   Fax - (613) 721-3070




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




[PHP] Undefined variables

2002-03-30 Thread Ernesto

Hi, newbie here.

I was erroneously using "error_reporting=E_ALL ~E_NOTICE" on my debug
server.
Now, I changed it to "error_reporting=E_ALL" and I can see lots of warnings
about using undefined variables.
So, if I don't want to see warnings all over the place, I have to check
every variable with isset() before I use it.
Is it necesary that I do this all the time? Why can't I trust on the
"emptiness" of uninitialized variables?
I'm using "register_globals=Off", so there should be no problem with that.

I know it's a good practice to declare and initialize all variables, but I
need my scripts to run as fast as they can (and I'm too lazy to check every
variable before I use it, too :-)

So... do I have any choice?

Regards,
Ernesto




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




Re: [PHP] Undefined variables

2002-03-30 Thread Lars Torben Wilson

On Sat, 2002-03-30 at 17:30, Ernesto wrote:
> Hi, newbie here.
> 
> I was erroneously using "error_reporting=E_ALL ~E_NOTICE" on my debug
> server.
> Now, I changed it to "error_reporting=E_ALL" and I can see lots of warnings
> about using undefined variables.
> So, if I don't want to see warnings all over the place, I have to check
> every variable with isset() before I use it.
> Is it necesary that I do this all the time? Why can't I trust on the
> "emptiness" of uninitialized variables?
> I'm using "register_globals=Off", so there should be no problem with that.
> 
> I know it's a good practice to declare and initialize all variables, but I
> need my scripts to run as fast as they can (and I'm too lazy to check every
> variable before I use it, too :-)
> 
> So... do I have any choice?
> 
> Regards,
> Ernesto

Not really. You either have to init your variables or turn off notices
in error_reporting() (or otherwise suppress them; i.e. display_errors =
off).



-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Undefined variables

2002-03-30 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


> Not really. You either have to init your variables or turn off notices
> in error_reporting() (or otherwise suppress them; i.e. display_errors =
> off).

initialising them with safe defaults is the thing to do - the point of the 
error is to warn about uninitialised variables (which, if register_globals is 
on, could be used by an attacker to make your scripts to bad things...)

- --
Shane
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8pmm85DXg6dCMBrQRAl0PAJ9W6iBFtaYtXBKnvmtfKPPVJzHWyACfRg91
6IXouixJwNAsLJDhvYyhnSs=
=DBej
-END PGP SIGNATURE-


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




[PHP] Re: Disabling the Back Button?

2002-03-30 Thread Hugh Bothwell

You're asking the wrong question.

'Disabling the back button' changes the expected behaviour
of the browser and as such is an *EVIL* thing to do, roughly
on par with driving the wrong way down one-way streets or
spray-painting your neighbor's cat.

What you want is to 'prevent the user from accessing or
resubmitting the form after it has been submitted', and
the question is the answer: when the form is submitted set
a flag; check the flag before showing a page or accepting
a submission.


"David Johansen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> OK, I basically just want to make it so that the user can't go back once
> they're done with an application form that I'm working on. I don't case if
> they go back in the middle and my page handles that just fine, but I want
> them to not be able to go back when they're all done. Is there some way
that
> I can do this? Thanks,



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




Re: [PHP] Undefined variables

2002-03-30 Thread Lars Torben Wilson

On Sat, 2002-03-30 at 17:43, Shane Wright wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> 
> > Not really. You either have to init your variables or turn off notices
> > in error_reporting() (or otherwise suppress them; i.e. display_errors =
> > off).
> 
> initialising them with safe defaults is the thing to do - the point of the 
> error is to warn about uninitialised variables (which, if register_globals is 
> on, could be used by an attacker to make your scripts to bad things...)
> 
> - --
> Shane

Yes, this is my standard suggestion as well, but since Ernesto seemed
to be aware of the issues I decided not to press the point. 


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Undefined variables

2002-03-30 Thread Shane Wright

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


sorry, didnt get that that was your prefered method - didnt mean to step on 
your toes :)

S

On Sunday 31 March 2002 2:50 am, Lars Torben Wilson wrote:
> On Sat, 2002-03-30 at 17:43, Shane Wright wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > > Not really. You either have to init your variables or turn off notices
> > > in error_reporting() (or otherwise suppress them; i.e. display_errors =
> > > off).
> >
> > initialising them with safe defaults is the thing to do - the point of
> > the error is to warn about uninitialised variables (which, if
> > register_globals is on, could be used by an attacker to make your scripts
> > to bad things...)
> >
> > - --
> > Shane
>
> Yes, this is my standard suggestion as well, but since Ernesto seemed
> to be aware of the issues I decided not to press the point.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8pm4K5DXg6dCMBrQRAsTLAJ9377x/gjRKbHrfcSYW11BKUgotgACfQmTw
x2rcCdMlPbAaPg8zAey7L/8=
=WVbB
-END PGP SIGNATURE-


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




Re: [PHP] Tracking impressions

2002-03-30 Thread Miguel Cruz

On Sat, 30 Mar 2002, David Duong wrote:
> Hello, I need a script that can track impressions through PHP.
> 
> I know you load a php script from  tags than some how the image is
> loaded or redirected.
> 
> Is their a way I can record impressions and environment variables like IP,
> Browser, referrer, etc.

Sure, it's all available to your PHP script.

counter.php:



And just insert this on your page:

  

It doesn't matter what you put for "anything.gif" as long as it looks like 
an image file.

miguel


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




[PHP] Sql results

2002-03-30 Thread Alberto Wagner

$Sql_Query_Login Returns an empty mysql array like:

$Sql_Query_Login = Mysql_Query("SELECT Nome FROM users WHERE User = 'Anyone'")

There isn't a user if name Anyone...

Why

If (!$Sql_Query_Login) {
   Echo "Ninguem";
}

Is returning False?




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




[PHP] MySQL Connection Error - mysql_select_db

2002-03-30 Thread Patrick Hartnett

here is a function used to authenticate users against mysql database.  
Problem is, I am not connecting for some reason.  I have the db variables:
$db_host
$db_user
$db_pass
$db_name

They are populated from an include ("x.php") in the beginning of the php 
section.  It is getting past the connect statement, but it is not selecting 
the proper database, and gives a:

"Error in query: No Database Selected"

in the error trap below (die).  Any ideas what is wrong?  Am I missing some 
syntax, or what?
Thanks.

Patrick

##

function authenticate($user, $pass)
{

// check login and password
// connect and execute query
$connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable 
to connect!");
$query = "SELECT id from users WHERE username = '$user' AND password = 
PASSWORD('$pass')";
mysql_select_db($db_name);
//mysql_select_db("devweb"); <--what it should be, from file
$result = mysql_query($query, $connection) or die ("Error in query: " . 
mysql_error());

// if row exists -> user/pass combination is correct
if (mysql_num_rows($result) == 1)
{
return 1;
}
// user/pass combination is wrong
else
{
return 0;
}
}

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




[PHP] Re: ASP vs PHP

2002-03-30 Thread John Lim

Hello Ciro,

For database access and automatic generation of forms, see
http://phplens.com/
You can create search/edit/new record forms automatically through the web
user
interface with little coding. It also has a low level PHP interface for
deep coding. This is a commercial product, developed by our company.

Regards, John

Ciro Martins <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi!
>
>
> I've been programming in PHP for long. But one question that always is
> coming to my mind is to know if there exists some kind of tools (like
> for SP. It exists a tool called ASPWebTools for wich it is possible to
> develop applications written in ASP and connecting with DB like SQL
> Server in an automatic way) that can help in the development of
> applications using PHP and databases. For instance, that could allow to
> develop automatically forms to connect to databases using PHP.
>
> Does anyone know any related application or tools.
> Because in ASP with that tool is more easy to develop code.
>
> Thanks in advance
>
> Ciro Martins
>



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




Re: [PHP] MySQL Connection Error - mysql_select_db

2002-03-30 Thread Alberto Wagner

31/03/2002 01:02:04, "Patrick Hartnett" <[EMAIL PROTECTED]> wrote:

You Need to use the command
Mysql_Select_Db("$db_name") Or Die("Unable to connect!");

after connect with mysql

I use something like this:

mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!");
Mysql_Select_Db("$db_name") Or Die("Unable to connect!");

I don't use a $connection like var.


>here is a function used to authenticate users against mysql database.  
>Problem is, I am not connecting for some reason.  I have the db variables:
>$db_host
>$db_user
>$db_pass
>$db_name
>
>They are populated from an include ("x.php") in the beginning of the php 
>section.  It is getting past the connect statement, but it is not selecting 
>the proper database, and gives a:
>
>"Error in query: No Database Selected"
>
>in the error trap below (die).  Any ideas what is wrong?  Am I missing some 
>syntax, or what?
>Thanks.
>
>Patrick
>
>##
>
>function authenticate($user, $pass)
>{
>
>   // check login and password
>   // connect and execute query
>   $connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable 
>to connect!");
>   $query = "SELECT id from users WHERE username = '$user' AND password = 
>PASSWORD('$pass')";
>   mysql_select_db($db_name);
>   //mysql_select_db("devweb"); <--what it should be, from file
>   $result = mysql_query($query, $connection) or die ("Error in query: " . 
>mysql_error());
>
>   // if row exists -> user/pass combination is correct
>   if (mysql_num_rows($result) == 1)
>   {
>   return 1;
>   }
>   // user/pass combination is wrong
>   else
>   {
>   return 0;
>   }
>}
>
>_
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
>
>-- 
>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] MySQL Connection Error - mysql_select_db

2002-03-30 Thread Tyler Longren

I don't think those variables are readable in the function.  Not totally
sure though.

Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com

- Original Message -
From: "Patrick Hartnett" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 30, 2002 10:02 PM
Subject: [PHP] MySQL Connection Error - mysql_select_db


> here is a function used to authenticate users against mysql database.
> Problem is, I am not connecting for some reason.  I have the db variables:
> $db_host
> $db_user
> $db_pass
> $db_name
>
> They are populated from an include ("x.php") in the beginning of the php
> section.  It is getting past the connect statement, but it is not
selecting
> the proper database, and gives a:
>
> "Error in query: No Database Selected"
>
> in the error trap below (die).  Any ideas what is wrong?  Am I missing
some
> syntax, or what?
> Thanks.
>
> Patrick
>
> ##
>
> function authenticate($user, $pass)
> {
>
> // check login and password
> // connect and execute query
> $connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable
> to connect!");
> $query = "SELECT id from users WHERE username = '$user' AND password =
> PASSWORD('$pass')";
> mysql_select_db($db_name);
> //mysql_select_db("devweb"); <--what it should be, from file
> $result = mysql_query($query, $connection) or die ("Error in query: " .
> mysql_error());
>
> // if row exists -> user/pass combination is correct
> if (mysql_num_rows($result) == 1)
> {
> return 1;
> }
> // user/pass combination is wrong
> else
> {
> return 0;
> }
> }
>
> _
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.
>
>
> --
> 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] mail() function.

2002-03-30 Thread Tyler Longren

Actually, that type of stuff is at the top of all e-mails.  You'd always see
it if you set your e-mail client to show you the headers.  So, it may be
something with your e-mail client.  Can you provide the code you're using to
send the e-mail?  The mail() part would suffice.

Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com

- Original Message -
From: "Birtch, James" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 30, 2002 7:16 PM
Subject: [PHP] mail() function.


When I email using this function, the email which is received has the
following content at the top of it...

From: [EMAIL PROTECTED]
Return-Path: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
X-OriginalArrivalTime: 31 Mar 2002 01:14:57.0786 (UTC)
FILETIME=[790BEDA0:01C1D851]

Any ideas on how to get rid of it??


"Were not satisfied until you are"
James Birtch
Compaq Canada OTTAWA Consumer Advisory Support

* Email - [EMAIL PROTECTED]
* Voice - (613) 721-3050 x 4516
* Fax - (613) 721-3070




--
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




  1   2   >