[PHP] Re: Function Call Line Number

2001-11-13 Thread _lallous

I guess that is not possible with PHP yet.

"Jason G." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> Does anyone know of a way, that from within a function, you can determine
> what line number and file the function was called on?
>
> I did try:
> function myfunc($lineno = __LINE__)
> {
> echo $lineno;
> }
> but this just outputted the very line that __LINE__ resides on.
>
> This would be very helpful in displaying sensible error messages, like the
> native php functions do.
>
> Thanks,
>
> -Jason Garber
> IonZoft.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] Re: can php detect whether an email address is a valid one?

2001-11-13 Thread dav

You can do it like:
1) Have php send the email with a particulare return reply so that wrong
email addresses get sent back to it
2) Configure procmail to launch a php script when an email is received on
that account (the "return" one)
3) Write the php script (SCRIPT NOT WEB) to parse the email reiceved and
delete the email-address from database.

What I did once was to:
Write an email (mime format, with colors and images) to many persons with
"Hello $customer_name".
But the system had to be controlled by the business boss :) So he could
write an email to a "bot", and the "bot" converted all the $some_thing into
text taken from database. It's much similar than what it looks...

Ju
"Alex Chau" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a php script sending newsletter to a mailing list time by time,
> but some emails are no longer exist, so I need to remove them manually.
> Can php detect whether an email address is a valid one, then remove it
> from the list automatically? no matter before or after the newsletter
> has sent.
>
> Thanks in advance.
>
>



-- 
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 php detect whether an email address is a valid one?

2001-11-13 Thread Daniel Masur

get the mx record:


function checkmail ($mailtocheck) {
if (eregi("^[_\.0-9a-z-]+@([0-9a-z][-0-9a-z\.]+)\.([a-z]{2,3}$)",
$mailtocheck, $check))
{
if (getmxrr($check[1].".".$check[2],$temp))
{
return true;
}
return false; // kein mx gefunden
}
else
{
return false; // syntax fehler
}
}


"Martin Towell" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You can set the "Error-To: " header to some email address that runs a
script
> to remove the email address - other that that, no, not that I know of.
>
> -Original Message-
> From: Alex Chau [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 14, 2001 1:31 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] can php detect whether an email address is a valid one?
>
>
> I have a php script sending newsletter to a mailing list time by time,
> but some emails are no longer exist, so I need to remove them manually.
> Can php detect whether an email address is a valid one, then remove it
> from the list automatically? no matter before or after the newsletter
> has sent.
>
> Thanks in advance.
>
>
>
> --
> 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] Re: Frames and Sessions

2001-11-13 Thread dav

I agree :-))
J
"Jimmy Elab" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Michael Hall wrote:
> > can't figure out how I'm going to maintain a session across the three
> > seperate HTML files in the frameset.
>
> You don't! PHP and your browser will do it for you. It doesn't matter
> whether you're in frames or not. All that matters is the cookie that is
> automagically generated by the session manager and is sent to the server
> on each request.
>
> You only need a call to session_start() in each file that relies on the
> session variables, and a session.register('varname') for each var once
> you've decided you want it being saved accross pages.



-- 
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] Re: Checkboxes / Undefined Variables

2001-11-13 Thread dav

define it :-))
boolean name_of_chechbox_3;
for example

J
<[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
.net...
> In am HTML form, checkboxes NOT checked are not passed
> to the PHP script called by the form.
>
> Therefore, if $name_of_chechbox_3 is not passed but it's
> used in the PHP script, it results in "Warning:
> Undefined Variable".
>
> How can I avoid this?
>
> Thanks!
>
> A. F. Rodriguez
> ([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] Checkboxes / Undefined Variables

2001-11-13 Thread Jason G.

your error reporting must be set to E_ALL.

a very simple way is:
$checkbox_3 = isset($checkbox_3);

Now, $checkbox_3 will be either TRUE or FALSE with no errors!

-Jason Garber
IonZoft.com

At 06:03 AM 11/14/2001 +, [EMAIL PROTECTED] wrote:
>In am HTML form, checkboxes NOT checked are not passed
>to the PHP script called by the form.
>
>Therefore, if $name_of_chechbox_3 is not passed but it's
>used in the PHP script, it results in "Warning:
>Undefined Variable".
>
>How can I avoid this?
>
>Thanks!
>
>A. F. Rodriguez
>([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] Function Call Line Number

2001-11-13 Thread Jason G.

Hello,

Does anyone know of a way, that from within a function, you can determine 
what line number and file the function was called on?

I did try:
function myfunc($lineno = __LINE__)
{
echo $lineno;
}
but this just outputted the very line that __LINE__ resides on.

This would be very helpful in displaying sensible error messages, like the 
native php functions do.

Thanks,

-Jason Garber
IonZoft.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] Checkboxes / Undefined Variables

2001-11-13 Thread Martin Towell

use : @$name_of_chechbox_3   to suppress warnings
or at the start of the file do :
if (!isset($name_of_chechbox_3))  $name_of_chechbox_3 = "";
or something similar

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 5:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Checkboxes / Undefined Variables


In am HTML form, checkboxes NOT checked are not passed 
to the PHP script called by the form.

Therefore, if $name_of_chechbox_3 is not passed but it's 
used in the PHP script, it results in "Warning: 
Undefined Variable".

How can I avoid this?

Thanks!

A. F. Rodriguez
([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] Checkboxes / Undefined Variables

2001-11-13 Thread afrodriguez

In am HTML form, checkboxes NOT checked are not passed 
to the PHP script called by the form.

Therefore, if $name_of_chechbox_3 is not passed but it's 
used in the PHP script, it results in "Warning: 
Undefined Variable".

How can I avoid this?

Thanks!

A. F. Rodriguez
([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] is_null misses spaces... SOLUTION!

2001-11-13 Thread Spunk S. Spunk III

Ahh...
and the winner is empty().

Thanks Christian for this elusive answer and everyone else for their input.

Spunk


> 
> I need to check variables for blank values but it appears that is_null and
> =="" return true if there is a space.
> 
> Any other suggestions?
> 
> 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]




[PHP] using sessions and include

2001-11-13 Thread jtjohnston

Martin, are ya out there? Does anyone know anything about sessions? (An
post & reply would be handy :)

I am using session_register. I have:

http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/index.html
http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/index.html.phps

Which submits to:

http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/postcard.php

http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/postcard.phps

postcard.php  is supposed to pass data to display_image.php

http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/display_image.php

http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/display_image.phps

The problem is that display_image.php loses my data coming from
index.html

}else{
include "display_image.php";
}

But when I try to debug and remove the \\ on lines 3 & 4

//include("display_image.php");
//exit;

display_image.php will display my data correctly from index.html

Can anyone help? What am I doing wrong?

John




[PHP] Re: EXPIRATION PROBLEM; PLEASE HELP ME !!!

2001-11-13 Thread Fred

Your login.php uses the POST method to send the username and password to
main.php.  In general this is a good idea, because you do not want someone's
password available from the URL.  If you used the GET method you would not
have a problem with the page expiring, but the password would be available
in the URL.

I do not know of any way to get around this problem, browsers do not
automatically resend POST data as a security measure.  This is a good thing.

In order to get around this you need to change the logic of your scripts.
Put the verification and session code in login.php.  Login.php should check
for the username and password variables.  If they do not exist just show the
login form.  If they do exist, check them for validity and if they are valid
register the session and print a link to main.php or use javascript to
redirect to that page.

Fred
Gustavo Luis Pereira Verly <[EMAIL PROTECTED]> wrote in
message 013d01c16c82$90327a20$8300a8c0@STONEHENGE">news:013d01c16c82$90327a20$8300a8c0@STONEHENGE...
>
> - Original Message -
> From: "Gustavo Luis Pereira Verly" <[EMAIL PROTECTED]>
> To: "PHP" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 13, 2001 2:26 PM
> Subject: [PHP] Expiration problem
>
>
> > Hi everybody, this is my first time writing in this list.
> >
> > I have the next problem:
> >
> > I have a page called
> >
> > login.php
> >
> > and when I log in,  there's a new page who receive the user and the
> > password, and this page is called
> >
> > main.php
> >
> > This page, check if the user have a valid account and a password; and if
> > this is OK, then make a session for the user. This work OK; but, from
the
> > main.php I go to a link in the same page, but with a new parameter, for
> > example:   and the page showme another
screen
> > (because this new screen only appears when I put the "option=1" as
> > parameter); and this also OK.
> > The problem appears when I make click on the BACK BUTTON from my
browser,
> > and the browser go back from "main.php?option=1" to the "main.php" page,
> and
> > get me a error:
> > the page was expire, you have to click REFRESH button on
your
> > browser to send the information again.
> > (( or sometime like that; I don't remember the exacts words, 'cause is a
> > spanish Internet Explorer ))
> >
> > Can somebody helpme with this problem?
> >
> > Thanks
> >
> > Gustavo Pereira
> >
> >
> > --
> > 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] Parsing XML

2001-11-13 Thread Ben Gollmer

Oops, forgot a line:

On Tuesday, November 13, 2001, at 08:58 PM, Ben Gollmer wrote:

> Do something like this:
>
> function parseXML($xmlFile)
> {
global $attributeArray;

>   $theParser = xml_parser_create();
>   xml_set_element_handler($theParser, "startElementHandler", 
> "endElementHandler");
>   //parse your XML here
>
>   return $attributeArray;
> }
>
> function startElementHandler($theParser, $theTag, $theAttrs)
> {
>   global $attributeArray;
>
>   //do your attribute handling here; maybe something like this
>   $attributeArray[] = $theAttrs;
> }
>
>
> Ben
>
>
> On Tuesday, November 13, 2001, at 07:34 PM, Michael Harris wrote:
>
>> Can anybody tell me if there is a way to build an array or some other
>> means of collecting the attributes from the Start Element Handler so I
>> can return them back to my main application?
>>
>> Thanks for any help,
>> -Mike
>>
>>
>> --
>> 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: php-list-
>> [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] Parsing XML

2001-11-13 Thread Ben Gollmer

Do something like this:

function parseXML($xmlFile)
{
$theParser = xml_parser_create();
xml_set_element_handler($theParser, "startElementHandler", 
"endElementHandler");
//parse your XML here

return $attributeArray;
}

function startElementHandler($theParser, $theTag, $theAttrs)
{
global $attributeArray;

//do your attribute handling here; maybe something like this
$attributeArray[] = $theAttrs;
}


Ben


On Tuesday, November 13, 2001, at 07:34 PM, Michael Harris wrote:

> Can anybody tell me if there is a way to build an array or some other
> means of collecting the attributes from the Start Element Handler so I
> can return them back to my main application?
>
> Thanks for any help,
> -Mike
>
>
> --
> 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] Security concerns with Virtual Hosts

2001-11-13 Thread Rasmus Lerdorf

That or open_basedir.  Both can be configured in the php.ini file.  It's 
not a compile-time thing.

-Rasmus

On Tue, 13 Nov 2001, Michael A. Peters wrote:

> Ah, OK. So I need to complain that their php is not compiled with the
> --with-safe_mode option.
> 
> Thanks!
> 
> On Tue, 13 Nov 2001 18:09:41 -0800 (PST)
> Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> 
> > This is what safe_mode addresses.  
> > 
> > On Tue, 13 Nov 2001, Michael A. Peters wrote:
> > 
> > > I am not going to mention which host I'm using for obvious reasons.
> > > 
> > > However, I'm wondering if it is just a mis-configuration, or if it is a
> > > weakness in php.
> > > 
> > > With this host, you initially have the same database password to the MySQL
> > > database as you do to the account. It is wise to change both, and to
> > > change them to different passwords, but this is the real world, baby...
> > > 
> > > Anyway, when setting up phpbb I didn't like the fact that the password is
> > > stored within the document root. That's easy enough to change- move it
> > > outside, and run a sed script to change the include path for that file.
> > > 
> > > I then thought of another issue. My MySQL database name that was given to
> > > me is identical to my username to log into this server. So I did a SHOW
> > > DATABASES in MySQL and got myself a collection of all the user names on
> > > the system.
> > > 
> > > Then I wrote a script to wget http://servername/~username/phpbb/config.php
> > > What it got wasn't useful, but did tell me the file was there.
> > > 
> > > So I wrote a php script in my directory to sizeof
> > > /home/username/public_html/phpbb/config.php and then send the text/plain
> > > mime type, and read the file.
> > > 
> > > Right there in my browser I had the a text file containing some guys MySQL
> > > password, which could be his login password as well.
> > > 
> > > There were about a dozen sites running phpbb in a directory called phpbb
> > > with the config file where I expected it to be.
> > > 
> > > The web server MUST have permission to read that file since php is an
> > > apache module.
> > > 
> > > What I would like to know is if there an apache directive you can put in a
> > > VirtualHost container that tells the php engine that it is NOT allowed to
> > > read files or include files or etc. outside of a certain directory.
> > > 
> > > A directive that could look like this:
> > > phpreadroot "/home/username"
> > > 
> > > There's still the problem of the exec() function, which could circumvent
> > > that, but exec() I think can be turned off (and probably should on
> > > multiuser systems)
> > > 
> > > As a user, if I tried to cat the file, I would be rejected. But the web
> > > server would not be. I assume this same type of vulnerability exists with
> > > cgi-bin as well, although I think there are solutions where the script
> > > runs with the users permissions, not the web servers's. I don't know
> > > cgi-bin security that well.
> > > 
> > > I guess the bottom line is be sure to have your database password
> > > different from your login password, and rename and/or move any config
> > > files that contain the database password, but is there any way within php
> > > to limit the ability of people to do what I did?
> > > 
> > > There's a bazillion user accounts on this machine, most of them porn
> > > sites, and lets just say I don't personally believe that "porn webmasters"
> > > will follow the common courtesy rules.
> > > 
> > > Hell, I guess even I didn't technically- since I did extract someone's
> > > database password.
> > > 
> > > Any ideas? 
> > > 
> > 
> 
> 
> 


