RE: [PHP] open_basedir

2001-07-08 Thread Ben Bleything

Ulrich,

Pretty sure that the way to fix this will be to make sure that PHP just
can't read those files... so that the apache (or whatever server) user
that runs the PHP [module/binary] doesn't have access to read them.  

If you are concerned specifically about /etc/passwd, shadow it.  You can
find more information in the HOWTO's off of RedHat's site or at
linux.com.

This may not be correct, but I'm fairly certain.  I trust someone will
correct me if I'm wrong.

Good Luck,
Ben

-Original Message-
From: Yacoon [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 12:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] open_basedir

mornin,

i´m new to the list and to php, so please don´t jump to hard on me, when
you
think the question is dump.


okay: is there a possibility to make a server only execute the php
scripts
in the document root it was called from?
I saw something about open_basedir, but am not sure if that is the way.

I badly need to protect the server from i.e. includes, that read out or
manipulated server config files, like passwd.
I have systems run under redhat, if that matters. could anyone please
just
let me know how and where?
I´ll definatelly need the correct syntax, since that’s my main-problem
with
php.

thanks a lot - ulrich



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] can't generate gif!!!

2001-07-08 Thread Ben Bleything

Also, if you don't need to do this on the fly (or even if you do, in
certain cases) just use 'convert', a standard unix tool (fairly
standard, anyway).  So if, for instance, your users are uploading a gif,
and you need a png (so that you can tweak with it), you could write it
to a file, and then 

echo `convert upload.gif output.png`;
your_functions_here('output.png');

Ben

-Original Message-
From: Henrik Hansen [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 3:16 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] can't generate gif!!!

"Rama" <[EMAIL PROTECTED]> wrote:

 > I have problem using all image functions for gif.
 > Does anyone have a suggestion how to convert gif images to png
images?
 > It's ok if I have to use other programming language instead of PHP.
 > 
 > Ps: in case you wonder, I can't control the input file type. It will
be
 > very helpful if I can at least convert to other image format.

what gdlib version do you use, as gif support is removed in the newer
versions, due to license stuff.

-- 
Henrik Hansen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] can't generate gif!!!

2001-07-08 Thread Ben Bleything

Oh yeah =>  That's probably true.

Howver, every machine I have ever used has had convert.  I do a lot of
photography, and so I use it a lot =>

Ben

-Original Message-
From: Tom Carter [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 9:52 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] can't generate gif!!!

I thought convert was an imagemagick command, rather than unix by
default?
could be wrong tho...
- Original Message -
From: "Ben Bleything" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 5:23 PM
Subject: RE: [PHP] can't generate gif!!!


> Also, if you don't need to do this on the fly (or even if you do, in
> certain cases) just use 'convert', a standard unix tool (fairly
> standard, anyway).  So if, for instance, your users are uploading a
gif,
> and you need a png (so that you can tweak with it), you could write it
> to a file, and then
>
> echo `convert upload.gif output.png`;
> your_functions_here('output.png');
>
> Ben
>
> -Original Message-
> From: Henrik Hansen [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 08, 2001 3:16 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] can't generate gif!!!
>
> "Rama" <[EMAIL PROTECTED]> wrote:
>
>  > I have problem using all image functions for gif.
>  > Does anyone have a suggestion how to convert gif images to png
> images?
>  > It's ok if I have to use other programming language instead of PHP.
>  >
>  > Ps: in case you wonder, I can't control the input file type. It
will
> be
>  > very helpful if I can at least convert to other image format.
>
> what gdlib version do you use, as gif support is removed in the newer
> versions, due to license stuff.
>
> --
> Henrik Hansen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mcrypt

2001-07-08 Thread Ben Bleything

Have you made sure that the php on the command line and the php that
apache is using are indeed the same one?  It's possible that apache is
looking at a module somewhere and that the php on the command line is
the binary you built.  

Just a thought.
Ben

