php-general Digest 9 Jan 2002 05:06:48 -0000 Issue 1100

Topics (messages 79799 through 79859):

Re: Supplied argument is not a valid MySQL result resource
        79799 by: Andrey Hristov
        79800 by: Andrey Hristov
        79801 by: Dan McCullough
        79803 by: Jimmy

Http request
        79802 by: Sandeep Murphy
        79804 by: David
        79806 by: Jon Farmer

Trouble with named session vars in classes
        79805 by: Alan McFarlane

Re: [php-xml] Http Request
        79807 by: Manuel Lemos

Apache and PHP under win98  help !
        79808 by: rick

PHP 4.1 crypt()
        79809 by: Mike Eheler
        79811 by: Patrik Wallstrom
        79812 by: Mike Eheler
        79814 by: Patrik Wallstrom
        79815 by: Mike Eheler
        79816 by: Patrik Wallstrom

Question about php.ini and dynamic extensions
        79810 by: Joelmon2001.aol.com

Re: E-Commerce: go TEP
        79813 by: Kraa de Simon

Date
        79817 by: aurelio
        79822 by: Mike Eheler

Maybe OT but I was wondering....
        79818 by: Ben Turner
        79819 by: Richard Crawford
        79820 by: CC Zona
        79821 by: Maciej Uhlig

newbie - help with field variables in forms
        79823 by: Andrea Caldwell
        79829 by: Ivan Balazs

stripping high ascii from a string
        79824 by: bill
        79825 by: CC Zona

Webmail with Attach
        79826 by: Luz Lopez
        79827 by: Jason Murray
        79828 by: Martin Towell

SetHandler & PHP (parsing pages through a php script)
        79830 by: C J Michaels

IP address from which country
        79831 by: Zhang, Leon (STHK/Zh)
        79835 by: Andrew Brampton
        79837 by: Zhang, Leon (STHK/Zh)
        79838 by: Jason Murray
        79840 by: Zhang, Leon (STHK/Zh)
        79841 by: Jason Murray

How MySQL Query and Fetch work?
        79832 by: Alex Shi
        79836 by: Mehmet Kamil ERISEN

Checking mail origin?
        79833 by: Bogdan Stancescu
        79842 by: Bogdan Stancescu
        79846 by: Tom Rogers
        79848 by: Miles Thompson
        79853 by: Bogdan Stancescu

Re: Connecting PHP to a remote mysql database
        79834 by: Miles Thompson

Re: Sessions
        79839 by: Ryan Kelley

Apache virtualhosts with different user
        79843 by: Gabor Gludovatz
        79858 by: Rich Buggy

functions...
        79844 by: Chris Hall
        79855 by: Martin Towell

How reliable is the 'user' in http:[EMAIL PROTECTED]/???
        79845 by: Philip Hallstrom

apostrophe's in PHP & MySQL
        79847 by: Tim Thorburn
        79849 by: Jason Murray

PHP] apostrophe's in PHP & MySQL
        79850 by: Rafael Perazzo

Apostrophes and text fileds forms
        79851 by: Rafael Perazzo
        79852 by: Jason Murray

Re: php 4.1.1 and imap/ssl
        79854 by: Ron Peterson

I'm new - one page to another
        79856 by: universal2001
        79857 by: Bogdan Stancescu

inserting a file into MSSQL
        79859 by: Peter Lavender

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Possibilities:
1)There was an error when mysql_query(). Possibly the SQL statement is not correct. 
Trace with var_dump()/mysql_errno().
2)You give as parameter to some of mysql_* functions a variable not returned from 
mysql_query().

HTH

Regards,
Andrey Hristov

----- Original Message ----- 
From: "Dan McCullough" <[EMAIL PROTECTED]>
To: "PHP General List" <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 6:47 PM
Subject: [PHP] Supplied argument is not a valid MySQL result resource


> I know this is a common error, but what does it mean.  This snippet of code is 
>something I use all
> the time.
> 
> help please.
> 
> dan
> 
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
> 
> -- 
> 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]
> 
> 

--- End Message ---
--- Begin Message ---
Try this:
$parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC";
$parent_result = mysql_query($parent_sql);
var_dump($parent_result);
while ($parent = mysql_fetch_array($parent_result) ) { <-- problem here
    $parent_select .= "<option 
value=\"".$parent['id']."\">".$parent['cat_name']."</option>";
}

Regards,
Andrey
----- Original Message ----- 
From: "Dan McCullough" <[EMAIL PROTECTED]>
To: "Andrey Hristov" <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 7:00 PM
Subject: Re: [PHP] Supplied argument is not a valid MySQL result resource


> here is the sql
> 
> $parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC";
> $parent_result = mysql_query($parent_sql);
> while ($parent = mysql_fetch_array($parent_result) ) { <-- problem here
> $parent_select .= "<option 
>value=\"".$parent['id']."\">".$parent['cat_name']."</option>";
> }
> --- Andrey Hristov <[EMAIL PROTECTED]> wrote:
> > Possibilities:
> > 1)There was an error when mysql_query(). Possibly the SQL statement is not 
>correct. Trace with
> > var_dump()/mysql_errno().
> > 2)You give as parameter to some of mysql_* functions a variable not returned from 
>mysql_query().
> > 
> > HTH
> > 
> > Regards,
> > Andrey Hristov
> > 
> > ----- Original Message ----- 
> > From: "Dan McCullough" <[EMAIL PROTECTED]>
> > To: "PHP General List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 08, 2002 6:47 PM
> > Subject: [PHP] Supplied argument is not a valid MySQL result resource
> > 
> > 
> > > I know this is a common error, but what does it mean.  This snippet of code is 
>something I use
> > all
> > > the time.
> > > 
> > > help please.
> > > 
> > > dan
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Send FREE video emails in Yahoo! Mail!
> > > http://promo.yahoo.com/videomail/
> > > 
> > > -- 
> > > 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]
> > > 
> > > 
> > 
> 
> 
> =====
> dan mccullough
> --------------------------------------------------------
> "Theres no such thing as a problem unless the servers are on fire!"
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
> 

--- End Message ---
--- Begin Message ---
Here is the code

$parent_select = "<TR><TD BGCOLOR=\"#F7F7F7\"><FONT FACE=\"Verdana, Arial, Tahoma\" 
SIZE=\"2\"
COLOR=\"#000000\">Parent Category:</font></td><TD BGCOLOR=\"#F7F7F7\" 
WIDTH=\"80%\"><select
name=\"parent_id\">";
$parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC";
$parent_result = mysql_query($parent_sql);
while ($parent = mysql_fetch_array($parent_result) ) { <-- the problem line
$parent_select .= "<option 
value=\"".$parent['id']."\">".$parent['cat_name']."</option>";
}
$parent_select = "</select></td></tr>\n";
print $parent_select;


this is similar to code that I use to get the result for several other places