-- 
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] Security concerns with Virtual Hosts

2001-11-13 Thread Michael A. Peters

Ah, OK. So I need to complain that their php is not compiled with the
--with-safe_mode option.

Thanks!

On Tue, 13 Nov 2001 18:09:41 -0800 (PST)
Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:

> This is what safe_mode addresses.  
> 
> On Tue, 13 Nov 2001, Michael A. Peters wrote:
> 
> > I am not going to mention which host I'm using for obvious reasons.
> > 
> > However, I'm wondering if it is just a mis-configuration, or if it is a
> > weakness in php.
> > 
> > With this host, you initially have the same database password to the MySQL
> > database as you do to the account. It is wise to change both, and to
> > change them to different passwords, but this is the real world, baby...
> > 
> > Anyway, when setting up phpbb I didn't like the fact that the password is
> > stored within the document root. That's easy enough to change- move it
> > outside, and run a sed script to change the include path for that file.
> > 
> > I then thought of another issue. My MySQL database name that was given to
> > me is identical to my username to log into this server. So I did a SHOW
> > DATABASES in MySQL and got myself a collection of all the user names on
> > the system.
> > 
> > Then I wrote a script to wget http://servername/~username/phpbb/config.php
> > What it got wasn't useful, but did tell me the file was there.
> > 
> > So I wrote a php script in my directory to sizeof
> > /home/username/public_html/phpbb/config.php and then send the text/plain
> > mime type, and read the file.
> > 
> > Right there in my browser I had the a text file containing some guys MySQL
> > password, which could be his login password as well.
> > 
> > There were about a dozen sites running phpbb in a directory called phpbb
> > with the config file where I expected it to be.
> > 
> > The web server MUST have permission to read that file since php is an
> > apache module.
> > 
> > What I would like to know is if there an apache directive you can put in a
> > VirtualHost container that tells the php engine that it is NOT allowed to
> > read files or include files or etc. outside of a certain directory.
> > 
> > A directive that could look like this:
> > phpreadroot "/home/username"
> > 
> > There's still the problem of the exec() function, which could circumvent
> > that, but exec() I think can be turned off (and probably should on
> > multiuser systems)
> > 
> > As a user, if I tried to cat the file, I would be rejected. But the web
> > server would not be. I assume this same type of vulnerability exists with
> > cgi-bin as well, although I think there are solutions where the script
> > runs with the users permissions, not the web servers's. I don't know
> > cgi-bin security that well.
> > 
> > I guess the bottom line is be sure to have your database password
> > different from your login password, and rename and/or move any config
> > files that contain the database password, but is there any way within php
> > to limit the ability of people to do what I did?
> > 
> > There's a bazillion user accounts on this machine, most of them porn
> > sites, and lets just say I don't personally believe that "porn webmasters"
> > will follow the common courtesy rules.
> > 
> > Hell, I guess even I didn't technically- since I did extract someone's
> > database password.
> > 
> > Any ideas? 
> > 
> 


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
http://24.5.29.77:10080/

-- 
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] Re: Frames and Sessions

2001-11-13 Thread jimmy elab

Michael Hall wrote:
> can't figure out how I'm going to maintain a session across the three
> seperate HTML files in the frameset.

You don't! PHP and your browser will do it for you. It doesn't matter
whether you're in frames or not. All that matters is the cookie that is
automagically generated by the session manager and is sent to the server
on each request.

You only need a call to session_start() in each file that relies on the
session variables, and a session.register('varname') for each var once
you've decided you want it being saved accross pages.

-- 
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] It doesn't cost you anything, why not try it!

2001-11-13 Thread John Huggins

Well, well.  They got around the USMail fraud problem so this now only
violates several dozen laws.

> -Original Message-
> From: Saint [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 13, 2001 1:24 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] It doesn't cost you anything, why not try it!
>
>
>   You will find the Legal Info at the bottom
> 
>
> RE: PayPal Account
>
> This is something that I wouldn't normally even look at, except
> that, I read
> an article in the Wall Street Journal about PayPal and x.com.
>
> There have been other articles written about these companies in other well
> recognized journals. Because I'm a member of PayPal, I knew that this was
> real and would work.
>
> If you need to make a few thousand dollars REALLY FAST, then please
> take a
> moment to read this simple program I'm sharing with you.
>
> THIS IS THE FASTEST, EASIEST PROGRAM YOU WILL EVER
> DO!!!
>
>


-- 
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] Non-PHP question

2001-11-13 Thread Martin Towell

OK, just found it!

window.pageYOffset

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 1:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Non-PHP question


Sorry about asking a non-PHP question here, but I thought that since I've
been helping others recently, you'll give me a bit of lee-way.

In IE, to find out how far down a page is scrolled, you can do
"document.body.scrollTop"
what's the equivalent in Netscape 6 ?

Thanks in advance
Martin



Re: [PHP] for loop problem?

2001-11-13 Thread jimmy elab

Tyler Longren wrote:
> 
> Here's something interesting though.  There's an id field that's set to
> AUTO_INCREMENT.  

Yep, and that's one thing I've been looking at. See, I find it strange
that you need an KEY idpass (id, passcode(245)) when the ID is
quaranteed to be unique in itself.

Funny... Would not explain why you get more, I'd rather expect you to
get fewer entries.

Anyway. Try this: Drop the passcode VARCHAR and make it fixed CHAR(10).
It seems like MySQL can't keep up with the speed of your inserts, and
varchar is obnoxiously slow.

-- 
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 php detect whether an email address is a valid one?

2001-11-13 Thread Martin Towell

You can set the "Error-To: " header to some email address that runs a script
to remove the email address - other that that, no, not that I know of.

-Original Message-
From: Alex Chau [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 1:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] can php detect whether an email address is a valid one?


I have a php script sending newsletter to a mailing list time by time, 
but some emails are no longer exist, so I need to remove them manually.
Can php detect whether an email address is a valid one, then remove it 
from the list automatically? no matter before or after the newsletter 
has sent.

Thanks in advance.



-- 
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] can php detect whether an email address is a valid one?

2001-11-13 Thread Alex Chau

I have a php script sending newsletter to a mailing list time by time, 
but some emails are no longer exist, so I need to remove them manually.
Can php detect whether an email address is a valid one, then remove it 
from the list automatically? no matter before or after the newsletter 
has sent.

Thanks in advance.



-- 
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] Non-PHP question

2001-11-13 Thread Martin Towell

Sorry about asking a non-PHP question here, but I thought that since I've
been helping others recently, you'll give me a bit of lee-way.

In IE, to find out how far down a page is scrolled, you can do
"document.body.scrollTop"
what's the equivalent in Netscape 6 ?

Thanks in advance
Martin



Re: [PHP] some questions on sessions (long)...

2001-11-13 Thread Christian Dechery

But what about the session? It get's registered... doesn't sessions also 
need to send header information?
it gets registered... it just doesn't persist...

At 17:07 12/11/01 -0800, you wrote:
>Your problem probably is including the miec.php from the .shtml
>document.  Does the .shtml document send any output to the browser before
>including your .php script?  If so, you're not going to be able to send
>any cookies from the .php script.  Once any standard output makes it to
>the browser (including any leading whitespace), no more headers can be
>sent to the browser.  PHP sends cookies to the browser as header data.
>Hence, if your .shtml document has any output before your .php document is
>included, your session cookie cannot be sent.
>
> ~Chris   /"\
>  \ / September 11, 2001
>   X  We Are All New Yorkers
>  / \ rm -rf /bin/laden
>
>On Mon, 12 Nov 2001, Christian Dechery wrote:
>
> > I've recently had a problem with sessions, and came up with a problem that
> > apparently has no solution...
> >
> > I want to understand why EXACTLY it does't work...
> >
> >  From what I understand about sessions (reading PHP Docs), cookies are
> > default and URLs holding the session_id are used if the cookies can be used
> > to get the current session_id right?
> >
> > So if, there's a cookie indicating a session, PHP will detect it and the
> > session will work beatifully..
> > If when a session is created, a cookie cannot be set, then the URLs come
> > into play.. right?
> >
> > -- I'm I right so far? --
> >
> > So, I can only presume, that whenever I can see those URLs with
> > session_ids, this means that no cookie was created... and if one of those
> > URLs is clicked, the session will persist, since the URL is carrying the
> > session_id.
> >
> > Well, now to the problem with no solution... I've described it here on the
> > list a couple of times... sorry if this is getting too annoying.
> >
> > 1 - I have a PHP script, that uses sessions, it's called miec.php
> >   miec.php uses both cookies and sessions... the cookie holds the
> > user_id and the session holds an array of every
> >   product the user has seen, so they won't repeat... of course, the
> > session only gets initialized if the cookie with the
> >   user id is found... if not, a login form is shown...
> > 2 - I have a html file, demo.shtml, which with SSI includes miec.php
> >   The inclusion works fine, even the cookie with the user id gets
> > detected and the username is shown as expected
> >
> > Now, the problem. If I run miec.php solo on the browser, everything works
> > perfectly.
> > But if I call demo.shtml, something goes wrong, and I want to know what.
> >
> > When demo.shtml is called, the cookie works (the user id is detected) and
> > the session gets started. I can see the URLs with the session id AND the
> > session file in my webserver. The problem is that, the session doesn't
> > persist, each time I reload demo.sthml, a new session is created.
> >
> > Now get this... if I call miec.php and then demo.shtml, everything works.
> > Why? My guess is, miec.php running solo is able to create the cookie with
> > the session id, while when SSI included it can't, which explain the URLs.
> >
> > Obviously, URLs (example: demo.shtml?sID=3897348734) aren't helpful here,
> > since it's a html file, and it can't parse the query string to send the
> > variable to an SSI included php file.
> >
> > But why the cookie can't be created? Headers aren't the problem... if a
> > session can be created and the session vars registered it's because the
> > headers have not been sent, so why can't a cookie be created in this
> > conditions.
> >
> > Does anyone has a clue??
> >
> > p.s: the problem is solved, I force the user to login in case of miec.php
> > is SSI included, which works, since the session is created elsewhere
> > (login.php).
> >
> > _
> > . Christian Dechery
> > . . Gaita-L Owner / Web Developer
> > . . http://www.webstyle.com.br
> > . . http://www.tanamesa.com.br
> >
> >
> > --
> > 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]


_
. Christian Dechery
. . Gaita-L Owner / Web Developer
. . http://www.webstyle.com.br
. . http://www.tanamesa.com.br


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

RE: [PHP] take date and convert to day of year

2001-11-13 Thread Martin Towell

I'm running on WinNT4 w/ PHP 4.0.6 and the code I supplied came back with
333
and for today I get 317
dunno why you're getting 364
anyone, any eye-dears ??