-Original Message-
From: Power Programmer [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 12:29 PM
To: [EMAIL PROTECTED]; Keyser Soze; [EMAIL PROTECTED]
Subject: [PHP] mcrypt

I have compiled PHP with mcrypt   and it works fine if I run a script
from
the command line but through a browswer such as IE   I get the following
error:



Fatal error: Call to undefined function: mcrypt_module_open() in
/home/wheit/html/test.php on line 6


What do I need to do to be able to use these functions through a browser
I
use apache as a web server


Randy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

Use a database.  With mysql, you can store the text into a table with
primary key called 'page' or something like that, and a text field of
some sort.

Then, do mysql_query("SELECT pagetext FROM website WHERE page=$page;");

=>

Dive into it.  It's easier than it looks.

Ben

-Original Message-
From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 1:44 PM
To: PHP General List (E-mail)
Subject: [PHP] Question about how to do this...

hey-

so I want to have my site so that the urls are like /index.php?page=bio

the way I made the index.php so far is just one gigantic switch
statement...is there a better way to do it?


chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

This is a very good valid point that I completely failed to consider =>

Chris, to answer your last question, yes, it _would_ work, but as Mark
points out, it's probably not a very good idea.  Still cool, but hey,
you can tell I don't work in a production environment =>

The other method I sent will reduce the size (and maintenance cost) of
your index.php page, while being fast (as Mark says).

Ben

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 2:05 PM
To: Ben Bleything; [EMAIL PROTECTED]; 'PHP General List (E-mail)'
Subject: Re: [PHP] Question about how to do this...

This is probably "not a good idea" if the data is mostly static. There's
no
real reason to use the power of a db engine for something this trivial,
and
static serving will be faster than a DB system.

Mark C.

- Original Message -
From: "Ben Bleything" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "'PHP General List (E-mail)'"
<[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 3:59 PM
Subject: RE: [PHP] Question about how to do this...


> Use a database.  With mysql, you can store the text into a table with
> primary key called 'page' or something like that, and a text field of
> some sort.
>
> Then, do mysql_query("SELECT pagetext FROM website WHERE
page=$page;");
>
> =>
>
> Dive into it.  It's easier than it looks.
>
> Ben
>
> -Original Message-
> From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 08, 2001 1:44 PM
> To: PHP General List (E-mail)
> Subject: [PHP] Question about how to do this...
>
> hey-
>
> so I want to have my site so that the urls are like
/index.php?page=bio
> 
> the way I made the index.php so far is just one gigantic switch
> statement...is there a better way to do it?
>
>
> chris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

Yup =>  Try splitting the pages out into separate files.  I'm betting
you'll find it easier to work with.

Ben


-Original Message-
From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 2:02 PM
To: PHP General List (E-mail)
Subject: RE: [PHP] Question about how to do this...

so the switch statement idea works I guess. sounds good. 

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 5:05 PM
To: Ben Bleything; [EMAIL PROTECTED]; 'PHP General List (E-mail)'
Subject: Re: [PHP] Question about how to do this...


This is probably "not a good idea" if the data is mostly static. There's
no
real reason to use the power of a db engine for something this trivial,
and
static serving will be faster than a DB system.

Mark C.

----- Original Message -
From: "Ben Bleything" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "'PHP General List (E-mail)'"
<[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 3:59 PM
Subject: RE: [PHP] Question about how to do this...


> Use a database.  With mysql, you can store the text into a table with
> primary key called 'page' or something like that, and a text field of
> some sort.
>
> Then, do mysql_query("SELECT pagetext FROM website WHERE
page=$page;");
>
> =>
>
> Dive into it.  It's easier than it looks.
>
> Ben
>
> -Original Message-
> From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 08, 2001 1:44 PM
> To: PHP General List (E-mail)
> Subject: [PHP] Question about how to do this...
>
> hey-
>
> so I want to have my site so that the urls are like
/index.php?page=bio
> 
> the way I made the index.php so far is just one gigantic switch
> statement...is there a better way to do it?
>
>
> chris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Running PHP as a cron job....

2001-07-08 Thread Ben Bleything

How are you executing the script?  Does it come by and run 'php
yourscript.php' or does the script have a shebang ('#!/usr/bin/php') in
it?  I've found that works well... just put that as the first line, and
it behaves as a shell script (after you make it executable, of course)

Ben

-Original Message-
From: James, Yz [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 3:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Running PHP as a cron job

Hi all,

This is probably going to sound incoherant, but

Do I have to do anything (other than change the permissions of a php
file)
to get it to run as part of a cron job?  I created an extremely simple
file
that should just send a blank email to me (using mail()).  I got an
email
from the cron daemon saying, "bad token", or something like that, yet
when
executed through a browser, the script behaves as it should.

Do I have to write the php scripts differently to how I would if they
were
to be displayed in a browser?

Neeed...Slp ;)

Cheers,
James.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Running PHP as a cron job....

2001-07-08 Thread Ben Bleything

Otay...

So, to get the shebang right, you need to know the path to the php
binary... it may not be where I said it was... You probably already
figured that out.  You will also need to set it executable.

It looks, from what you sent, that crond is interpreting the php file
(and not having much luck)

So... I'm not extremely familiar with cron, so, let me guess a little...
in your /etc/cron.hourly (or whatever) directory, you've got this
script, right?

My guess would be, if you 'chmod +x file' on this, with the shebang
(with proper path) it will work.

Let me know,
Ben

-Original Message-
From: James, Yz [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 3:57 PM
To: Ben Bleything; [EMAIL PROTECTED]
Subject: Re: [PHP] Running PHP as a cron job

Hi Ben,

When running it as a normal PHP file, I get the cron daemon emailing me
stuff like:

automation/mail.php: ?: No such file or directory
automation/mail.php: =: command not found
automation/mail.php: =: command not found
automation/mail.php: line 7: syntax error near unexpected token
`mail("emailaddress@takenout",'
automation/mail.php: line 7: `mail("emailaddress@takenout", "mail test",
"$mailcontent", "$sender");'


When running it with the Perl style line at the top (as you suggested) I
get, "no such file or directory."

The script is Chmodded to 755 in both cases.  And I saved it as a .php
and
.cgi file (with the root to bin/php in it).  God knows what I'm doing
wrong
;)

James.

> How are you executing the script?  Does it come by and run 'php
> yourscript.php' or does the script have a shebang ('#!/usr/bin/php')
in
> it?  I've found that works well... just put that as the first line,
and
> it behaves as a shell script (after you make it executable, of course)
>
> Ben
>
> -Original Message-
> From: James, Yz [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 08, 2001 3:39 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Running PHP as a cron job
>
> Hi all,
>
> This is probably going to sound incoherant, but
>
> Do I have to do anything (other than change the permissions of a php
> file)
> to get it to run as part of a cron job?  I created an extremely simple
> file
> that should just send a blank email to me (using mail()).  I got an
> email
> from the cron daemon saying, "bad token", or something like that, yet
> when
> executed through a browser, the script behaves as it should.
>
> Do I have to write the php scripts differently to how I would if they
> were
> to be displayed in a browser?
>
> Neeed...Slp ;)
>
> Cheers,
> James.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Running PHP as a cron job....

2001-07-08 Thread Ben Bleything

Interesting method, with the lynx... I imagine that if you've only built
the DSO, then that would be the way to do it.. if it worked.  My guess
would be, you would have to do lynx
'http://localhost/path/to/script/script.php' to force it to go through
the server.

TO be totally honest with you, I'm too lazy to learn bash scripting, so
I've been using php (it's fast and easy and does everything I need!
Honest!) so when I build a new version of php, I make both... =P

ANYWAY, thanks for clarifying... I think we all had been assuming =>

Ben

-Original Message-
From: Michael Hall [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 3:16 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Running PHP as a cron job


This looks like a good place for me to step in and maybe clear up
something I've been wondering about ...

With all the advice that has been offered so far, has it been assumed
that
php is installed in the CGI rather than DSO manner? Can PHP as a DSO
interpret shell script-like files with a shebang at the top?

Alternatively, I've read somewhere about using lynx to run a .php cron
job. Does this apply to DSO setups? For example, would James put
something
like this in his crontab:

*   *   *   *  lynx mail.php


TIA
Mick


On Mon, 9 Jul 2001, Chris Fry wrote:

> Check the path to your php cgi executable - which php - you'll
probably find that
> it's #!/usr/local/bin/php
> 
> This is what the "no such file or directory" is referring to.
> 
> Chris
> 
> Don Read wrote:
> 
> > On 08-Jul-01 James, Yz wrote:
> > > Hi Ben,
> > >
> > > When running it as a normal PHP file, I get the cron daemon
emailing me
> > > stuff like:
> > >
> > > automation/mail.php: ?: No such file or directory
> > > automation/mail.php: =: command not found
> > > automation/mail.php: =: command not found
> > > automation/mail.php: line 7: syntax error near unexpected token
> > > `mail("emailaddress@takenout",'
> > > automation/mail.php: line 7: `mail("emailaddress@takenout", "mail
test",
> > > "$mailcontent", "$sender");'
> > >
> > >
> >
> > try a wrapper
> >
> > > When running it with the Perl style line at the top (as you
suggested) I
> > > get, "no such file or directory."
> > >
> > > The script is Chmodded to 755 in both cases.  And I saved it as a
.php and
> > > .cgi file (with the root to bin/php in it).  God knows what I'm
doing wrong
> > > ;)
> > >
> > > James.
> > >
> > >> How are you executing the script?  Does it come by and run 'php
> > >> yourscript.php' or does the script have a shebang
('#!/usr/bin/php') in
> > >> it?  I've found that works well... just put that as the first
line, and
> > >> it behaves as a shell script (after you make it executable, of
course)
> > >>
> > >> Ben
> > >>
> > >> -Original Message-
> > >> From: James, Yz [mailto:[EMAIL PROTECTED]]
> > >> Sent: Sunday, July 08, 2001 3:39 PM
> > >> To: [EMAIL PROTECTED]
> > >> Subject: [PHP] Running PHP as a cron job
> > >>
> > >> Hi all,
> > >>
> > >> This is probably going to sound incoherant, but
> > >>
> > >> Do I have to do anything (other than change the permissions of a
php
> > >> file)
> > >> to get it to run as part of a cron job?  I created an extremely
simple
> > >> file
> > >> that should just send a blank email to me (using mail()).  I got
an
> > >> email
> > >> from the cron daemon saying, "bad token", or something like that,
yet
> > >> when
> > >> executed through a browser, the script behaves as it should.
> > >>
> > >> Do I have to write the php scripts differently to how I would if
they
> > >> were
> > >> to be displayed in a browser?
> > >>
> > >> Neeed...Slp ;)
> > >>
> > >> Cheers,
> > >> James.
> > >>
> > >>
> > >>
> > >> --
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >>
> > >>
> > >>
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> >
> > --
> > Don Read   [EMAIL PROTECTED]
> > -- It's always darkest before the dawn. So if you are going to
> >steal the neighbor's newspaper, that's the time to do it.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> 
> --
> 
> Chris Fry
> Quillsoft Pty Ltd
> Specialists in Secure Internet Services and E-Commerce Solutions
> 10 Gray Street
> Kogarah
> NSW  2217
> Australia
> 
> Phone: +61 2 9553 1691
> Fax: +61 2 9553 1692
> Mobile: 0419 414 323
> eMail: [EMAIL PROTECTED]
> http://www.quillsoft.com.au
> 
> You can download our Public CA Certificate from:-
> https://ca.secur

[PHP] Mosinskis's autoreply

2001-07-08 Thread Ben Bleything

Just out of curiosity, is everyone else receiving auto-replies from
Peter Mosinskis when they post to the list?  I know I am.
 
=>  Ben



RE: [PHP] Mosinskis's autoreply

2001-07-08 Thread Ben Bleything

That's what I thought.  Great.

I just wanted to make sure that I wasn't doing something else to provoke
his mailer =>

Ben

-Original Message-
From: Matthew Loff [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 5:19 PM
To: 'Ben Bleything'; [EMAIL PROTECTED]
Subject: RE: [PHP] Mosinskis's autoreply


Yep... Getting them here too.


-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 8:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mosinskis's autoreply


Just out of curiosity, is everyone else receiving auto-replies from
Peter Mosinskis when they post to the list?  I know I am.
 
=>  Ben



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] easy mysql question

2001-07-08 Thread Ben Bleything

Do you mean to output the current structure of the table?

Check out http://www.mysql.com/doc/m/y/mysqldump.html.  Mysqldump will
do that for you... If you mean a syntax reference, check www.mysql.com.
If you didn't mean either of those things, Sorry =>

Ben

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 7:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP] easy mysql question

Since I first made the tables for my site I've had to modify them quite
a
bit. I always keep a copy of the commands I used to make the tables in
case
I need to move a site. Is there a way to ask mysql to list the create
table
commands?


Susan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] url without a query string?

2001-07-08 Thread Ben Bleything

A shot in the dark would be to use HTTP Post instead of Get... but, I
don't know http.

-Original Message-
From: Jon Yaggie [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 9:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP] url without a query string?

the problem

i have a page that uses a query string to determine content.  ie
index.php?id=2  in this page there is a link to a memebership area that
uses a remote service.  this service requires that thee be the exact
same refering url.  is the refering url must always be index.php.  how
can i do this?  can i do this?







Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] url without a query string?

2001-07-08 Thread Ben Bleything

Yikes.  Popups and porn.

Anyhoo, I guess I can't help you.  I just don't know enough about the
inner workings of http.

Sorry =>

Ben

-Original Message-
From: Jon Yaggie [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 9:34 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] url without a query string?

i mean this is coming from a hardcoded link.

example

www.design-monster.com links to www.site.com/index.php?id=4
but site www.hopeless.com links to www.site.com/index.php?id=2

both these then have a membership link on them and the memebership
service
uses the refering url.  but the referer needs to be exact.  so the query
string needs to be stripped some how?









Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0


- Original Message -----
From: "Ben Bleything" <[EMAIL PROTECTED]>
To: "'Jon Yaggie'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 11:25 AM
Subject: RE: [PHP] url without a query string?


> A shot in the dark would be to use HTTP Post instead of Get... but, I
> don't know http.
>
> -Original Message-
> From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 08, 2001 9:22 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] url without a query string?
>
> the problem
>
> i have a page that uses a query string to determine content.  ie
> index.php?id=2  in this page there is a link to a memebership area
that
> uses a remote service.  this service requires that thee be the exact
> same refering url.  is the refering url must always be index.php.  how
> can i do this?  can i do this?
>
>
>
>
>
>
>
> Thank You,
>
> Jon Yaggie
> www.design-monster.com
>
> And they were singing . . .
>
> '100 little bugs in the code
> 100 bugs in the code
> fix one bug, compile it again
> 101 little bugs in the code
>
> 101 little bugs in the code . . .'
>
> And it continued until they reached 0
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

I believe (and I'm sure someone will correct me if I'm wrong) that
whenever you 'include' or 'require' a file, it drops to regular HTML
mode... so, yes, you will need to use 
tags at the ends =>

Hope that helps =>
Ben

-Original Message-
From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 9:25 PM
To: PHP General List (E-mail)
Subject: RE: [PHP] Question about how to do this...

