php-general Digest 29 May 2003 12:05:40 -0000 Issue 2085

Topics (messages 149331 through 149389):

Help with eval()
        149331 by: zavaboy
        149371 by: Marek Kilimajer

Re: detect proxy
        149332 by: sonjaya

Re: Create Links on the fly?
        149333 by: Justin French

Re: How can I change the timezone?
        149334 by: Justin French
        149378 by: Jay Blanchard

PHP OOP x Procedural Performance
        149335 by: William N. Zanatta
        149339 by: Ray Hunter
        149380 by: Jay Blanchard

Re: Session Question
        149336 by: Justin French

Notice: Undefined variable: PHP_SELF
        149337 by: Dandie
        149340 by: John W. Holmes

creating thumbnails from .BMP files
        149338 by: Artoo Smith
        149341 by: John W. Holmes
        149375 by: Marek Kilimajer
        149379 by: Robert

Re: Search Engines and Last-Modified Header (was:  Variables don't pass...)
        149342 by: olinux

sending email
        149343 by: Aris  Santillan
        149345 by: daniel.electroteque.org
        149346 by: Dan Anderson
        149348 by: Manuel Lemos

Re: My Sincere Request!![Scanned]
        149344 by: Joel Rees

Re: Search Engines and Last-Modified Header
        149347 by: Manuel Lemos

run extension library as different uid/gid?
        149349 by: Joe Wong
        149370 by: Marek Kilimajer

Re: Biding Arrays from Oracle Stored Procedure to PHP Variables
        149350 by: Lang Sharpe

Re: Parsing html to extract images
        149351 by: David Grant

vpopmail what is it???
        149352 by: Haseeb Iqbal
        149353 by: David Grant
        149365 by: Jason Wong
        149376 by: Haseeb Iqbal

PHP redirect
        149354 by: Angelo Zanetti
        149355 by: Awlad Hussain
        149356 by: Ralph
        149357 by: David Grant
        149362 by: Leif K-Brooks

caller function identification
        149358 by: Christopher D. Jarecki
        149368 by: Marek Kilimajer

Re: Decrypting data with GnuPG
        149359 by: Evan Nemerson

Re: id & name when identifying html elements
        149360 by: Ford, Mike               [LSS]

Re: Variables don't pass... *sniff*
        149361 by: Ford, Mike               [LSS]
        149363 by: Ford, Mike               [LSS]

Netbilling PHP Script
        149364 by: Ralph
        149366 by: Jason Wong

Re: daily availability chart array
        149367 by: Marek Kilimajer

Re: Will Pay for Netbilling PHP Script
        149369 by: Ralph

Re: replacing register_shutdown_function
        149372 by: Marek Kilimajer

Re: Triggers & events with objects
        149373 by: Marek Kilimajer

Re: greater than question
        149374 by: Marek Kilimajer

Re: Matching titles from distinct data sources
        149377 by: David Robley

Date question
        149381 by: Shaun
        149383 by: Jay Blanchard

Socket problem
        149382 by: Adrian Zaharia

upload problem, urgent plz guy
        149384 by: fr r
        149385 by: fr r
        149386 by: fr r
        149387 by: Jay Blanchard
        149388 by: Marek Kilimajer

PHP 4.3.2 released
        149389 by: Jani Taskinen

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

I'm having problems with the eval() function...

if ($Sort == "Up") {
$do="<=";
} else {
$do=">=";
}
for ($i = $aNum; eval ('$i ' . $do . ' $bNum'); )
//So.. the above line acts like:
//for ($i = $aNum; $i <= $bNum; )
//...or...
//for ($i = $aNum; $i <= $bNum; )
{
i
if ($Sort == "Up") {
$i++;
} else {
$i--
}

Any idea how to make it work right?



- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com



--- End Message ---
--- Begin Message --- for ($i = $aNum; eval ('return $i ' . $do . ' $bNum'); )



zavaboy wrote:

Hey,

I'm having problems with the eval() function...

if ($Sort == "Up") {
$do="<=";
} else {
$do=">=";
}
for ($i = $aNum; eval ('$i ' . $do . ' $bNum'); )
//So.. the above line acts like:
//for ($i = $aNum; $i <= $bNum; )
//...or...
//for ($i = $aNum; $i <= $bNum; )
{
i
if ($Sort == "Up") {
$i++;
} else {
$i--
}

Any idea how to make it work right?



- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com







--- End Message ---
--- Begin Message ---
dear sir
 sorry if my english bad, my question is , any body now script to detect ip(internet 
protocol)  to 
web us . exsample : your  ip is  192.168.1.1 , i get this $ip(REMOTE_ADDRES) , but 
this script just 
for main ip i want client ip because i use proxy , how we can detect, i want like this 
 . You are 
connected through proxy : 1.0 cleint.yahi.com:8080 (Squid/2.4.STABLE1), 1.0 
cache2.yahi.com:8080 
(Squid/2.4.STABLE7), 1.0 sfc-cache- main.cache.yahi.com:8080 (squid/2.5.STABLE2) at 
216.149.15.26
Your IP : 192.168.0.153, 216.125.24.6, 216.125.22.105 
User Online: 45
like that 

>Understandable english please!
>
>On Wed, 28 May 2003 18:02:26 +0700
>  sonjaya <[EMAIL PROTECTED]> wrote:
>> dear milist 
>> any body now script to detect browser also ip  event 
>> using proxy public or high anonymous .thank's
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>
>----------------------------------------------------
>António Rafael C. Paiva
>Electronics and Telecommunications Dep.
>Aveiro University
>




--- End Message ---
--- Begin Message ---
if you wish to have this work purely with PHP, and not rely on client-side
stuff like javascript, then your only option (that i can see) is to create a
middle man script which translates their wishes.

startpage.html
---
<html>
...
<form action='redirect.php' method='post'>
<input type='text' name='yourNumber' size='5' maxlength='5' />
<input type='submit' name='submit' value='show' />
</form>
...
</html>
---

redirect.php
---
<?
if($_POST['yourNumber'])
    {
    header("Location: http://mysite.com/dir/{$_POST['yourNumber']}");
    }
else
    {
    header("Location: startpage.html");
    }
?>
---


It can be done client side, IF you're willing to take on the risks and
uncertainties of relying on javascript, which i try to avoid wherever
possible.

You'll have to ask a JS list about that though :)


Justin French

on 29/05/03 4:20 AM, Chase ([EMAIL PROTECTED]) wrote:

> Salutations!
> 
> I am trying to do something fairly simple, but I can't seem to make it
> work...  I want to have a form field on a page that the user will put in a 3
> to 5 digit number and when they click on "Submit" that number will become
> part of an URL that they are forwarded to.
> 
> For example, if the user put in the number 123, then when they click on
> "Submit" they would be pushed to http://www.mypage.com/123.
> 
> Can anyone offer help??
> 
> 


--- End Message ---
--- Begin Message ---
on 28/05/03 11:49 PM, Jay Blanchard ([EMAIL PROTECTED])
wrote:

> [snip]
> I am in Hong Kong and the server is in US.
> I can't change the server setting.
> [/snip]
> 
> How about getting the server time and then adding or subtracting from
> that to get the appropriate time?
> 
> http://us2.php.net/manual/en/function.time.php

That doesn't really account for daylight savings, etc etc.

Justin


--- End Message ---
--- Begin Message ---
[snip]
> [snip]
> I am in Hong Kong and the server is in US.
> I can't change the server setting.
> [/snip]
> 
> How about getting the server time and then adding or subtracting from 
> that to get the appropriate time?
> 
> http://us2.php.net/manual/en/function.time.php

That doesn't really account for daylight savings, etc etc.
[/snip]

True, does Hong Kong use DSLT? Does the server in the US use DSLT? Can
the server time be related to GMT and then added to or subrtacted from?

Jay

--- End Message ---
--- Begin Message ---
  It is a known issue that function calls are expensive for the processor.

  The OOP let us better organize the code but, thinking in function (or
method) calls it may be more expensive than in the procedural form.

  My question is, has anyone made any tests regarding the performance of
OOP versus procedural language? Is it a good choice to code in OOP with
PHP ?


-=[ William N. Zanatta ]=------------------------=[ [EMAIL PROTECTED] ]=-


--- End Message ---
--- Begin Message ---
yes, the bottom line is code reuse...that is why there is oop. So that a
developer can always reuse code saving money on development and thus if
speed is an issue then adding more hardware.


--
Ray

On Wed, 2003-05-28 at 20:05, William N. Zanatta wrote:
>   It is a known issue that function calls are expensive for the processor.
> 
>   The OOP let us better organize the code but, thinking in function (or
> method) calls it may be more expensive than in the procedural form.
> 
>   My question is, has anyone made any tests regarding the performance of
> OOP versus procedural language? Is it a good choice to code in OOP with
> PHP ?
> 
> 
> -=[ William N. Zanatta ]=------------------------=[ [EMAIL PROTECTED] ]=-
> 


--- End Message ---
--- Begin Message ---
[snip]
  It is a known issue that function calls are expensive for the
processor.

  The OOP let us better organize the code but, thinking in function (or
method) calls it may be more expensive than in the procedural form.

  My question is, has anyone made any tests regarding the performance of
OOP versus procedural language? Is it a good choice to code in OOP with
PHP ?
[/snip]

We have done some informal testing and have found negligible difference
mostly due to current processor power, even on single processor
machines. Therefore OOP in PHP is a good thing when used correctly.

HTH!

Jay

--- End Message ---
--- Begin Message ---
Register globals essentially takes the value of $_SESSION['foo'] and creates
$foo.  It does the same thing for GET, POST, COOKIES, etc.

The problem here is that you have no way of telling if $foo was a POST
variable, GET, SESSION, or whatever.  So, I can choose to append ?admin=1 to
one of your URLs, and if you do not do any checking or variable
initialising, it might be possible for me to fake myself as a user with
admin clearance, or anything else that would be considered a risk.

The super global arrays like $_SESSION exist, and can be used, regardless of
whether register globals is on or off.  If you start relying on
$_SESSION['foo'] rather than $foo, $_POST['bah'] instead of $bah and
$_GET['xyz'] instead of $xyz, you've made a great start.

You should be able to use $_SESSION right now, but be aware that the manual
says if you choose to use $_SESSION, then you should stop using functions
such as session_register().


The next logical step would be to manually turn off register globals for
your site, using a directory-level .htaccess file in your document root.  An
example of this file would be:

---
<IfModule mod_php4.c>
    php_flag register_globals off
</IfModule>
---

Do a whole bunch of testing on your LAN, make any changes you need to make
to your code, perhaps turn the error reporting to the highest level (E_ALL)
to see what warnings you get, then try the same on your live server.


Justin




on 29/05/03 3:18 AM, Pushpinder Singh Garcha ([EMAIL PROTECTED]) wrote:

> SInce register_globals() is ON on my server, I need to be able to
> figure out a way to ensure session security.
> Another question I had was that,  with register_globals() ON can I
> still use the $_SESSION to set my variables ? I want to avoid recoding
> the entire application, so I want to see what can be done to enhance
> security with the current setup.
> 
> Does the super-global array approach i.e. $_SESSION work, irrespective
> of the fact that REGISTER_GLOBALS is ON / OFF ?
> If I start setting session variables in the $_SESSION array from now
> on, will it improve the security of the session.  I am a newbie in PHP
> session handling and am sorry if any of the above questions sound
> extremely lame.
 


--- End Message ---
--- Begin Message ---
Hi,
I am having problem with a PHP page on our web site.
I've installed the latest version of PHP on a Windows 2000 server.

The error we're getting is:
Notice: Undefined variable: PHP_SELF

Where do I start to fix this problem?

Thanks



--- End Message ---
--- Begin Message ---
> I am having problem with a PHP page on our web site.
> I've installed the latest version of PHP on a Windows 2000 server.
> 
> The error we're getting is:
> Notice: Undefined variable: PHP_SELF
> 
> Where do I start to fix this problem?

Read the release notes. Register_globals is OFF. Use
$_SERVER['PHP_SELF'].

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



--- End Message ---
--- Begin Message ---
Hey,

How do you create thumbnails from .BMP files?  Is there a function like
there is for JPG (ImageJPEG)?

Thanks



--- End Message ---
--- Begin Message ---
> How do you create thumbnails from .BMP files?  Is there a function
like
> there is for JPG (ImageJPEG)?

Probably need to use an external program that understands that format
and an exec() call. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



--- End Message ---
--- Begin Message --- image_bmp class at www.phpclasses.org can create bmp files, you might be able to write a class that will read it and return raw data.

Artoo Smith wrote:

Hey,

How do you create thumbnails from .BMP files?  Is there a function like
there is for JPG (ImageJPEG)?

Thanks







--- End Message ---
--- Begin Message ---
John W. Holmes wrote:

>> How do you create thumbnails from .BMP files?  Is there a function
> like
>> there is for JPG (ImageJPEG)?
> 
> Probably need to use an external program that understands that format
> and an exec() call.
> 
> ---John W. Holmes...
> 
> Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
> 
> 
> 

I use convert - its part of the ImageMagick package.  You use exec to run it
and it will convert a lot of different file formats.  Incidentally, you can
use MPlayer to do thumbnails from movies as well!
-- 



--- End Message ---
--- Begin Message ---
I think this is very important for dynamic site
developers to understand. I'm very interested in
learning more about this and I think we could all
benefit from anyone with solid search engine
experience.

I run a site with about 18,000 news articles. They are
stored in database and dynamically generated (some
template elements update weekly). Since these articles
are mostly static once published, I generate a
last-modified header using the article publish_date
(and zero's for the hour/min/sec). This last-modified
header is also used by the internal search engine
(ht://Dig) to make articles searchable by date. 

I'm finding that even though google indexes the site
daily and grabs stories for their news.google.com MANY
of my pages are not appearing in the google index. It
appears that these are not being updated in their
cache either (only a couple months of data to go on).
I'm quite knowledgable on search engine optimizing
etc. but this has me confused. 

To make sure that google re-indexes every month. I
have thought of sending a last modified header using
year/month/day of article and a random
hour/minute/second. but if this random
hour/month/second is "earlier" than the one already
indexed it does not get indexed? 

olinux


> On Wed, 28 May 2003 09:31:11 -0500, Jay Blanchard
> wrote:
> 
> >I wouldn't go as far as using the
> auto_prepend_file.
> 
> Neither would I in this case Jay.    It was simply
> an example of what
> could be done, not necessarily what SHOULD be done. 
> I did however, use
> auto_prepend_file in a .htaccess file for a somewhat
> similar case.  
> 
> I have a site with about 90 pseudo-static pages (the
> page is static but
> I use PHP to include the header and footer) and a
> handful of fully
> dynamic pages.  I REALLY want this site to be
> regularly updated in the
> search engines but, unfortunately, many search
> engines only spider
> pages that are "newer" than what they have in their
> database.  Since
> PHP is dynamic, it doesn't report a "Last-Modified"
> header so the
> search engine doesn't think anything has been
> updated.  Hence stale
> search engine results.
> 
> To force all of the pages (both pseudo-static and
> dynamic) to generate
> a "Last-Modified" header, I set up prepend.php
> script which is
> configured as a directory level (.htaccess) parm to
> auto_prepend_file.
> 
> Here is the content of prepend.php.....
> 
> 
> <?php 
> 
>   header( "Last-Modified: " . 
>     gmdate( "D, d M Y H:i:s", 
>        filemtime( $_SERVER['SCRIPT_FILENAME'] ) ) . 
>     " GMT" ); 
> 
> ?>
> 
> For my truly dynamic pages, I figured out that only
> the last call to
> header actually shows up in the "real" header that
> makes it to the
> browser (or search engine), so I can create a more
> unique
> "Last-Modified" header as part of the dynamic pages
> (like when the
> database is updated or whatever makes sense) and it
> will overwrite the
> automatically generated one.
> 

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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

i want to send html format type of emails
using mail( ); function?

is there a how to where can i start learning
that type of encoding


thanks

--- End Message ---
--- Begin Message ---
add this in the header section

Content-Type: text/html; charset=\"iso-8859-1

also for html body use this

$message = chunk_split(base64_encode($message));
> hi
>
> i want to send html format type of emails
> using mail( ); function?
>
> is there a how to where can i start learning
> that type of encoding
>
>
> thanks




--- End Message ---
--- Begin Message ---
HTML E-mail is just HTML code embedded in the e-mail.  Pick up a book on
HTML code.  Even easier, make a web page using your favorite editor
(note ms word and open office allow you to save as web page) and cut and
paste the code.

I think there /might/ be an extra line or two you might have to add to
the mail header.  Perhaps googling would help.

-Dan

On Wed, 2003-05-28 at 23:32, Aris Santillan wrote:
> hi
> 
> i want to send html format type of emails
> using mail( ); function?
> 
> is there a how to where can i start learning
> that type of encoding
> 
> 
> thanks


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

On 05/29/2003 12:32 AM, Aris Santillan wrote:
i want to send html format type of emails
using mail( ); function?

is there a how to where can i start learning
that type of encoding

You may want to try this class that is able to compose and send HTML messages properly:


http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


--- End Message ---
--- Begin Message ---
> 1. This is the an example of the Nigeria 419 scam. I have no idea how it got 
> the 419 in the name.  

    http://www.google.com/search?hl=en&ie=ISO-8859-1&q=nigeria+419

in particular,

    http://home.rica.net/alphae/419coal/  

-- 
Joel Rees <[EMAIL PROTECTED]>


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

On 05/28/2003 11:48 PM, Olinux wrote:
To make sure that google re-indexes every month. I
have thought of sending a last modified header using
year/month/day of article and a random
hour/minute/second. but if this random
hour/month/second is "earlier" than the one already
indexed it does not get indexed?

Google does not index your whole site unless you pay.



--


Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


--- End Message ---
--- Begin Message ---
Hi, I have created an extension library for my own use. This library needs
to access a storage area needs specific user ID to operate. If I start
Apache as normal ( using User Apache, Group Apache in httpd.conf ), my PHP
script fails to run. I try to setuid / setguid on the PHP script ( this
script will call the function in my extension library ) to the specific
uid/gid I need, it didn't work. The only way I can make it work is to run
Apache as the uid/gid that I needed. But this is surely breaking something
else.

What should I do in order to resolve this?

TIA.

- Joe



--- End Message ---
--- Begin Message --- You can make a wraper setuid script and execute it, or chown /dev/your_storage

Joe Wong wrote:

Hi, I have created an extension library for my own use. This library needs
to access a storage area needs specific user ID to operate. If I start
Apache as normal ( using User Apache, Group Apache in httpd.conf ), my PHP
script fails to run. I try to setuid / setguid on the PHP script ( this
script will call the function in my extension library ) to the specific
uid/gid I need, it didn't work. The only way I can make it work is to run
Apache as the uid/gid that I needed. But this is surely breaking something
else.

What should I do in order to resolve this?

TIA.

- Joe







--- End Message ---
--- Begin Message ---
Have a look at this paper, in particular the collections section at the end

http://www.phpconference.de/2001/slides/arntzen_ocipaper.txt

I've never used them myself, because they look a bit dodgy. But it may be 
the only way to do what you're trying to do.

Lang

Gregory Watson wrote:

> Hi guys...
> 
> I'm very new to using Oracle and stored procedures.
> 
> I'm using a stored procedure to return 12 variables, 8 of which are
> arrays.
> 
> <?php
> 
>     $EventID = 41403;
>     $BufferSize = 3000;
>     $connection_oracle = OCILogon("****","******", "******");
> 
>     $statement_oracle = OCIParse($connection_oracle, "BEGIN
>     CFADMIN.getRewardUserList(:in_eventid, :out_status,
>     :out_record_count, :in_buffersize, :out_memberid, :out_firstname,
>     :out_lastname, :out_city, :out_state, :out_loginid, :out_email,
>     :out_redeemstatus); END;");
> 
>     OCIBindByName($statement_oracle, ":in_eventid", $EventID, -1);
>     OCIBindByName($statement_oracle, ":out_status", $Status, -1);
>     OCIBindByName($statement_oracle, ":out_record_count", $RecordCount,
>     -1); OCIBindByName($statement_oracle, ":in_buffersize", $BufferSize,
>     -1); OCIBindByName($statement_oracle, ":out_memberid", $MemberID, -1,
>     OCI_ASSOC);
>     OCIBindByName($statement_oracle, ":out_firstname", $FirstName, -1,
>     OCI_ASSOC);
>     OCIBindByName($statement_oracle, ":out_lastname", $LastName, -1,
>     OCI_ASSOC);
>     OCIBindByName($statement_oracle, ":out_city", $City, -1, OCI_ASSOC);
>     OCIBindByName($statement_oracle, ":out_state", $State, -1, OCI_ASSOC);
>     OCIBindByName($statement_oracle, ":out_loginid", $LoginID, -1,
>     OCI_ASSOC);
>     OCIBindByName($statement_oracle, ":out_email", $Email, -1, OCI_ASSOC);
>     OCIBindByName($statement_oracle, ":out_redeemstatus", $RedeemStatus,
>     -1, OCI_ASSOC);
> 
>     OCIExecute($statement_oracle, OCI_DEFAULT);
>     OCIFreeStatement($statement_oracle);
>     OCILogOff($connection_oracle);
> 
> ?>
> 
> I keep getting the following error:
> 
>     Warning: OCIStmtExecute: ORA-06550: line 1, column 7: PLS-00306:
>     wrong number or types of arguments in call to 'GETREWARDUSERLIST'
>     ORA-06550: line 1, column 7: PL/SQL: Statement ignored in
>     C:\ftp_dir\boards\winners.php on line 22
> 
> I know I'm not binding them correctly, but I've looked all over the PHP
> site and I can't seem to find anything that makes any sense in what to
> do! Can anyone help?
> 
> Thanks in advance!
> 
> Greg


--- End Message ---
--- Begin Message --- Hidrahyl wrote:
Hi,

anyone can help me parsing html files in order to get all the images
containing a file?

Thanks, Simon.


1. Use fopen() to grab the HTML file you're after. 2. Read in each line to an array using file(); 3. Loop through the array, and apply the following reg. exp.:

preg_match("/\<img.*src=[\"\'](.*)[\"\'].*\>/U", $line, $matches);

NOTE: this might need a bit of tweeking, since I'm not too hot on regular expressions... :)

Regards,

David

--
David Grant
Web Developer

[EMAIL PROTECTED]
http://www.wiredmedia.co.uk

Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD

Company registration number: 4016744

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


--- End Message ---
--- Begin Message ---
hi,
can anyone direct me.i want information about vpopmail  and what is does . a tutorial 
or something will work
thanx in advance. i searched google but got only manual pages of php. but there isn't 
any info there.

Creativity is inventing, experimenting, growing, taking risks, breaking rules, making 
mistakes, and having fun.
Haseeb Iqbal

--- End Message ---
--- Begin Message --- Haseeb Iqbal wrote:

hi,
can anyone direct me.i want information about vpopmail  and what is does . a tutorial 
or something will work
thanx in advance. i searched google but got only manual pages of php. but there isn't 
any info there.

Try this:


http://www.pscs.co.uk/products/vpop3/index.html

--
David Grant
Web Developer

[EMAIL PROTECTED]
http://www.wiredmedia.co.uk

Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD

Company registration number: 4016744

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


--- End Message ---
--- Begin Message ---
On Friday 30 May 2003 04:16, Haseeb Iqbal wrote:

> can anyone direct me.i want information about vpopmail  and what is does .
> a tutorial or something will work thanx in advance. i searched google but
> got only manual pages of php. but there isn't any info there.

If you don't already know what vpopmail is then I doubt whether you need to 
know. But if you do want to know then search google.

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


--- End Message ---
--- Begin Message ---
Actually i know what vpopmail is but to be abs clear i want to read more. i
have a few questions in my mind. that i want to be clear about.i want to
make a script that would create new users on a qmail server.i want to be
sure this is what i want.
now any suggestions welcome


Creativity is inventing, experimenting, growing, taking risks, breaking
rules, making mistakes, and having fun.
Haseeb Iqbal
----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 02:43 PM
Subject: Re: [PHP] vpopmail what is it???


> On Friday 30 May 2003 04:16, Haseeb Iqbal wrote:
>
> > can anyone direct me.i want information about vpopmail  and what is does
.
> > a tutorial or something will work thanx in advance. i searched google
but
> > got only manual pages of php. but there isn't any info there.
>
> If you don't already know what vpopmail is then I doubt whether you need
to
> know. But if you do want to know then search google.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hi guys what is the function in PHP for directing a php page??

thanx in advance
Angelo


--- End Message ---
--- Begin Message ---
Try this
header("LOCATION: page2go.php");

----- Original Message ----- 
From: "Angelo Zanetti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 9:46 AM
Subject: [PHP] PHP redirect


Hi guys what is the function in PHP for directing a php page??

thanx in advance
Angelo



--- End Message ---
--- Begin Message ---
Use the header function:

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


-----Original Message-----
From: Angelo Zanetti [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 29, 2003 1:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP redirect

Hi guys what is the function in PHP for directing a php page??

thanx in advance
Angelo




--- End Message ---
--- Begin Message --- Awlad Hussain wrote:
Try this
header("LOCATION: page2go.php");

I'm not normally so pedantic, however, the HTTP specification defines the above header as "Location", not "LOCATION". It might also be an idea to give the filename as a path relative to the root directory, e.g.


header("Location: /foo/bar/index.php");

This should ensure compatability between user agents.

Regards,

David

--
David Grant
Web Developer

[EMAIL PROTECTED]
http://www.wiredmedia.co.uk

Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD

Company registration number: 4016744

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


--- End Message ---
--- Begin Message --- Actually, the standards require an absolute URL, e.g.

header("Location: http://foo.com/bar/baz/something.php";);

David Grant wrote:

It might also be an idea to give the filename as a path relative to the root directory, e.g.

header("Location: /foo/bar/index.php");


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



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

Is there a way to find out which function (or which script) called
the function that is currently being executed?

I mean something like perl's caller_function().

Regards,

--
Christopher D. Jarecki
Senior Application Developer
Implix.com



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

Christopher D. Jarecki wrote:

Hi,

Is there a way to find out which function (or which script) called
the function that is currently being executed?

I mean something like perl's caller_function().

Regards,

--
Christopher D. Jarecki
Senior Application Developer
Implix.com







--- End Message ---
--- Begin Message ---
GnuPG doesn't use stdin to read the password, which is where you're
sending it. It uses a more low-level interface (check out the below link
if you're interested) where they interact directly with the virtual
console.

Try piping to your command- that won't work either

echo $PASSPHRASE | \
/usr/bin/gpg \
--homedir=/path/to/.gnupg \
--no-secmem-warning \
--always-trust \
--yes \
--output /path/to/output.txt \
--decrypt /path/to/testtext.asc

GnuPG source code for TTY I/O:
http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/*checkout*/gnupg/util/ttyio.c?rev=1.28&content-type=text/plain



On Wed, 2003-05-28 at 16:14, Pierre-Luc Soucy wrote:
> Hi,
> 
> I would like to decrypt data encoded with GnuPG without including the 
> private key passphrase in the command to prevent people from viewing it 
> with "ps".
> 
> Here is the code I wrote:
> 
> ====
> $command = "/usr/bin/gpg --homedir=/path/to/.gnupg --no-secmem-warning 
> --always-trust --yes --output /path/to/output.txt --decrypt 
> /path/to/testtext.asc";
> $passphrase = '***********';
> 
> $fp = popen($command, 'w+');
> fputs($fp, $passphrase);
> pclose($fp);
> 
> print "Done";
> exit;
> ======
> 
> I assumed that the fputs() function would write the passphrase at the 
> prompt, but that doesn't seem to be the case - the command does not 
> create the output.txt file when ran by the PHP program (which is running 
> as a CGI under my user BTW) while it works when ran from the shell.
> 
> Any idea why?
> 
> Thanks!
> 
> Pierre-Luc Soucy
> 


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Roland Tarver [mailto:[EMAIL PROTECTED]
> Sent: 28 May 2003 10:07
> 
> I've got a question about about naming html components (text fields, 
> select boxes etc) when submitting a form to a php page.
> First I tried identifying an element using the "id" attribute 
> and found 
> that it was not being posted to the php page. When I use the "name" 
> attribute it did get posted to the page?
> 
> I had a look on the w3c html spec and "name" takes precedence 
> over "id" 
> if used together but you should be able to use them 
> individually with no 
> problems.
> 
> When you submit a form with this select box, "country" will is not 
> submitted to the php page.
> <select *id*="country" onChange="alterForm();">
> <option value="one">one</option>
> <option value="two">two</option>
> </select>
> 
> 
> When you use this code, it works fine. "country"  gets 
> submitted to the 
> php page?
> <select *name*="country" onChange="alterForm();">
> <option value="one">one</option>
> <option value="two">two</option>
> </select>
> 
> Any thoughts?

This is according to the HTML 4.01 specification, which says:

   "When a form is submitted for processing, [...] controls have
    their name paired with their current value and these pairs
    are submitted with the form."

This also applies to XHTML 1.0 -- indeed, the XHTML 1.0 Strict DTD says that the name= 
attribute is *required* for all <input > types except submit and reset.

None of this is likely to change in the foreseeable future -- name= will always be the 
one to use for submitted form elements.

The id= attribute is for identifying a particular element uniquely within the [X]HTML 
document -- no two elements can have the same id= attribute.  Its most likely uses are 
for specifically targeted stylesheet formatting, or manipulating a specific element 
using a client-side technology such as JavaScript.  It is absolutely *not* a 
substitute for name= in form elements. 

Hope this clears things up a bit for you.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: David Grant [mailto:[EMAIL PROTECTED]
> Sent: 28 May 2003 12:47
> To: Leif K-Brooks
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Variables don't pass... *sniff*
> 
> 
> Leif K-Brooks wrote:
> 
> > To maintain absolute compatibility, just use $HTTP_GET_VARS.  It's 
> > availalable in all PHP versions, just deprectaed in 
> versions here $_GET 
> > is available.
> 
> I would've thought that $HTTP_*_VARS will be deprecated 
> sometime in the 
> future.

$HTTP_*_VARS are *already* deprecated -- this means that they *may* be removed some 
time in the future.

In fact, I'm pretty sure that PHP5 is planned to come with a php.ini setting to 
suppress $HTTP_*_VARS -- so better start coding now for future environments where 
$HTTP_*_VARS no longer exist.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Wendell Brown [mailto:[EMAIL PROTECTED]
> Sent: 28 May 2003 15:02
> 
> On Wed, 28 May 2003 12:46:50 +0100, David Grant wrote:
> 
> >I would've thought that $HTTP_*_VARS will be deprecated 
> sometime in the 
> >future.  It might be an idea to write your own accessor methods, e.g.
> >
> >function RetrieveGetParameter($parameterValue)
> 
> Egads!  Wouldn't the following be a little simpler?
> 
> At the top of the file put.....
> 
> if( is_array($_POST) ) 
>   $pArray = $_POST;
> else
>   $pArray = $HTTP_POST_VARS;
> 
> Then access $pArray["fred"] where ever you want to?  And yes, I know
> this creates a second copy of the post array in local memory

Only if you actually change any of the elements -- otherwise, PHP does
what's called a _shallow_copy_, which doesn't actually copy all the values
unless it becomes necessary.

>  (wouldn't
> pointers be nice right about now)

Well, how about references, then?  (And me, personally, I'd use isset()
rather than is_array().)

   if (isset($_POST)):
      $POST = &$_POST;
   else:
      $POST = &$HTTP_POST_VARS;
   endif;

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message ---
I have to setup credit card verification/processing with Netbilling.com,
does anybody know of a PHP based Netbilling gateway script or class?

Thanks in advance



--- End Message ---
--- Begin Message ---
On Thursday 29 May 2003 17:36, Ralph wrote:
> I have to setup credit card verification/processing with Netbilling.com,
> does anybody know of a PHP based Netbilling gateway script or class?

Have you searched google?

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


--- End Message ---
--- Begin Message ---
for($day=0; $day<7;$day++) {
   // $day[0] is mon; $day[1] is tues; ...
   foreach($avail[$day] as $av) {
      //do your calculation here
   }
}

Jason Dulberg wrote:

Thank you for the response. I am not quite sure how that works, can you
please give an example?

Thanks.

Jason



-----Original Message-----
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: May 27, 2003 8:13 AM
To: Jason Dulberg
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] daily availability chart array


Use weekdays' numbers instead of the short format, then you need only 2 nested loops

Jason Dulberg wrote:



I need to create a daily availability chart and currently am using
multidimensional arrays to assign which day/timeslot is chosen.


My problem


is that in doing so, I have to create 7 "foreach" statements to


go through


each of the days to pick out the timeslot values.

ie.
avail[mon][1] (morning)
avail[tues][2] (afternoon)
avail[wed][4] (evening)
avail[thurs][8] (night)
etc.
(the above data is taken from a user input form, user can choose 1 or all
timeslots)

I need to loop through these values for bitwise calculation and


comparison


to a mysql db field. The user can have multiple choices in the


same day so


the obtained bit values would have to be added accordingly.

Is there any way to get around using 7 loops to create the bit value?

Any suggestions are greatly appreciated!

Jason












--- End Message ---
--- Begin Message ---
Yeah. But no luck. Only in PERL. 

I'm pushed for time and I'm still working on other modules that I need
for my client. Anybody interested in helping me out? I will gladly pay
for help. Just give me quote.

Here is Netbilling's API manual for anybody that is interested:

http://netbilling.com/direct/
 

-----Original Message-----
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 29, 2003 2:44 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Netbilling PHP Script

On Thursday 29 May 2003 17:36, Ralph wrote:
> I have to setup credit card verification/processing with
Netbilling.com,
> does anybody know of a PHP based Netbilling gateway script or class?

Have you searched google?

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


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




--- End Message ---
--- Begin Message --- Put an & in:

exec("/dealnews/myscript.php &");

The script will run in background.

Brian Moon wrote:

Hi all,

Ever since register_shutdown_function was changed to no longer happen after
the connection was closed, several things on our site have started to suck.
Not the main, public site, but our internal pages where cache is regenerated
and such.

I have tried using the pcntl functions in an exec'd script (both perl and
PHP) to fork and hopefully return to the web app to allow it to continue
(and not wait forever).  This works great with CLI and the command line, but
does not work at all if I exec() from mod_php.

All I do is call:

exec("/dealnews/myscript.php");

in the PHP app.  myscript.php then forks.  Unfortunately, exec() waits for
the damn forked process to finish before he returns.

Am I just not seeing something in PHP pcntl support here or am I on a wild
goose chase?

Thanks,

Brian Moon
dealnews.com






--- End Message ---
--- Begin Message --- You need to modify Testclass::someMethod to call the event handler directly

Axel Tietje wrote:

Hi,

I would like to do the following

When an objects method is called like this:

$test= new Testclass;
$test->someMethod ($someArgument);

I'd like to have an event handler outside Testclass to
log this event, like this:

function event_handler ( $method_name, $obj [, mixed parameter [, mixed...]]) {
   switch get_class($obj) {
       case "testclass" :
           // ...
           if ($method_name == "someMethod " {
               // ...
           }
       break;
   }
}

Is that possible in any way?


TIA, Axel.






--- End Message ---
--- Begin Message --- Create a function, then func_get_args will return you an array. Then continue as others sugested. You can call the function as
functionName($a, $b, ....) - any number of parameters you need


Steve Buehler wrote:

Hopefully someone has done this and has an easy answer. I know that I can do what I need with a LOT of code, but am trying to come up with something a little shorter that 50 lines of code. Here is the problem. I have 4 variables that each have a number in them. I need to find which one has the highest number. I then just need to do something with that number. If two or more have the same "highest" number, than I need to do the same thing with them. So......
$a=5
$b=1
$c=5
$d=3


$a and $c are the highest number. I need to run something on those two variables.

Thanks in Advance
Steve




--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hello
> 
> Does anyone know of an algorithm or program for matching pieces of text
> (such as film titles) that are conceptually the same, but which may be
> written/spelled differently?
> 
> eg. I need something which will identify a (likely to be) the same:
> "The Matrix Reloaded"
> "Matrix Reloaded, The"
> "Matrix Reloaded"
> "The Matrix: Reloaded"
> etc.
> 
> Thanks
> James

Maybe one or more of soundex(), metaphone(), levenshtein() or 
similar_text() might do the trick for you. All php functions :-)

Cheers
-- 
Quod subigo farinam



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

For a given date, how can i find out the date of the day of the begining of
that week?

Thanks for your help



--- End Message ---
--- Begin Message ---
Have you checked the date functions at http://www.php.net ?

-----Original Message-----
From: Shaun [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 29, 2003 6:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date question


Hi,

For a given date, how can i find out the date of the day of the begining
of that week?

Thanks for your help



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


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

I try to make a script which runs 24/7 and which connects to a socket 
based news feed and fetches some data whenever the server sends it.

The problem is that if i disconnect the client machine from the network, 
the program is not making any difference between receiving nothing cause 
server sends nothing, and receiving nothing cause it has no network. 

Also, didn't found any way to set a timeout. 

A bigger problem is that when i start the network, the program simply hangs.

Can anybody give me a hint? I saw similar previous postings without any 
reply. Maybe i will be the lucky one.

Regards,

Adrian


--- End Message ---
--- Begin Message ---
i'm trying to do a very simple thing:
upload image but it keep giving me this error although i gave permession on folder:
Warning: open_basedir restriction in effect. File is in wrong directory in 
/var/www/vhosts/negoumelshasha.com/httpdocs/test4.php on line 9
and here is my code:
//////////////////////////////////////////////////////////////////////////////////////////////
<HTML><BODY BGCOLOR=FFFFFF> 
    <?php 
       $uploadDir = $DOCUMENT_ROOT . "/test/";
        if (isset($submit))
  { 
            if ($upload != 'none')
   { 
                $dest = $uploadDir . $upload_name; 
                if (copy($upload, $dest))
    { 
                    echo "Successfully uploaded $dest<BR>\n"; 
                } 
                else
    { 
                    echo "<FONT COLOR=FF0000><B>File Upload Failed</B></FONT><BR>\n"; 
                    $perms = @fileperms($uploadDir); 
                    $owner = @fileowner($uploadDir); 
                    if (!$perms)
     { 
                        echo "Directory does not exist: $uploadDir<BR>\n"; 
                    } 
                    else
     { 
                        $myuid = getmyuid(); 
                        if (!($perms & 2) && !(($owner == $myuid) && ($perms & 128)))
      { 
                            echo get_current_user(), " doesn't have permission to 
write in $uploadDir<BR>\n"; 
                        } 
                    } 
                } 
            } 
            else
   { 
                echo "<FONT COLOR=FF0000><B>File2 Upload Failed</B></FONT><BR>\n"; 
                echo "Filesize exceeds limit in FORM or php.ini<BR>\n"; 
            } 
        } 
    ?> 
    <FORM ENCTYPE=multipart/form-data ACTION=test4.php METHOD=POST> 
        <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=10000> 
        Upload File: <INPUT NAME=upload TYPE=FILE><BR> 
        <INPUT TYPE=SUBMIT NAME=submit VALUE="Upload"> 
    </FORM> 
</BODY></HTML> 


---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

--- End Message ---
--- Begin Message ---
i'm trying to do a very simple thing:
upload image but it keep giving me this error although i gave permession on folder:
 
Warning: open_basedir restriction in effect. File is in wrong directory in 
/var/www/vhosts/negoumelshasha.com/httpdocs/test4.php on line 9
 
and here is my code:
//////////////////////////////////////////////////////////////////////////////////////////////
<HTML><BODY BGCOLOR=FFFFFF> 
    <?php 
       $uploadDir = $DOCUMENT_ROOT . "/test/";
        if (isset($submit))
  { 
            if ($upload != 'none')
   { 
                $dest = $uploadDir . $upload_name; 
                if (copy($upload, $dest))
    { 
                    echo "Successfully uploaded $dest<BR>\n"; 
                } 
                else
    { 
                    echo "<FONT COLOR=FF0000><B>File Upload Failed</B></FONT><BR>\n"; 
                    $perms = @fileperms($uploadDir); 
                    $owner = @fileowner($uploadDir); 
                    if (!$perms)
     { 
                        echo "Directory does not exist: $uploadDir<BR>\n"; 
                    } 
                    else
     { 
                        $myuid = getmyuid(); 
                        if (!($perms & 2) && !(($owner == $myuid) && ($perms & 128)))
      { 
                            echo get_current_user(), " doesn't have permission to 
write in $uploadDir<BR>\n"; 
                        } 
                    } 
                } 
            } 
            else
   { 
                echo "<FONT COLOR=FF0000><B>File2 Upload Failed</B></FONT><BR>\n"; 
                echo "Filesize exceeds limit in FORM or php.ini<BR>\n"; 
            } 
        } 
    ?> 
    <FORM ENCTYPE=multipart/form-data ACTION=test4.php METHOD=POST> 
        <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=10000> 
        Upload File: <INPUT NAME=upload TYPE=FILE><BR> 
        <INPUT TYPE=SUBMIT NAME=submit VALUE="Upload"> 
    </FORM> 
</BODY></HTML> 


---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

--- End Message ---
--- Begin Message ---
i'm trying to do a very simple thing:
upload image but it keep giving me this error although i gave permession on folder:
 
Warning: open_basedir restriction in effect. File is in wrong directory in 
/var/www/vhosts/negoumelshasha.com/httpdocs/test4.php on line 9
 
and here is my code:
//////////////////////////////////////////////////////////////////////////////////////////////
<HTML><BODY BGCOLOR=FFFFFF> 
    <?php 
       $uploadDir = $DOCUMENT_ROOT . "/test/";
        if (isset($submit))
  { 
            if ($upload != 'none')
   { 
                $dest = $uploadDir . $upload_name; 
                if (copy($upload, $dest))
    { 
                    echo "Successfully uploaded $dest<BR>\n"; 
                } 
                else
    { 
                    echo "<FONT COLOR=FF0000><B>File Upload Failed</B></FONT><BR>\n"; 
                    $perms = @fileperms($uploadDir); 
                    $owner = @fileowner($uploadDir); 
                    if (!$perms)
     { 
                        echo "Directory does not exist: $uploadDir<BR>\n"; 
                    } 
                    else
     { 
                        $myuid = getmyuid(); 
                        if (!($perms & 2) && !(($owner == $myuid) && ($perms & 128)))
      { 
                            echo get_current_user(), " doesn't have permission to 
write in $uploadDir<BR>\n"; 
                        } 
                    } 
                } 
            } 
            else
   { 
                echo "<FONT COLOR=FF0000><B>File2 Upload Failed</B></FONT><BR>\n"; 
                echo "Filesize exceeds limit in FORM or php.ini<BR>\n"; 
            } 
        } 
    ?> 
    <FORM ENCTYPE=multipart/form-data ACTION=test4.php METHOD=POST> 
        <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=10000> 
        Upload File: <INPUT NAME=upload TYPE=FILE><BR> 
        <INPUT TYPE=SUBMIT NAME=submit VALUE="Upload"> 
    </FORM> 
</BODY></HTML> 



---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

--- End Message ---
--- Begin Message ---
[snip]
i'm trying to do a very simple thing:
upload image but it keep giving me this error although i gave permession
on folder:
 
Warning: open_basedir restriction in effect. File is in wrong directory
in /var/www/vhosts/negoumelshasha.com/httpdocs/test4.php on line 9
[/snip]

Have you read and tried
http://us4.php.net/manual/en/features.file-upload.php ? 

HTH!

Jay

--- End Message ---
--- Begin Message --- Use move_uploaded_file() instead of copy()

fr r wrote:

i'm trying to do a very simple thing:
upload image but it keep giving me this error although i gave permession on folder:
Warning: open_basedir restriction in effect. File is in wrong directory in /var/www/vhosts/negoumelshasha.com/httpdocs/test4.php on line 9
and here is my code:
//////////////////////////////////////////////////////////////////////////////////////////////
<HTML><BODY BGCOLOR=FFFFFF> <?php $uploadDir = $DOCUMENT_ROOT . "/test/";
if (isset($submit))
{ if ($upload != 'none')
{ $dest = $uploadDir . $upload_name; if (copy($upload, $dest))
{ echo "Successfully uploaded $dest<BR>\n"; } else
{ echo "<FONT COLOR=FF0000><B>File Upload Failed</B></FONT><BR>\n"; $perms = @fileperms($uploadDir); $owner = @fileowner($uploadDir); if (!$perms)
{ echo "Directory does not exist: $uploadDir<BR>\n"; } else
{ $myuid = getmyuid(); if (!($perms & 2) && !(($owner == $myuid) && ($perms & 128)))
{ echo get_current_user(), " doesn't have permission to write in $uploadDir<BR>\n"; } } } } else
{ echo "<FONT COLOR=FF0000><B>File2 Upload Failed</B></FONT><BR>\n"; echo "Filesize exceeds limit in FORM or php.ini<BR>\n"; } } ?> <FORM ENCTYPE=multipart/form-data ACTION=test4.php METHOD=POST> <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=10000> Upload File: <INPUT NAME=upload TYPE=FILE><BR> <INPUT TYPE=SUBMIT NAME=submit VALUE="Upload"> </FORM> </BODY></HTML>



---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).




--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


  After a lengthy QA process, PHP 4.3.2 is finally out!  This maintenance
  release solves a lot of bugs found in earlier PHP versions and is a
  *strongly* recommended upgrade for all PHP users.

  PHP 4.3.2 contains, among others, following important fixes, additions and
  improvements:

   * Fixes several potentially hazardous integer and buffer overflows.
   * Fixes for several 64-bit problems.
   * New Apache 2.0 SAPI module (sapi/apache2handler, enabled with --with-apxs2).
   * New session_regenerate_id() function. 
     (Important feature against malicious session planting).
   * Improvements to dba extension.
   * Improvements to thttpd SAPI module.
   * Dropped support for GDLIB version 1.x.x (php_gd.dll) on Windows.
   * An unix man page for CLI version of PHP.
   * New "disable_classes" php.ini option to allow administrators to disable
     certain classes for security reasons.
   * ..and huge amount other bug fixes
   
  For a full list of changes in PHP 4.3.2, see the NEWS file.
  (http://www.php.net/ChangeLog-4.php).

  md5sums:

   8aec1bb2dbcca1c92835c71e2e30d9c5 *php-4.3.2.tar.bz2
   8433a1d0ce679780990d4813ae094590 *php-4.3.2.tar.gz
   e1afea6341d97e8160bd7d93712721ec *php-4.3.2-Win32.zip
   cb55d0d9df6a2bf4ba666c27886d12cb *php-4.3.2-installer.exe


  kippis,

    Jani Taskinen
    [EMAIL PROTECTED]


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

iD8DBQE+1feO/HlsOzK2WlERAuExAKDYgdy/qCRur4YPdoPGrxfFqWxxmgCfdnal
DtTNv9vmVAUDRh2LjM0lUH0=
=GHti
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to