-Original Message-
From: sundogcurt [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 12:14 PM
To: GENERAL PHP LIST
Subject: Re: [PHP] take date and convert to day of year


I have tried to implement your code Martin, and I do thank you VERY MUCH 
for the help, but your code seems to have the same trouble as mine, it 
doesn't matter what date I start with, I end up with 364 as the day of 
the year, I am on win32 though I don't know if that matters.

Here is what I tried:


//FORMAT HAS TO BE date("d-M-Y");
//GET DAY OF YEAR FOR DOB utime = UNIX time
$utine = strtotime("30-Nov-1971");
$dob = getdate($utime);
$dobnum = $dob['yday'];
print "dob is " . $dobnum . "";

//GET DAY OF YEAR FOR TODAY
//$today = date("d-M-Y");
$utoday = strtotime(date("d-M-Y"));
$today = getdate($utoday);
$todaynum = $today['yday'];
print "today is " . $todaynum . "";

There should be a different of about 17 days here right? Not if this is 
returning 364 for $dobnum, then it's 48!


[EMAIL PROTECTED] wrote:

>looking at the manual, getdate() is meant to be passed a unix time stamp,
>so, you'll need to use strtotime() first thus:
>
>$utime = strtotime("30-Nov-1971");
>$dob = getdate($utime);
>$dobnum = $dob['yday'];
>print $dobnum;
>
>Notice I changed the format of the date, when I tried using the original
>format, strtotime() complained, saying it couldn't convert it.
>
>Martin T
>
>-Original Message-
>From: sundogcurt [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, November 14, 2001 7:57 AM
>To: GENERAL PHP LIST
>Subject: [PHP] take date and convert to day of year
>
>
>Hi guys, I know that you can take todays date and display it as the 
>numeric day of the year, 1 - 365 / 0 - 364 etc.
>But can you take a date such as (November-30-1971) and convert that to 
>the numeric day of the year?
>
>I have been trying to do this but have had no joy, I don't think my code 
>is even close.
>
>$dob = getdate("Nov-30-1971");
>$dobnum = $dob['yday'];
>print $dobnum;
>
>$dob 'should' be an array and 'yday' should be the numeric value for the 
>day of the year, right?!?
>
>This is what I am trying, and how I understand it, using 'yday' should 
>give you basically the same output as date ("z");
>
>What I would like is the ability to convert any date to the days numeric 
>value. Any help would be GREATLY appreciated.
>
>(C:
>
>



-- 
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] Sending mail from PHP with SMTP server requiring authentication

2001-11-13 Thread Richard Heyes

> Hi gang,
> Any one tried to send mail through PHP using mail() through an smtp server
> which requires authentication ?

http://www.phpguru.org/scripts/10/

--
Richard Heyes
"If you have any trouble sounding condescending,
find a Unix user to show you how it's done." - Scott Adams


-- 
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] Security concerns with Virtual Hosts

2001-11-13 Thread Rasmus Lerdorf

This is what safe_mode addresses.  

On Tue, 13 Nov 2001, Michael A. Peters wrote:

> I am not going to mention which host I'm using for obvious reasons.
> 
> However, I'm wondering if it is just a mis-configuration, or if it is a
> weakness in php.
> 
> With this host, you initially have the same database password to the MySQL
> database as you do to the account. It is wise to change both, and to
> change them to different passwords, but this is the real world, baby...
> 
> Anyway, when setting up phpbb I didn't like the fact that the password is
> stored within the document root. That's easy enough to change- move it
> outside, and run a sed script to change the include path for that file.
> 
> I then thought of another issue. My MySQL database name that was given to
> me is identical to my username to log into this server. So I did a SHOW
> DATABASES in MySQL and got myself a collection of all the user names on
> the system.
> 
> Then I wrote a script to wget http://servername/~username/phpbb/config.php
> What it got wasn't useful, but did tell me the file was there.
> 
> So I wrote a php script in my directory to sizeof
> /home/username/public_html/phpbb/config.php and then send the text/plain
> mime type, and read the file.
> 
> Right there in my browser I had the a text file containing some guys MySQL
> password, which could be his login password as well.
> 
> There were about a dozen sites running phpbb in a directory called phpbb
> with the config file where I expected it to be.
> 
> The web server MUST have permission to read that file since php is an
> apache module.
> 
> What I would like to know is if there an apache directive you can put in a
> VirtualHost container that tells the php engine that it is NOT allowed to
> read files or include files or etc. outside of a certain directory.
> 
> A directive that could look like this:
> phpreadroot "/home/username"
> 
> There's still the problem of the exec() function, which could circumvent
> that, but exec() I think can be turned off (and probably should on
> multiuser systems)
> 
> As a user, if I tried to cat the file, I would be rejected. But the web
> server would not be. I assume this same type of vulnerability exists with
> cgi-bin as well, although I think there are solutions where the script
> runs with the users permissions, not the web servers's. I don't know
> cgi-bin security that well.
> 
> I guess the bottom line is be sure to have your database password
> different from your login password, and rename and/or move any config
> files that contain the database password, but is there any way within php
> to limit the ability of people to do what I did?
> 
> There's a bazillion user accounts on this machine, most of them porn
> sites, and lets just say I don't personally believe that "porn webmasters"
> will follow the common courtesy rules.
> 
> Hell, I guess even I didn't technically- since I did extract someone's
> database password.
> 
> Any ideas? 
> 


-- 
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] Security concerns with Virtual Hosts

2001-11-13 Thread Michael A. Peters

I am not going to mention which host I'm using for obvious reasons.

However, I'm wondering if it is just a mis-configuration, or if it is a
weakness in php.

With this host, you initially have the same database password to the MySQL
database as you do to the account. It is wise to change both, and to
change them to different passwords, but this is the real world, baby...

Anyway, when setting up phpbb I didn't like the fact that the password is
stored within the document root. That's easy enough to change- move it
outside, and run a sed script to change the include path for that file.

I then thought of another issue. My MySQL database name that was given to
me is identical to my username to log into this server. So I did a SHOW
DATABASES in MySQL and got myself a collection of all the user names on
the system.

Then I wrote a script to wget http://servername/~username/phpbb/config.php
What it got wasn't useful, but did tell me the file was there.

So I wrote a php script in my directory to sizeof
/home/username/public_html/phpbb/config.php and then send the text/plain
mime type, and read the file.

Right there in my browser I had the a text file containing some guys MySQL
password, which could be his login password as well.

There were about a dozen sites running phpbb in a directory called phpbb
with the config file where I expected it to be.

The web server MUST have permission to read that file since php is an
apache module.

What I would like to know is if there an apache directive you can put in a
VirtualHost container that tells the php engine that it is NOT allowed to
read files or include files or etc. outside of a certain directory.

A directive that could look like this:
phpreadroot "/home/username"

There's still the problem of the exec() function, which could circumvent
that, but exec() I think can be turned off (and probably should on
multiuser systems)

As a user, if I tried to cat the file, I would be rejected. But the web
server would not be. I assume this same type of vulnerability exists with
cgi-bin as well, although I think there are solutions where the script
runs with the users permissions, not the web servers's. I don't know
cgi-bin security that well.

I guess the bottom line is be sure to have your database password
different from your login password, and rename and/or move any config
files that contain the database password, but is there any way within php
to limit the ability of people to do what I did?

There's a bazillion user accounts on this machine, most of them porn
sites, and lets just say I don't personally believe that "porn webmasters"
will follow the common courtesy rules.

Hell, I guess even I didn't technically- since I did extract someone's
database password.

Any ideas? 
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
http://24.5.29.77:10080/

-- 
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] silly question

2001-11-13 Thread sundogcurt

Take care to be sure that you make the update, before the rest of the 
page loads, things happen in order, so it's almost like creating your 
page backwards (I just had that problem).
I can elaborate if you like.

(C:

[EMAIL PROTECTED] wrote:

>Hi list,
>
>I have PHP code to insert the result of a form into mysql. When I nedd to
>made an update, I pass an "id" in the url and use it to make the update
>query. The problem is after I click in the update button (input submit) my
>page refresh and came back in the same state, to see the changes I need to
>type in the url again with the parameter?? why?? There's a way to avoid this
>and get a new blank form page after the update?
>
>ps: I've stored the "id" in a input type hidden, so I could click the button
>and still have the id
>
>Thank's in advance
>
>Rodrigo Peres
>



-- 
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] Help! How do i mail a value from a mysql databse?

2001-11-13 Thread David Robley

On Wed, 14 Nov 2001 04:26, Raymond wrote:
> Hi!
>
> I'm trying to send a mail with password to the new user of my website,
> but . Does anyone know how to put the variable inside my mail?
>
> I have tried this:
>
> -->
> else {
>
> // sende kundeopplysninger til databasen
>
>   $db = mysql_connect("localhost", "root");
>
>   mysql_select_db("subway",$db);
>
>   $sql = "INSERT INTO nettkunder
> (fornavn,etternavn,firma,adresse,postnr,sted,telefon,epost) VALUES
> ('$fornavn','$etternavn','$firma','$adresse','$postnr','$sted','$telefo
>n','$ epost')";
>
>   $result = mysql_query($sql);
>
>   echo "Velkommen som kunde hos Subway.\n";
>
> }
>
>   $db = mysql_connect("localhost", "root");
>
>   mysql_select_db("subway",$db);
>
>
> $id = mysql_query("GET id FROM nettkunder WHERE epost = '$epost'",$db);
>
> mail("$epost", "Velkommen som kunde hos Subway", "Her har du ditt
> passord: $myrow["id"] \n God appetitt! Hilsen Subway");

The value you are passing in $myrow["id"] doesn't exist in your code. You 
need to do 

$myrow = mysql_fetch_row($id);

after your mysql_query to populate the row data. And your query should 
probably read "SELECT id FROM...

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Washed the cat - took HOURS to get the hair off my tongue!

-- 
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] fopen and paths

2001-11-13 Thread David Robley

On Tue, 13 Nov 2001 22:28, PACKER, Steffan wrote:
> Thanks but I am still having problems, $DOCUMENT_ROOT does not seem to
> work(I am using an NT4 server), I cannot use an absolute path as the
> content management software that is running has a tendency to strip
> them out!
>
> It seems (to me) that it is a precedence problem, as it does not look
> in the include_path first to see if the file exists but simply creates
> it in the active documents directory.
>
> Any ideas would be appreciated!
>
> Steffan
>
>
> -Original Message-
> From: David Robley [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 13, 2001 3:22 AM
> To: PACKER, Steffan; '[EMAIL PROTECTED]'
> Subject: Re: [PHP] fopen and paths
>
> On Tue, 13 Nov 2001 03:14, PACKER, Steffan wrote:
> > I am trying to log particular information in an access log and I need
> > it to be used on several pages all in different directories, I would
> > like the actual log to be stored in a directory called data in the
> > root directory of my web page. I using an include() on each page
> > where I would like the info logged.
> > I am using:
> > $log_fp = fopen("../data/access_log.txt", "a",1);
> > with the use_include_path set to 1.
> >
> > My problem is that a new file is being created in each directory that
> > the logging.inc file is added to.
> >
> > Can anyone help?
> > Steffan
>
> ../data/access_log.txt seems to be a relative address to me, pointing
> to the directory data which hangs off the parent of the current
> directory.
>
> Why not give full path information, so there is no ambiguity? Or use
> $DOCUMENT_ROOT for portability?

Well, what exactly is your include_path setting? $DOCUMENT_ROOT certainly 
works on a W98, I'll just fire up an NT4 w/station here and see Works 
a treat there. Are you by chance running php as a cgi - that may have a 
bearing? See what phpinfo has to say.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Help! I'm trapped in a Chinese computer factory!

-- 
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: Can If Else statements be split into code blocks??

2001-11-13 Thread Jack Dempsey

David's correct. The reason it wasn't working for you is that you didn't put
braces around the code you wanted executed in the if statement. Also, to
output large chunks of html in a simple manner with variables included, look
into "here docs". They look like this:


echo< Ok, I figured out that just using echo seems to be the best way to do
> this under PHP.  In ASP, you can end your code block and start in with
> HTML, but I couldn't get that to work with PHP.  However, I was able to
> just use the echo statement to get the conditional HTML I wanted to
> show up when the proper condition was met in the If Else statement.
>
> Brad
>
> "Brad Melendy" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hello,
> > I'm trying to execute some HTML in an IF ELSE statement.  I'm trying
> > something like:
> >
> >  > if (strstr($DomResults,$Match))
> > print "Congratulations!  $domain.$suffix is available!";
> > ?>
> > 
> >   
> > 
> >
> >  >else
> > print "Sorry, $domain.$suffix is already taken.";
> > ?>
> >
> > Basically, it works great without the form I'm trying to insert, but
> > with the form after the IF statement, it fails.  Is what I want to do
> > against
>
> the
>
> > rules?  I'm converting an ASP script I have to PHP and I have it all
>
> working
>
> > under ASP.  That means it should be eaiser with PHP right?  ;-)
> > Thanks in advance.
> >
> > ...Brad

You can drop in and out of php parsing, even in a control structure. So
something like


That

The Other


will work just fine.
--
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA

   Stop talking! I'm out of aspirin!

--
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: Can If Else statements be split into code blocks??

2001-11-13 Thread David Robley

On Wed, 14 Nov 2001 11:43, Brad Melendy wrote:
> Ok, I figured out that just using echo seems to be the best way to do
> this under PHP.  In ASP, you can end your code block and start in with
> HTML, but I couldn't get that to work with PHP.  However, I was able to
> just use the echo statement to get the conditional HTML I wanted to
> show up when the proper condition was met in the If Else statement.
>
> Brad
>
> "Brad Melendy" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hello,
> > I'm trying to execute some HTML in an IF ELSE statement.  I'm trying
> > something like:
> >
> >  > if (strstr($DomResults,$Match))
> > print "Congratulations!  $domain.$suffix is available!";
> > ?>
> > 
> >   
> > 
> >
> >  >else
> > print "Sorry, $domain.$suffix is already taken.";
> > ?>
> >
> > Basically, it works great without the form I'm trying to insert, but
> > with the form after the IF statement, it fails.  Is what I want to do
> > against
>
> the
>
> > rules?  I'm converting an ASP script I have to PHP and I have it all
>
> working
>
> > under ASP.  That means it should be eaiser with PHP right?  ;-) 
> > Thanks in advance.
> >
> > ...Brad

You can drop in and out of php parsing, even in a control structure. So 
something like


That

The Other


will work just fine.
-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Stop talking! I'm out of aspirin!

-- 
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] newbie question about odbc_connect

2001-11-13 Thread David Robley