ok so if I use this method below, or a hash table, etcand it has an
include/require statement...in those files to be included...do I need to
start it off with the mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 5:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Question about how to do this...


Or even better, create a system where you can create new pages without
adding to the switch statement:



Note that you _need_ to have the full path, else you're creating a
security
issue.

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Ben Bleything <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; 'PHP General List (E-mail)'
<[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 5:17 PM
Subject: RE: [PHP] Question about how to do this...


| Yup =>  Try splitting the pages out into separate files.  I'm betting
| you'll find it easier to work with.
|
| Ben
|
|
| -Original Message-
| From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]]
| Sent: Sunday, July 08, 2001 2:02 PM
| To: PHP General List (E-mail)
| Subject: RE: [PHP] Question about how to do this...
|
| so the switch statement idea works I guess. sounds good.
|
| -Original Message-
| From: Mark Charette [mailto:[EMAIL PROTECTED]]
| Sent: Sunday, July 08, 2001 5:05 PM
| To: Ben Bleything; [EMAIL PROTECTED]; 'PHP General List (E-mail)'
| Subject: Re: [PHP] Question about how to do this...
|
|
| This is probably "not a good idea" if the data is mostly static.
There's
| no
| real reason to use the power of a db engine for something this
trivial,
| and
| static serving will be faster than a DB system.
|
| Mark C.
|
| - Original Message -
| From: "Ben Bleything" <[EMAIL PROTECTED]>
| To: <[EMAIL PROTECTED]>; "'PHP General List (E-mail)'"
| <[EMAIL PROTECTED]>
| Sent: Sunday, July 08, 2001 3:59 PM
| Subject: RE: [PHP] Question about how to do this...
|
|
| > Use a database.  With mysql, you can store the text into a table
with
| > primary key called 'page' or something like that, and a text field
of
| > some sort.
| >
| > Then, do mysql_query("SELECT pagetext FROM website WHERE
| page=$page;");
| >
| > =>
| >
| > Dive into it.  It's easier than it looks.
| >
| > Ben
| >
| > -Original Message-
| > From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]]
| > Sent: Sunday, July 08, 2001 1:44 PM
| > To: PHP General List (E-mail)
| > Subject: [PHP] Question about how to do this...
| >
| > hey-
| >
| > so I want to have my site so that the urls are like
| /index.php?page=bio
| > 
| > the way I made the index.php so far is just one gigantic switch
| > statement...is there a better way to do it?
| >
| >
| > chris
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| >
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail:
| [EMAIL PROTECTED]
| >
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail:
[EMAIL PROTECTED]
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail:
[EMAIL PROTECTED]
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail:
[EMAIL PROTECTED]
|
|
|



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Question about how to do this...

2001-07-08 Thread Ben Bleything

Thanks, I was looking for that =>

Ben

-Original Message-
From: mike cullerton [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 10:01 PM
To: 'PHP General List (E-mail)'
Subject: Re: [PHP] Question about how to do this...

on 7/8/01 10:58 PM, Steve Werby at [EMAIL PROTECTED] wrote:

> "Ben Bleything" <[EMAIL PROTECTED]> wrote:
>> I believe (and I'm sure someone will correct me if I'm wrong) that
>> whenever you 'include' or 'require' a file, it drops to regular HTML
>> mode... so, yes, you will need to use 
>> tags at the ends =>
> 
> Think of the behavior of include() as copying the exact text from your
code
> in the include'd file and pasting it as is into the calling code...a
la
> paper and scissors.  There is no special transformation.  So if the
code in
> the include'd file would have needed PHP codes if it was directly
within the
> calling code then it needs it in the include'd file too and if it
wouldn't
> have in the calling code then it won't in the include'd file.

from http://php.net/include

An important note about how this works is that when a file is
include()ed or
require()ed, parsing drops out of PHP mode and into HTML mode at the
beginning of the target file, and resumes again at the end. For this
reason,
any code inside the target file which should be executed as PHP code
must be
enclosed within valid PHP start and end tags.

 -- mike cullerton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] command output

2001-07-09 Thread Ben Bleything

Couldn't you just 
echo `traceroute $ipgoeshere`;
??

Ben

-Original Message-
From: Ker Ruben Ramos [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 09, 2001 8:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] command output

ey guys.. anyone know of doing something like with
net.yahoo.com/cgi-bin/trace.sh?ip_here .. something that prints out
every
result of the traceroute command... not showing the result after command
exited


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP as a shell script

2001-07-09 Thread Ben Bleything

It's simple.  Find your php binary (or build one if you don't have
one)... I think 'which php' will find it.

Then, write a php file with '#!/path/to/php -q' at the top.  Use any one
of the various execution methods to run your programs.  Done!

I've been doing this for quite a while.  I find it easier than
'traditional' shell scripting =>

More questions?  Ask!
Ben