--- Andrey Hristov <[EMAIL PROTECTED]> wrote:
> Possibilities:
> 1)There was an error when mysql_query(). Possibly the SQL statement is not correct. 
>Trace with
> var_dump()/mysql_errno().
> 2)You give as parameter to some of mysql_* functions a variable not returned from 
>mysql_query().
> 
> HTH
> 
> Regards,
> Andrey Hristov
> 
> ----- Original Message ----- 
> From: "Dan McCullough" <[EMAIL PROTECTED]>
> To: "PHP General List" <[EMAIL PROTECTED]>
> Sent: Tuesday, January 08, 2002 6:47 PM
> Subject: [PHP] Supplied argument is not a valid MySQL result resource
> 
> 
> > I know this is a common error, but what does it mean.  This snippet of code is 
>something I use
> all
> > the time.
> > 
> > help please.
> > 
> > dan
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Send FREE video emails in Yahoo! Mail!
> > http://promo.yahoo.com/videomail/
> > 
> > -- 
> > 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]
> 


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---
Hi Dan,

> $parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC";
> $parent_result = mysql_query($parent_sql);

change the line to this one and run it again to see the error:
$parent_result = mysql_query($parent_sql) or die(mysql_error());

--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Brain off-line, please wait.


--- End Message ---
--- Begin Message ---
Hi,

Can anyone tellme how I can do a http request to a servlet from a PHP??

I mean, I have a username and password which I want to send in a
string(variable) to a Servlet which authentifies it and responses back in
XML format...

any suggestions??

TIA,
sandeep
--- End Message ---
--- Begin Message ---
 just use post to send your username/password to the servlet

>Hi, 
>
>Can anyone tellme how I can do a http request to a servlet >from a PHP?? 
>
>I mean, I have a username and password which I want to >send in a string(variable) to 
>a Servlet which authentifies >it and responses back in XML format... 
>
>any suggestions?? 
>
>TIA, 
>sandeep 
--- End Message ---
--- Begin Message ---
> just use post to send your username/password to the servlet
>
> >Hi,
> >
> >Can anyone tellme how I can do a http request to a servlet >from a PHP??
> >
> >I mean, I have a username and password which I want to >send in a
string(variable) to a Servlet which authentifies >it and responses back in
XML format...
> >
> >any suggestions??


Well that would suffice if he just wanted to display the raw XML in the
broswer. However if he wanted to parse the XML he needs to open a socket on
port 80 or use a http class.

Regards


jon

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key


--- End Message ---
--- Begin Message ---
I'm having trouble with some session management code.

What I'm after is a basic class which is capable of storing some data via
the built-in
session handling routines. The name of the session variable must be
configurable at
run-time.

i.e:

$object1 = new Object( 'object1_session_variable_name' );
$object2 = new Object( 'object2_session_variable_name' );

Unfortunately, I can't get this to work...

[ ---------- END CODE SAMPLE ---------- ]

class Test
{ 
var $sessvar; 

function Test( $sessvar ) 
{ 
// set the name of the session variable to use for persistent storage 

$this->sessvar = $sessvar; 
} 

function Execute( ) 
{ 
// get this instance's session data 

$container = &$this->container(); 

// display the data 

echo "container['sequence'] = " . $container['sequence'] . "<br>"; 
echo "container['signature'] = " . $container['signature'] . "<br>"; 

// update the sequence # value 

$container['sequence']++; 
} 

function &factory( $sessvar ) 
{ 
static $instances; 

// generate the instance id 

$id = $sessvar; 

// if the instance already exists, return it 

if (isset($instances[$id])) 
{ 
return $instances[$id]; 
} 

// create a new instance; 

$object = new Test($sessvar); 

// get the new instance's session data 

$container = &$object->container(); 

// set it's signature 

$container['siganture'] = $sessvar; 

// store the newly created instance 

$instances[$id] = &$object; 

// and return the new instance 

return $object; 
} 

function &container( ) 
{ 
static $container; 

if (!isset($container)) 
{ 
if (session_is_registered($this->sessvar)) 
{ 
if (ini_get("register_globals")) 
{ 
$container = &$GLOBALS[$this->sessvar]; 
} 
else if (function_exists("version_compare")) 
{ 
$container = &$_SESSION[$this->sessvar]; 
} 
else 
{ 
$container = &$HTTP_SESSION_VARS[$this->sessvar]; 
} 
} 
else 
{ 
session_register($this->sessvar); 

$container = array 
( 
'sequence' => 1, 
'signature' =>
 ""
);
}
}

return $container;
}
}

session_start();

$test1 = &Test::factory("test1_data");
$test2 = &Test::factory("test2_data");

echo "\$test1->Execute() reports: ";
$test1->Execute();

echo "\$test2->Execute() reports: ";
$test2->Execute();

echo "\$test1->Execute() reports: ";
$test1->Execute();

[ ---------- END CODE SAMPLE ---------- ]

Running this in a browser, I would expect to see the following:

$test1->Execute reports:
container['sequence'] = 1
container['signature'] = test1_data

$test2->Execute reports:
container['sequence'] = 1
container['signature'] = test2_data

$test1->Execute reports:
container['sequence'] = 2
container['signature'] = test1_data

And on refreshing the browser:

$test1->Execute reports:
container['sequence'] = 3
container['signature'] = test1_data

$test2->Execute reports:
container['sequence'] = 2
container['signature'] = test2_data

$test1->Execute reports:
container['sequence'] = 4
container['signature'] = test1_data

However... it doesn't!

Any clues, suggestions, hints, tips, etc. would be most gratefully recieved
as I'v been trying to
get this code to work for some considerable time now.

Oh and BTW, the code MUST be capable of running on PHP 4.0.0 but can take
advantage of anything
up-to and including PHP 4.1.0, and must use the standard built-in session
handling routines.

Thanks
--
Alan McFarlane
[EMAIL PROTECTED]
ICQ: 20787656


--- End Message ---
--- Begin Message ---
Hello,

Sandeep Murphy wrote:
> 
> Hi,
> 
> Can anyone tellme how I can do a http request to a servlet from a PHP??
> 
> I mean, I have a username and password which I want to send in a
> string(variable) to a Servlet which authentifies it and responses back in
> XML format...
> 
> any suggestions??

This is what you need. There is even an example on how to make a SOAP
request via HTTP.

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

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
hi guys , 

         I have a problem with my Apache and PHP configuration under 
win 98 .....

I can't make it works......

This is my httpd lines pointing to php : 

 LoadModule php4_module c:\php\dlls\php4apache.dll
    AddType application/x-httpd-php .php4
    
    ScriptAlias /php4/ "C:/php/"
    Action application/x-httpd-php4 "/php/php.exe"
    AddType application/x-httpd-php4 .php

I had this configuration before and all works fine , but now 
When I try to run Apache for the first time , Its tell me that he 
can't  find the php4apache.dll library . 

but the library is there.....??!!! , next I change the path to point 
to sapi directory where the library also exists , but I get the same 
error ......