On Wed, 14 Nov 2001 10:51, Johannes Ambrose wrote:
> Hi,
> I've been happily using mysql_connect() for various scripts on a linux
> box. Now I'd like to connect to a filemaker pro database using
> odbc_connect(). However, the response I get is "Call to undefined
> function".
>
> Do I need to compile odbc support? (I thought it was built in.)
>
> Is there an include file somewhere that I need to specifiy?
>
> regards
>
>
> --
> Johannes Ambrose
> Computer Systems Manager
> School of Life Sciences
> University of Queensland, Brisbane Australia
> ph: 07 3365 4826 fax:3365 1655 mob: 0401 714 835

You'll need to recompile and specify odbc support in your configure 
flags. You'll also need to get hold of some odbc software - check the 
manual for some sources at this link
 http://au2.php.net/manual/en/install.configure.php#install.configure.data
bases

There are several odbc options - I don't know which is better or worse 
but a search through the mail archives will probably turn up some recent 
discussion.


-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   I won't rise to the occasion, but I'll slide over to 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]




[PHP] Re: Can If Else statements be split into code blocks??

2001-11-13 Thread Brad Melendy

Ok, I figured out that just using echo seems to be the best way to do this
under PHP.  In ASP, you can end your code block and start in with HTML, but
I couldn't get that to work with PHP.  However, I was able to just use the
echo statement to get the conditional HTML I wanted to show up when the
proper condition was met in the If Else statement.

Brad

"Brad Melendy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I'm trying to execute some HTML in an IF ELSE statement.  I'm trying
> something like:
>
>  if (strstr($DomResults,$Match))
> print "Congratulations!  $domain.$suffix is available!";
> ?>
> 
>   
> 
>
> else
> print "Sorry, $domain.$suffix is already taken.";
> ?>
>
> Basically, it works great without the form I'm trying to insert, but with
> the form after the IF statement, it fails.  Is what I want to do against
the
> rules?  I'm converting an ASP script I have to PHP and I have it all
working
> under ASP.  That means it should be eaiser with PHP right?  ;-)  Thanks in
> advance.
>
> ...Brad
>
>



-- 
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] take date and convert to day of year

2001-11-13 Thread sundogcurt

I have tried to implement your code Martin, and I do thank you VERY MUCH 
for the help, but your code seems to have the same trouble as mine, it 
doesn't matter what date I start with, I end up with 364 as the day of 
the year, I am on win32 though I don't know if that matters.

Here is what I tried:


//FORMAT HAS TO BE date("d-M-Y");
//GET DAY OF YEAR FOR DOB utime = UNIX time
$utine = strtotime("30-Nov-1971");
$dob = getdate($utime);
$dobnum = $dob['yday'];
print "dob is " . $dobnum . "";

//GET DAY OF YEAR FOR TODAY
//$today = date("d-M-Y");
$utoday = strtotime(date("d-M-Y"));
$today = getdate($utoday);
$todaynum = $today['yday'];
print "today is " . $todaynum . "";

There should be a different of about 17 days here right? Not if this is 
returning 364 for $dobnum, then it's 48!


[EMAIL PROTECTED] wrote:

>looking at the manual, getdate() is meant to be passed a unix time stamp,
>so, you'll need to use strtotime() first thus:
>
>$utime = strtotime("30-Nov-1971");
>$dob = getdate($utime);
>$dobnum = $dob['yday'];
>print $dobnum;
>
>Notice I changed the format of the date, when I tried using the original
>format, strtotime() complained, saying it couldn't convert it.
>
>Martin T
>
>-Original Message-
>From: sundogcurt [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, November 14, 2001 7:57 AM
>To: GENERAL PHP LIST
>Subject: [PHP] take date and convert to day of year
>
>
>Hi guys, I know that you can take todays date and display it as the 
>numeric day of the year, 1 - 365 / 0 - 364 etc.
>But can you take a date such as (November-30-1971) and convert that to 
>the numeric day of the year?
>
>I have been trying to do this but have had no joy, I don't think my code 
>is even close.
>
>$dob = getdate("Nov-30-1971");
>$dobnum = $dob['yday'];
>print $dobnum;
>
>$dob 'should' be an array and 'yday' should be the numeric value for the 
>day of the year, right?!?
>
>This is what I am trying, and how I understand it, using 'yday' should 
>give you basically the same output as date ("z");
>
>What I would like is the ability to convert any date to the days numeric 
>value. Any help would be GREATLY appreciated.
>
>(C:
>
>



-- 
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] newbie question about odbc_connect

2001-11-13 Thread Johannes Ambrose

Hi,
I've been happily using mysql_connect() for various scripts on a linux
box. Now I'd like to connect to a filemaker pro database using
odbc_connect(). However, the response I get is "Call to undefined
function".

Do I need to compile odbc support? (I thought it was built in.)

Is there an include file somewhere that I need to specifiy?

regards


--
Johannes Ambrose
Computer Systems Manager
School of Life Sciences
University of Queensland, Brisbane Australia
ph: 07 3365 4826 fax:3365 1655 mob: 0401 714 835



-- 
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] Sending mail from PHP with SMTP server requiring authentication

2001-11-13 Thread R'twick Niceorgaw

Hi gang,
Any one tried to send mail through PHP using mail() through an smtp server
which requires authentication ?

Regards
R'twick


-- 
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] Re: Parsing XML

2001-11-13 Thread Manuel Lemos

Hello,

Michael Harris wrote:
> 
> Can anybody tell me if there is a way to build an array or some other
> means of collecting the attributes from the Start Element Handler so I
> can return them back to my main application?

Maybe you would like to try this class that does exactly what you need.

http://phpclasses.UpperDesign.com/browse.html/package/3

Regards,
Manuel Lemos

-- 
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] Adding Dates (To Obtain Future Dates)

2001-11-13 Thread David Robley

On Wed, 14 Nov 2001 07:21, Robert Miller wrote:
> This problem took a while to figure out. I'm posting the solution so
> that = other's may find this example. If you know of a better way,
> please reply. =
>
> :-)
>
> Cheers,
>
> Rob
>
> Problem: Generate Future Dates:
> Sub-Problem: Future Dates are Dictated by Record Type (Permanent or =
> Temporary)
> The Script:
>
> $cyear =3D date("Y");
> $cmonth =3D  date("m");
> $cday =3D date("d");
> if ($sType =3D=3D p)
> {
>$fyear =3D $cyear + 6
>$sExpiry =3D $fyear.$cmonth.$cday;
> }
> else
> {
>$adv =3D $cmonth + 6;
>$newunix =3D mktime(0,0,0,$adv,$cmonth,$cyear);
>$sExpiry =3D date("Ymd", $newunix);
> }
>
> $sCreated =3D date("Ymd");
> $sUpdated =3D date("Ymd");
>
>
>
> It seems weird to have use months possibly greater than 12 ($adv =3D =
> $cmonth + 6;), but hey... it works.

It is documented for mktime - it says '...it will automatically calculate 
the correct value for out of rnage input' and the examples include one 
where the month value is 13 (at least in my older docs).

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Smile... people will wonder what you've been up to.

-- 
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] javascript to php ???? THANKS =)

2001-11-13 Thread fitiux

Thanks to all for help me..
=)


I hope to help someone soon.  


--Patricio.




RE: [PHP] javascript to php ???????

2001-11-13 Thread Martin Towell

That's why I put quotes around the words - obviously a function would be
need to be written to do the "serialising" and a corresponding php function
to retrieve the values and place them into an array again.

-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 10:28 AM
To: [EMAIL PROTECTED]; PHP General
Subject: RE: [PHP] javascript to php ???


On Wed, 14 Nov 2001 10:16:42 +1100, Martin Towell wrote:
>"serialise" the array and make the "value" of a hidden field this
>value.
>Then in PHP "unserialise" it.

that would work great if it were a php array, but I believe we're 
talking about javascript arrays here. :)

>-Original Message-
>From: fitiux [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, November 14, 2001 10:18 AM
>To: PHP General
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP] javascript to php ???
>
>
>>>Hi  =)
>>>is it possible to pass a javascript array to php ???
>
>>by the time javascript comes into play, php has already done it's
>>job
>>and left the building. If you mean can javascript pass variables to
>>a
>>new request for php to handle, then sure.
>
>
>Thanks for your reply.  =)
>
>I have a little problem..
>well.. with php I build an html page with javascript to validate a
>form,
>the action of this form is call again to the php page.
>I mean...
>test.php - (make an html page)---> question.html ---
>(submit
>form)> test.php
>
>I populated an array but now I need to pass this array to the same
>starting
>php page again.
>
>can I do this?
>
>
>--Patricio
>
>
>(I apology because my english is not good enough.. I hope that you
>can
>understand me.. )
>
>
>
>


-- 
Mark, [EMAIL PROTECTED] on 11/13/2001




Re: [PHP] javascript to php ???????

2001-11-13 Thread Richard S. Crawford

Why, sure!

In your FORM tag, use ACTION="test.php".

You can send your JavaScript variable as part of the form, in a hidden form 
field such as INPUT TYPE="hidden" VALUE=myValue.  The value of the variable 
will be available the next time test.php shows up as $myValue.  You can 
then manipulate it to your heart's delight.


At 03:17 PM 11/13/2001, fitiux wrote:
> >>Hi  =)
> >>is it possible to pass a javascript array to php ???
>
> >by the time javascript comes into play, php has already done it's job
> >and left the building. If you mean can javascript pass variables to a
> >new request for php to handle, then sure.
>
>
>Thanks for your reply.  =)
>
>I have a little problem..
>well.. with php I build an html page with javascript to validate a form,
>the action of this form is call again to the php page.
>I mean...
> test.php - (make an html page)---> question.html ---(submit 
> form)> test.php
>
>I populated an array but now I need to pass this array to the same 
>starting php page again.
>
>can I do this?
>
>
>--Patricio
>
>
>(I apology because my english is not good enough.. I hope that you can 
>understand me.. )


Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"


--
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] Parsing XML

2001-11-13 Thread Michael Harris

Can anybody tell me if there is a way to build an array or some other
means of collecting the attributes from the Start Element Handler so I
can return them back to my main application?

Thanks for any help,
-Mike


-- 
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] javascript to php ???????

2001-11-13 Thread Mark

On Wed, 14 Nov 2001 10:16:42 +1100, Martin Towell wrote:
>"serialise" the array and make the "value" of a hidden field this
>value.
>Then in PHP "unserialise" it.

that would work great if it were a php array, but I believe we're
talking about javascript arrays here. :)

>-Original Message-
>From: fitiux [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, November 14, 2001 10:18 AM
>To: PHP General
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP] javascript to php ???
>
>
>>>Hi  =)
>>>is it possible to pass a javascript array to php ???
>
>>by the time javascript comes into play, php has already done it's
>>job
>>and left the building. If you mean can javascript pass variables to
>>a
>>new request for php to handle, then sure.
>
>
>Thanks for your reply.  =)
>
>I have a little problem..
>well.. with php I build an html page with javascript to validate a
>form,
>the action of this form is call again to the php page.
>I mean...
>test.php - (make an html page)---> question.html ---
>(submit
>form)> test.php
>
>I populated an array but now I need to pass this array to the same
>starting
>php page again.
>
>can I do this?
>
>
>--Patricio
>
>
>(I apology because my english is not good enough.. I hope that you
>can
>understand me.. )
>
>
>
>


--
Mark, [EMAIL PROTECTED] on 11/13/2001



--
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] javascript to php ???????

2001-11-13 Thread Mark

On Tue, 13 Nov 2001 20:17:32 -0300, fitiux wrote:
>   >>Hi  =)
>>>is it possible to  pass a javascript array to php ???
>
>>by the time javascript comes into  play, php has already done it's
>>job
>>and left the building. If you mean  can javascript pass variables
>>to a
>>new request for php to handle, then  sure.
>
>
>Thanks for your reply.  =)
>
>I have a little problem..
>well.. with php I build an html page with  javascript to validate a
>form,
>the action of this form is call again to the php  page.
>I mean...
>test.php  - (make an html page)---> question.html ---
>(submit form)>  test.php
>
>I populated an array but now I need to pass  this array to the same
>starting php page again.
>
>can I do this?

sure. for GET you would just make a request out of the variables,
i.e.:
var url="/mypage.php?value[0]="+value[0]+"value[1]="+value[1];
document.location.href=url;

you can do this in a loop if you want. for POST you would use hidden
fields, i.e.:

document.write('');
document.write('');

you could do this in a loop too.



--
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] javascript to php ???????

2001-11-13 Thread Martin Towell

"serialise" the array and make the "value" of a hidden field this value.
Then in PHP "unserialise" it.

-Original Message-
From: fitiux [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 10:18 AM
To: PHP General
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] javascript to php ???


>>Hi  =)
>>is it possible to pass a javascript array to php ???

>by the time javascript comes into play, php has already done it's job 
>and left the building. If you mean can javascript pass variables to a 
>new request for php to handle, then sure.


Thanks for your reply.  =)

I have a little problem..
well.. with php I build an html page with javascript to validate a form,
the action of this form is call again to the php page.
I mean... 
test.php - (make an html page)---> question.html ---(submit
form)> test.php

I populated an array but now I need to pass this array to the same starting
php page again.