-Original Message-
From: Kevin Pratt [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 09, 2001 10:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP as a shell script

Can anyone direct me to a place where I can read up on how to use php as
a
shell scripting language?


Thanks Kevin
Ouelong Group
www.ouelong.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Hiding password in a class file (object-oriented programming)?

2001-07-09 Thread Ben Bleything

put  tags around the file you include, and it
will parse it as PHP =>

I'm doing this now.  I have a bunch of files in a subdir
of the published directory, that contain functions and
definitions to do these things, and I include them at
the beginning of each file.  But, you do need 
tags around the includes.

=>
Ben

Quoting Thomas David Kehoe <[EMAIL PROTECTED]>:

> How do I put my password into an external
> file?
> 
> I have dozens of webpages with the line
> 
> mysql_connect (localhost, username,
> password);
> 
> What if I have to change my password?  Rather
> then change dozens of scripts,
> I want to put this line into an external file
> and call it with "include".
> 
> The problem is security.  If I make the file a
> class, then the file
> extension must be .inc.  Anyone can type in the
> URL and see the contents of
> the file.
> 
> I've tried these solutions, without success:
> 
> Changing the permission to "everyone-execute"
> and "owner-read" doesn't work,
> apparently because a .inc file is read, not
> executed.
> 
> Using the .php file extension (instead of .inc)
> executes the script when the
> URL is accessed.  The user sees nothing, if the
> file contains no HTML.  But
> class only works with the .inc extension.  Using
> "include" without making a
> class treats the file as HTML and it doesn't
> execute.
> -- 
> Thomas David Kehoe, author of
> "THE EVOLUTION OF INTIMATE RELATIONSHIPS"
> How Our Brains Are Hardwired For Relationships
> http://www.FriendshipCenter.com/TEIR/
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Running PHP as a cron job....

2001-07-09 Thread Ben Bleything

Someone yesterday also suggested putting them in a
web-accessible location, but having lynx come by and run
them.

That seemed pretty cool =>

Good luck,
Ben

Quoting "Chadwick, Russell" <[EMAIL PROTECTED]>:

> 
> You can still run php... I put my cron scripts
> in a directory on the web
> server, just makes sure they are all safe to run
> multiple times in case
> someone finds it
> 
> then make a script that for each entry in that
> directory invokes the script.
> mines in python so you just 
> import urllib
> 
> and then for each file in the directory
> urllib.urlopen (' name>/cron/.php')
> 
> and make it run your python script nightly and
> it will run any php script
> you put in that directory.
> 
> -Original Message-
> From: James, Yz [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 3:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Running PHP as a cron
> job
> 
> 
> Thanks for all of your help on this.  My host
> admin have informed me that
> php is installed only for the web, and not as a
> cgi, so that's what was
> going wrong (it wasn't down to my own naievity
> afterall.)
> 
> So, it's time to learn perl (or bash).
> 
> Thanks again for all your comments and help.
> 
> James.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Store uploaded files in MySQL-BLOB

2001-07-10 Thread Ben Bleything

Check out http://www.phpbuilder.com/columns/florian19991014.php3.  I've
been using it to maintain image galleries.  Works like a champ.

My guess would be that any version of php will upload multiple files...
just use multiple variables =>

Good luck and let us know,
Ben

-Original Message-
From: Tom Gitzinger [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 2:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Store uploaded files in MySQL-BLOB

Hi friends, 
 
could anybody tell me how I best store one or several uploaded files in
a
MySQL database (as a BLOB). I use PHP 3. 
Let's say I have the variable $userfile. Is it possible to simply insert
this into the database?
$query = "INSERT INTO ... (file) VALUES (" . $userfile . ");
 
By the way: which version of PHP 3 do you need to upload several files
at
once?
 
Tom

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

GMX Tipp:

Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Store uploaded files in MySQL-BLOB

2001-07-10 Thread Ben Bleything

This won't work if they're binary files.  Also, for most binaries, it's
better to use LONGBLOB... much more flexibility.  But there's a bunch of
stuff to tweak to get it to work.

http://www.phpbuilder.com/columns/florian19991014.php3 has details.

Ben

-Original Message-
From: Adam [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 3:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Store uploaded files in MySQL-BLOB

I would suggest setting the database column to LONGTEXT instead of BLOB
since it can accomidate far more characters per entry.

As for the entry to the database through php, I'm not entirely sure what
method you're using to add these. Are they uploading their file and then
it
reads it as it exists on the server? Is it supposed to read a file they
specify with a browse but never actually upload it anywhere? It might be
better to just include a text field for them to cut+paste to in a form
if
it's nothing but text.

-Adam



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to fetch a "group by" Query?

2001-07-10 Thread Ben Bleything

Did you try 'SELECT categorie,item FROM your_table GROUP BY categorie'?

Ben

-Original Message-
From: Frédéric Mériot [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 5:41 AM
To: PHP General List
Subject: [PHP] How to fetch a "group by" Query?

Hello (again)

I've got a query which extract titles and categories with a group by on
the
categorie. Is there a simple way to display rows like this (without
doing a
second query ):

Categorie A
-titi
-toto
-tutu

Categorie B
-bibi
-nini
-fififi

Categorie C
-titi
-toto
-tutu

... etc

With cold fusion (for those who know) I want to do the same as 

Thanks




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] What the heck is this

2001-07-11 Thread Ben Bleything

Ack!  The travesty!  Opportunities for OOP are literally
everywhere!

=> =>
Ben

-Original Message-
From: Adam [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 12:26 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] What the heck is this

ahh so it's for classes, then i'm fine because i haven't fount a use for
that yet.

-Adam



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Wget and PHP

2001-07-16 Thread Ben Bleything

Do you mean to suck down the pre-interpreted scripts from a remote
server?
 
Can't be done.  The server interprets the scripts long before they ever
get put on the network.  Your best bet will be to e-mail the admin and
ask =>
 
Ben
 
-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 15, 2001 9:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Wget and PHP
 
Is there a utility available that will get PHP based websites?
Wget doesn't do it
 
TIA!
 
Clayton Dukes
CCNA, CCDA, CCDP, CCNP
Download Free Essays, Term Papers and Cisco Training from
http://www.gdd.net
 
 



[PHP] Request for help =>

2001-07-16 Thread Ben Bleything

Hey everybody,
 
I've been hacking away on some scripts to do various things (primarily,
a job listing and faculty listing database for my work, Oregon State
University), and I've got to admit, I'm pretty new to this stuff, and a
lot of it I'm just hacking away at.
 
For instance, today, I threw together some session stuff to verify users
yadda yadda yadda.  I see a lot of code come through the list that
looks. well, more defensive than mine.
 
I was wondering if someone (or a few people) might be so kind as to take
a look at my code and let me know if there are things that I'm missing,
doing wrong, or doing right.  Any bit of help would be appreciated.
 
Thanks very much,
Ben



RE: [PHP] string search

2001-07-18 Thread Ben Bleything

http://php.net/manual/en/function.strpos.php

-Original Message-
From: Joseph Bannon [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 16, 2001 7:46 AM
To: PHP (E-mail)
Subject: [PHP] string search

I need a search function (if statement) that performs a search on a
string
and if the string contains something like "aol.com", performs another
function. Can anyone help me? Thanks.

Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RPM Install #6 still doesn't work

2001-07-18 Thread Ben Bleything

Under RedHat 7.1, if you installed apache and php from the RPMs, you
should not have to change anything, other than maybe telling it to serve
up index.php pages.

The thing about MySQL from the RPM under that distro is that the server
is not started by default... if you haven't already, use 'chkconfig
--list' to confirm that it is actually running (I set it to run in
levels 345).

Later today, if you are still having problems, we can look into it more
=>

Ben

-Original Message-
From: Gaylen Fraley [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, July 14, 2001 3:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RPM Install #6 still doesn't work

Ok.  I've been in this industry for 32 years.  I've loved O/S2, hated
windoz
and been intrigued with *nix.  So, I have a successful web site and
server
under windoz/php/mysql and I decide to venture into RedHat Linux because
I
have heard some great things about it.

I get 7.0 and install it, virgin.  Apache and PHP work, but I was never
able
to get MySQL working, except from a command line.  So, after abut 17
hours
of frustration, I get 7.1 .  Apache is the only thing that works.  I was
able to get PHP working when I did an install from scratch (tarball).
But,
it seems as if the RPM should work.  I still could not get MySQL working
working.  It consistently gives an error 2002 / socket problem.

Right now I have a virgin Apache and PHP4 and MySwl install from the RPM
(7.1) and php will not work.  As far as I can tell, I have modified my
httpd.config in all the right places.  Please, could someone who has a
working install from the 7.1 RPM package, please post their httpd.conf
lines
that pertain to getting php to work?  Also, if their is a library that I
need to move around, please advise that too.

Thanks.  The MySQL problem would be a nice caveat if someone knows how
to
fix that too :)

Regards,

--
Gaylen
[EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] REGEXP

2001-07-18 Thread Ben Bleything

Why don't you explode(";",$header); ??

Ben

-Original Message-
From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, July 14, 2001 2:54 AM
To: php general list
Subject: [PHP] REGEXP

Hi,

I am trying to capture the Header from a mail for my webmail using php
and
pop3.  The header is something like this:
Content-Type: multipart/mixed;
 boundary="B42DA66C4EC07C9B572A58FC"

When I use preg_split("/[\d;]*/", $buffer), I get
Content-Type: multipart/mixed;

What I want is to return the whole line split by the ";".  I usually try
to avoid regexp (too lazy) but now I want to use it.  The final result I
would need is: B42DA66C4EC07C9B572A58FC so that I can search
in the body of the message for the rest of the parts.

Any pointers would be helpful.

Adrian


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Force new page in browser and wait commands

2001-07-19 Thread Ben Bleything

You could do something like print()'ing or echo()'ing whatever you want
into a file, and then sending a header("Location: newpage.php")... just
in case you haven't already figured out a solution.

By the way, this will not happen on the client end.  PHP is server
interpreted, so anything you do will be on the server.

Hope this helps.
Ben

-Original Message-
From: Hugh Danaher [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 4:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Force new page in browser and wait commands

Help, I'm new to php, and to writing software in general.  Enough said
on that.  What I want to do, is to have my program wait for user input
on a  and once data is submitted, to have the browser (IE5)
generate a new page.  Right now, my program runs straight through input
forms and appends everything to the existing page.  I now accomplish
this by running several connected php programs, but want to do it in one
program.  I've looked throughout the php manual and website but have yet
to find the right commands.
Your help is greatly appreciated.
Hugh


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] days

2001-07-19 Thread Ben Bleything

Could you please be quite a bit more specific?  It's difficult to
diagnose the problem without really knowing what it is =>

-Original Message-
From: Jeremy Morano [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 19, 2001 4:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] days


The employees here and I have noticed that we have a variable that works
when it wants to...
But for days at a time. One day it works fine all day. Another day it
fills
up with garbage instead of what its supposed toBut whats particular
about this is that it lasts all day. Good or bad, the behavior lasts all
dayCan anyone shed some light on this for us? We  are really
baffled!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Confirmation Requester

2001-07-19 Thread Ben Bleything

I'm not sure if this solution is not what you want to do or not... but
what I've done is to essentially send information identifying the info
to be deleted to another page (which you could pop up using jscript or
target="_blank"), which has yes or no buttons.  If you click the yes
button, it does its thing, then goes back to the original page.  If you
click no, it just goes back. 

I can send you the code if this fits, and sorry if it doesn't =>

Good luck,
Ben

-Original Message-
From: Dave Freeman [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 5:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Confirmation Requester

Hi All

I'm really not sure if this is php or, perhaps, javascript.

I have a php application in development.  On one page I have a list of 
information extracted from a mysql database.  I have links beside each 
line to edit or delete that informaiton (which calls a php function to
carry 
out the actual work).

I am trying to find a way to generate some sort of warning/confirmation
on 
the delete link.  ie. I want to give people a warning before they delete

information out of the database.

I know I can do this by using loading a form on the page and getting 
confirmation from it but I'm hoping to find a more elegant solution.

What I'd really like to do is get a windows-style requester appearing
with a 
warning and 'OK'/'Cancel' boxes.  If they select OK then I'll go ahead
and 
delete the data - if they select cancel I'll do nothing more.

Mostly what I'm trying to do is have that ok/cancel take place before I
do 
anything with the page currently being displayed.

Can anyone offer pointers to a method of achieving this?

CYA, Dave


---
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au  mailto:[EMAIL PROTECTED]
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Zip Code Locator?

2001-07-24 Thread Ben Bleything

You could write your own. . .

Just kidding... well, technically you could... but... that's not the
point.

http://sourceforge.net/projects/zipcodedb has a "Raw ZIP code dump"... It
has a little more data than just zip, city, state... I don't know what it
means, but maybe you would...

Sorry, it's the best I could do =>

Ben

On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote:

> Hi,
>
> Does anyone know where can I find documentation or example scripts for a zip code 
>locator. I'm looking for something that will list
> other zip codes within a number of miles radius of the zip specified.
>
> Thanks!
>
> Vince
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] telnetty/phpy/unixy thing

2001-07-24 Thread Ben Bleything

Hey all... I tried sending this earlier... accidentally sent it to
[EMAIL PROTECTED], then tried bouncing it to the write address...
anyway, apologies if it didn't work correctly.

Anyhoo...

I'm trying to get a piece of information from a server in the field that
responds to a certain command with a line of data... ie 'telnet machine
temp' and it gives back "MACHINE:75.3" (temperature).

Anyway, there's a bunch of other stuff you can do to it with rsh, but
that's not directly important.  I'm trying to build a web interface to
control these machines.  Basically, I need to have PHP call 'telnet
machine temp' and have it feed out whatever the machine returns...

I've tried exec(), system(), passthru(), and backticks, all without
success.  I imagine that the reason for this is that telnet isn't routing
it's stuff to STDOUT (or whatever it is that php reads from in this
situation).

Now, get this.  If I use my php binary (shell scripting with php!  wh00!)
it works dandy... the temp gets passed on, yadda yadda yippy.  But the
second you try from a web browser, no dice.

Now, I may be completely off track here... it may be that for some reason
that I don't understand, telnet isn't actually outputting anything... I
suspect it is, though.

So... any ideas how I can get what I want?

Thanks,
Ben


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Destroy object

2001-07-24 Thread Ben Bleything

My guess would be you can unset() it... but, hey.. it's a guess.

On Mon, 23 Jul 2001, ROsen wrote:

> Hi,
> how can I destroy an object created with "new" ?
>
> Thanks,
> Rosen
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] highlighting keywords problem

2001-07-24 Thread Ben Bleything

Why not do something that parses the text, and put's  tags
around the text, and use a stylesheet to highlight it?

The problem (that I can find) is that you are using eregi_replace(), which
is case-insensitive.  You may need to do something like strpos() to find
the beginning and ends of the word, and using eregi_replace() to replace
the the spaces on either side of it with " " and " ".

I have a killer headache right now, otherwise I'd write some code =>
Sorry!

Good luck,
Ben

On Mon, 23 Jul 2001, Christian Dechery wrote:

> I want to highlight some keywords in a text without losing its case.
>
> How do I do that? I have something like the following:
>
>   $keyword="something here";
>
>   ob_start("highlight_keyword");
>   ?>
>   just some text
>   to get it to grab the text and highlight it
>
>   the keyword is right now... check it out
>   Something Here, see? it's with a different case...
>  ob_end_flush();
>
>   function highlight_keyword($buffer)
>   {
>   global $keyword;
>
>   return eregi_replace($keyword,"".$keyword."",$buffer);
>   }
>
> the problem is that it's going to give me "...something here, see?
> it's with a different case...", with a lowercased keyword... I want to
> preserve the case of the found text... any ideas
> 
> . Christian Dechery (lemming)
> . http://www.tanamesa.com.br
> . Gaita-L Owner / Web Developer
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Execution Functions

2001-07-24 Thread Ben Bleything

check http://www.php.net/manual/en/features.safe-mode.php  I suspect that
the problem is that the files you are trying to run are not owned by the
same user as the webserver user... that page should give you details on
this.

Good luck,
Ben

On Tue, 24 Jul 2001 [EMAIL PROTECTED] wrote:

> Hello all,
>
> I'm discovering the joys of PHP as supplied by RH on their 7.1 release.
> Actually, everything about it is SO much nicer than ASP or pure Perl.  (Not
> to take anything away from either--PHP's just a LOT easier to get hold of!)
>
> I'm running PHP as an Apache module (default RedHat installation) but I did
> turn Safe Mode on.  None of the execution functions work at all, though.
> The Safe Mode directory is set to /usr/local/bin and the script I want to
> run is (also) in that directory.  No matter how I approach it, the system()
> or passthru() functions apparently execute nothing and return nothing.  Not
> even an error message or warning of any kind.  (Backticks give a decidedly
> pointed message in Safe Mode, though:  "No can do" as I would expect).
>
> How DO I step out of a PHP page and execute a script or command?  And would
> that method be safe to give to "regular" users?  There is no mention in the
> manual (to which I constantly refer) nor in any place on the php.net site to
> tell me how this should "REALLY" work.
>
> Any advice would be appreciated.  This is the last stumbling block to
> converting my web-portal 100% to PHP.
>
> Best regards,
> Bill
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php in html-- what gives?

2001-07-24 Thread Ben Bleything

Put it in a .php file.  Your webserver probably doesn't interpret PHP in
HTML files (as is proper).  If it MUST be in a HTML file, you'll have to
set up your webserver to interpret php in html files... that process
depends on your webserver.

Ben

On Tue, 24 Jul 2001, CGI GUY wrote:

> I'm trying to test the following:
>
> I have created a simple cookie script:
>
>  if (!IsSet($session)) {
> $cookievalue = md5(uniqid(rand()));
> setcookie('session', $cookievalue, mktime
> (8,0,0,7,31,2001));
> } else {
> mail("[EMAIL PROTECTED]", "cookie", $session);
> }
> ?>
>
> I have placed it in an html page, at the very top (no
> spaces, lines, etc.), and have left no lines/spaces
> between the '?>' and '' tags. Yet the script
> does not execute (nor does it return an error of any
> kind). What gives?!?!
>
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] The BIG Question

2001-07-25 Thread Ben Bleything

It can be used for (nearly) anything, it seems.

Sure, making dynamic web sites is cool... not necessarily database driven,
but perhaps driven by user input.

I'm currently using PHP as my primary shell scripting language... I have a
collection of scripts that manipulate directories full of digital images
that I've taken (or scanned from my film photography)...

I can be used to create web-based interfaces to traditionally command-line
tasks... for instance, another project I'm working on (that unfortunately
will need to be moved to java due to the need for multiple threads and
draw-anywhere capabilities) is a website that monitors machines on my
network that are out in the field... queries them for the temperature,
status of some services, etc etc... the command execution functions
(system(), exec(), etc) really make PHP incredibly powerful.