The most amazing part is that when I browse the directory I can't see 
the file !!!!!!!!! but when I try to copy the file inside the directory
its tells me that the file already exists !!!!! 

so , What's happend ?  

Somebody could help me ??  

thanks in advance , guys 


Ricardo Karcher 




--- End Message ---
--- Begin Message ---
Is there any way to force PHP 4.1's crypt to generate crypt's with 
2-letter salts? We've written some apps that do things the hack way -- 
if (crypt($pass,substr($pass,0,2)) == $cryptpass) -- and changing all of 
them to work the extended way is a real pain the arse. That includes 
changing all our password generation code to create 2-letter salts.

Any help much appreciated.

In short -- I want crypt() to work like it did in 4.0.6.

Mike

--- End Message ---
--- Begin Message ---
On Tue, 8 Jan 2002, Mike Eheler wrote:

> Is there any way to force PHP 4.1's crypt to generate crypt's with
> 2-letter salts? We've written some apps that do things the hack way --
> if (crypt($pass,substr($pass,0,2)) == $cryptpass) -- and changing all of
> them to work the extended way is a real pain the arse. That includes
> changing all our password generation code to create 2-letter salts.
>
> Any help much appreciated.
>
> In short -- I want crypt() to work like it did in 4.0.6.

This is exactly the reason you should use a specific standard hash
algorithm like MD5 or SHA-1 when encrypting passwords. The PHP crypt()
call uses the system call crypt(), which might vary between different
systems.

Look at the PHP man pages for crypt() and the mcrypt package for more info
on the subject. With mcrypt you can use whatever crypto function you need
for compatibility.

http://www.php.net/manual/en/function.crypt.php
http://www.php.net/manual/en/ref.mcrypt.php

--
patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-709580442

--- End Message ---
--- Begin Message ---
It's too late for that. And I don't believe that the system's crypt() 
function just magically changed at exactly the same time we upgraded to 
PHP 4.1

Mike

Patrik Wallstrom wrote:

> On Tue, 8 Jan 2002, Mike Eheler wrote:
> 
> 
>>Is there any way to force PHP 4.1's crypt to generate crypt's with
>>2-letter salts? We've written some apps that do things the hack way --
>>if (crypt($pass,substr($pass,0,2)) == $cryptpass) -- and changing all of
>>them to work the extended way is a real pain the arse. That includes
>>changing all our password generation code to create 2-letter salts.
>>
>>Any help much appreciated.
>>
>>In short -- I want crypt() to work like it did in 4.0.6.
>>
> 
> This is exactly the reason you should use a specific standard hash
> algorithm like MD5 or SHA-1 when encrypting passwords. The PHP crypt()
> call uses the system call crypt(), which might vary between different
> systems.
> 
> Look at the PHP man pages for crypt() and the mcrypt package for more info
> on the subject. With mcrypt you can use whatever crypto function you need
> for compatibility.
> 
> http://www.php.net/manual/en/function.crypt.php
> http://www.php.net/manual/en/ref.mcrypt.php
> 
> --
> patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-709580442
> 
> 

--- End Message ---
--- Begin Message ---
On Tue, 8 Jan 2002, Mike Eheler wrote:

> It's too late for that. And I don't believe that the system's crypt()
> function just magically changed at exactly the same time we upgraded to
> PHP 4.1

According to the crypt() man page, crypt() can use four methods of
encryption:

  CRYPT_STD_DES - Standard DES-based encryption with a two character salt
  CRYPT_EXT_DES - Extended DES-based encryption with a nine character salt
  CRYPT_MD5 - MD5 encryption with a twelve character salt starting with $1$
  CRYPT_BLOWFISH - Blowfish encryption with a sixteen character salt starting with $2$

You should check which method your crypt() method used before changing
PHP version, and use the mcrypt specific method. You did backup the old
php installation, right?

--
patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-709580442

--- End Message ---
--- Begin Message ---
Too late for that, too.. in addition to providing web hosting for 
hundreds of sites, we are also a web development company and have 2 
major websites out there using extended php 4.1 features.

We need STD_DES, and it appears that PHP 4.1 has switched to using MD5 
by default.

Thanks for your help! I'll see what I can do.

Mike

Patrik Wallstrom wrote:

> On Tue, 8 Jan 2002, Mike Eheler wrote:
> 
> 
>>It's too late for that. And I don't believe that the system's crypt()
>>function just magically changed at exactly the same time we upgraded to
>>PHP 4.1
>>
> 
> According to the crypt() man page, crypt() can use four methods of
> encryption:
> 
>   CRYPT_STD_DES - Standard DES-based encryption with a two character salt
>   CRYPT_EXT_DES - Extended DES-based encryption with a nine character salt
>   CRYPT_MD5 - MD5 encryption with a twelve character salt starting with $1$
>   CRYPT_BLOWFISH - Blowfish encryption with a sixteen character salt starting with 
>$2$
> 
> You should check which method your crypt() method used before changing
> PHP version, and use the mcrypt specific method. You did backup the old
> php installation, right?
> 
> --
> patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-709580442
> 
> 

--- End Message ---
--- Begin Message ---
On Tue, 8 Jan 2002, Mike Eheler wrote:

> Too late for that, too.. in addition to providing web hosting for
> hundreds of sites, we are also a web development company and have 2
> major websites out there using extended php 4.1 features.
>
> We need STD_DES, and it appears that PHP 4.1 has switched to using MD5
> by default.
>
> Thanks for your help! I'll see what I can do.

If you really really need STD_DES for PHP 4.1, check the source code in
ext/standard/crypt.c and force it to use STD_DES and recompile.

>From crypt.c:

/*
   The capabilities of the crypt() function is determined by the test programs
   run by configure from aclocal.m4.  They will set PHP_STD_DES_CRYPT,
   PHP_EXT_DES_CRYPT, PHP_MD5_CRYPT and PHP_BLOWFISH_CRYPT as appropriate
   for the target platform
*/

--
patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-709580442

--- End Message ---
--- Begin Message ---
Hello, if I want to be able to load dynamic extensions via php, do I just go 
to
php.ini and under

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
 ;;;;;;;;;;;;;;;;;;;;;;

Do I just add the extensions I need?
   extension=msql.so
   extension=gd.so
   extension=xml.so

making sure they are uncommented ?

And then just save the file and reload apache?

In the php page, would
dl("gd.so");

activate it? Is this how to do it?

Thanks
--- End Message ---
--- Begin Message ---
BTW

TEP is called osCommerce nowadays.

http://www.oscommerce.com/