can I do this?


--Patricio


(I apology because my english is not good enough.. I hope that you can
understand me.. )






Re: [PHP] javascript to php ???????

2001-11-13 Thread fitiux

>>Hi  =)
>>is it possible to pass a javascript array to php ???

>by the time javascript comes into play, php has already done it's job 
>and left the building. If you mean can javascript pass variables to a 
>new request for php to handle, then sure.


Thanks for your reply.  =)

I have a little problem..
well.. with php I build an html page with javascript to validate a form,
the action of this form is call again to the php page.
I mean... 
test.php - (make an html page)---> question.html ---(submit form)> 
test.php

I populated an array but now I need to pass this array to the same starting php page 
again.

can I do this?


--Patricio


(I apology because my english is not good enough.. I hope that you can understand me.. 
)






[PHP] silly question cont...

2001-11-13 Thread Rodrigo Peres

Sorry all, just to add a little info, the inpu hidden i've mentioned in the
other message is made if exist the id in the url!! it isn't all the time
there :-)

thks again

Rodrigo



-- 
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] silly question

2001-11-13 Thread Martin Towell

try adding the "nocache" header() calls to the page to force the broswer to
refresh.
See how that goes

Martin T

-Original Message-
From: Rodrigo Peres [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 9:43 AM
To: PHP
Subject: [PHP] silly question


Hi list,

I have PHP code to insert the result of a form into mysql. When I nedd to
made an update, I pass an "id" in the url and use it to make the update
query. The problem is after I click in the update button (input submit) my
page refresh and came back in the same state, to see the changes I need to
type in the url again with the parameter?? why?? There's a way to avoid this
and get a new blank form page after the update?

ps: I've stored the "id" in a input type hidden, so I could click the button
and still have the id

Thank's in advance

Rodrigo Peres
-- 



-- 
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] javascript to php ????

2001-11-13 Thread Mark

On Tue, 13 Nov 2001 19:53:48 -0300, fitiux wrote:
>Hi  =)
>
>is it possible to pass a javascript array to php ???

by the time javascript comes into play, php has already done it's job
and left the building. If you mean can javascript pass variables to a
new request for php to handle, then sure.


--
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] javascript to php ????

2001-11-13 Thread fitiux

Hi  =)

is it possible to pass a javascript array to php ???


thanks.




[PHP] silly question

2001-11-13 Thread Rodrigo Peres

Hi list,

I have PHP code to insert the result of a form into mysql. When I nedd to
made an update, I pass an "id" in the url and use it to make the update
query. The problem is after I click in the update button (input submit) my
page refresh and came back in the same state, to see the changes I need to
type in the url again with the parameter?? why?? There's a way to avoid this
and get a new blank form page after the update?

ps: I've stored the "id" in a input type hidden, so I could click the button
and still have the id

Thank's in advance

Rodrigo Peres
-- 



-- 
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] take date and convert to day of year

2001-11-13 Thread Martin Towell

looking at the manual, getdate() is meant to be passed a unix time stamp,
so, you'll need to use strtotime() first thus:

$utime = strtotime("30-Nov-1971");
$dob = getdate($utime);
$dobnum = $dob['yday'];
print $dobnum;

Notice I changed the format of the date, when I tried using the original
format, strtotime() complained, saying it couldn't convert it.

Martin T

-Original Message-
From: sundogcurt [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 7:57 AM
To: GENERAL PHP LIST
Subject: [PHP] take date and convert to day of year


Hi guys, I know that you can take todays date and display it as the 
numeric day of the year, 1 - 365 / 0 - 364 etc.
But can you take a date such as (November-30-1971) and convert that to 
the numeric day of the year?

I have been trying to do this but have had no joy, I don't think my code 
is even close.

$dob = getdate("Nov-30-1971");
$dobnum = $dob['yday'];
print $dobnum;

$dob 'should' be an array and 'yday' should be the numeric value for the 
day of the year, right?!?

This is what I am trying, and how I understand it, using 'yday' should 
give you basically the same output as date ("z");

What I would like is the ability to convert any date to the days numeric 
value. Any help would be GREATLY appreciated.

(C:


-- 
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: $QUERY_STRING

2001-11-13 Thread John Steele

Hi Ernesto,

  Try taking a look at the HTTP_SERVER_VARS array:

test.php?1

HTTP_SERVER_VARS["argc"] = 1
HTTP_SERVER_VARS["argv"] = array([0] => test)


XPerience the new windows (scary!) :)
  John

>
>Nop. getenv("QUERY_STRING") also returns an empty string.
>The crazy thing is that getenv returns an empty string instead of FALSE.
>Anyway, if I do "index.php?a=1", I get HTTP_GET_VARS['a']==1, but 
>$QUERY_STRING is still empty :(
>
>
>dav wrote:
>
>> Try getenv() function to import the query string from apache ambient.
>> This is not a bug, maybe the index.php?1 isn't standard at all.
>
>> "Ernesto" <[EMAIL PROTECTED]> ha scritto nel messaggio
>> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> 
>>>Hi,
>>>
>>>I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows.
>>>I'm trying to access the $QUERY_STRING var, but it's empty even when I
>>>do have a query string. On one server (Win2K), it works ok. On the other
>>>server (WinXP) it's always empty.
>>>If I use "index.php?s=1", $HTTP_GET_VARS['s'] is 1, but I need the raw
>>>query string because it's something like "index.php?1".
>>>
>>>Is this a known bug on PHP/WinXP?
>>>
>>>Regards,
>>>Ernesto

--
/* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
 *  We also walk dogs...  Dynamic Web Design  PHP/MySQL/Linux/Hosting
 *  www.steelesoftconsulting.com [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] Problems with headers in redirect

2001-11-13 Thread John Steele

Hi Richy,

  Try sending the content header before the location header:

header("Content-type: image/jpeg");
header("Location: http://yourhost.com/yourfile.jpg";);

HTH,
  John

>Hi, I'm hoping someone can help me with this one...
>
>I'm doing redirects to various types of file (Flash, Office, DWF etc) and 
>have found a problem with IE5.
>
>I pass the script a document ID, and it retrieves the document record from 
>a database, which stores the location of the file on the web server, and 
>redirects the browser to the document.
>
>What happens is that the browser gets redirected, but doesn't get the 
>content-type header, and subsequently can't display the document.
>
>Until yesterday I was using javascript redirection, which worked fine. 
>However for other reasons (ie that didn't work with IE 5.5 or IE6) I had to 
>change to using the header("Location: ") way.
>
>Only work around I can see is to do the redirection based on browser type 
>(i.e. one way for IE5, the other for IE5.5/IE6) but thats messy.
>
>Any other ideas???
>
>Richy

--
/* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
 *  We also walk dogs...  Dynamic Web Design  PHP/MySQL/Linux/Hosting
 *  www.steelesoftconsulting.com [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] Frames and Sessions

2001-11-13 Thread Rodolfo Gonzalez

On Tue, 13 Nov 2001, Martín Marqués wrote:
> > I have tried starting a session in the main frameset file, then adding
> >  to the URLs of the frame files, which sort of works but breaks
> > where JavaScript is used for buttons in one of the frames. JavaScript
> > doesn't seem to cope with the PHP tags.

Append manually the  (or session_name()."=".session_id()) to the
javascript code it works well :)



-- 
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] getrusage() not supported

2001-11-13 Thread Larry Jeannette II


According to the docs, it says to check your systems man pages for
getrusage. Since they appear to referencing *nix system (no man in NT), my
guess is that NT does not support it. In fact, executing getrusage at the
NT command prompt gives the 'not recognized internal or external command'
error.

LRJ


Daniel Berwig writes:

> I'm trying to run a script in my server (IIS 5) that uses the function
> getrusage(), but it returns the following warning:
> 
> Warning: getrusage() is not supported in this PHP build in file_name.php on
> line 377
> 
> Does anyone know how I can solve this problem?
> 
> Thanks in advance.
> 
> 
> 
> 
> -- 
> 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]
> 


LRJ

-- 
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] take date and convert to day of year

2001-11-13 Thread sundogcurt

Hi guys, I know that you can take todays date and display it as the 
numeric day of the year, 1 - 365 / 0 - 364 etc.
But can you take a date such as (November-30-1971) and convert that to 
the numeric day of the year?

I have been trying to do this but have had no joy, I don't think my code 
is even close.

$dob = getdate("Nov-30-1971");
$dobnum = $dob['yday'];
print $dobnum;

$dob 'should' be an array and 'yday' should be the numeric value for the 
day of the year, right?!?

This is what I am trying, and how I understand it, using 'yday' should 
give you basically the same output as date ("z");

What I would like is the ability to convert any date to the days numeric 
value. Any help would be GREATLY appreciated.

(C:


-- 
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] PDF Library Not Working (Call to undefined function)

2001-11-13 Thread Robert Miller

I RTFM but did not find a solution. My head hurts from banging it against =
the wall. :-P

Apache, OpenSSL, MySQL and PHP work fine... but the PDF libraries will not =
work. I used the following configure commands:

PHP:  './configure' '--with-mysql=3D/usr/local/mysql/' '--with-xml' =
'--with-apache=3D../apache_1.3.22/' '--with-curl=3D/usr/local/curl' =
'--enable-shared-pdflib' '--enable-track-vars'

PDFLib: Almost defaults... just turned off Python and C/C++.

I can provide a complete list of configure options and the order they were =
executed if you need them...

The error message when attempting to use the PDFLib functions is:

Fatal error: Call to undefined function: pdf_new() in /usr/local/apache/htd=
ocs/program/dmipps/pdfdemo.php on line 2


Thanks for any help, it's really appreciated.

Rob




--
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] Adding Dates (To Obtain Future Dates)

2001-11-13 Thread Robert Miller

This problem took a while to figure out. I'm posting the solution so that =
other's may find this example. If you know of a better way, please reply. =
:-)

Cheers,

Rob

Problem: Generate Future Dates:
Sub-Problem: Future Dates are Dictated by Record Type (Permanent or =
Temporary)
The Script:

$cyear =3D date("Y");
$cmonth =3D  date("m");
$cday =3D date("d");
if ($sType =3D=3D p)
{
   $fyear =3D $cyear + 6
   $sExpiry =3D $fyear.$cmonth.$cday;
}
else
{
   $adv =3D $cmonth + 6;
   $newunix =3D mktime(0,0,0,$adv,$cmonth,$cyear);
   $sExpiry =3D date("Ymd", $newunix);
}

$sCreated =3D date("Ymd");
$sUpdated =3D date("Ymd");



It seems weird to have use months possibly greater than 12 ($adv =3D =
$cmonth + 6;), but hey... it works.




--
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] PATH_INFO and the ' / ' (search friendly URLs)

2001-11-13 Thread Andy

Hi there,

I am trying to put after .php an information like:

.php/1234

This is because I am trying to build a searchfriedly URL like described in
http://www.zend.com/zend/spotlight/searchengine.php#3

The problem is... it does not work I get an server error. As soon as there
is a slash and info behind. This happens on win and unix.

It workes for example at this site:
http://www.stuttgarter-zeitung.de/stz/page/detail.php/13971

So..does anybody know whats going on with that? Maybe there is a need to
enter something in a .htaccess file?

Thanx for any help,

Cheers Andy




-- 
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] explain these testresults (search/replace)

2001-11-13 Thread Niklas Fondberg



1.7303379774094 seconds with strtr()
1.557923078537 seconds with preg_replace()
1.494078040123 seconds with str_replace()
1.4984160661697 seconds with ereg_replace()
/* source ---8<---*/
" => "PRE",
 ""=>"LI",
 " "TABLE ROW START",
 "" => "BOLD",
 " "TABLE CELL START"
 );

/* - END CONFIG -- */
// read in filedata
for ($i = 0; $i < count($files); $i++) {
 $raw[] = implode("", file($files[$i]));
}
// build preg_replace reg/replace pattern arrays
while(list($reg, $rep) = each($strtr_rep)) {
 $preg_reg[]  = "/".$reg."/";
 $preg_repl[] = $rep;
}
//START TEST
$timer = new Timer();

for ($i=0; $i < 1000; $i++) {
 $data = ($i % 2 == 0) ? $raw[0] : $raw[1];
 if ($test == 1) {
  $test = "strtr";
  $data = strtr($data, $strtr_rep);
 } elseif ($test == 2) {
  $test = "preg_replace";
  $data = preg_replace($preg_reg, $preg_repl, $data);
 } elseif ($test == 3) {
  $test = "str_replace";
  while(list($k, $v) = each($strtr_rep)) {
   $data = str_replace($k, $v, $data);
  }
 } elseif ($test == 4) {
  $test = "ereg_replace";
  while(list($k, $v) = each($strtr_rep)) {
   $data = ereg_replace($k, $v, $data);
  }
 }
}
print $timer->getElapsed() . " seconds with $test";
?>
/*  ---8<- END SOURCE -8<--8<- */
--
Best Regards

Niklas Fondberg  -  [EMAIL PROTECTED]
System Developer  -  I3 Micro Technology


--

--
Best Regards

Niklas Fondberg  -  [EMAIL PROTECTED]
System Developer  -  I3 Micro Technology



-- 
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] explain these testresults (search/replace)