What else?  Do you have a particular application that you think might be
able to use php for?

Ben

On Wed, 25 Jul 2001, Kyle Smith wrote:

> Ok this is the big question, in-depth could someone tell me what PHP could be used 
>for other than aking databases (which i canT do)
>
> Thanks
> -legokiller666-
> http://www.StupeedStudios.f2s.com
> New address new site
>
> ICQ: 115852509
> MSN: [EMAIL PROTECTED]
> AIM: legokiller666
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Please Please Pleeeeaaaaaaaaaasssssssseeeeeee

2001-07-27 Thread Ben Bleything

There are a wealth of available scripts at other websites...
www.hotscripts.com for instance... I find it unlike at this point that
anybody will send you anything... Just go there, or to SourceForge, and
you'll find all you need.

Ben

-Original Message-
From: Kyle Smith [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 27, 2001 5:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Please Please Plaaeee

Can everybody please send me a simple script they have made it doesnt
matter what, i just need some material to learn from, i learn better
hands on.


-legokiller666-
http://www.StupeedStudios.f2s.com
New address new site

ICQ: 115852509
MSN: [EMAIL PROTECTED]
AIM: legokiller666




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTTP header question.

2001-07-29 Thread Ben Bleything

Hey all,

I want to craft a header such that it seems to the page that data has
been POST'ed to it... Here's the situation:  I'm writing a login page to
my application, and if they log in incorrectly, I want the page to
redisplay, but I want it to throw out an error message.  I'm currently
doing it by 

header("Location: login.php?failure=true");

but I'd like to make it transparent.  Any ideas?

Thanks,
Ben


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: HTTP header question.

2001-07-29 Thread Ben Bleything

I'm fully aware of that.  The issue is not the refreshing (that works
fine)...

Here's a little more detail:

if(!$login)
{
if($failure)
// complain

// show the form
}
else
{
if(user_is_good)
// take them to the next page
else
// complain
}

The //complain in the else section is this:

Unset($login); // so it won't try to authenticate again
$failure = true; // so the form knows to complain
header("Location: login.php");

Okay.  So, just to clear things up, I'm not sending anything before
this.  This happens IMMEDIATELY after the user clicks on Submit...

What I'm looking for is a way to do this such that the user does not see
anything more than http://host.name.here/rams/login.php in their address
bar when it failed... doing it the way I show above does not work, and
the alternative ( header("Location: login.php?failure=true") ) does not
satisfy my requirement.

So... anybody else?

Ben