> -----Original Message-----
> From: Vincent Stoessel [mailto:[EMAIL PROTECTED]]
> Sent: dinsdag 8 januari 2002 17:08
> To: Julio Nobrega Trabalhando
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Re: E-Commerce: go TEP
> 
> 
> I have to second the TEP recommendation. I am using it for
> an E-tailer client of mine and it is performing flawlessly. Also,
> the project has a lot of enthusiastic developers behind it.
> 
> Julio Nobrega Trabalhando wrote:
> 
> > 
> > 
> --------------------------------------------------------------
> ----------
> > 
> > Subject:
> 
> > 
> > 
> >   I haven't used, but heard good stuff from folks of the 
> local mailing list,
> > from TEP.
> > 
> > http://theexchangeproject.org/
> > 
> > --
> > 
> > Julio Nobrega.
> > 
> > Um dia eu chego l:
> > http://sourceforge.net/projects/toca
> > 
> > Ajudei? Salvei? Que tal um presentinho?
> > http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> -- 
> Vincent Stoessel [EMAIL PROTECTED]
> Java Linux Apache Mysql Php (JLAMP) Engineer
> (301) 362-1750 Mobile (410) 419-8588
> AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica
> 
> 
> -- 
> 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]
> 
--- End Message ---
--- Begin Message ---
hi,

how i make to catch a future date, with this formatting 09/01/2002.???

thanks,
Aurlio Sabino
--- End Message ---
--- Begin Message ---
echo date('m/d/Y', strtotime('September 1, 2002'));

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

Mike

Aurelio wrote:

> hi,
> 
> how i make to catch a future date, with this formatting 09/01/2002.???
> 
> thanks,
> Aurlio Sabino
> 
> 

--- End Message ---
--- Begin Message ---
I am trying to set up a completely dynamic site using php and a mysql
backend.  I am trying to find somewhere that I can identify a custom 404
error page and then pull the page based on the document directory.  Problem
is, is this even possible in PHP?  I haven't found too much related to
custom 404 pages done in php.

So I was thinking, if anyone knows some information on this topic, might you
have a url or maybe a book title that I could check out to research this a
bit further?

thanks for your help
Ben
--- End Message ---
--- Begin Message ---
I believe that this is something you actually set in your webserver. 
Which webserver are you running?  Check out the documentation for that.

Ben Turner wrote:

> I am trying to set up a completely dynamic site using php and a mysql
> backend.  I am trying to find somewhere that I can identify a custom 404
> error page and then pull the page based on the document directory.  Problem
> is, is this even possible in PHP?  I haven't found too much related to
> custom 404 pages done in php.
> 
> So I was thinking, if anyone knows some information on this topic, might you
> have a url or maybe a book title that I could check out to research this a
> bit further?
> 
> thanks for your help
> Ben
> 
> 



-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED] 
        http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

"When you have lost the ability to laugh at yourself, you have lost the 
ability to think straight." --Clarence Darrow

"Push the button, Max!"


--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Ben Turner) wrote:

> I am trying to find somewhere that I can identify a custom 404
> error page and then pull the page based on the document directory. 

If you just want to customize your 404 page (presumably to call a PHP 
script?), your web server documentation should be of assistance.  For 
instance, Apache's ErrorDocument directive 
<http://httpd.apache.org/docs/mod/core.html#errordocument> is quite simple 
to implement, as long as the hosting setup at least permits use of an 
.htaccess file.

By "pull the page based on the document directory" do mean that you want to 
display different versions of a 404 page depending upon what URL resulted 
in the 404 status?  For instance, /dir1/badpath1 would get "No such page, 
bozo" while /dir2/badpath2 would get "That page is not available, but 
here's our site map instead", etc.?  If so, then you may want to direct all 
404s to a single PHP script, then let the script generate appropriate 
output based on an env var such as PHP_SELF, REQUEST_URI, SCRIPT_NAME (see 
phpinfo() for a bunch of possibilities).

-- 
CC
--- End Message ---
--- Begin Message ---
read http://shat.net/php/404/ as an example then do your page...

Maciek