2001-11-13 Thread Niklas Fondberg



1.7303379774094 seconds with strtr()
1.557923078537 seconds with preg_replace()
1.494078040123 seconds with str_replace()
1.4984160661697 seconds with ereg_replace()
/* source ---8<---*/
" => "PRE",
 ""=>"LI",
 " "TABLE ROW START",
 "" => "BOLD",
 " "TABLE CELL START"
 );
 
/* - END CONFIG -- */
// read in filedata
for ($i = 0; $i < count($files); $i++) {
 $raw[] = implode("", file($files[$i]));
}
// build preg_replace reg/replace pattern arrays
while(list($reg, $rep) = each($strtr_rep)) {
 $preg_reg[]  = "/".$reg."/";
 $preg_repl[] = $rep;
}
//START TEST
$timer = new Timer();

for ($i=0; $i < 1000; $i++) {
 $data = ($i % 2 == 0) ? $raw[0] : $raw[1];
 if ($test == 1) {
  $test = "strtr";
  $data = strtr($data, $strtr_rep);
 } elseif ($test == 2) {
  $test = "preg_replace";
  $data = preg_replace($preg_reg, $preg_repl, $data);
 } elseif ($test == 3) {
  $test = "str_replace";
  while(list($k, $v) = each($strtr_rep)) {
   $data = str_replace($k, $v, $data);
  }
 } elseif ($test == 4) {
  $test = "ereg_replace";
  while(list($k, $v) = each($strtr_rep)) {
   $data = ereg_replace($k, $v, $data);
  }
 }
}
print $timer->getElapsed() . " seconds with $test";
?>
/*  ---8<- END SOURCE -8<--8<- */
--
Best Regards

Niklas Fondberg  -  [EMAIL PROTECTED]
System Developer  -  I3 Micro Technology


-- 
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: $QUERY_STRING

2001-11-13 Thread Ernesto


Nop. getenv("QUERY_STRING") also returns an empty string.
The crazy thing is that getenv returns an empty string instead of FALSE.
Anyway, if I do "index.php?a=1", I get HTTP_GET_VARS['a']==1, but 
$QUERY_STRING is still empty :(


dav wrote:

> Try getenv() function to import the query string from apache ambient.
> This is not a bug, maybe the index.php?1 isn't standard at all.

> "Ernesto" <[EMAIL PROTECTED]> ha scritto nel messaggio
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>Hi,
>>
>>I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows.
>>I'm trying to access the $QUERY_STRING var, but it's empty even when I
>>do have a query string. On one server (Win2K), it works ok. On the other
>>server (WinXP) it's always empty.
>>If I use "index.php?s=1", $HTTP_GET_VARS['s'] is 1, but I need the raw
>>query string because it's something like "index.php?1".
>>
>>Is this a known bug on PHP/WinXP?
>>
>>Regards,
>>Ernesto
>>
>>
> 
> 
> 



-- 
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] EXPIRATION PROBLEM; PLEASE HELP ME !!!

2001-11-13 Thread Gustavo Luis Pereira Verly


- Original Message -
From: "Gustavo Luis Pereira Verly" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 2:26 PM
Subject: [PHP] Expiration problem


> Hi everybody, this is my first time writing in this list.
>
> I have the next problem:
>
> I have a page called
>
> login.php
>
> and when I log in,  there's a new page who receive the user and the
> password, and this page is called
>
> main.php
>
> This page, check if the user have a valid account and a password; and if
> this is OK, then make a session for the user. This work OK; but, from the
> main.php I go to a link in the same page, but with a new parameter, for
> example:   and the page showme another screen
> (because this new screen only appears when I put the "option=1" as
> parameter); and this also OK.
> The problem appears when I make click on the BACK BUTTON from my browser,
> and the browser go back from "main.php?option=1" to the "main.php" page,
and
> get me a error:
> the page was expire, you have to click REFRESH button on your
> browser to send the information again.
> (( or sometime like that; I don't remember the exacts words, 'cause is a
> spanish Internet Explorer ))
>
> Can somebody helpme with this problem?
>
> Thanks
>
> Gustavo Pereira
>
>
> --
> 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] Re: $QUERY_STRING

2001-11-13 Thread dav

Try getenv() function to import the query string from apache ambient.
This is not a bug, maybe the index.php?1 isn't standard at all.
"Ernesto" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi,
>
> I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows.
> I'm trying to access the $QUERY_STRING var, but it's empty even when I
> do have a query string. On one server (Win2K), it works ok. On the other
> server (WinXP) it's always empty.
> If I use "index.php?s=1", $HTTP_GET_VARS['s'] is 1, but I need the raw
> query string because it's something like "index.php?1".
>
> Is this a known bug on PHP/WinXP?
>
> Regards,
> Ernesto
>



-- 
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] getrusage() not supported

2001-11-13 Thread Daniel Berwig

I'm trying to run a script in my server (IIS 5) that uses the function
getrusage(), but it returns the following warning:

Warning: getrusage() is not supported in this PHP build in file_name.php on
line 377

Does anyone know how I can solve this problem?

Thanks in advance.




-- 
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] $QUERY_STRING

2001-11-13 Thread Ernesto


Hi,

I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows.
I'm trying to access the $QUERY_STRING var, but it's empty even when I 
do have a query string. On one server (Win2K), it works ok. On the other 
server (WinXP) it's always empty.
If I use "index.php?s=1", $HTTP_GET_VARS['s'] is 1, but I need the raw 
query string because it's something like "index.php?1".

Is this a known bug on PHP/WinXP?

Regards,
Ernesto


-- 
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] I Need To Upload Massive Huge Files : 20Mb

2001-11-13 Thread The Big Roach

Thanks Sebastian,

I'll take a look at our proxy logs.
I've also discovered a perl script deep in the bowels of our servers which
seem to be a problem.
Here's an error log excerpt:

POPSTACK
panic: POPSTACK
panic: POPSTACK
panic: POPSTACK
panic: POPSTACK
panic: POPSTACK
[Tue Nov 13 13:26:57 2001] [error] [client "IP ADDRESS HERE"] Premature end
of script headers:
/usr/local/etc/httpd/htdocs/imanager/wizards/fm_upload.cgi
FATAL:  erealloc():  Unable to allocate 6940001 bytes

Can't imagine why it panics when it pops the stack.
Anyhow, proof here-in lies that I'm being limited : unable to allocate
bytes.
Unforunately I have no admin rights setup for this machine to mess with this
cgi.

I'll keep you all posted... seems like there's a lot of interest in
uploading files, &c.

"Sebastian" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi

We encountere some problems with our Squid-Proxy.
When we user direct internet connection the sky was the limit,
but with our Proxy, the limit was 2MB...

Sebastian

> -Ursprüngliche Nachricht-
> Von: The Big Roach [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 13. November 2001 17:31
> An: [EMAIL PROTECTED]
> Betreff: [PHP] I Need To Upload Massive Huge Files : 20Mb
>
>
> Fans!
>
> I need your help, but first you must worship me.
> Does PHP have a flakey file upload limit? Or what could be wrong?
>
> max_upload_size and all that is set to 32Mb.
> post_max_size is also set to 32Mb.
> max_exec_time is set to 0 (unlimited).
> apache's timeout is set to 1800 (30 mins).
>
> And my 6Mb or less files upload.
> But not my 7+Mb files.
> This is frustrating.
>
> But I think Rasmus can answer this for me.
> Rasmus, over to you...
>
> Here's my code just to prove I'm not a proud ^%#@!
>
>   $conn_id = ftp_connect("$ftp_server");
>   $login_result = ftp_login($conn_id, "$ftp_user_name",
> "$ftp_user_pass");
>   if ((!$conn_id) || (!$login_result)){
>   echo "Ftp connection failed!";
>   die;
>   }
>   else {
>   echo "Connected to $ftp_server!";
>   }
>
>   @ftp_chdir($conn_id, $my_dir);
>
>   @ftp_pasv ($conn_id, TRUE);
>
>   /*Using ftp_fput*/
>   $local_file = fopen($source_file, "r");
>   $upload = @ftp_fput($conn_id, $destination_file, $local_file,
> FTP_BINARY);
>   /*Using ftp_put*/
> /*  $upload = @ftp_put($conn_id, $destination_file, $source_file,
> FTP_BINARY);*/
>
>   if (!$upload) {
>   echo "Ftp upload failed!";
>   $headers = getallheaders();
>   while (list ($header, $value) = each ($headers)) {
>   echo "$header: $value\n";
>   }
>   }
>   else {
>   echo "Ftp upload successfull!Uploaded
> $destination_file to
> $ftp_server/$my_dir";
>   $headers = getallheaders();
>   while (list ($header, $value) = each ($headers)) {
>   echo "$header: $value\n";
>   }
>   }
>
>   @ftp_quit($conn_id);
>
>
>
>
> --
> 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]




AW: [PHP] I Need To Upload Massive Huge Files : 20Mb

2001-11-13 Thread Sebastian

Hi

We encountere some problems with our Squid-Proxy.
When we user direct internet connection the sky was the limit, 
but with our Proxy, the limit was 2MB...

Sebastian

> -Ursprüngliche Nachricht-
> Von: The Big Roach [mailto:[EMAIL PROTECTED]] 
> Gesendet: Dienstag, 13. November 2001 17:31
> An: [EMAIL PROTECTED]
> Betreff: [PHP] I Need To Upload Massive Huge Files : 20Mb
> 
> 
> Fans!
> 
> I need your help, but first you must worship me.
> Does PHP have a flakey file upload limit? Or what could be wrong?
> 
> max_upload_size and all that is set to 32Mb.
> post_max_size is also set to 32Mb.
> max_exec_time is set to 0 (unlimited).
> apache's timeout is set to 1800 (30 mins).
> 
> And my 6Mb or less files upload.
> But not my 7+Mb files.
> This is frustrating.
> 
> But I think Rasmus can answer this for me.
> Rasmus, over to you...
> 
> Here's my code just to prove I'm not a proud ^%#@!
> 
>   $conn_id = ftp_connect("$ftp_server");
>   $login_result = ftp_login($conn_id, "$ftp_user_name",
> "$ftp_user_pass");
>   if ((!$conn_id) || (!$login_result)){
>   echo "Ftp connection failed!";
>   die;
>   }
>   else {
>   echo "Connected to $ftp_server!";
>   }
> 
>   @ftp_chdir($conn_id, $my_dir);
> 
>   @ftp_pasv ($conn_id, TRUE);
> 
>   /*Using ftp_fput*/
>   $local_file = fopen($source_file, "r");
>   $upload = @ftp_fput($conn_id, $destination_file, $local_file,
> FTP_BINARY);
>   /*Using ftp_put*/
> /*  $upload = @ftp_put($conn_id, $destination_file, $source_file,
> FTP_BINARY);*/
> 
>   if (!$upload) {
>   echo "Ftp upload failed!";
>   $headers = getallheaders();
>   while (list ($header, $value) = each ($headers)) {
>   echo "$header: $value\n";
>   }
>   }
>   else {
>   echo "Ftp upload successfull!Uploaded 
> $destination_file to
> $ftp_server/$my_dir";
>   $headers = getallheaders();
>   while (list ($header, $value) = each ($headers)) {
>   echo "$header: $value\n";
>   }
>   }
> 
>   @ftp_quit($conn_id);
> 
> 
> 
> 
> -- 
> 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] Basic handling of pre 1901 dates

2001-11-13 Thread George Whiffen

I'm feeling dumb!

The Basic Problem
=

Basically all I want to do is to output each day in turn from 1900 i.e.

01-Jan-1900
02-Jan-1900
03-Jan-1900
etc.

But date() won't accept dates pre 13-Dec-1901
and mktime doesn't like anything pre 01-Jan-1970.

I know I can get mysql to do this without trouble but not efficiently.

So how do you work with pre-1901 dates in php?

The Full Problem


In actual fact what I'm trying to do is list all dates within 
a given range which are NOT in a mysql table.

The dates and date ranges can span anywhere from 1850 to the
present.

I can very easily use mysql to generate an array of the days
which are present in the table.  What I can't seem to do is 
get php to run through each day in turn and let me output it.

The only possible solution I can think of is to just generate a 
dummy mysql table with all dates I might ever use and then join 
that to my actual date table and select the non-matches.  Not a very 
elegant solution!

What have I missed?


George

-- 
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: is_null misses spaces... another solution?

2001-11-13 Thread Johnson, Kirk

A space is a valid string. Are you sure there is a space?

";
} else {
  echo "a is not blank";   // this is printed
}

if(is_null($a)) {
  echo "a is null";
} else {
  echo "a is not null";   // this is printed
}
?>

Kirk

> > I need to check variables for blank values but it appears 
> that is_null and
> > =="" return true if there is a space.
> >
> > Any other suggestions?

-- 
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] Help! How do i mail a value from a mysql databse?

2001-11-13 Thread Raymond

Hi!

I'm trying to send a mail with password to the new user of my website, but
. Does anyone know how to put the variable inside my mail?

I have tried this:

-->
else {

// sende kundeopplysninger til databasen

  $db = mysql_connect("localhost", "root");

  mysql_select_db("subway",$db);

  $sql = "INSERT INTO nettkunder
(fornavn,etternavn,firma,adresse,postnr,sted,telefon,epost) VALUES
('$fornavn','$etternavn','$firma','$adresse','$postnr','$sted','$telefon','$
epost')";

  $result = mysql_query($sql);

  echo "Velkommen som kunde hos Subway.\n";

}

  $db = mysql_connect("localhost", "root");

  mysql_select_db("subway",$db);


$id = mysql_query("GET id FROM nettkunder WHERE epost = '$epost'",$db);

mail("$epost", "Velkommen som kunde hos Subway", "Her har du ditt passord:
$myrow["id"] \n God appetitt! Hilsen Subway");





Regards Raymond









-- 
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] Re: is_null misses spaces... another solution?

2001-11-13 Thread Julio Nobrega Trabalhando

trim(); it before?

--

Julio Nobrega

No matter where you go, &this.
"Spunk S. Spunk III" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need to check variables for blank values but it appears that is_null and
> =="" return true if there is a space.
>
> Any other suggestions?
>
> 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]




RE: [PHP] User Authentication

2001-11-13 Thread Matt Schroebel

Caveat: Don't forget to escape user input before sending to SQL.  Those samples leave 
that part to your imagination.  Bad guys might take advantage of that :)
 
> http://www.google.com/search?q=php+mysql+user+authentication&b
tnG=Google+Search
> 
> First hit's a winner :)
> 
> 

-- 
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] is_null misses spaces... another solution?

2001-11-13 Thread Spunk S. Spunk III

I need to check variables for blank values but it appears that is_null and
=="" return true if there is a space.

Any other suggestions?

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]




RE: [PHP] Variable definitions...

2001-11-13 Thread Neil Kimber

BTW, the official explanation is wrong.

"local part this variable is destroyed and declared again"

is incorrect. The global variable is not destroyed. The local namespace
pushes the variable name onto the stack and gives it a value for the
duration of the function. Every time you try and access this variable it is
taken from the stack by the parser. Once you exit the function the local
namespace is destroyed and all the local variables are popped from the
stack. If the call stack is in the Global area then all variabels are
accessed from the heap,  so your original variable (and its original value)
are still accessible.


> -Original Message-
> From: Chris Hobbs [mailto:[EMAIL PROTECTED]]
> Sent: 13 November 2001 17:09
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Variable definitions...
>
>
> Hi Stephan,
>
> IMHO, I think the answer requested is the only one that really makes
> sense - as soon as I read it, _my_ first thought went to scope.
>
> If a variable changes values, the other value is no longer usable, and
> thus there aren't really two variables with the same name in that case.
> When comparing global to local scope, however, you can definitely have
> the same name in use in two places.
>
> Of course, I wasn't a CS major, so someone else might be able to give
> you an answer that will help you justify yours - but prima facie, you
> got it wrong :(
>
> Now, if you're talking about the compiler level, then no two variables
> (which are actually memory registers at this point, iirc) can share the
> same memory space with different values - this is just logically
> impossible. But the question is certainly referring to source code, and
> so scope is the only reasonable answer.
>
> HTH!
>
> Stephan wrote:
>
> > Hello,
> >
> > first of all I didn't exactely know where the right place is to ask this
> > question.
> >
> > Well, my problem is that I just had some exams and am very unhappy on
> > how certain things were rated.
> >
> > There's especially one question and I try to translate it as exact as
> > possible:
> >
> > When is it possible that two variables have the same name but display
> > different variables?
> >
> > The official solution was when in a script a global variable is declared
> > and then in a local part this variable is destroyed and declared again
> > with the same name (maybe even using different data type).
> >
> > As for me, I'm of the opinion that this definition according to the
> > question is too narrow minded. I think that a variable is already
> > different if the the value within the variable is changed due to script
> > OR if you appoint a new value to the variable OR if the variable is an
> > array and some elements are accessed / elements are added / elements are
> > removed.
> > The reason why I think variables with different values can be considered
> > as different variable according to the question asked in the exam is
> > that when you declare a variable it also has a value even if this value
> > is NULL.
> >
> > Now I'd like very much to hear your opinion on this issue since for me
> > very much depends on that (3 years of studying at college).
> >
> > Stephan
> >
> > P.S.: If you agree with me or not can you also send me an email to me?
> > [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> ___  ____    _
> Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
> Head Geek| (___  \ \  / /| |  | | (___ | |  | |
> WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
> PostMaster) |  \  /  | |__| |) | |__| |
>\/\/\/ \/|_/
>http://www.silvervalley.k12.ca.us
>[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] Expiration problem

2001-11-13 Thread Gustavo Luis Pereira Verly

Hi everybody, this is my first time writing in this list.

I have the next problem:

I have a page called

login.php

and when I log in,  there's a new page who receive the user and the
password, and this page is called

main.php

This page, check if the user have a valid account and a password; and if
this is OK, then make a session for the user. This work OK; but, from the
main.php I go to a link in the same page, but with a new parameter, for
example:   and the page showme another screen
(because this new screen only appears when I put the "option=1" as
parameter); and this also OK.
The problem appears when I make click on the BACK BUTTON from my browser,
and the browser go back from "main.php?option=1" to the "main.php" page, and
get me a error:
the page was expire, you have to click REFRESH button on your
browser to send the information again.
(( or sometime like that; I don't remember the exacts words, 'cause is a
spanish Internet Explorer ))

Can somebody helpme with this problem?

Thanks

Gustavo Pereira


-- 
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] Variable definitions...

2001-11-13 Thread Chris Hobbs

Hi Stephan,

IMHO, I think the answer requested is the only one that really makes 
sense - as soon as I read it, _my_ first thought went to scope.

If a variable changes values, the other value is no longer usable, and 
thus there aren't really two variables with the same name in that case. 
When comparing global to local scope, however, you can definitely have 
the same name in use in two places.

Of course, I wasn't a CS major, so someone else might be able to give 
you an answer that will help you justify yours - but prima facie, you 
got it wrong :(

Now, if you're talking about the compiler level, then no two variables 
(which are actually memory registers at this point, iirc) can share the 
same memory space with different values - this is just logically 
impossible. But the question is certainly referring to source code, and 
so scope is the only reasonable answer.

HTH!

Stephan wrote:

> Hello,
> 
> first of all I didn't exactely know where the right place is to ask this
> question.
> 
> Well, my problem is that I just had some exams and am very unhappy on
> how certain things were rated.
> 
> There's especially one question and I try to translate it as exact as
> possible:
> 
> When is it possible that two variables have the same name but display
> different variables?
> 
> The official solution was when in a script a global variable is declared
> and then in a local part this variable is destroyed and declared again
> with the same name (maybe even using different data type).
> 
> As for me, I'm of the opinion that this definition according to the
> question is too narrow minded. I think that a variable is already
> different if the the value within the variable is changed due to script
> OR if you appoint a new value to the variable OR if the variable is an
> array and some elements are accessed / elements are added / elements are
> removed.
> The reason why I think variables with different values can be considered
> as different variable according to the question asked in the exam is
> that when you declare a variable it also has a value even if this value
> is NULL.
> 
> Now I'd like very much to hear your opinion on this issue since for me
> very much depends on that (3 years of studying at college).
> 
> Stephan
> 
> P.S.: If you agree with me or not can you also send me an email to me?
> [EMAIL PROTECTED]
> 
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] User Authentication

2001-11-13 Thread Chris Hobbs

http://www.google.com/search?q=php+mysql+user+authentication&btnG=Google+Search

First hit's a winner :)

Damien Burke wrote:

> Hi,
> 
> Can anyone recommend a good place on the web to learn about user
> authentication.
> I want users of my site to login with a username & password - once they are
> logged in they can see information customised to each separate user.
> Without being logged in the won't see any valuable information.
> Especially issues dealing with hackers.
> 
> Thanks,
> Damien
> 
> 
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Advice Needed

2001-11-13 Thread Joe Van Meer

Hi there. I have a small php app connected to sqlServer db. The app is used
as a code library for various programming languages. Basically, a code
repository.  My problem is this, I would like to be able to insert the code
for a function (the actual code) into the db. However, I keep running into
the quote problem when inserting. In Asp for example, commenting is done by
using a ' . When I try to insert some asp code into the db via my php app,
it throws errors. Somebody had mentioned that using addslashes() and
stripslashes () functions would do the trick. Is there a better way to do
this or are these two functions the best to use? Also, how do I keep the
formatting of a function to stay the same while inputting and retrieving?

Your time is greatly appreciated!
Thx Joe



-- 
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] User Authentication

2001-11-13 Thread Damien Burke

Hi,

Can anyone recommend a good place on the web to learn about user
authentication.
I want users of my site to login with a username & password - once they are
logged in they can see information customised to each separate user.
Without being logged in the won't see any valuable information.
Especially issues dealing with hackers.

Thanks,
Damien



-- 
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: Empty form variables when uploading, Help please???

2001-11-13 Thread Warren Vail

Interesting because I have used multiple submit buttons on forms for years.
Each can have a different name, and even if I use the same name for all of
them, which I often do, each can have a separate value.  Each will cause all
other form fields to transmit their variables in their usual manner, but
obviously I will only receive one submit button( the one that was clicked).
If all are named "go" with different values (what displays on the button),
all I have to do is;

Switch($go) {
 Case "Add":  something; break;
 Case "Update":  something, break;
 Case "Delete":  something else, break;
}


-Original Message-
From:   The Big Roach [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, November 13, 2001 8:19 AM
To: [EMAIL PROTECTED]
Subject:[PHP] Re: Empty form variables when uploading, Help please???

 << File: [PHP] Re Empty form variables when uploading, Help please.txt >>
In a form you can't really have 2 submit buttons.
Either a submit submits or it is just a button.
That's because the var name is already submit (check out your
http_post_vars).
And you have it twice!
Change one of them and make it just a button (HTML4).
Recheck your post-vars.
This should help.

Otherwise you're loosing your post vars somehwere in the fire-wall.
That's bad!


"Sandra Rascheli" <[EMAIL PROTECTED]> wrote in message
003601c16abd$3985ae70$c46223c8@srascheli">news:003601c16abd$3985ae70$c46223c8@srascheli...
Hi everybody,

I hope someone is able to help me with this, I've been having this problem
for  a couple of months now and I have not been able to find a solution. I
have a form to upload a file which submits to itself, and has two submit
buttons, one called "eliminarfoto" (deletephoto) and "salvar" (savephoto),
but for some weird and unexplainable reason (it only happens to some users,
not all of them) when they hit any of these two submit buttons, the form
returns empty variables.

This is part of my script, has anybody had a similar problem before??? Any
help would be greatly appreciated.

 
 
 
  Foto
  (opcional,tamaño máximo: 20k,formatos permitidos: JPEG,
GIF)
  
  ";
  }
  ?>
  
  
  
  
  
 
 
  
  
  

 
 
 







--
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] Re: matches problem ("preg_match")

2001-11-13 Thread _lallous


viele Grüße,
lallous!

"Ewald Schoeller" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hello
> we want to save every word of a text in an array field.
> we want to solve the problem without "split".
>
> Here's our code:
>
> $str="eins zwei drei vier fünf sechs";
> preg_match("'(\w+)(\s+\w+)*'",$str,$Wort);
>
> $n=count($Wort);
> for($i=0;$i<$n;$i++){echo "$i: $Wort[$i]";}
>
> The result is:
> 0: eins zwei drei vier fünf sechs
> 1: eins
> 2: sechs
>
> it only saves the first and the last word.
> why doesn't it save every single word in one array field?
> can anybody give us the (corrected) code to achieve the desired result?
>
> thanks for every answer !!
>
> Bruno and Ewald
>
>



-- 
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] matches problem ("preg_match")

2001-11-13 Thread Valentin V. Petruchek

Try this code:

$str="eins zwei drei vier fünf sechs";
$Wort = explode (' ',$str);

$n=count($Wort);
for($i=0;$i<$n;$i++){echo "$i: $Wort[$i]";}

It should works

Zliy Pes [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] matches problem ("preg_match")

2001-11-13 Thread Ewald Schoeller

hello
we want to save every word of a text in an array field.
we want to solve the problem without "split".

Here's our code:

$str="eins zwei drei vier fünf sechs";
preg_match("'(\w+)(\s+\w+)*'",$str,$Wort);

$n=count($Wort);
for($i=0;$i<$n;$i++){echo "$i: $Wort[$i]";}

The result is:
0: eins zwei drei vier fünf sechs
1: eins
2: sechs

it only saves the first and the last word.
why doesn't it save every single word in one array field?
can anybody give us the (corrected) code to achieve the desired result?

thanks for every answer !!

Bruno and Ewald



-- 
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] Serial Port Programing

2001-11-13 Thread Ernesto


Brian C. Doyle wrote:

> Hello all,
> 
> Does PHP have the ability to control a serial port?  I see we can use 
> the Printer but that was All I saw.
> 
> 
> 

I guess you may fopen COM1: or COM2:
You should be able to fopen PRN: or LPT1: as well.