-Original Message-
From: Jacques [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 29, 2001 5:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: HTTP header question.

"Ben Bleything" <[EMAIL PROTECTED]> wrote in message
01c11891$447271c0$0201a8c0@allegro">news:01c11891$447271c0$0201a8c0@allegro...
> Hey all,
>
> I want to craft a header such that it seems to the page that data has
> been POST'ed to it... Here's the situation:  I'm writing a login page
to
> my application, and if they log in incorrectly, I want the page to
> redisplay, but I want it to throw out an error message.  I'm currently
> doing it by
>
> header("Location: login.php?failure=true");
>
> but I'd like to make it transparent.  Any ideas?
>
> Thanks,
> Ben

You cannot send ANY text or html tag (even a space ) before usin header
function.
If you have to get something displayed.
I suggest to use then :
 echo "";

Regards,
Jacques



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: HTTP header question.

2001-07-29 Thread Ben Bleything

That seems much more complicated than I need.

I understand that the POST operation stores the data from the form in
the message headers... I just need to know which headers, so I can use
that information to write my own... I basically want to make it seem as
if the $failure var was POST'ed back to the page.

I'm having NO luck whatsoever with the HTTP RFC's... too thick =>

Thanks,
Ben

-Original Message-
From: Philip Murray [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 29, 2001 6:06 PM
To: Ben Bleything
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: HTTP header question.

Quoting Ben Bleything <[EMAIL PROTECTED]>:
> I'm fully aware of that.  The issue is not the refreshing (that works
> fine)...
> 
> Here's a little more detail:
> 
> if(!$login)
> {
>   if($failure)
>   // complain
> 
>   // show the form
> }
> else
> {
>   if(user_is_good)
>   // take them to the next page
>   else
>   // complain
> }
> 
> The //complain in the else section is this:
> 
> Unset($login); // so it won't try to authenticate again
> $failure = true; // so the form knows to complain
> header("Location: login.php");
> 
> Okay.  So, just to clear things up, I'm not sending anything before
> this.  This happens IMMEDIATELY after the user clicks on Submit...
> 
> What I'm looking for is a way to do this such that the user does not
see
> anything more than http://host.name.here/rams/login.php in their
address
> bar when it failed... doing it the way I show above does not work, and
> the alternative ( header("Location: login.php?failure=true") ) does
not
> satisfy my requirement.
> 
> So... anybody else?
> -

How about using javascript?

For example



[...any other data you want...]



<!--
document.forms[0].submit()

// or document.forms['loginFailure'].submit();
// -->


It's untested, but you get the idea.

Cheers

-- 

 -  -- -  -   -
Philip Murray - [EMAIL PROTECTED]
http://www.open2view.com - Open2View.com
- -  -- -   -


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Generating mysql statement from php return an error :-(

2001-07-29 Thread Ben Bleything

I _believe_ (not totally sure) that mysql_query() can only handle one
statement at a time, and if you need to execute multiple, you will need
to use more than one mysql_query() statements.  It's a bummer =>  I have
all sorts of problems with it.

What's up with your return e-mail address?  It's a pain in the ass for
all mails to you bouncing...

Ben

-Original Message-
From: Jacques [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 29, 2001 5:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Generating mysql statement from php return an error :-(

Hi,
I'm using a table in my session to store my variable to generate later
my
sql statements.
Until now... nothing very weird !
But when I want to generate my sql statement. I've got an error after
the
first line where I put a comma
" ; " to make a difference within my statements.


this is a portion of my code :
 $query.="Insert into product
(id_quote,item,description,quantity,unit_price,ext_price,lead) values
('$QUOTE_NUMBER' , '".$TABLE_QUOTE_PRODUCT[$y]["item"]."' ,
'".$TABLE_QUOTE_PRODUCT[$y]["description"]."',
  '".$TABLE_QUOTE_PRODUCT[$y]["qty"]."' ,
'".$TABLE_QUOTE_PRODUCT[$y]["unitprice"]."' ,
  '".$TABLE_QUOTE_PRODUCT[$y]["extprice"]."' ,
'".$TABLE_QUOTE_PRODUCT[$y]["leadtime"]."');\n";
 }
 $result=mysql_query($query);

If I have only one line in my sql and I remove the ; it works.
but If I add the ; to separate two sql lines error !

Any idea how I can resolve this problem ?

Regards,
Jacques



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HTTP header question.

2001-07-29 Thread Ben Bleything

All I want to do is output "Authentication failed" above the form if
they type in invalid credentials.  I want to do it by passing a header
that contains the same information as if there were a form submitted
that contained a field name "failed" and value "true".  Aside from this
one application, I can think of many other places where this would be
valuable.

Am I being unclear?  It seems that my question was not understood.
Please let me know so I can try to re-explain.

Thanks,
Ben

-Original Message-
From: Dave VanAuken [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 29, 2001 7:16 PM
To: Ben Bleything; [EMAIL PROTECTED]
Subject: RE: [PHP] HTTP header question.

what is the logic behind requiring the header?

for example, to avoid using cookies and yet ensuring security, we pass a
loginkey for all pages.

every page has
include('securitycheck.php');
which parses the loginkey, uncompresses/decode it to get the userid and
timestamp, and prompts for a login if the last access was too old (say
10 min).

the security check displays the login screen if no key is available or
key is
expired, and exits, preventing display of the remainder of the page

ifthe key is valid, it updates the key for the current time (reset the
expire
counter so to speak) and displays the page iwth all URL's conyaining the
encoded
key.

you end up with one additional line of code per page (which we include
as part
of site template)

unless you are looking for something else entirely and I am missing the
point
(entirely possible).

Dave

>-Original Message-
>From: Ben Bleything [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, July 29, 2001 8:48 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] HTTP header question.
>
>
>Hey all,
>
>I want to craft a header such that it seems to the page that data has
>been POST'ed to it... Here's the situation:  I'm writing a login page
to
>my application, and if they log in incorrectly, I want the page to
>redisplay, but I want it to throw out an error message.  I'm currently
>doing it by
>
>   header("Location: login.php?failure=true");
>
>but I'd like to make it transparent.  Any ideas?
>
>Thanks,
>Ben
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail:
[EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HTTP header question.

2001-07-29 Thread Ben Bleything

THANK YOU.  Finally.

Unfortunately, in brief tests, I can't get it to work, but I will
continue to beat on it.  That's exactly what I was getting at.

I found some info on the internet regarding what the headers that POST
sends are... you can see it at http://opop.nols.com/write/HTTP.html.
Hope this helps everybody out.

Thanks,
Ben

-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 29, 2001 8:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] HTTP header question.

The way that I did it was by using sessions which if you have a login
you
are probably using anyways.  One of my session variables is "message".
That
way I can pass messages back and forth to pages, reinitialize them after
the
message has been received, etc etc etc.  If you REALLY want to use
headers
this is what Lawrence Sheed (thanks Lawrence) sent me:

header "POST /index.php3 HTTP/1.1";
header "Host: $host";
header "Content-type: application/x-www-form-urlencoded" ;
header "Content-length: ". strlen ($data);
header "Connection: close\n\n";  //may only need one, can't remember if
header postpends \n
//Now print variables
//var1=information&var2=more
//for each var to submit
header "$$var1=$var1&$$var2=$var2";

I eventually went a different route, but he said this emulates a POST.
Good
luck.. I hope I understand and I hope it helps


> 
> All I want to do is output "Authentication failed" above the form if
> they type in invalid credentials.  I want to do it by passing a header
> that contains the same information as if there were a form submitted
> that contained a field name "failed" and value "true".  Aside from
this
> one application, I can think of many other places where this would be
> valuable.
> 
> Am I being unclear?  It seems that my question was not understood.
> Please let me know so I can try to re-explain.
> 
> Thanks,
> Ben
> 
> -Original Message-
> From: Dave VanAuken [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 29, 2001 7:16 PM
> To: Ben Bleything; [EMAIL PROTECTED]
> Subject: RE: [PHP] HTTP header question.
> 
> what is the logic behind requiring the header?
> 
> for example, to avoid using cookies and yet ensuring security, we pass
a
> loginkey for all pages.
> 
> every page has
> include('securitycheck.php');
> which parses the loginkey, uncompresses/decode it to get the userid
and
> timestamp, and prompts for a login if the last access was too old (say
> 10 min).
> 
> the security check displays the login screen if no key is available or
> key is
> expired, and exits, preventing display of the remainder of the page
> 
> ifthe key is valid, it updates the key for the current time (reset the
> expire
> counter so to speak) and displays the page iwth all URL's conyaining
the
> encoded
> key.
> 
> you end up with one additional line of code per page (which we include
> as part
> of site template)
> 
> unless you are looking for something else entirely and I am missing
the
> point
> (entirely possible).
> 
> Dave
> 
>> -Original Message-
>> From: Ben Bleything [mailto:[EMAIL PROTECTED]]
>> Sent: Sunday, July 29, 2001 8:48 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] HTTP header question.
>> 
>> 
>> Hey all,
>> 
>> I want to craft a header such that it seems to the page that data has
>> been POST'ed to it... Here's the situation:  I'm writing a login page
> to
>> my application, and if they log in incorrectly, I want the page to
>> redisplay, but I want it to throw out an error message.  I'm
currently
>> doing it by
>> 
>> header("Location: login.php?failure=true");
>> 
>> but I'd like to make it transparent.  Any ideas?
>> 
>> Thanks,
>> Ben
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: HTTP header question.

2001-07-30 Thread Ben Bleything

If you all would like, I can post my code... I'm still looking for a
solution.

Matt has it right.  I'm trying to go for a more professional looking
thing... and I do want it to display a notice when the login fails.  I
have thought of another way to do it... but it's not pretty, so I'm
still open to suggestions.  A while back I posted a pseudo-code
explanation of what it is... attached to this e-mail is the actual
page... Hopefully it will either shed some light on my predicament or
help you all to alert me to any major errors that are probably hiding in
there =>

Thanks a pile,
Ben


-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 8:05 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: HTTP header question.

below

>Some of the original message:
>> still don't see the need to pass as a header...
>>
>> you avoid the http://his.website.com/rams/login.php?failure=true as
you
>just get
>> login.php each time as far as the displayed URL.
>>
>> my opinion, let the scripting handle all the logic and ease off the
header
>> functions.
>
>The whole idea behind his point is so the user cannot see what's going
on
>behind the scenes.  It's just another method of making it look more
>professional.

I understand that much, but don't see why he would want to do a
header('filename') redirection at all in case of a failure?

>It's not really a case of headers, Ben just wanted to know if it is at
all
>possible to use PHP to keep the URL from showing the query as opposed
to
>having to use JavaScript or anything else.
>
>People kept giving him different solutions to something he didn't need
>solutions for -- he already had the verification and if-then's down in
the
>script... He just wanted one little thing about making the browser show
only
>the simple URL and not let it change.  That's all.   =)

Understood.  My point is that he appears to be using the wrong tool for
the job,
and solving a problem where if done otherwise would not exist.

My impression is he is posting a login to a page and redirecting back to
the
login page if it fails with a "failure notice".  Rather than that, my
suggestion
would be to keep the login page seperate, have it do the authentication,
and
only move from that page when it succeeds.  This also allows him to
reuse this
code as necessary, and removes the need for any passing of header
information,
thus no problem.

>What a confusing thread, eh?  hehe..  At least if someone wants to read
>something funny and understands the American Language, this is the
thread to
>read...

I think if he had posted the code from tha pages he is using, that would
have
clarified things greatly.

My mistake is taking his problem, and suggesting that he is trying to do
a big
workaround for a problem that if done differently wouldn't exist.  Why
reinvent
the wheel.  :)

Cheers

Dave


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


RE: [PHP] Re: HTTP header question.

2001-07-30 Thread Ben Bleything

Ahh, and a bit of clarification before you read the code, the page posts
to itself =>

Ben

-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 8:05 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: HTTP header question.

below

>Some of the original message:
>> still don't see the need to pass as a header...
>>
>> you avoid the http://his.website.com/rams/login.php?failure=true as
you
>just get
>> login.php each time as far as the displayed URL.
>>
>> my opinion, let the scripting handle all the logic and ease off the
header
>> functions.
>
>The whole idea behind his point is so the user cannot see what's going
on
>behind the scenes.  It's just another method of making it look more
>professional.

I understand that much, but don't see why he would want to do a
header('filename') redirection at all in case of a failure?

>It's not really a case of headers, Ben just wanted to know if it is at
all
>possible to use PHP to keep the URL from showing the query as opposed
to
>having to use JavaScript or anything else.
>
>People kept giving him different solutions to something he didn't need
>solutions for -- he already had the verification and if-then's down in
the
>script... He just wanted one little thing about making the browser show
only
>the simple URL and not let it change.  That's all.   =)

Understood.  My point is that he appears to be using the wrong tool for
the job,
and solving a problem where if done otherwise would not exist.

My impression is he is posting a login to a page and redirecting back to
the
login page if it fails with a "failure notice".  Rather than that, my
suggestion
would be to keep the login page seperate, have it do the authentication,
and
only move from that page when it succeeds.  This also allows him to
reuse this
code as necessary, and removes the need for any passing of header
information,
thus no problem.

>What a confusing thread, eh?  hehe..  At least if someone wants to read
>something funny and understands the American Language, this is the
thread to
>read...

I think if he had posted the code from tha pages he is using, that would
have
clarified things greatly.

My mistake is taking his problem, and suggesting that he is trying to do
a big
workaround for a problem that if done differently wouldn't exist.  Why
reinvent
the wheel.  :)

Cheers

Dave


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] THE END OF the HTTP header question.

2001-07-30 Thread Ben Bleything

We can all shut the hell up about this now!  It's wonderful!

Found a class on px.sklar.com that does what I need.  It may not be the
most elegant solution in some people's opinion, but I'm happy with it.
Do with it as you will.

http://px.sklar.com/code-pretty.html?code_id=313

Still curious about what everyone thinks =>

Ben

-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 4:16 PM
To: 'Dave'; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: HTTP header question.

Ahh, and a bit of clarification before you read the code, the page posts
to itself =>

Ben

-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 8:05 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: HTTP header question.

below

>Some of the original message:
>> still don't see the need to pass as a header...
>>
>> you avoid the http://his.website.com/rams/login.php?failure=true as
you
>just get
>> login.php each time as far as the displayed URL.
>>
>> my opinion, let the scripting handle all the logic and ease off the
header
>> functions.
>
>The whole idea behind his point is so the user cannot see what's going
on
>behind the scenes.  It's just another method of making it look more
>professional.

I understand that much, but don't see why he would want to do a
header('filename') redirection at all in case of a failure?

>It's not really a case of headers, Ben just wanted to know if it is at
all
>possible to use PHP to keep the URL from showing the query as opposed
to
>having to use JavaScript or anything else.
>
>People kept giving him different solutions to something he didn't need
>solutions for -- he already had the verification and if-then's down in
the
>script... He just wanted one little thing about making the browser show
only
>the simple URL and not let it change.  That's all.   =)

Understood.  My point is that he appears to be using the wrong tool for
the job,
and solving a problem where if done otherwise would not exist.

My impression is he is posting a login to a page and redirecting back to
the
login page if it fails with a "failure notice".  Rather than that, my
suggestion
would be to keep the login page seperate, have it do the authentication,
and
only move from that page when it succeeds.  This also allows him to
reuse this
code as necessary, and removes the need for any passing of header
information,
thus no problem.

>What a confusing thread, eh?  hehe..  At least if someone wants to read
>something funny and understands the American Language, this is the
thread to
>read...

I think if he had posted the code from tha pages he is using, that would
have
clarified things greatly.

My mistake is taking his problem, and suggesting that he is trying to do
a big
workaround for a problem that if done differently wouldn't exist.  Why
reinvent
the wheel.  :)