> -----Original Message-----
> From: Ben Turner [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 08, 2002 9:37 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Maybe OT but I was wondering....
>
>
> I am trying to set up a completely dynamic site using php and a mysql
> backend.  I am trying to find somewhere that I can identify a custom 404
> error page and then pull the page based on the document
> directory.  Problem
> is, is this even possible in PHP?  I haven't found too much related to
> custom 404 pages done in php.
>
> So I was thinking, if anyone knows some information on this
> topic, might you
> have a url or maybe a book title that I could check out to research this a
> bit further?

--- End Message ---
--- Begin Message ---
Hi there,

I'm really, really new at this (like 2 days into it) and never programmed
before (besides HTML)... so please bear with me.

I established an email feedback form, everything works fine, and now I'd
like to add code to make a couple of fields required.  What function would I
use for this and how would it be structured?

Any help would be appreciated... thanks!

Andrea


--- End Message ---
--- Begin Message ---
Hi!

A very simple way to do this is by checking the variables of the form (the
names of fields) if they are isset() or not. To be more specific you can
even check, if any of them is empty().
In special cases like the email address, i suggest using regexp to check
if it is a valid email address.

The structure i use for this:
if (isset($name_of_submit_button) {
        here comes the checking part
        if (error_occures) $error = true;
}
if (isset($name_of_submit_button) && !$error) {
        send the email
} else {
        show the form itself
}

this is my way, but there are other good solutions out there as well.

>
> I established an email feedback form, everything works fine, and now I'd
> like to add code to make a couple of fields required.  What function would I
> use for this and how would it be structured?
>
> Any help would be appreciated... thanks!
you're welcome
Balazs

--- End Message ---
--- Begin Message ---
Is there a function that can strip high ascii from a string?

thanks,

bill

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bill) 
wrote:

> Is there a function that can strip high ascii from a string?

How about a regex?  preg_replace() supports matching on octal or hex ranges 
<http://www.php.net/manual/en/pcre.pattern.syntax.php>, so perhaps one of 
these...?

$newstring=preg_replace('/[\200-\377]/','',$oldstring); //octal
$newstring=preg_replace('/[\x80-\xff]/','',$oldstring); //hex

-- 
CC
--- End Message ---
--- Begin Message ---
Hi All,

I am making a webmail, this webmail can send with just one attach, but I 
need that that my webmail can send mail with many attach.

Now my function have the follwing code line:

if ($attach != "none")
        {
                $file = fopen($attach, "r");
                $contents = fread($file, $attach_size);
                $encoded_attach = chunk_split(base64_encode($contents));
                fclose($file);

                //$encoded_attach = base64_encode($attach);\
                //$encoded_attach = $attach;

                $mailheaders .= "MIME-version: 1.0\n";
                $mailheaders .= "Content-type: multipart/mixed; ";
                $mailheaders .= "boundary=\"Message-Boundary\"\n";
                $mailheaders .= "Content-transfer-encoding: 7BIT\n";
                $mailheaders .= "X-attachments: $attach_name";

                $body_top = "--Message-Boundary\n";
                $body_top .= "Content-type: text/plain; charset=US-ASCII\n";
                $body_top .= "Content-transfer-encoding: 7BIT\n";
                $body_top .= "Content-description: Mail message body\n\n";

                $msg_body = $body_top . $msg_body;

                $msg_body .= "\n\n--Message-Boundary\n";
                $msg_body .= "Content-type: $attach_type; 
name=\"$attach_name\"\n";
                $msg_body .= "Content-Transfer-Encoding: BASE64\n";
                $msg_body .= "Content-disposition: attachment; 
filename=\"$attach_name\"\n\n";
                $msg_body .= "$encoded_attach\n";
                $msg_body .= "--Message-Boundary--\n";
        }


How can I do it?

Some body can help me?

Thanks in Advanced,

Regards,

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---
> I need that that my webmail can send mail with many attach.
> How can I do it?

You could either ask the user how many attachments they want,
and present that number of <INPUT TYPE=FILE> fields, or you
can grab the file attachment from the user, store it in a 
uniquely-named temporary directory, get another, and another, 
and store them all in the temp directory until the user says
"right, that's it" at which point you read all the files in
your directory and send them as attachments. 

You've got the code right for sending one attachment, sending
mutliples is just another loop in the email assembly code.

Jason
--- End Message ---
--- Begin Message ---
you just need to loop this part of the code:

  $msg_body .= "\n\n--Message-Boundary\n";
  $msg_body .= "Content-type: $attach_type; name=\"$attach_name\"\n";
  $msg_body .= "Content-Transfer-Encoding: BASE64\n";
  $msg_body .= "Content-disposition: attachment;
filename=\"$attach_name\"\n\n";
  $msg_body .= "$encoded_attach\n";

as many times as there are attachments, obviously, using the next
attachment's content and type for $encoded_attach and $attach_type

and don't do:

  $msg_body .= "--Message-Boundary--\n";

until all the attachments have been added

hope that helps
Martin


-----Original Message-----
From: Luz Lopez [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Webmail with Attach


Hi All,

I am making a webmail, this webmail can send with just one attach, but I 
need that that my webmail can send mail with many attach.

Now my function have the follwing code line:

if ($attach != "none")
        {
                $file = fopen($attach, "r");
                $contents = fread($file, $attach_size);
                $encoded_attach = chunk_split(base64_encode($contents));
                fclose($file);

                //$encoded_attach = base64_encode($attach);\
                //$encoded_attach = $attach;

                $mailheaders .= "MIME-version: 1.0\n";
                $mailheaders .= "Content-type: multipart/mixed; ";
                $mailheaders .= "boundary=\"Message-Boundary\"\n";
                $mailheaders .= "Content-transfer-encoding: 7BIT\n";
                $mailheaders .= "X-attachments: $attach_name";

                $body_top = "--Message-Boundary\n";
                $body_top .= "Content-type: text/plain; charset=US-ASCII\n";
                $body_top .= "Content-transfer-encoding: 7BIT\n";
                $body_top .= "Content-description: Mail message body\n\n";

                $msg_body = $body_top . $msg_body;

                $msg_body .= "\n\n--Message-Boundary\n";
                $msg_body .= "Content-type: $attach_type; 
name=\"$attach_name\"\n";
                $msg_body .= "Content-Transfer-Encoding: BASE64\n";
                $msg_body .= "Content-disposition: attachment; 
filename=\"$attach_name\"\n\n";
                $msg_body .= "$encoded_attach\n";
                $msg_body .= "--Message-Boundary--\n";
        }


How can I do it?

Some body can help me?

Thanks in Advanced,

Regards,

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.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]
--- End Message ---
--- Begin Message ---
Server version: Apache/1.3.22 (Unix) + mod_php/4.1.1

Hello,

Short Question:
What is php's apache handler, i.e. for use with the "SetHandler" statement?

Longer Version:
I would like to parse every URI that is requested on a certain VirtualHost,
through a specific PHP script.  I have _almost_ figgured out a way to do it
but I've run into one snag.  Below is the config I am using.

I am using "Action" to assign a handler to a specific php script and then
using "SetHandler" in the VHost to use that script.

If I use a script that is not in a directory that falls under the one I
specified "SetHandler" in it works fine.  If the script falls under the same
dir that has the "SetHandler" specified, I get sucked into a loop.  I'll
eventually get an error to the effect of:

Forbidden:
/path-to/script.php/path-to/script.php/path-to/script.php/path-to/script.php
/path-to/script.php/path-to/script.php/URL-REQUESTED

The kicker here being, is that I want EVERY url on the server to be
processed by the .php script I specify, so everything on that server (even
the script) falls under the "SetHandler" directive.

I cannot seem to find a way to disable the "SetHandler" but I can specify a
new one.  Problem is, I have no clue what to use for the "SetHandler"
statement that would force it to be processed by php.

Any assistance would be greatly appreciated.  I'm open to alternate
solutions to my root problem.

--Chris

=========
<VirtualHost *:80>
ServerName myserver.mydomain.org
DocumentRoot /usr/local/www/myserver
Action php-parse /path-to/script.php

<Directory "/usr/local/www/myserver">
 SetHandler php-parse
 allow from all
 order allow,deny
</Directory>
</VirtualHost>
==========


--- End Message ---
--- Begin Message ---
Hi,
 In php ,we can easily get the ip address of a connected computer ,but I always see on the web that there are some pages can tell you where you are from,so there must be a complete table show the relation of the ip address and country or region ,where can I find this .
 
Thanks .
Leon
 
--- End Message ---
--- Begin Message ---
No such table, the best you can do is look at their hostname and parse the last part 
ie .co.uk or .com... And then u can try and figure where they are from that

Andrew
  ----- Original Message ----- 
  From: Zhang, Leon (STHK/Zh) 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, January 09, 2002 1:03 AM
  Subject: [PHP] IP address from which country


  Hi,
   In php ,we can easily get the ip address of a connected computer ,but I always see 
on the web that there are some pages can tell you where you are from,so there must be 
a complete table show the relation of the ip address and country or region ,where can 
I find this .

  Thanks .
  Leon



------------------------------------------------------------------------------


  -- 
  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]
--- End Message ---
--- Begin Message ---

Thank you Andrew,but in China mainland ,I saw many websites can even tells
the province information which the user come from and I think in USA the
State information can also be gotten from the visitor's ip address.BTW,in
PHP what we can get is just the ip address of the user how can we get the
host name ?Anything missed here?
Regards
Leon


-----ԭʼʼ-----
: Andrew Brampton [mailto:[EMAIL PROTECTED]]
ʱ: 09 January, 2002 9:46
ռ: Zhang, Leon (STHK/Zh)
: [EMAIL PROTECTED]
: Re: [PHP] IP address from which country


No such table, the best you can do is look at their hostname and parse the
last part ie .co.uk or .com... And then u can try and figure where they are
from that

Andrew
  ----- Original Message ----- 
  From: Zhang, Leon (STHK/Zh) 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, January 09, 2002 1:03 AM
  Subject: [PHP] IP address from which country


  Hi,
   In php ,we can easily get the ip address of a connected computer ,but I