-- 
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 versus all other languages

2001-11-13 Thread Olexandr Vynnychenko

Hello Pat,

Tuesday, November 13, 2001, 4:10:31 AM, you wrote:

PH> I'm doing my senior exit project on database languages online. I'm asking
PH> for help from anyone who can provide any information on the comparison
PH> between the different languages. I'm comparing languages such as PHP, ASP,
PH> ColdFussion, perl and any others that I might not know about that you guys
PH> might know. Thank you to anyone who helps me out in the least.

Will we be able to see the result when it's ready?

-- 
Best regards,
 Olexandrmailto:[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] Variable definitions...

2001-11-13 Thread Stephan

Hello,

first of all I didn't exactely know where the right place is to ask this
question.

Well, my problem is that I just had some exams and am very unhappy on
how certain things were rated.

There's especially one question and I try to translate it as exact as
possible:

When is it possible that two variables have the same name but display
different variables?

The official solution was when in a script a global variable is declared
and then in a local part this variable is destroyed and declared again
with the same name (maybe even using different data type).

As for me, I'm of the opinion that this definition according to the
question is too narrow minded. I think that a variable is already
different if the the value within the variable is changed due to script
OR if you appoint a new value to the variable OR if the variable is an
array and some elements are accessed / elements are added / elements are
removed.
The reason why I think variables with different values can be considered
as different variable according to the question asked in the exam is
that when you declare a variable it also has a value even if this value
is NULL.

Now I'd like very much to hear your opinion on this issue since for me
very much depends on that (3 years of studying at college).

Stephan

P.S.: If you agree with me or not can you also send me an email to me?
[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] cron not allowed

2001-11-13 Thread Caspar Kennerdale


thanks for the ideas


-Original Message-
From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 15:23
To: Jon Haworth; [EMAIL PROTECTED]
Subject: RE: [PHP] cron not allowed


thanks jonwas more of a 'how are you going to' rather than 'how is it
possible' :-)
either way, from lynx or from php being a cgi a simple shell script or perl
script should be able to make the appropriate call...

jack

-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 9:29 AM
To: 'Jack Dempsey'; [EMAIL PROTECTED]
Subject: RE: [PHP] cron not allowed


> how did you plan on running php from cron?

Well, this works for me:

0 3 * * * lynx -dump http://mysite.com/mypage.php > /dev/null

HTH
Jon


**
'The information included in this Email is of a confidential nature and is
intended only for the addressee. If you are not the intended addressee,
any disclosure, copying or distribution by you is prohibited and may be
unlawful. Disclosure to any party other than the addressee, whether
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**

--
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] Re: Re: Empty form variables when uploading, Help please???

2001-11-13 Thread Alexander Weber

The Big Roach wrote:
> 
> In a form you can't really have 2 submit buttons.
> Either a submit submits or it is just a button.
> That's because the var name is already submit (check out your
> http_post_vars).
> And you have it twice!
> Change one of them and make it just a button (HTML4).
> Recheck your post-vars.
> This should help.

That's definetely not true. You can have more than one submit buttons in
a form. I often make formulars with more than one submit button, there
have not been any problems. 
You just have give a name and a value to your submit buttons. Then you
can check which one was pressed by the user.
For example:
...


...

Then just write:
if ($submit1 == "do this")
...
else if ($submit2) == "do that")
...

To [EMAIL PROTECTED]: 
Please post some code your formular action script (foto.php). Having
just the form, we can guess what went wrong.

-- 
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] I Need To Upload Massive Huge Files : 20Mb

2001-11-13 Thread The Big Roach

Fans!

I need your help, but first you must worship me.
Does PHP have a flakey file upload limit? Or what could be wrong?

max_upload_size and all that is set to 32Mb.
post_max_size is also set to 32Mb.
max_exec_time is set to 0 (unlimited).
apache's timeout is set to 1800 (30 mins).

And my 6Mb or less files upload.
But not my 7+Mb files.
This is frustrating.

But I think Rasmus can answer this for me.
Rasmus, over to you...

Here's my code just to prove I'm not a proud ^%#@!

  $conn_id = ftp_connect("$ftp_server");
  $login_result = ftp_login($conn_id, "$ftp_user_name",
"$ftp_user_pass");
  if ((!$conn_id) || (!$login_result)){
  echo "Ftp connection failed!";
  die;
  }
  else {
  echo "Connected to $ftp_server!";
  }

  @ftp_chdir($conn_id, $my_dir);

  @ftp_pasv ($conn_id, TRUE);

  /*Using ftp_fput*/
  $local_file = fopen($source_file, "r");
  $upload = @ftp_fput($conn_id, $destination_file, $local_file,
FTP_BINARY);
  /*Using ftp_put*/
/*  $upload = @ftp_put($conn_id, $destination_file, $source_file,
FTP_BINARY);*/

  if (!$upload) {
  echo "Ftp upload failed!";
  $headers = getallheaders();
  while (list ($header, $value) = each ($headers)) {
  echo "$header: $value\n";
  }
  }
  else {
  echo "Ftp upload successfull!Uploaded $destination_file to
$ftp_server/$my_dir";
  $headers = getallheaders();
  while (list ($header, $value) = each ($headers)) {
  echo "$header: $value\n";
  }
  }

  @ftp_quit($conn_id);




-- 
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: Empty form variables when uploading, Help please???

2001-11-13 Thread PACKER, Steffan

another option could be to make the choice between delete and update two
radio buttons with the same name and just have the one submit button, then
add extra logice to your PHP script to either delete or update depending on
the value of this field.

good luck!
Steffan

-Original Message-
From: The Big Roach [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 4:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Empty form variables when uploading, Help please???


In a form you can't really have 2 submit buttons.
Either a submit submits or it is just a button.
That's because the var name is already submit (check out your
http_post_vars).
And you have it twice!
Change one of them and make it just a button (HTML4).
Recheck your post-vars.
This should help.

Otherwise you're loosing your post vars somehwere in the fire-wall.
That's bad!


"Sandra Rascheli" <[EMAIL PROTECTED]> wrote in message
003601c16abd$3985ae70$c46223c8@srascheli">news:003601c16abd$3985ae70$c46223c8@srascheli...
Hi everybody,

I hope someone is able to help me with this, I've been having this problem
for  a couple of months now and I have not been able to find a solution. I
have a form to upload a file which submits to itself, and has two submit
buttons, one called "eliminarfoto" (deletephoto) and "salvar" (savephoto),
but for some weird and unexplainable reason (it only happens to some users,
not all of them) when they hit any of these two submit buttons, the form
returns empty variables.

This is part of my script, has anybody had a similar problem before??? Any
help would be greatly appreciated.

 
 
 
  Foto
  (opcional,tamaño máximo: 20k,formatos permitidos: JPEG,
GIF)
  
  ";
  }
  ?>
  
  
  
  
  
 
 
  
  
  

 
 
 







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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp



DISCLAIMER

Any opinions expressed in this email are those of the individual
and not necessarily the company.  This email and any files 
transmitted with it, including replies and forwarded copies (which
may contain alterations) subsequently transmitted from the 
Company, are confidential and solely for the use of the intended
recipient.  It may contain material protected by attorney-client
privilege.  If you are not the intended recipient or the person
responsible for delivering to the intended recipient, be advised
that you have received this email in error and that any use is
strictly prohibited.

If you have received this email in error please notify the Network
Manager by telephone on +44 (0) 870 243 2431.

Please then delete this email and destroy any copies of it.
This email has been swept for viruses before leaving our system.

Admiral Insurance Services Limited, Cardiff CF10 3AZ



_
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp



[PHP] Re: Empty form variables when uploading, Help please???

2001-11-13 Thread The Big Roach

In a form you can't really have 2 submit buttons.
Either a submit submits or it is just a button.
That's because the var name is already submit (check out your
http_post_vars).
And you have it twice!
Change one of them and make it just a button (HTML4).
Recheck your post-vars.
This should help.

Otherwise you're loosing your post vars somehwere in the fire-wall.
That's bad!


"Sandra Rascheli" <[EMAIL PROTECTED]> wrote in message
003601c16abd$3985ae70$c46223c8@srascheli">news:003601c16abd$3985ae70$c46223c8@srascheli...
Hi everybody,

I hope someone is able to help me with this, I've been having this problem
for  a couple of months now and I have not been able to find a solution. I
have a form to upload a file which submits to itself, and has two submit
buttons, one called "eliminarfoto" (deletephoto) and "salvar" (savephoto),
but for some weird and unexplainable reason (it only happens to some users,
not all of them) when they hit any of these two submit buttons, the form
returns empty variables.

This is part of my script, has anybody had a similar problem before??? Any
help would be greatly appreciated.

 
 
 
  Foto
  (opcional,tamaño máximo: 20k,formatos permitidos: JPEG,
GIF)
  
  ";
  }
  ?>
  
  
  
  
  
 
 
  
  
  

 
 
 







-- 
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] cron not allowed

2001-11-13 Thread Jack Dempsey

thanks jonwas more of a 'how are you going to' rather than 'how is it
possible' :-)
either way, from lynx or from php being a cgi a simple shell script or perl
script should be able to make the appropriate call...

jack

-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 9:29 AM
To: 'Jack Dempsey'; [EMAIL PROTECTED]
Subject: RE: [PHP] cron not allowed


> how did you plan on running php from cron?

Well, this works for me:

0 3 * * * lynx -dump http://mysite.com/mypage.php > /dev/null

HTH
Jon


**
'The information included in this Email is of a confidential nature and is
intended only for the addressee. If you are not the intended addressee,
any disclosure, copying or distribution by you is prohibited and may be
unlawful. Disclosure to any party other than the addressee, whether
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**

--
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] Mysql and Images

2001-11-13 Thread Stefan Rusterholz

If I understand you right, then what you want is just impossible.
You have to give a source as filepath. You can't put the binary picture data
into the same output.
What you could is to have a file which calls itself with params telling it
to output now the image instead of the html e.g. example.php which produces
without given parameters html like

You can then check in the example.php file if $showimage is set. if it is
set then you call a function to send correct header and binary data and die
afterwards (better: exit ;-)
But due hold it more simple I would hardly suggest you to have image-output
functions in a separate file. You can still use that file for all images in
your database

If I misunderstood you and you just want a sample code for outputting
picture-data then look at this:


I hope I could help you
Stefan Rusterholz, [EMAIL PROTECTED]
--
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
--
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
--
- Original Message -
From: "Rodrigo Peres" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 3:32 PM
Subject: [PHP] Mysql and Images


> His list,
>
> I have some images stores in a mysql database and now i need to recover
them
> to put in a html. My question is there's a way to do this in the same
page,
> I mean, withou the need to buil another php page that process th image?
> Something like a function that output the image to the  in the
> html.
>
> Thank's in advance
>
> Rodrigo Peres
> --
>
>
>
> --
> 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] RE: server side games question

2001-11-13 Thread Brinkman, Theodore

PHP will do fine.  What's the project?  I'm a wannabe game developer, and I
had a bit of fun a few months back with randomly generated, but
reproducable, game worlds (in my case it was a star map for a space conquest
type of game).  It's a really neat concept, and its how alot of the 'big
world' games were done when games came on floppy disks.  

The code isn't very polished, but if you're interested in that sort of
thing, I can dig it up and fire it off to you.

- Theo

-Original Message-
From: Daniel [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 5:32 AM
To: [EMAIL PROTECTED]
Subject: server side games question


Hi,

Right I'm still pretty new to server side programming and have a few
questions regarding the possible uses of existing technology in 'low-tech'
(not 3d FPS/RTS/RPGs) online games.  As I understand it PHP is used to add
dynamic content to HTML (from MySQL database for example) and it is also
possible to write applications in C/C++ that run on server computer (SUSE
7.2 + APACHE for example) that update databases at set time intervals.  I am
a games programmer and was wondering if it would be possible to code the
following system which would run on an SUSE Apache server box:

An database containing client and game data (use MySQL?),
An HTML/PHP based front end (is PHP best choice for this?),
A Some form of application that process the game or turn info (in the DB) at
set time intervals and updates the game database with it (use C/C++?).

I am competent in C/C++, ok at php and ok at MySQL but not sure how to fit
it all together like how do I go about creating an application that
process's the database?  Can any one suggest sites/books/people who I could
read/ask to find out more about this idea?  Also are the languages I
specified the best languages to use for this?  I am open to suggestions and
constructive criticism.

Cheers,

Daniel



-- 
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] URL Headers - Retrieval

2001-11-13 Thread HEW Staff

I currently have a script which gathers information from a site, adds a new
variable and then resubmits it as a post back to the originating script.

I need to gather the header information from the final response to
categorise the errors received. At the moment the error I get is not
consistant with the information that has been sent.

My hosting server, w/ Apache/1.3.19 PHP 4.0.6 and Linux does not have the
CURL lib installed.

Any help much appreciated.
Jonathan S Hardiman



-- 
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] cron not allowed

2001-11-13 Thread Jon Haworth

> how did you plan on running php from cron? 

Well, this works for me:

0 3 * * * lynx -dump http://mysite.com/mypage.php > /dev/null

HTH
Jon


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**

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




  1   2   >