Cheers

Dave


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] THE END OF the HTTP header question.

2001-07-30 Thread Ben Bleything

If you try to do this and find that it's barfing out the headers, use
this:

include "include/class.http_post.php";
$poster = new http_post();
$poster->set_action("http://$HTTP_HOST$RAMS_ROOT/login.php";);
$poster->set_element("failure",true);
$poster->set_enctype("multipart/form-data");
$return = $poster->send(0);
echo eregi_replace("^HTTP.*html>", "", $return);

Just thought I'd stick a little hint along with it.  Sorry for the
long-windedness of this thread =>

Ben

-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 4:55 PM
To: [EMAIL PROTECTED]
Cc: 'Matt Rogers'; 'Matt Greer'
Subject: [PHP] THE END OF the HTTP header question.

We can all shut the hell up about this now!  It's wonderful!

Found a class on px.sklar.com that does what I need.  It may not be the
most elegant solution in some people's opinion, but I'm happy with it.
Do with it as you will.

http://px.sklar.com/code-pretty.html?code_id=313

Still curious about what everyone thinks =>

Ben

-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 4:16 PM
To: 'Dave'; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: HTTP header question.

Ahh, and a bit of clarification before you read the code, the page posts
to itself =>

Ben

-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 8:05 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: HTTP header question.

below

>Some of the original message:
>> still don't see the need to pass as a header...
>>
>> you avoid the http://his.website.com/rams/login.php?failure=true as
you
>just get
>> login.php each time as far as the displayed URL.
>>
>> my opinion, let the scripting handle all the logic and ease off the
header
>> functions.
>
>The whole idea behind his point is so the user cannot see what's going
on
>behind the scenes.  It's just another method of making it look more
>professional.

I understand that much, but don't see why he would want to do a
header('filename') redirection at all in case of a failure?

>It's not really a case of headers, Ben just wanted to know if it is at
all
>possible to use PHP to keep the URL from showing the query as opposed
to
>having to use JavaScript or anything else.
>
>People kept giving him different solutions to something he didn't need
>solutions for -- he already had the verification and if-then's down in
the
>script... He just wanted one little thing about making the browser show
only
>the simple URL and not let it change.  That's all.   =)

Understood.  My point is that he appears to be using the wrong tool for
the job,
and solving a problem where if done otherwise would not exist.

My impression is he is posting a login to a page and redirecting back to
the
login page if it fails with a "failure notice".  Rather than that, my
suggestion
would be to keep the login page seperate, have it do the authentication,
and
only move from that page when it succeeds.  This also allows him to
reuse this
code as necessary, and removes the need for any passing of header
information,
thus no problem.

>What a confusing thread, eh?  hehe..  At least if someone wants to read
>something funny and understands the American Language, this is the
thread to
>read...

I think if he had posted the code from tha pages he is using, that would
have
clarified things greatly.

My mistake is taking his problem, and suggesting that he is trying to do
a big
workaround for a problem that if done differently wouldn't exist.  Why
reinvent
the wheel.  :)

Cheers

Dave


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] storing array in mysql

2001-07-30 Thread Ben Bleything

To be honest, I don't know what this line does:

Echo $db_result->lists_actual

I also noticed something... it appears that the serialized data is
incorrect... are you sure you copied the whole thing?  I think there
should be more to that... is it possible that your MySQL datatype is too
small to store the serialized data?

Hope this helps =>
Ben

-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 8:34 PM
To: Ben Bleything
Cc: PHP Mailing List
Subject: RE: [PHP] storing array in mysql

Hi Ben,

This is a section of the insert statement I used ($lists_actual is the
array):

$lists_actual  = serialize($lists_actual);
Then : INSERT INTO $table (lists_actual) VALUES
('$lists_actual')

When I look in the db there is serialized data there - it appears like
this:
a:4:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"3";i:3;s:1:"

When I output this to the screen I get the same as above. But when I
try to echo the unserialized result I get nothing. I am using:
echo $db_result->lists_actual (nothing is returned)

If I try to display the result using foreach I get the warning
"Invalid argument supplied for foreach()". I am using:
$array = unserialize($db_result->lists_actual);
foreach($array AS $val) {
echo $val;
};

I hope the problem is clear, I am thoroughly confused at this stage! I
should admit that I am only just getting used to arrays...

Matthew

-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 3:03 PM
To: 'Matthew Delmarter'
Subject: RE: [PHP] storing array in mysql


Have you tried serialize()'ing it before storing and then
unserialize()'ing it afterwards?

http://www.php.net/serialize
http://www.php.net/unserialize

=>
Ben

-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 8:10 PM
To: PHP Mailing List
Subject: [PHP] storing array in mysql

Hi all,

I want to store the results of a multiple select input box in a mysql
db. The box looks like this:

name


I cannot seem to store the array in a database and then output the
result using foreach. Any tips?

Regards,

Matthew Delmarter
Web Developer

AdplusOnline.com Ltd
www.adplusonline.com

Phone: 06 8357684
Cell: 025 2303630


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] storing array in mysql

2001-07-30 Thread Ben Bleything

Whee!  I'm a moron!

Anyhoo, I've always used mysql_fetch_array() =>

So... Like I said about the serialized data getting truncated... that's
still my best guess =>

Ben

-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 9:10 PM
To: 'Matthew Delmarter'
Cc: 'PHP Mailing List'
Subject: RE: [PHP] storing array in mysql

To be honest, I don't know what this line does:

Echo $db_result->lists_actual

I also noticed something... it appears that the serialized data is
incorrect... are you sure you copied the whole thing?  I think there
should be more to that... is it possible that your MySQL datatype is too
small to store the serialized data?

Hope this helps =>
Ben