always see on the web that there are some pages can tell you where you are
from,so there must be a complete table show the relation of the ip address
and country or region ,where can I find this .

  Thanks .
  Leon



----------------------------------------------------------------------------
--


  -- 
  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]
--- End Message ---
--- Begin Message ---
> Thank you Andrew,but in China mainland ,I saw many websites can even tells
> the province information which the user come from and I think in USA the
> State information can also be gotten from the visitor's ip address.BTW,in
> PHP what we can get is just the ip address of the user how can we get the
> host name ?Anything missed here?

A database may exist for IPs in China (I don't know), but outside of China 
it's impossible to tell with much accuracy which country an IP is in. You
could look at Digital Envoy, which was an attempt a couple of years ago
to 'map the internet' and obtain exactly the data you're referring to. The
problem is that as soon as that data is published it's out of date due to
routing changes and network configuration changes.

You can do a reverse lookup on the IP address to get the hostname, but you
can rely on that even less - for example, a hostname ending in aol.com could

be in the USA, Europe, Asia, or Australia these days.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"
--- End Message ---
--- Begin Message ---
Thank you Jason ,I will check the Digital Envoy to get more information
,have you got the website address of it?



-----ԭʼʼ-----
: Jason Murray [mailto:[EMAIL PROTECTED]]
ʱ: 09 January, 2002 10:06
ռ: 'Zhang, Leon (STHK/Zh)'; [EMAIL PROTECTED]
: [EMAIL PROTECTED]
: RE: [PHP] IP address from which country


> Thank you Andrew,but in China mainland ,I saw many websites can even tells
> the province information which the user come from and I think in USA the
> State information can also be gotten from the visitor's ip address.BTW,in
> PHP what we can get is just the ip address of the user how can we get the
> host name ?Anything missed here?

A database may exist for IPs in China (I don't know), but outside of China 
it's impossible to tell with much accuracy which country an IP is in. You
could look at Digital Envoy, which was an attempt a couple of years ago
to 'map the internet' and obtain exactly the data you're referring to. The
problem is that as soon as that data is published it's out of date due to
routing changes and network configuration changes.

You can do a reverse lookup on the IP address to get the hostname, but you
can rely on that even less - for example, a hostname ending in aol.com could

be in the USA, Europe, Asia, or Australia these days.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

-- 
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]
--- End Message ---
--- Begin Message ---
> Thank you Jason ,I will check the Digital Envoy to get more 
> information, have you got the website address of it?

www.google.com ... "digital envoy" ... "I'm feeling lucky" :)

... or just www.digitalenvoy.net.

Search engines are fun :)

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"
--- End Message ---
--- Begin Message ---
Yesterday I posted a question yet got response. The question 
is regarding to how Query works. Now I repost it in a more 
specific way.

I am just wondering how MySQL API functions work. Let's look
at following two functions:

1. mysql_query(), 
2. mysql_fetch_array()

To my understanding, mysql_query() will definately to its job with
MySQL server. But how about the latter? Does it just fetch data
from client/local buffer, which is previously put in by mysql_query(), 
or still has to goto server side to fetch data?

Alex


--- End Message ---
--- Begin Message ---
Hi,
Suppose you have a table students:
student_id / student_name / GPA

here is the code:

$sql = "select * 
        from students";

$result = mysql_query($sql);
 while(list($student_id,
$student_name,$gpa)=mysql_fetch_array($result) {

echo $student_name." has a GPA of".$gpa."<BR>";

}
     
btw, this is something really basic, you should be able to
go to the php.net and read the documentation. there are
great examples.



--- Alex Shi <[EMAIL PROTECTED]> wrote:
> Yesterday I posted a question yet got response. The
> question 
> is regarding to how Query works. Now I repost it in a
> more 
> specific way.
> 
> I am just wondering how MySQL API functions work. Let's
> look
> at following two functions:
> 
> 1. mysql_query(), 
> 2. mysql_fetch_array()
> 
> To my understanding, mysql_query() will definately to its
> job with
> MySQL server. But how about the latter? Does it just
> fetch data
> from client/local buffer, which is previously put in by
> mysql_query(), 
> or still has to goto server side to fetch data?
> 
> Alex
> 
> 
> 
> -- 
> 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]
> 


=====
Mehmet Erisen
http://www.erisen.com

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---
Hi all!

I'm working on a free software package due to be launched on freshmeat
some time soon (next month most probably). The program is a project
development environment, somewhat similar to phpGroupWare but, I like to
think, better and with less bugs.

Due to the nature of the project I need to be able to give registered
users the ability to upload data in the system via e-mail. This
obviously means checking who the originator of the e-mail is, apart from
actually processing the e-mail (which works fine).

My problem is, how do I check that securely? I'm currently using the
headers of the e-mail for the "from:" field and check it against the
registered users' e-mail addresses. Works fine. But I guess that's
pretty easy to trick.

I basically have two concerns: one is that a person may send an e-mail
with fake headers. The other is that a user (or non-user) on the same
domain with another user would be able to send messages using the second
guy's e-mail account (that's because SMTP doesn't have any security
mechanism and one can easily impersonate somebody else once they're
logged on a computer with SMTP permissions on the mail server).

Did anybody run into this kind of problem? Any suggestions?

Thanks in advance - I'll let you know when we release this thing if
you're interested.

Bogdan



--- End Message ---
--- Begin Message ---
Billy Harvey wrote:

> Bogdan, a technique I've used in the past may work for you.
>
> When someone wants to upload something, I have them request a cookie by
> sending a blank email to a specific address.  This automatically
> generated cookie is good for some limited time (whatever works for you),
> and will only be sent to appropriate return addresses (I use a web form
> to allow the proper registration of those addresses).
>
> This cookie then needs to be used in the subject-line of the email - a
> reply to the message would work for example.
>
> So, if your system gets an email with a specially formatted, and
> short-lived (randomly generated) cookie in the subject, it knows what to
> do with it.
>
> Billy

Thanks for taking the time to reply!

That's the proper (and definitely secure) way to do it. However I'm looking
for something not necessarily that secure, because the servers won't be
public, but with a more "on-the-fly" approach for the user.

You see, this feature is the alternative to uploading data by logging in the
system. Logging in is no big deal - just type your username and password and
you're there. Two clicks away and you can upload. This, however, would be a
simple way to send an e-mail on a project you're working on to another user
and simply CC the system so there's a copy there for everybody to see
without spamming all the people involved. The same can be accomplished by
sending the e-mail to the user, logging in and pasting the message and
upload the document via HTTP. But isn't this too complicated for the average
user? :-)

I have two vague directions to accomplish the results I'm looking for, but I
don't know if any of them is reliable/possible.

The first method involves taking a better look at those headers. I noticed
there are a bunch of originating information headers in the e-mail. How
secure would it be to use them? Should I expect them to be there or is it
that the mail servers I tested this on are nice enough to include that
information?

The second approach is based on the fact that the environment this system
will work in is known - it's made of people who trust the company which
installed the system. As such, they can easily be persuaded to perform
action "X" which would result in adding a certain "secret" header to their
e-mail messages. This secret header would be an all-time cookie for the
respective user - the system would recognize the user by it and allow the
e-mail to get posted.

The second approach is rather poor even if someone can suggest some
practical directions for action "X" because the whole idea behind the system
is mobility and I wouldn't want users not to be able to send e-mail messages
to it just because they're not using the computer in the office. I jotted it
down however, so you can get an idea of where my thoughts are going... :-)

Bogdan



--- End Message ---
--- Begin Message ---
Hi
You could get all your users to add an encrypted signature to their emails 
and check that on recieipt.
Tom

At 11:35 AM 9/01/02, Bogdan Stancescu wrote:
>Hi all!
>
>I'm working on a free software package due to be launched on freshmeat
>some time soon (next month most probably). The program is a project
>development environment, somewhat similar to phpGroupWare but, I like to
>think, better and with less bugs.
>
>Due to the nature of the project I need to be able to give registered
>users the ability to upload data in the system via e-mail. This
>obviously means checking who the originator of the e-mail is, apart from
>actually processing the e-mail (which works fine).
>
>My problem is, how do I check that securely? I'm currently using the
>headers of the e-mail for the "from:" field and check it against the
>registered users' e-mail addresses. Works fine. But I guess that's
>pretty easy to trick.
>
>I basically have two concerns: one is that a person may send an e-mail
>with fake headers. The other is that a user (or non-user) on the same
>domain with another user would be able to send messages using the second
>guy's e-mail account (that's because SMTP doesn't have any security
>mechanism and one can easily impersonate somebody else once they're
>logged on a computer with SMTP permissions on the mail server).
>
>Did anybody run into this kind of problem? Any suggestions?
>
>Thanks in advance - I'll let you know when we release this thing if
>you're interested.
>
>Bogdan
>
>
>
>
>--
>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]

--- End Message ---
--- Begin Message ---
Bogdan,

Penny just dropped with what Tom suggested. REad up on how Debian does it, 
use the web of trust approach.

Miles

At 12:52 PM 1/9/2002 +1000, Tom Rogers wrote:
>Hi
>You could get all your users to add an encrypted signature to their emails 
>and check that on recieipt.
>Tom
>
>At 11:35 AM 9/01/02, Bogdan Stancescu wrote:
>>Hi all!
>>
>>I'm working on a free software package due to be launched on freshmeat
>>some time soon (next month most probably). The program is a project
>>development environment, somewhat similar to phpGroupWare but, I like to
>>think, better and with less bugs.
>>
>>Due to the nature of the project I need to be able to give registered
>>users the ability to upload data in the system via e-mail. This
>>obviously means checking who the originator of the e-mail is, apart from
>>actually processing the e-mail (which works fine).
>>
>>My problem is, how do I check that securely? I'm currently using the
>>headers of the e-mail for the "from:" field and check it against the
>>registered users' e-mail addresses. Works fine. But I guess that's
>>pretty easy to trick.
>>
>>I basically have two concerns: one is that a person may send an e-mail
>>with fake headers. The other is that a user (or non-user) on the same
>>domain with another user would be able to send messages using the second
>>guy's e-mail account (that's because SMTP doesn't have any security
>>mechanism and one can easily impersonate somebody else once they're
>>logged on a computer with SMTP permissions on the mail server).
>>
>>Did anybody run into this kind of problem? Any suggestions?
>>
>>Thanks in advance - I'll let you know when we release this thing if
>>you're interested.
>>
>>Bogdan
>>
>>
>>
>>
>>--
>>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]

--- End Message ---
--- Begin Message ---
Thanks for all the suggestions! I found something which suits me just fine
based on your ideas - wanted to share it.

The system separates most of the elements in the database (including the
e-mails) based on project. That means that the users are notified when a
project is created and given a specific e-mail address to use for that
specific project. They then use the respective e-mail address to send e-mail
messages and the system parses the "to:" field to set the proper project for
the newly uploaded e-mail. The addresses are of the form "OPT archive #7
<[EMAIL PROTECTED]>" for project 7 (OPT is the name of the software package).

So, my solution is simply using distinct e-mail addresses for each user of
the form "OPT *A5BD8 #7 <[EMAIL PROTECTED]>", where A5BD8 would be the first
five characters in the user's hashed password in the database.

I may implement an optional high-security mechanism based on Billy's
suggestions, but I don't know if this would be actually needed for the
access level breaching this security system allows - I mean, if you do trick
the system, all you're able to do is post an e-mail. The real user you're
impersonating doesn't have any problems deleting it once logged in, so no
harm done!

Thanks again!

Bogdan



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

Check tutorials at Thickbook, WebMonkey, DevShed, etc. and the manual.

Asking this question indicates you haven't taken the first critical step 
yourself.

So I searched the php site for
1. "connect", 12 hits, including one explicitly for mysql.
2. "database", 12 hits, none for mysql, but close enough you'd get the idea.
3. "mysql" - The opening page of the MySQL section of the manual, including 
example code of how to connect and a listing of all the mysql functions and 
a brief explanation of each.

Queries to the list are better put in the form .... I tried to do this, ... 
received this error or results were unexpected, ... this is the code I am 
using.

Alternately, you're at the installation stage. There is a whole section of 
the manual devoted to that, as well as guides to installation of PHP on the 
'net which contain specific installation instructions. Again, please try first.

Miles Thompson

At 10:36 AM 1/8/2002 +0100, Flix Garca Renedo wrote:
>Hello,
>     How could I configure php to access to a remote mysql database?
>Thanks

--- End Message ---
--- Begin Message ---
I actually fixed the problem with the following code:

session_start();
$HTTP_SESSION_VARS['sess_id']=$PHPSESSID;

Except that it will not assign an actual value until i hit refress on my
browser. Any ideas for a fix?

Thanks,

Ryan Kelley