-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 30, 2001 8:34 PM
To: Ben Bleything
Cc: PHP Mailing List
Subject: RE: [PHP] storing array in mysql

Hi Ben,

This is a section of the insert statement I used ($lists_actual is the
array):

$lists_actual  = serialize($lists_actual);
Then : INSERT INTO $table (lists_actual) VALUES
('$lists_actual')

When I look in the db there is serialized data there - it appears like
this:
a:4:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"3";i:3;s:1:"

When I output this to the screen I get the same as above. But when I
try to echo the unserialized result I get nothing. I am using:
echo $db_result->lists_actual (nothing is returned)

If I try to display the result using foreach I get the warning
"Invalid argument supplied for foreach()". I am using:
$array = unserialize($db_result->lists_actual);
foreach($array AS $val) {
echo $val;
};

I hope the problem is clear, I am thoroughly confused at this stage! I
should admit that I am only just getting used to arrays...

Matthew

-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 3:03 PM
To: 'Matthew Delmarter'
Subject: RE: [PHP] storing array in mysql


Have you tried serialize()'ing it before storing and then
unserialize()'ing it afterwards?

http://www.php.net/serialize
http://www.php.net/unserialize

=>
Ben

-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 8:10 PM
To: PHP Mailing List
Subject: [PHP] storing array in mysql

Hi all,

I want to store the results of a multiple select input box in a mysql
db. The box looks like this:

name


I cannot seem to store the array in a database and then output the
result using foreach. Any tips?

Regards,

Matthew Delmarter
Web Developer

AdplusOnline.com Ltd
www.adplusonline.com

Phone: 06 8357684
Cell: 025 2303630


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Visual Login

2001-07-31 Thread Ben Bleything

One way would be to use a database (of any type) to store
username/password data, present the user with a form to fill out,
authenticate against the database, set session variable if they are
valid, and let them use the application.. if they fail, do whatever.

=>  EXTREMELY brief.  Can give more detail if you like =>

Ben

-Original Message-
From: Steve Wright [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 31, 2001 4:01 PM
To: PHP List
Subject: [PHP] Visual Login

How can i go about doing a visual login on a web page... instead of the
pop up window i have at the min like with .htaccess ??

I apologize if this is in the manual, but i couldn't see it

Kind Regards,

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sorry... but a good PHP editor for Linux/Unix

2001-07-31 Thread Ben Bleything

I can't speak for terminal usage... I use pico and or vi... pico on
console, vi over ssh.

When working locally, I use nedit (www.nedit.org) on *nix (with custom
PHP syntax highlighting) and EditPlus on windows.

Good luck,
Ben

-Original Message-
From: Augusto Cesar Castoldi [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 31, 2001 7:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Sorry... but a good PHP editor for Linux/Unix

Sorry about talking about this subject, but a really wanna know if any
one
nows a good editor for linux/unix.

Sometimes I need to work by SSH and I have to use the program pico.

I can't use vi, to use it, i'll need to see the manual!!

thanks,

Augusto



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Visual Login

2001-08-01 Thread Ben Bleything

VERY good point I forgot to mention =>  

By the way, that's what the session variables are for... you just check
every page if they are set correctly, and go with it =>

Good luck,
Ben

-Original Message-
From: scott [gts] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 01, 2001 7:33 AM
To: php
Subject: RE: [PHP] Visual Login

if you go this route, you would, however, have to check
for valid-login users on every page that you want to
have security on.

> -Original Message-----
> From: Ben Bleything [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP] Visual Login
> 
> One way would be to use a database (of any type) to store
> username/password data, present the user with a form to fill out,
> authenticate against the database, set session variable if they are
> valid, and let them use the application.. if they fail, do whatever.
> 
> =>  EXTREMELY brief.  Can give more detail if you like =>
> 
> Ben


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Installing PHP probs

2001-08-01 Thread Ben Bleything

AND, you can fairly easily configure it to deny all connections coming
from anywhere but localhost =>

Ben

-Original Message-
From: scott [gts] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 01, 2001 12:08 PM
To: php
Subject: RE: [PHP] Installing PHP probs

you dont have to have a server running.

just use the CGI binary.

...and if you're using windows - why not just use apache...
it's free, easier to install/configure than PWS (yech!)
and it has *MUCH* better documentation and support
than microsoft can ever offer.  :-)



> -Original Message-
> From: Matt Greer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 3:14 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Installing PHP probs
> 
> 
> on 8/1/01 9:57 PM, Kyle Smith at [EMAIL PROTECTED] wrote:
> 
> > well what if i want to set up the computer im using to be able to
run php
> > acripts, but NOT be an internet server?
> > 
> You can't. You need a webserver on your computer to run php locally.
If
> you're running windows98/me you can use Personal Web Server, which is
free
> and included on your Win98/me cd. It's no big deal once its set up,
you
> still see the scripts' output through your web browser. You can forget
about
> the web server once its in place and working.
> 
> Matt
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] weird behavior with a form

2001-08-03 Thread Ben Bleything

Submit should get set when you click the submit button... it is not used
anywhere else...

Again, it works when you click the button, just not when you press
enter...

=>
I'm going to try what Richard just suggested, and I'll get back to you.

Ben

-Original Message-
From: Queen [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 03, 2001 5:31 PM
To: Benjamin Bleything
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] weird behavior with a form

On Fri, 3 Aug 2001, Benjamin Bleything wrote:

>Date: Fri, 3 Aug 2001 17:05:54 -0700 (PDT)
>From: Benjamin Bleything <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [PHP] weird behavior with a form
>
>Okay... so this is sorta off topic... but the form is generated by a
>script =>
>
>Anyway, for some reason, when I fill in a form on my site and press
enter,
>it doesn't actually submit the form and do the processing like it is
>supposed to... it should be throwing some information into the
database.
>Instead, it seems to just be reloading the page.
>
>Source is below... if anybody has any idea, I would appreciate... I
>imagine I'm just doing something stupid wrong.
>

Does $submit get unset in any of your include files? Does it get set at
all? Can you acess $submit through $GLOBALS[$submit]?

--- SOURCE ---
>
>include_once("../include/definitions.inc");
>include_once("../include/functions.inc");
>
>// Check to make sure they're allowed to be here
>session_start();
>check_access($session_data);
>
>// They haven't clicked anything, so show the form
>if(!$submit)
>{ ?>
>
>
>Add Genre
>
>
>
>function verify()
>{
>   if(document.forms[0].name.value=="")
>   {
>   alert("The name field cannot be blank!");
>   return false;
>   }
>
>   return true; // fallthrough
>}
>
>
>
>
>AddGenre
>
>
>
>
>
>
>   Name: 
>   
>
>
>
>   
>   
>
>
>
>
>
>
>
>
>
>
>   setup_db_connection('w') or die("Could not connect to
database!");
>
>   //Stick it in
>   $query = "INSERT INTO genres (name) VALUES ('$name');";
>   mysql_query($query);
>   header("Location: genres.php");
>}
>?>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] chmod

2001-08-05 Thread Ben Bleything

Chmod -R 77x test

The 'x' in the above statement is the world-permissions... 

Execute is worth 1, Write is worth 2, Read is worth 4.  If you add up
the numbers for the permissions you want, you get the result, so 775
would be full access for owner and group, and read/execute for world.

Hope this helps =>

Ben

-Original Message-
From: Manu Verhaegen [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, August 05, 2001 4:29 AM
To: 'Php-General (E-mail)
Subject: [PHP] chmod

I have the following question :
I have a directory on my ftp server and i want give access to this
directory
by usergroup ( the name of the group is test )

We have do the following :
% vadduser

user Configuration
--
Username:   test
Password:   test
Fullname:   test
UID:35647
Groups: test
Home Dir:   /ftp/test

% dir
drwxrwxr-x c myname vkernel512 AUG 5 11:27 test

I want give read,write,exectute access for this directory to the group
test
how can i do this?
chmod 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] array + checkbox

2001-08-07 Thread Ben Bleything

try this:

If( strcmp($voorraad[1],'on') == 0 )
// it's checked
else
// it's not

Good luck,
Ben

-Original Message-
From: Tijmen Hennink [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 06, 2001 1:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] array + checkbox

Hi All,

I've the following weird problem.
I have a form which contains an array with values of some checkboxes.
This is the HTML-part: 

if checked or 


Now I want to check which of the checkboxes are really checked.
So I've got the following PHP code:
  if(count($voorraad[1])>0) {
echo "VOORRAAD NEE";
}
else {
echo "VOORRAAD JA";
}

I've tried it with isset($voorraad[1]), count, is_null($voorraad[1]) but
all the functions doesn't work.
Does anyone see what I'm doing wrong??

Met vriendelijke groet/with kind regards,
 
Tijmen Hennink


[EMAIL PROTECTED]
Medi@connect


 
Dit e-mail bericht is uitsluitend bestemd voor de geadresseerde(n).
Gebruik van deze informatie door andere dan de geadresseerde
is verboden.
Het is evenmin toegestaan om deze informatie openbaar te maken,
te vermenigvuldigen, te verspreiden of te verstrekken aan derden. Aan
dit
bericht kunnen geen rechten worden ontleend.
Indien u dit mailtje heeft ontvangen terwijl het niet aan u gericht was,
reply richting mij en verwijder vervolgens de email en uitgeprinte
versies
van dit mailtje.
 


This e-mail is intended for the use of the addressee(s) only and may
contain privileged, confidential, or proprietary information that is
exempt
from disclosure under law.  If you have received this message in error,
please inform me promptly by reply e-mail, then delete the e-mail and
any printed copy.
 
Thank you.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]