"Kirk Johnson" <[EMAIL PROTECTED]> wrote in message
01A4B59FD1EBD311838100A0C98BE0D9AD5EFE@chef">news:01A4B59FD1EBD311838100A0C98BE0D9AD5EFE@chef...
> "!sess_id|" means that $sess_id has been registered, but it hasn't been
> assigned a value. Is register_globals on or off in php.ini? Did you assign
a
> value to $sess_id?
>
> Kirk
>
> > -----Original Message-----
> > From: Ryan Kelley [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 07, 2002 8:59 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Sessions
> >
> >
> > I am having problems getting the sessions to work. when i input the
> > following code:
> >
> > session_start();
> > session_register("sess_id");
> >
> > i get nothing registered. I have checked the sess_***etc...
> > files in /tmp
> > and they say:
> >
> > !sess_id|
> >
> > Does anybody have any ideas why this is?
>


--- End Message ---
--- Begin Message ---
Hello,

if I define 'user' in virtualhost section of apache's httpd.conf, then my
cgi scripts will be running as 'user' if suexec has been set up correctly.
It's okay. But how can I tell apache to run the whole virtualhost as
'user'? Including accessing html files, and especially php.

Is it possible somehow? Having read the apache docs, I haven't found
anything useful, but there must be a solution if I don't want my users to
run php scripts as www-data.

thx in advance

-- 
 Gabor Gludovatz <[EMAIL PROTECTED]>  -  Phone: +36 (20) 9 109 129
         http://www.sopron.hu/~ggabor/  -  ICQ# 861 404

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

> if I define 'user' in virtualhost section of apache's httpd.conf, then my
> cgi scripts will be running as 'user' if suexec has been set up correctly.
> It's okay. But how can I tell apache to run the whole virtualhost as
> 'user'? Including accessing html files, and especially php.

  In 1.3 you can't. Last I heard version 2 was supposed to include something
that would let you do this.

> Is it possible somehow? Having read the apache docs, I haven't found
> anything useful, but there must be a solution if I don't want my users to
> run php scripts as www-data.

  Run PHP as a cgi instead of a module. The PHP docs tell you how

     Rich



--- End Message ---
--- Begin Message ---
function lala() {

do i HAVE to define a variable or argument <eg>

function lala($var) {

or can i use it like:

lala($stmt);

will $stmt become part of the function?


--
Chris Hall
hardwired industries


--- End Message ---
--- Begin Message ---
it's possible to pass a variable number of parameters to a function

  $num = func_num_args();
  for ($i = 1; $i < $num; $i++)
  {
    $arg = func_get_arg($i);
  }

try looking at these...

-----Original Message-----
From: Chris Hall [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 1:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] functions...


function lala() {

do i HAVE to define a variable or argument <eg>

function lala($var) {

or can i use it like:

lala($stmt);

will $stmt become part of the function?


--
Chris Hall
hardwired industries



-- 
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]
--- End Message ---
--- Begin Message ---
Hi -
        For one of my projects I need to pass around a bit of information
to all the pages.  The information is the same throughout and is the same
for groups of clients.  Right now I just pass it on the query string, but
it's getting cumbersome so I started looking into sessions and I see that
I can do the $SID thing on the query string... and for some reason that
reminded me that I've seen urls that look like this:

http:[EMAIL PROTECTED]/somepath.html

I've played around with it a little bit and it seems I can put whatever I
want in for 'user' and that I can change it and that it "sticks" around
for relative urls.  And it's in RFC 1738, but it doesn't say too much.

So my questions are these:

- how reliable is that syntax for passing data around?

- is there a reason PHP can't use that for storing $SID?

Thanks!

-philip



--- End Message ---
--- Begin Message ---
Hi,

I've been experiencing some sporadic problems with a few web forms written 
in PHP 3.0.16 and MySQL 3.23.31 with text fields (both single lines and 
rows).  Generally if any of the text in these forms contains an apostrophe 
- either nothing is entered into the database, or nothing after the 
apostrophe is entered.

Is there a way around this?  Or is this a limitation of my older versions 
of PHP and MySQL?

Thanks
-Tim


--- End Message ---
--- Begin Message ---
> Is there a way around this?  Or is this a limitation of my 
> older versions of PHP and MySQL?

You need to apply addSlashes() to the text fields before entering
them into the database.

Jason
--- End Message ---
--- Begin Message ---
I have the same problem with the apostrophes in text
fields form object. When I try to enter a string that
contains ' the data is not entered in the database. I
use PHP 4 and Mysql 3.23. 
How can I avoid this problem ? 

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---
>You need to apply addSlashes() to the text fields
>before entering
>them into the database.

>Jason
What is an addSlash ? 
How can I appy addSlashes ? Can anyone give me an
example ? 

Thanks
Rafael Perazzo


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---
> What is an addSlash ? 
> How can I appy addSlashes ? Can anyone give me an example ? 

Try the manual ... http://www.php.net/addslashes

Jason
--- End Message ---
--- Begin Message ---
Ron Peterson wrote:
> 
> I've installed php 4.1.1. with the following configure options:
> 
> ./configure --prefix=/usr/local/versioned/php-4.1.1
> --with-apache=../apache_1.3.19 --with-openssl --with-imap
> --with-imap-ssl=/usr/local/openssl --with-kerberos --with-gettext
> --with-xml --with-pgsql=/usr/local/postgresql
> 
> The following script fails.
> 
> <?
>   $mbox = imap_open ("{localhost:993/imap/ssl/novalidate-cert}INBOX",
> "username", "password");
>   print $mbox . "\n";
> ?>
> 
> The symptom is that an imapd process is started, but then nothing ever
> happens.  A corresponding non-ssl script works fine.
> 
> My imap/ssl installation works fine - I use it all the time.  I'm using
> the following UW imap RPM's:
> 
> imap-devel-2000c-10
> imap-2000-9
> 
> I can telnet to port 993 o.k.
> 
> Any ideas?  Or can anyone at least verify that imap-ssl works in php
> 4.1.1.?

Well, I guess I'll answer my own question.

Use the source.  Install both OpenSSL and UW Imap from source.  Edit the
imap Makefile as req'd such that the build process relies on your home
brewed OpenSSL installation, not, say, some RPM installation you might
have.  Also direct php build to use this home baked goodness.

Works great.

-- 

-Ron-
https://www.yellowbank.com/
--- End Message ---
--- Begin Message ---
Hi!

I'm new to PHP and I have tried to find the answer to my questions but I
still have no luck.

I'm trying to make a page which is based on the data that I retrieved from
my database. now, I want to make a link (text) to a new page but I want to
pass my variable also. I don't have any form at all so .. how do I pass
avariable through a text link which is being clicked.

thanks for reviewing my email

any answer is greatly appriciated.



--- End Message ---
--- Begin Message ---
Use <a href="link.php?var=$val"> -- make sure you use rawurlencode() on $val
if you expect it to contain special characters that can't be passed via URL
(such as spaces or ampersands).

Bogdan

universal2001 wrote:

> Hi!
>
> I'm new to PHP and I have tried to find the answer to my questions but I
> still have no luck.
>
> I'm trying to make a page which is based on the data that I retrieved from
> my database. now, I want to make a link (text) to a new page but I want to
> pass my variable also. I don't have any form at all so .. how do I pass
> avariable through a text link which is being clicked.
>
> thanks for reviewing my email
>
> any answer is greatly appriciated.
>
> --
> 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]

--- End Message ---
--- Begin Message ---
Hi everyone,

Does anyone have a link to a good reference on how to insert a binary file
(zip file) into MSSQL?

I've got the upload and stuff working, just a bit unsure about how I'm now
going to put the file(it's been moved) into the database itself.  The
datatype I have used is Image, but most of the examples I have seen have
used text or some similar to store the file.

Thanks,

Pete

--- End Message ---

Reply via email to