RE: [PHP] OnUNload Scripts

2001-10-24 Thread Martin Towell

From what I can tell, the only way you can execute a PHP script is to have
the browser request it. This means using the same window that the document
is being unloaded in, or opening a new window.

You could open a new window, give focus to the current window, and in the
new window, have it close itself after it's finished processing.

Hope this helps.
Martin

-Original Message-
From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 4:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] OnUNload Scripts


Hi everyone,

I can use javascripts onunload to run PHP file with a new window.
Is there anyway i can run PHP script file on ONUNLOAD with out opening a new
window ( in the back ground).

Any one's help will be greatly appreciated.

Best regards,
Hasan



-- 
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] Enabling php in only certain hosts and directories

2001-10-24 Thread Joseph Blythe

Hello all,

I am just configuring up a new web server, and I want to be able to run php
only in the web servers main document root and in specified virtual hosts, I
have a fair understanding on how to go about this, but would really like
some feedback before I get to far into it. Basically the only directories I
don't want to be able to use php are all the user directories (/~username)
unless they have been mapped to a virtual host that has the right directives
in them to enable php.

BTW: Running Apache/1.3.22, PHP/4.0.6, RedHat 6.2

Any feedback would be greatly appreciated,

Regards,

Joseph



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




[PHP] redirecting the browser

2001-10-24 Thread Ozgur Demirtas

Hi all,

I have a PHP script and at one point of the script I am trying to redirect
my browser to a certaion page. I can't seem to find an easy way of doing
this. header() call is so much of a problem. There is no such function like
redirect(...) as in ASP?

PS: I am using PHP version 3.09 as an Apache module on Solaris.

Thanks!
Ozgur




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




Re: [PHP] redirecting the browser

2001-10-24 Thread Mak

Hi, you can use Javascript as follows:

?php
  // your code here...
  print(scriptdocument.location.href='somepage.php';/script);
  //continue yr code...
?

Hope it helps.

- Mak

- Original Message -
From: Ozgur Demirtas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 2:47 PM
Subject: [PHP] redirecting the browser


 Hi all,

 I have a PHP script and at one point of the script I am trying to redirect
 my browser to a certaion page. I can't seem to find an easy way of doing
 this. header() call is so much of a problem. There is no such function
like
 redirect(...) as in ASP?

 PS: I am using PHP version 3.09 as an Apache module on Solaris.

 Thanks!
 Ozgur




 --
 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!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




Re: [PHP] redirecting the browser

2001-10-24 Thread Valentin V. Petruchek

Use this:
?php
Header(Location: anypage.php);
exit(); //stopping the script
?
- Original Message -
From: Ozgur Demirtas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 9:47 AM
Subject: [PHP] redirecting the browser


 Hi all,

 I have a PHP script and at one point of the script I am trying to redirect
 my browser to a certaion page. I can't seem to find an easy way of doing
 this. header() call is so much of a problem. There is no such function
like
 redirect(...) as in ASP?

 PS: I am using PHP version 3.09 as an Apache module on Solaris.

 Thanks!
 Ozgur




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






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




Re: [PHP] INPUT tag with default value

2001-10-24 Thread Silvia Mahiques

  Dear Philip,

  Thank you very much,
  I have lost long time proving different alternatives that it's better
not to implement. I prefer a safe code.

  Thanks again!.

  Cheers

  Silvia Mahiques


Philip Olson [EMAIL PROTECTED] escribió en el mensaje
Pine.BSF.4.10.10110231629160.58932-10@localhost">news:Pine.BSF.4.10.10110231629160.58932-10@localhost...
 This is not possible. Default values cannot be set with type=file as if it
 were it would be quite a security risk.A little more information on
 the capability of this html form element:

   http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm

 And a related RFC :

   http://www.faqs.org/rfcs/rfc1867.html

 regards,
 Philip Ollson


 On Tue, 23 Oct 2001, Silvia Mahiques wrote:

  Hi,
  I can't print a default value in a INPUT tag with TYPE=file. INPUT tag
has value attribute, but it not apear in window box.
 
  input type=file name=photo size=60 maxlength=150 value=? echo
$photo; ?.
 
  How can I print a default value?
 
 
 
  Thanks,
 
  Silvia Mahiques
 



begin 666 px.gif
K1TE.#EA`0`!`/ ``/___P```'Y! $```$`+ `!``$```(3 $`.P``
`
end


-- 
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] Check mail user

2001-10-24 Thread Rosen

Hi,
can someone give me script for syntax check of username for mail server ?

Thanks,
Rosen



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




RE: [PHP] OnUNload Scripts

2001-10-24 Thread Jason G.

It may be possible to do something of the following:

I know that on rollovers, Javascript can preload the images needed to 
rollover to...  Hmm...  Maybe you could have javascript load an image 
during the unload event with the image's src pointing to a php script...

-Jason Garber



At 04:51 PM 10/24/2001 +1000, Martin Towell wrote:
 From what I can tell, the only way you can execute a PHP script is to have
the browser request it. This means using the same window that the document
is being unloaded in, or opening a new window.

You could open a new window, give focus to the current window, and in the
new window, have it close itself after it's finished processing.

Hope this helps.
Martin

-Original Message-
From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 4:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] OnUNload Scripts


Hi everyone,

I can use javascripts onunload to run PHP file with a new window.
Is there anyway i can run PHP script file on ONUNLOAD with out opening a new
window ( in the back ground).

Any one's help will be greatly appreciated.

Best regards,
Hasan



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


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




Re: [PHP] OnUNload Scripts

2001-10-24 Thread Mak

It may also be possible to use document.location.href (in Javascript) to
change the location to the desired PHP file which you want to run, and then
at the end of that PHP file, go to the page which the user originally wanted
to go (if any)...

I'm not very sure if that works though. Hope it helps.

Mak

- Original Message -
From: Jason G. [EMAIL PROTECTED]
To: Martin Towell [EMAIL PROTECTED]; 'Impex Holidays Maldives /
Hasan' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 3:37 PM
Subject: RE: [PHP] OnUNload Scripts


 It may be possible to do something of the following:

 I know that on rollovers, Javascript can preload the images needed to
 rollover to...  Hmm...  Maybe you could have javascript load an image
 during the unload event with the image's src pointing to a php script...

 -Jason Garber



 At 04:51 PM 10/24/2001 +1000, Martin Towell wrote:
  From what I can tell, the only way you can execute a PHP script is to
have
 the browser request it. This means using the same window that the
document
 is being unloaded in, or opening a new window.
 
 You could open a new window, give focus to the current window, and in the
 new window, have it close itself after it's finished processing.
 
 Hope this helps.
 Martin
 
 -Original Message-
 From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 24, 2001 4:16 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] OnUNload Scripts
 
 
 Hi everyone,
 
 I can use javascripts onunload to run PHP file with a new window.
 Is there anyway i can run PHP script file on ONUNLOAD with out opening a
new
 window ( in the back ground).
 
 Any one's help will be greatly appreciated.
 
 Best regards,
 Hasan
 
 
 
 --
 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!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




Re: [PHP] Check mail user

2001-10-24 Thread Valentin V. Petruchek

If I understand you properly you need smth like this

function checkmail ($email) {
return (eregi(^[_\.0-9a-z-]+@([0-9a-z][-0-9a-z\.]+)\.([a-z]{2,3}$),
$email, $check));
}

- Original Message -
From: Rosen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 10:24 AM
Subject: [PHP] Check mail user


 Hi,
 can someone give me script for syntax check of username for mail server ?

 Thanks,
 Rosen



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






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




[PHP] Looking for a high usage PHP host

2001-10-24 Thread Ben Quinn

Hi all

I'm looking for a web host with the following requirments

* PHP (would prefer version 4) with GD support - the most important thing is
the version of GD must be 1.6 or lower because we have to work with GIF
files on the fly
* High data transfer - somewhere in the range of 20gig+ per month
* Telnet access

I've been looking for quite some time now and haven't had much luck - if
anyone could help me out it'd be much appreciated!

Cheers

Ben Quinn

Assistant webmaster of the Australian Severe Weather Association website
http://www.severeweather.asn.au
Webmaster of the Brisbane Storm Chasers Homepage
http://www.bsch.au.com
Weather education section at NEMAS (North East Media of Atmospheric Science)
http://www.nemas.net/edu/




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




Re: [PHP] redirecting the browser

2001-10-24 Thread Kodrik

 ?php
 Header(Location: anypage.php);
 exit(); //stopping the script
 ?

No, he wants to launch a script after Javascript has processed.
PHP is run on the server, Javascript on the client so Javascript has to run 
after PHp is finished.
For him to launch a Javascript code, he can only do it by contacting the 
server and asking it for a page.
The only way to do it with Javacript and PHP without changing the page you 
are on is to use an invisible frame, which he said he didn't want to.

So, it is impossible with only Javascript and PHP.

But he can do it with Java or Flash to talk to his server.
But you must handle either pretty well to do it.

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




Re: [PHP] problem pattern matching a url with question mark

2001-10-24 Thread Neil Freeman

Why does your URL contain .asp?

[EMAIL PROTECTED] wrote:

 I found the following code currently used on our website to match a url
 expression. Unfortunately, when I added a question mark, the webpage that
 contained the url with the question mark just hung and would not load into
 my browser at all. Currently, the url links only up to the question mark.

 Here's the url I'm trying to get to work:
 http://www.thejakartapost.com/yesterdaydetail.asp?fileid=20011018.G07

 Can you look at the code below and tell me what I'm doing wrong?

 - Shawna

 ORIGINAL CODE

 // this will find web addresses and encapsulate each one in a standard
 anchor

 while(ereg(http://([\/~_\.0-9A-Za-z#-]+), $content, $match)){
 $http_old = $match[0];
 $http = dubdubdub . $match[1] . $match[2];
 $url = A HREF=\javascript:externalURL('$http')\;$http/A;
 $content = ereg_replace($http_old, $url, $content);
 };

 $content = ereg_replace(dubdubdub, http://;, $content);

 CODE WITH QUESTION MARK

 // this will find web addresses and encapsulate each one in a standard
 anchor

 while(ereg(http://([\/~_\.0-9A-Za-z#-?]+), $content, $match)){
 $http_old = $match[0];
 $http = dubdubdub . $match[1] . $match[2];
 $url = A HREF=\javascript:externalURL('$http')\;$http/A;
 $content = ereg_replace($http_old, $url, $content);
 };

 $content = ereg_replace(dubdubdub, http://;, $content);

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

 ***
  This message was virus checked with: SAVI 3.50
  last updated 23rd October 2001
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





RE: [PHP] Using A Query Results Multiple Times

2001-10-24 Thread Niklas Lampén

mysql_data_seek();


Niklas

-Original Message-
From: Adam Douglas [mailto:[EMAIL PROTECTED]] 
Sent: 23. lokakuuta 2001 21:48
To: PHP-DB (mailing list) (E-mail); PHP-General (mailing list) (E-mail)
Subject: [PHP-DB] Using A Query Results Multiple Times


I have an instance where I have to query my MySQL database and
then use the multiple row results to create multiple pull down menus on
a web page. My problem is how can I take the results of the query and
use them more the once to create pull down menus? I've always used a
while look to fetch each row of the results and have it create the pull
down menu as it goes through each row. But doing it this way only stores
one row of results in a variable. Is there a way I can grab all the
results from a query that would go into an array so I could use it
multiple times? I've looking briefly for a function to MySQL that would
allow me to do this but haven't found anything unless I misunderstand
mysql_fetch_array function. At first I thought I could loop through my
while loop and have it put the results from the query of each row in to
a multidimensional array. But then how would I add to the array after
the initial row?

BTW, I'm using PHP 3.0.16 so I can't use the added array functions
that PHP 4 has. I do plan on upgrading soon.


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


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




Re: [PHP] How to protect MySQL password

2001-10-24 Thread Justin French

All these solutions are depending (mainly) on having a dedicated server,
which I believe would not be the case for 90% of the users on here
(don't shoot me if i'm wrong).

So far, I can't see how the problem can be solved.  My host does not
allow telnet/ssh at all which sounds like a good thing!

I can put the password file outside the public html, but from i've read
in this thread, it looks like other users on a virtual server might be
able to gain access to that file using PHP or annother program to read
through the hard disk hierarchy.

Then there was a suggestion that everything could be wrapped in a
PHP-CGI thing, but I don't have PHP as a CGI on my server.  What we
really need is an expert here to give us the low-down on the best way to
accomplish the best security given regular tools.

What about encryption?


Justin French

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




Re: [PHP] Using A Query Results Multiple Times

2001-10-24 Thread Kodrik

Checkout sqltools at:
http://zc8.com/zc8/ZC8news/shownews.php?articleid=98

It has many fucntions for mysql within php.
They should work with php3.

On Wednesday 24 October 2001 04:19 am, Niklas Lampén wrote:
 mysql_data_seek();


 Niklas

 -Original Message-
 From: Adam Douglas [mailto:[EMAIL PROTECTED]]
 Sent: 23. lokakuuta 2001 21:48
 To: PHP-DB (mailing list) (E-mail); PHP-General (mailing list) (E-mail)
 Subject: [PHP-DB] Using A Query Results Multiple Times


   I have an instance where I have to query my MySQL database and
 then use the multiple row results to create multiple pull down menus on
 a web page. My problem is how can I take the results of the query and
 use them more the once to create pull down menus? I've always used a
 while look to fetch each row of the results and have it create the pull
 down menu as it goes through each row. But doing it this way only stores
 one row of results in a variable. Is there a way I can grab all the
 results from a query that would go into an array so I could use it
 multiple times? I've looking briefly for a function to MySQL that would
 allow me to do this but haven't found anything unless I misunderstand
 mysql_fetch_array function. At first I thought I could loop through my
 while loop and have it put the results from the query of each row in to
 a multidimensional array. But then how would I add to the array after
 the initial row?

 BTW, I'm using PHP 3.0.16 so I can't use the added array functions
 that PHP 4 has. I do plan on upgrading soon.

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




Re: [PHP] OnUNload Scripts

2001-10-24 Thread Kodrik

 You could open a new window, give focus to the current window, and in the
 new window, have it close itself after it's finished processing.

An invisible frame is the easiest:
frame rows=100%, *
 framset name='main' src='src.php'
 frameset name='invisibleframe' src='background.php'
/frameset

then javascript can send orders to php through the invisible frame.

Flash can also talk to php without reloading which allows for some cool stuff.
Finally, Java is the hardest solution but still a solution




 -Original Message-

 From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]

 Sent: Wednesday, October 24, 2001 4:16 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] OnUNload Scripts
 
 
 Hi everyone,
 
 I can use javascripts onunload to run PHP file with a new window.
 Is there anyway i can run PHP script file on ONUNLOAD with out opening a
  new window ( in the back ground).
 
 Any one's help will be greatly appreciated.
 
 Best regards,
 Hasan
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




Re: [PHP] Check mail user

2001-10-24 Thread Kodrik

Like this?

function checkmail ($email)
{
 if 
(eregi(^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z][a-z][a-z]?$, 
$email, $check))

 { 
  if (checkdnsrr(substr(strstr($check[0], '@'), 1), ANY))
  {
   return TRUE;
  }
 }
 return FALSE;
}


On Wednesday 24 October 2001 03:24 am, Rosen wrote:
 Hi,
 can someone give me script for syntax check of username for mail server ?

 Thanks,
 Rosen

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




Re: [PHP] redirecting the browser

2001-10-24 Thread Kodrik

I got some thread mixed up. Ignore that answer.

 No, he wants to launch a script after Javascript has processed.
 PHP is run on the server, Javascript on the client so Javascript has to run
 after PHp is finished.
 For him to launch a Javascript code, he can only do it by contacting the
 server and asking it for a page.
 The only way to do it with Javacript and PHP without changing the page you
 are on is to use an invisible frame, which he said he didn't want to.

 So, it is impossible with only Javascript and PHP.

 But he can do it with Java or Flash to talk to his server.
 But you must handle either pretty well to do it.

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




Re: [PHP] OnUNload Scripts

2001-10-24 Thread Mak

Yes I agree. Flash has great integration with PHP and that makes it much
easier for communication between them, eg. passing around variables.

- Original Message -
From: Kodrik [EMAIL PROTECTED]
To: Jason G. [EMAIL PROTECTED]; Martin Towell [EMAIL PROTECTED];
'Impex Holidays Maldives / Hasan' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 1:40 PM
Subject: Re: [PHP] OnUNload Scripts


  You could open a new window, give focus to the current window, and in
the
  new window, have it close itself after it's finished processing.

 An invisible frame is the easiest:
 frame rows=100%, *
  framset name='main' src='src.php'
  frameset name='invisibleframe' src='background.php'
 /frameset

 then javascript can send orders to php through the invisible frame.

 Flash can also talk to php without reloading which allows for some cool
stuff.
 Finally, Java is the hardest solution but still a solution




  -Original Message-
 
  From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]
 
  Sent: Wednesday, October 24, 2001 4:16 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] OnUNload Scripts
  
  
  Hi everyone,
  
  I can use javascripts onunload to run PHP file with a new window.
  Is there anyway i can run PHP script file on ONUNLOAD with out opening
a
   new window ( in the back ground).
  
  Any one's help will be greatly appreciated.
  
  Best regards,
  Hasan
  
  
  
  --
  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!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




Re: [PHP] Package mechanism

2001-10-24 Thread DL Neil

 I have a need for a package mechanism like that provided by TCL. We
 write a
 lot of code in reusable libraries and often encounter the situation in
 which
 an application uses a particular library but requires at least version X
 or
 greater.

 The require(), require_once(), etc. functionality doesn't provide any
 version
 checking facility and I'm not aware of any other such mechanism built
 into
 PHP.

 I played around with the following which kind of emulates the TCL
 behaviour:
 In each library I set a variable that contains that file's version
 number
 (automatically populated by CVS keyword expansion). I then replaced my
 require() statements by a customised version which takes version number
 arguments.

 So, in my application script I have, for example:

 require_once(package.inc);
 package_require(libraryfile.inc, 1.5, 0);
 ...

 And in package.inc I have:

 function package_require($file, $minVersion, $maxVersion) {

 require_once($file);

 // Code to check if $file is within the specified bounds

 }


 The obvious (potential) problems with this approach are with respect to
 scope. Most of the libraries I use contain function and class
 definitions and
 I'm not at all sure about the consequences of declaring these from
 within
 another function (package_require()). To my surprise, though, it seemed
 to
 work. No errors were generated and I could happily use the classes and
 functions as usual. I'm a little nervous, though, about problems that
 are not
 immediately visible.

 Secondly, there is the problem of global variables. Any variables set in
 the
 global scope in the library files are now in the local scope of the
 package_require() function. I cannot put 'global' declarations for each
 of
 these as I would have to know about each and every one of them in
 advance
 which prevents it from being a general solution.

 Does anyone else have some good ideas about this issue?
 Are there any plans to implement this in PHP itself where it properly
 belongs?



Douw,

As to the first question: if package_require($file, $minVersion, $maxVersion) was set 
up to only return the assembled
filename (not perform the require call), and the require_once($file) nested that 
function call and was placed in the
'mainline', would that allay some of your concerns?

 require_once( package_require( $file [, args ] ) );

- but what if there isn't a suitable candidate? Would there be some advantage to 
setting package_require() to return a
boolean (suitable include file found - success/failure) and then:

 package_require( $file [, args ] ) ? require_once( $file ) : die( 'or whatever' );

which 'blends' quite happily into a list of require_once() calls - but could be an 
if-then-else construct if you prefer
that presentation.

As to the last question, I can't say, but I was recently asking for a tidy method to 
keep development/test and
production code/includes/databases separate and ended up writing my own name-handler, 
much as yours...

Regards,
=dn



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




Re: [PHP] Enabling php in only certain hosts and directories

2001-10-24 Thread Kodrik

Well, php runs the same as apache, so whatever apache can access, php can 
access.
So any files with the db passwords that need to be accessed by php, can be 
seen by all users who can upload php scripts to your server. In the case of 
virtual hosting.

So trust people you give access, even limited,  to your machine.


On Wednesday 24 October 2001 02:42 am, you wrote:
 Hello all,

 I am just configuring up a new web server, and I want to be able to run php
 only in the web servers main document root and in specified virtual hosts,
 I have a fair understanding on how to go about this, but would really like
 some feedback before I get to far into it. Basically the only directories I
 don't want to be able to use php are all the user directories (/~username)
 unless they have been mapped to a virtual host that has the right
 directives in them to enable php.

 BTW: Running Apache/1.3.22, PHP/4.0.6, RedHat 6.2

 Any feedback would be greatly appreciated,

 Regards,

 Joseph

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




[PHP] libxml

2001-10-24 Thread php

Firstly,

thanks to those who replied to me last week about xmldom support with this
error:

Warning:  Unknown list entry type in request shutdown (0) in Unknown on line
0

I've since tried a few combinations of versions of libxml, and expat (dont
know if expat would
matter), any was wondering if anyone who is using dom support correctly
could
tell me which versions work for them.


Thank you,

Sean


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




RE: [PHP] PHP Openlink/Progress Problems

2001-10-24 Thread Grant Walters

 On Tue, 23 Oct 2001 16:35, Grant Walters wrote:
  I'm going nuts trying to work out how to handle errors from data
  statement with single quotes.  PHP 4.0.6 appears to be mangling
  something somewhere.
  All statements work with the Openlink odbctest program
  Any help appreciated
 
  ?
  $conn = odbc_connect($dsn,,,$cursor);
  $sql=SELECT ID,Category,description FROM card_type WHERE
  description='IMPEYS'; echo BRbSQL:/b $sqlBR;
  $results = odbc_do($conn,$sql);
  if ($results) {
while (odbc_fetch_into($results,$row)) {
  echo $row[0]. .$row[1]. .$row[2].\n;
}
  }
  $sql=SELECT ID,Category,description FROM card_type WHERE description
  LIKE '%PEP%'; echo BRbSQL:/b $sqlBR;
  $results = odbc_do($conn,$sql);
  if ($results) {
while (odbc_fetch_into($results,$row)) {
  echo $row[0]. .$row[1]. .$row[2].\n;
}
  }
  $sql='SELECT ID,Category,description FROM card_type WHERE description
  LIKE %PEP%'; echo BRbSQL:/b $sqlBR;
  $results = odbc_do($conn,$sql);
  if ($results) {
while (odbc_fetch_into($results,$row)) {
  echo $row[0]. .$row[1]. .$row[2].\n;
}
  }
  $sql='SELECT ID,Category,description FROM card_type WHERE
  description=PEPPERELL\'S'; echo BRbSQL:/b $sqlBR;
  $results = odbc_do($conn,$sql);
  if ($results) {
while (odbc_fetch_into($results,$row)) {
  echo $row[0]. .$row[1]. .$row[2].\n;
}
  }
  $sql=SELECT ID,Category,description FROM card_type WHERE
  description=\PEPPERELL'S\; echo BRbSQL:/b $sqlBR;
  $results = odbc_do($conn,$sql);
  if ($results) {
while (odbc_fetch_into($results,$row)) {
  echo $row[0]. .$row[1]. .$row[2].\n;
}
  }
  ?

 If I were doing that with mysql, I would use
  $sql=SELECT ID,Category,description FROM card_type WHERE
  description='PEPPERELL\'S'; echo BRbSQL:/b $sqlBR;

I do the same for MySQL.  Appears there is a bug somewher in the PHP odbc code.  The 
Openlink team suggested using odbc_prepare
instead, and that works fine, so I'll be converting all of my classes to use 
odbc_prepare statements instead of odbc_do.  I've just
logged this as a bug on the php bug site, so we'll see if they can shed any further 
light on it.

 Given that you are probably getting the description value passed in, you
 might want to check your magic_quotes settings, and also perhaps echo the
 incoming value for description to see whether it is as you expect.

 You might have to play around with addslashes to get the right result.

Seems, that addslashes and magic_quotes have no impact at all.  I've downloaded and 
checked the M$ ODBC SDK and the error 37000 is
now error 42000 under ODBC 3.5?  It means that there is a syntax error in the SQL 
command being passed.  considering that everything
works fine from the odbctest program provided by Openlink and also works with 
odbc_prepare using ? and parameters, it must be in the
PHP stuff somewhere.


  OUTPUT

 
  SQL: SELECT ID,Category,description FROM card_type WHERE
  description=PEPPERELL'S Warning: SQL error:
  [OpenLink][ODBC][Driver]Syntax error or access, SQL state 37000 in
  SQLExecDirect in /usr/local/.WWW/WEBS/_odbc/test.php3 on line 58
 
 Ah, how's the wind today? :-)

Ever present.  I live right on the coast facing West, so it gets a wee bit 
rambunctious sometimes :-)


Regards

Grant Walters
Brainbench 'Most Valuable Professional' for Unix Admin
Walters  Associates, P O Box 13-043 Johnsonville, Wellington, NEW ZEALAND
Telephone: +64 4 4765175, CellPhone 025488265, ICQ# 23511989


-- 
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] sorting an array of objects

2001-10-24 Thread L Melville

Hi,

Is it possible to sort a class array using array multisort, I have two items
in each class that I wish to sort by, one is a text and the other is the
first item in an array within within each class. i.e.;-

$class[$index]-text;
$class[$index]-array[0];

how can I do this?

thanks in advance
lee




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




Re: [PHP] How to protect MySQL password

2001-10-24 Thread Christian Reiniger

On Tuesday 23 October 2001 23:33, Kurt Lieber wrote:

 Sorry -- but you're wrong.  If you've got php loaded as an apache
 module in a shared hosting environment, then any file that apache can
 read, I can gain access to through a simple FTP account and a
 well-constructed php file using fopen().  Doesn't matter if that file

Only if the host has safe_mode disabled or badly misconfigured.

- safe_mode, open_basedir in the config section of the manual

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

Very funny, Scotty! Now beam up my clothes...

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




[PHP] Re: Check mail user

2001-10-24 Thread Rosen

Thanks  !!!

Rosen



Rosen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 can someone give me script for syntax check of username for mail server ?

 Thanks,
 Rosen





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




Re: [PHP] Package mechanism

2001-10-24 Thread DL Neil

Douw,

It's kind of eerie the way your reply appears in my email before I can see my 
intervening post!!!???
Perhaps you're just more important than me (bow, scrape, simper...)

 Thanks for the feedback and additional ideas.

=HTH

 I had also though that it might be necessary to separate out the
 require_once() and the version check. I would rather do the
 require_once() first (unconditionally) and then the version check rather
 than the other way around for performance reasons; ie.
 require_once($file);
 if (!package_require($file, 1.5, 0)) die( 'or whatever' );

=you want the 'good news' before the 'bad'?

 If we did
 package_require( $file [, args ] ) ? require_once( $file ) : die( 'or
 whatever' );
 we would presumably have to open $file twice (once for the check and
 once for the loading), although a decent file system cache would
 presumably ameliorate this).

=have no detail of what happens within package_require(). What is the 'checking' logic?

=I assumed (!?) that you might be using a directory level 'scan' of 'include-dir' for 
possible code-candidates. Is it
necessary to actually open the file (prior to the 'require' itself) or is the file 
name sufficiently indicative? eg I'm
working on Req_MySQLv3.php (my own higher-level access/error checking routines) at the 
moment.

 I'd prefer not to go the route of having many versions of each library
 lying around and having to assemble an appropriate filename, especially
 on deployment servers. I'd rather that there is a single version and the
 application simply indicates failure if it is not recent enough.

=seems reasonable - as long as the first thing that happens after the delivery of new 
code to the production environment
is that someone checks that all the requisite linkages do in fact, work. If on the 
other hand, this is not a script that
is repeatedly called, but is perhaps the first in a 'conversation', eg a login screen, 
then the overhead is
insignificant, and if its possible to assume all checks at this stage will 'assure' 
the version relationships for the
rest of the scripts in the conversation you only need to do it once for the whole 
conversation.

=I'm intrigued though (as mentioned, I tried working through such a procedure a while 
back) - back to the question about
'logic', if that's not 'prying'...
=dn



-- 
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] Problems with TTF

2001-10-24 Thread Alberto

Warning: Could not find/open font in
/sdr/httpd/Prisa/DATA/private/libs/graficos/intradia.php on line 57

Line 57: ImageTTFText ($O_imagen, 11, 0, 10, 20, $O_colorValor,
arial.ttf,$s_Valor);

arial.ttf is into the same dir.

Any ideas?

that file has read permissiones for everyone.




-- 
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] Premature end of script headers

2001-10-24 Thread Tshering Norbu

Hi list,
What/why  this error:

[Wed Oct 24 17:03:33 2001] [error] [client 127.0.0.1] Premature end of
script headers: c:/php4win/php.exe


Thanks,
NOBBY



-- 
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] Problem with --with-custom-odbc

2001-10-24 Thread Kraa de Simon

Hello,

I configured PHP 4.0.5 with the --with-custom-odbc option.

I get no errors but the odbc functions are not available.

When I look at phpinfo() I can see that the configure command is:

'./configure' '--with-mysql' '--with-apache=../apache_1.3.19'
'--enable-track-vars'

Is --with-custom-odbc ignored? Any ideas?

I did set CUSTOM_ODBC_LIBS and CFLAGS and created a odbc.h include file:

[/root] echo $CUSTOM_ODBC_LIBS
-L/progress/dlc91/odbc/lib -lodbc -lodbcinst
[/root] echo $CFLAGS
-I/progress/dlc91/odbc/include -I/usr/local/src/apache_1.3.19/include
[/root] echo $LDFLAGS

[/root] cat /progress/dlc91/odbc/include/odbc.h
#include sql.h
#include sqlext.h
#include odbcinst.h
[/root]

Met vriendelijke groet / With kind regards,

ICL Nederland B.V.  Simon de Kraa
e-Applications / Logistic Systems   Systems Architect
Het Kwadrant 1  Tel. +31 346 598865
Postbus 4000Fax  +31 346 562703
3600 KA  MAARSSEN
The Netherlands mailto:[EMAIL PROTECTED]

---

Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows
2000 5.00.2195 SP 2
Progress 9.1b @ SCO UnixWare 7.1.1

-- 
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] talking directly w/ MySql

2001-10-24 Thread _lallous

I think that the MySql's API allow to many queries to be executed w/o having
an open connection, example:
SELECT 1+1;

how can i issue such statments w/o opening a connection?

like SELECT NOW() ..


whenever I first run mysql_query() it tries to connect w/ default connection
settings.



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




[PHP] Re: Detect mySql Install

2001-10-24 Thread _lallous

$mysql_installed = function_exists('mysql_query');
as for the version, you can then do:
$r = mysql_query(SELECT VERSION());
$r = mysql_fetch_array($r);
$ver = $r[0];


Chris [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there a way to detect, using PHP, if mySql is installed on a server?
 Can a version # be determined also? I know this can be done using
 phpinfo, but I don't want to use that approach.

 Thanks,
 Chris




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




[PHP] Re: running scripts onunload

2001-10-24 Thread _lallous

I'm afraid there is no way to do so!


Impex Holidays Maldives / Hasan [EMAIL PROTECTED] wrote in message
0beb01c15bcb$f0becf50$c6c801ca@hasan">news:0beb01c15bcb$f0becf50$c6c801ca@hasan...
 Hi everyone,

 I can use javascripts onunload to run PHP file with a new window.
 Is there anyway i can run PHP script file on ONUNLOAD with out opening a
new window ( in the back ground).

 Any one help will be greatly appreciated.

 Best regards,
 Hasan




-- 
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] Linux news group

2001-10-24 Thread Rehuel Lobato de Mesquita

Hey guys,

where can i find a linux news group? I thought one, (comp.os.linux.setup)
but my reader seems to think it's not a valid news server... (is it?)

Rehuel



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

2001-10-24 Thread Victor Hugo Oliveira

Does anyone know a way to share an object with all sessions ?
The idea is to access the same database connection poll.

Thanks,
Victor


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




Re: [PHP] Object sharing

2001-10-24 Thread Andrey Hristov

sharedMemory on *nix


-- 
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com

On Wednesday 24 October 2001 09:35 am, you wrote:
 Does anyone know a way to share an object with all sessions ?
   The idea is to access the same database connection poll.

 Thanks,
 Victor

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




[PHP] Re: Help converting ASP-PHP

2001-10-24 Thread MrBaseball34

In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...
   datCurrent, intCurrentMonthDays and intWorkDays are local
 
  This didn't totaly help. This line I can't figure out:
  intCurrentMonthDays= Day[DateAdd[d,-1, DateAdd[m,1, datCurrent]]];
 
  Basically it gets the number of days in the current month, How to do 
  in PHP?
 
 Mr.Baseball,
 
 have a look at the manual page for the date function
 http://www.php.net/manual/en/function.date.php
 There is a an option to get the number of days in a month
 do a search for 'number of days in the given month' 

Thanks, that was it...hmmm, it is wonderful when you FULLY read
the manual, huh?

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




RE: [PHP] Object sharing

2001-10-24 Thread Victor Hugo Oliveira

Is there an easy way to save an object in this section ?
The object will have something like an open file or a database connection...

Thanks,
Victor

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: quarta-feira, 24 de outubro de 2001 16:43
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Object sharing


sharedMemory on *nix


--
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com

On Wednesday 24 October 2001 09:35 am, you wrote:
 Does anyone know a way to share an object with all sessions ?
   The idea is to access the same database connection poll.

 Thanks,
 Victor

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


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




[PHP] I NEED HELP WITH PWS AND W98

2001-10-24 Thread Nicolas Llamosas

My name is Nicolás Llamosas, I`m from Río Cuarto, Argentina and sorry for my 
poor english. I need informacion about how configure Personal Web Server 
under W98 to use with PHP 3.0 I downloaded the BIN code of PHP version 
3.0.17 for W32 and I followed the instructions on the manual #8220;PHP 
Manual#8221; (I downloaded it in php.net page, and I configured the PHP.ini 
file, etc, etc.), but I don#8217;t know if I need to compile under C or 
Visual C, or what I have to do after that to start to use PHP under w98 and 
PWS. Some detailed informacion will very important for me.

Thanks.

Nicolas Llamosas #8211; [EMAIL PROTECTED]


_
Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp


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




Re: [PHP] Enabling php in only certain hosts and directories

2001-10-24 Thread Tamas Arpad

On Wednesday 24 October 2001 08:19, you wrote:
 Well, php runs the same as apache, so whatever apache can access,
 php can access.
 So any files with the db passwords that need to be accessed by php,
 can be seen by all users who can upload php scripts to your server.
That's not completely true. You can use open_basedir, safe_mode 
settings in apache's configuration, based on virtualhosts or even 
directories. This way you can restrict users, virtual hosts to their 
own directories.
Arpi

  Hello all,
 
  I am just configuring up a new web server, and I want to be able
  to run php only in the web servers main document root and in
  specified virtual hosts, I have a fair understanding on how to go
  about this, but would really like some feedback before I get to
  far into it. Basically the only directories I don't want to be
  able to use php are all the user directories (/~username) unless
  they have been mapped to a virtual host that has the right
  directives in them to enable php.

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




Re: [PHP] PHP with XML

2001-10-24 Thread Tamas Arpad

On Tuesday 23 October 2001 21:17, Vinicius Tavares wrote:
 What I have to do to make the PHP4 run the DOM XML???
Download the libxml library (the development packages too, if you 
download the packaged distrib). 
And compile php with it (--with-dom switch for configure).

http://www.xmlsoft.org

Arpi

-- 
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] Opening a new page when done

2001-10-24 Thread Roy W

I have several scripts that when you complete a form it executes a PHP
script.

At the end of each script I have a simple statement saying it's done and
then a place to hyperlink back to a given page:

PRINT Process complete. a href=\index.html\Click here/a to continue;

But what I really wanna do is just have the script code execute and when its
all done - just take the user automatically to index.html or some other
page.

I know there's a command but cant seem to find it.  Thought it might be
include() but couldn't figure out my syntax

Ideas?

THANKS!!! :-)



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




Re: [PHP] libxml

2001-10-24 Thread Tamas Arpad

On Wednesday 24 October 2001 11:38, php wrote:
 Firstly,

I use php 4.0.5 and libxml 2.3.9 on several machines without any 
problem.

Older php and libxml combinations however caused many segmentation 
faults, especially with not well-formatted xmls.

Are you sure that you warning message is related to libxml library? 
If you compile php without domxml the warning message disappears?
Arpi

 thanks to those who replied to me last week about xmldom support
 with this error:

 Warning:  Unknown list entry type in request shutdown (0) in
 Unknown on line 0

 I've since tried a few combinations of versions of libxml, and
 expat (dont know if expat would
 matter), any was wondering if anyone who is using dom support
 correctly could
 tell me which versions work for them.


 Thank you,

 Sean

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




Re: [PHP] OnUNload Scripts

2001-10-24 Thread _lallous

This can be done...but what if the user closes the whole browser?
the frame won't work cause it will also be closed i guess!

The popup window will assure that in all cases it will be poped up.

Kodrik [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  You could open a new window, give focus to the current window, and in
the
  new window, have it close itself after it's finished processing.

 An invisible frame is the easiest:
 frame rows=100%, *
  framset name='main' src='src.php'
  frameset name='invisibleframe' src='background.php'
 /frameset

 then javascript can send orders to php through the invisible frame.

 Flash can also talk to php without reloading which allows for some cool
stuff.
 Finally, Java is the hardest solution but still a solution




  -Original Message-
 
  From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]
 
  Sent: Wednesday, October 24, 2001 4:16 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] OnUNload Scripts
  
  
  Hi everyone,
  
  I can use javascripts onunload to run PHP file with a new window.
  Is there anyway i can run PHP script file on ONUNLOAD with out opening
a
   new window ( in the back ground).
  
  Any one's help will be greatly appreciated.
  
  Best regards,
  Hasan
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
[EMAIL PROTECTED]



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




[PHP] Re: I NEED HELP WITH PWS AND W98

2001-10-24 Thread _lallous

1)Install PHP w/ the installer or manually
2)In PWS add a new virtual directory and give it Script+Execute rights.
3)Create a simple script there (where the virtual directory points) and
write ?phpinfo();? just to see if everything is fine.

you may want to try to ask in php.install group too.

Nicolas Llamosas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 My name is Nicolás Llamosas, I`m from Río Cuarto, Argentina and sorry for
my
 poor english. I need informacion about how configure Personal Web Server
 under W98 to use with PHP 3.0 I downloaded the BIN code of PHP version
 3.0.17 for W32 and I followed the instructions on the manual #8220;PHP
 Manual#8221; (I downloaded it in php.net page, and I configured the
PHP.ini
 file, etc, etc.), but I don#8217;t know if I need to compile under C or
 Visual C, or what I have to do after that to start to use PHP under w98
and
 PWS. Some detailed informacion will very important for me.

 Thanks.

 Nicolas Llamosas #8211; [EMAIL PROTECTED]


 _
 Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp




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




Re: [PHP] Problems with TTF

2001-10-24 Thread Michael A. Peters

On Wed, 24 Oct 2001 12:37:16 +0200
Alberto alberto arround [EMAIL PROTECTED] wrote:

 Warning: Could not find/open font in
 /sdr/httpd/Prisa/DATA/private/libs/graficos/intradia.php on line 57
 
 Line 57: ImageTTFText ($O_imagen, 11, 0, 10, 20, $O_colorValor,
 arial.ttf,$s_Valor);
 
 arial.ttf is into the same dir.
 
 Any ideas?

try ./arial.ttf
and see if that helps

I don't remember if there's a font path for ttf fonts in php.ini or not-
but if there is, its quite possible ./ isn't in it on your system. (If
there's not one- there should be...)

Last time I did anything with Freetype- I made a /fonts/php directory on
my filesystem, and put whatever fonts I wanted in their, and called them
full path.

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

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




[PHP] Application servers / job priorities ?

2001-10-24 Thread Lee

Hi,

I am developing a portal that will allow users to perform various
calculations on their data sets. These calculations (handled by C /
Fortran programs) will be run as external processes (and may take up to
a few hours to complete). I am wondering if there is something that I
can use (either in PHP or as another external process) to act as an
application server i.e. allow multiple users to submit requests for
calculations, but place these requests in a queue - perhaps associating
each calculation with a priority, and handling each request as
appropriate.

Can anyone suggest anything that may faciliate this? Any links/hints
would be greatly appreciated. Thanks very much in advance.

- Best regards,

Lee


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




Re: [PHP] Opening a new page when done

2001-10-24 Thread Richard S. Crawford

Assuming you don't output anything else to a web page:

header (Location: index.html);

should do the trick if you put it at the end of the program.  Be warned, 
though, that if you output anything to the browser at all, the header 
function will not work.

Good luck!


At 06:39 AM 10/24/2001, Roy W wrote:
I have several scripts that when you complete a form it executes a PHP
script.

At the end of each script I have a simple statement saying it's done and
then a place to hyperlink back to a given page:

PRINT Process complete. a href=\index.html\Click here/a to continue;

But what I really wanna do is just have the script code execute and when its
all done - just take the user automatically to index.html or some other
page.

I know there's a command but cant seem to find it.  Thought it might be
include() but couldn't figure out my syntax

Ideas?

THANKS!!! :-)



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


Sliante,
Richard S. Crawford

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

Push the button, Max!


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




[PHP] Re: Application servers / job priorities ?

2001-10-24 Thread Hugh Bothwell


Lee [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am developing a portal that will allow users to perform various
 calculations on their data sets. These calculations (handled by C /
 Fortran programs) will be run as external processes (and may take up to
 a few hours to complete). I am wondering if there is something that I
 can use (either in PHP or as another external process) to act as an
 application server i.e. allow multiple users to submit requests for
 calculations, but place these requests in a queue - perhaps associating
 each calculation with a priority, and handling each request as
 appropriate.

 Can anyone suggest anything that may faciliate this? Any links/hints
 would be greatly appreciated. Thanks very much in advance.

I would separate this into front end/back end systems.

The front end lets people sign in, submit a data set, request an operation,
and set the priority.  It should let them view job status and
reorder/reprioritize the jobs.  All this information gets stored in a
database (three tables - one for users, one for data sets, one for jobs).

The back end runs independantly - repeatedly queries the database to find
the next most urgent job and spawns a program to do the calculation.  Play
with the number of concurrent threads per processor to find a good balance
to keep the system busy but not bottlenecked.

This set-up would make it very easy to distribute the calculations across
multiple systems to speed things up.



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




Re: [PHP] How to protect MySQL password

2001-10-24 Thread Kurt Lieber

On Wednesday 24 October 2001 00:30, you wrote:
 What we
 really need is an expert here to give us the low-down on the best way to
 accomplish the best security given regular tools.

There isn't a way to solve it within the constraints you've mentioned (shared 
server at a hosting provider, apache, php-as-a-module)  If apache has read 
access on a file, which it has to have in order to serve it, someone else can 
get to that file via a PHP/Perl/C/whatever script/program.  Yes, you can use 
a server that has php safe_mode enabled, but that doesn't mean your scripts 
are safe -- it just means they're safe from being exploited by other php 
scripts.

So, the only way to secure your PHP scripts from prying eyes (in a shared 
environment) is to upload them with group/world read permissions removed 
(i.e. chmod 700 or 600) But then Apache can't read that file either.  That's 
where php-cgiwrap comes into play as it acts as an interface between apache 
and your chmodded 600 file.

Basically, if you're on a shared server, you're either going to be buddies 
with your fellow users and trust them, or you're going to use something like 
php-cgiwrap which allows you to remove group/world read permissions and still 
 let apache read the file.

And, if security is *that* important to you, then you can, of course, use a 
dedicated server.  Then you don't have to worry about other users.

--kurt




-- 
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] Error: 1 is not a valid mysql link resource

2001-10-24 Thread Rafael Steil


Hi all.  
With php version 4.0.1, I made a database class. I use a function called 
connect() to open database connection to mysql, and the link resource is 
stored in $GLOBALS[CONNETION_ID] global variable. All of code work 
perfectly, with no any problems..
But when I upgraded to php version 4.0.6, the code wasn't work at all. The 
error returned is 

Warning: 1 is not a valid MySQL-Link resource in 
/usr/local/apache/htdocs/Produtora/manole/config/site/database.class.php on 
line 190

the line 190, in this case, is just

$data = mysql_query($sql, $GLOBALS[CONNECTION_ID])

it is the same code that works with php 4.0.1,,  The link resource is valid ( 
at least I think that ), because when I do

 echo $GLOBALS[CONNECTION_ID];

the return is

Resource id #1

does anyone knows the problem???

thanks anyway,
Rafael Steil

-- 
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] file system question

2001-10-24 Thread Jay Paulson

Hello-

I'm trying to write a php script that creates a directory and then copies
uploaded files to that directory.  That isn't hard but what is hard is the
fact that the script tells me that i do not have permission to do any of
these actions.  I'm running red hat 7.1 and I have heard things about SetUID
and sticky bits, however since I'm pretty much still a novice at linux I'm
not too sure what to do.  The script is running under the username Apache
any ideas?

thanks..
jay


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

2001-10-24 Thread Srinivasan Ranganathan

Hi

Its me again (for those who know me ;-)). ive been
working with php and mysql for a while and am curious
about xml. what do i have to do to get started?

thanks in advance
Srinivasan Ranganathan


Do You Yahoo!?
Send a newsletter, share photos  files, conduct polls, organize chat events. Visit 
http://in.groups.yahoo.com

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




Re: [PHP] I NEED HELP WITH PWS AND W98

2001-10-24 Thread Chris Hayes


 poor english. I need informacion about how configure Personal 
Web Server 
 under W98 to use with PHP 3.0 I downloaded the BIN code of 
PHP version 
 3.0.17 for W32 and I followed the instructions on the manual 
#8220;PHP 
 Manual#8221; (I downloaded it in php.net page, and I 
configured the PHP.ini 
 file, etc, etc.), but I don#8217;t know if I need to compile 
under C or 
 Visual C, or what I have to do after that to start to use PHP 
under w98 and 
 PWS. Some detailed informacion will very important for me.

hi  Nicolas,
pws is not so great. if you are still in the beginning phase 
you may consider to use the free Apache server. It has a 
version for windows, very stable. 
You just need to make some changes to the configuration file to 
make php work. btw you do not need to compile php if you 
download the right version! (don't download 'source' but maybe 
they call it 'binary' or whatever).

There are even packets on the internet which include working 
combinations of apache + php4 + mysql (mysql= free very popular 
web database). Just do a search on a search engine. 
There are also instruction pages on how to make php work on 
apache (you need to change two or three lines in a 
configuration file).

good luck.
Chris 


---
-
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the 
Netherlands  --
---
-

 


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




RE: [PHP] XML newbie

2001-10-24 Thread Jon Haworth

Start your document with

?xml version=1.0?

Sorry, couldn't resist it :-)

http://www.w3.org/XML/ isn't a bad place to find out about it, but if you
find them a bit dry or you're in need of a nice tutorial then you'd better
get yourself over to http://hotwired.lycos.com/webmonkey/authoring/xml/ and
have a look at their stuff.

Cheers
Jon


-Original Message-
From: Srinivasan Ranganathan [mailto:[EMAIL PROTECTED]]
Sent: 24 October 2001 16:46
To: [EMAIL PROTECTED]
Subject: [PHP] XML newbie


Hi

Its me again (for those who know me ;-)). ive been
working with php and mysql for a while and am curious
about xml. what do i have to do to get started?

thanks in advance
Srinivasan Ranganathan


Do You Yahoo!?
Send a newsletter, share photos  files, conduct polls, organize chat
events. Visit http://in.groups.yahoo.com

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


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

**

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




Re: [PHP] I NEED HELP WITH PWS AND W98

2001-10-24 Thread Richard S. Crawford

Getting PHP to work with Apache is pretty simple.  The documentation is 
easy to read.

I would agree with trying Apache on your Win98 box; but be warned that the 
current Apache release is only supposed to be stable on NT 
platforms.  Since I have win2k it's not an issue for me, but it might now 
work on Windows 98.


At 08:54 AM 10/24/2001, Chris Hayes wrote:
hi  Nicolas,
pws is not so great. if you are still in the beginning phase
you may consider to use the free Apache server. It has a
version for windows, very stable.
You just need to make some changes to the configuration file to
make php work. btw you do not need to compile php if you
download the right version! (don't download 'source' but maybe
they call it 'binary' or whatever).

There are even packets on the internet which include working
combinations of apache + php4 + mysql (mysql= free very popular
web database). Just do a search on a search engine.
There are also instruction pages on how to make php work on
apache (you need to change two or three lines in a
configuration file).

good luck.
Chris


Sliante,
Richard S. Crawford

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

Push the button, Max!


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




Re: [PHP] file system question

2001-10-24 Thread Rafael Steil


Well, this is a problem.. with perl, you can use suidperl, but not with 
php.. the most easyest way is to give write permission to apache user to the 
directory you want to upload the files...

Rafael Steil

On Wednesday 24 October 2001 11:43, you wrote:
 Hello-

 I'm trying to write a php script that creates a directory and then copies
 uploaded files to that directory.  That isn't hard but what is hard is the
 fact that the script tells me that i do not have permission to do any of
 these actions.  I'm running red hat 7.1 and I have heard things about
 SetUID and sticky bits, however since I'm pretty much still a novice at
 linux I'm not too sure what to do.  The script is running under the
 username Apache any ideas?

 thanks..
 jay

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




RE: [PHP] Re: Annotated PHP Manual

2001-10-24 Thread V

try to use webzip, or teleport, or such kind of software

Salu2,

V

-Mensaje original-
De: DL Neil [mailto:[EMAIL PROTECTED]]
Enviado el: sábado 20 de octubre de 2001 17:08
Para: [EMAIL PROTECTED]; Yasuo Ohgaki
Asunto: Re: [PHP] Re: Annotated PHP Manual


 Khalid Hazmi wrote:
  How I can download the current Annotated PHP Manual???


 There is no such thing... AFAIK.
= Yasuo Ohgaki


Yasuo: Yes there is (and VERY useful it is too), check out the range of PHP
documentation available from
http://www.php.net/docs.php

Khalid: Unlike some other packages I don't think there's a zipped-up,
ready-for-download version. I presume this is
because the online version is always 'the latest' - but I don't know how
often they update it (maybe that's somewhere on
the page I just quoted!?) You could try something called a webwhacker to
download the web of pages that make up the
manual...

=dn






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




RE: [PHP] I NEED HELP WITH PWS AND W98

2001-10-24 Thread Dana Holt


I use Apache on Win ME (don't ask!), and it works fine. Never tried it on 98
though.

--
Dana Holt / [EMAIL PROTECTED]
Xenos Online
http://www.xenosonline.com/
---
This is my sig. There are many like it, but this
one is mine. I must master my sig as I must master
my life. Without my sig I am useless, without me
my sig is useless.
--

 -Original Message-
From:   Richard S. Crawford [mailto:[EMAIL PROTECTED]]
Sent:   Wednesday, October 24, 2001 11:00 AM
To: [EMAIL PROTECTED]; Nicolas Llamosas; [EMAIL PROTECTED]
Subject:Re: [PHP] I NEED HELP WITH PWS AND W98

Getting PHP to work with Apache is pretty simple.  The documentation is
easy to read.

I would agree with trying Apache on your Win98 box; but be warned that the
current Apache release is only supposed to be stable on NT
platforms.  Since I have win2k it's not an issue for me, but it might now
work on Windows 98.


At 08:54 AM 10/24/2001, Chris Hayes wrote:
hi  Nicolas,
pws is not so great. if you are still in the beginning phase
you may consider to use the free Apache server. It has a
version for windows, very stable.
You just need to make some changes to the configuration file to
make php work. btw you do not need to compile php if you
download the right version! (don't download 'source' but maybe
they call it 'binary' or whatever).

There are even packets on the internet which include working
combinations of apache + php4 + mysql (mysql= free very popular
web database). Just do a search on a search engine.
There are also instruction pages on how to make php work on
apache (you need to change two or three lines in a
configuration file).

good luck.
Chris


Sliante,
Richard S. Crawford

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

Push the button, Max!


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



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




[PHP] Re: redirecting the browser

2001-10-24 Thread John A. Grant

Ozgur Demirtas [EMAIL PROTECTED] wrote in message
001a01c15c57$ce6fad20$ea0d198a@Jackhammer">news:001a01c15c57$ce6fad20$ea0d198a@Jackhammer...
 Hi all,

 I have a PHP script and at one point of the script I am trying to redirect
 my browser to a certaion page. I can't seem to find an easy way of doing
 this. header() call is so much of a problem. There is no such function
like
 redirect(...) as in ASP?

 PS: I am using PHP version 3.09 as an Apache module on Solaris.

Discussion:
http://www.chron.com/cs/CDA/story.hts/tech/735399

Solution:
http://www.builder.com/Authoring/Tagmania/011000/index.html

The latter solution is very good because it covers all of the bases.

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here





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




Re: [PHP] Problems with TTF

2001-10-24 Thread Oliver Heinisch

At 24.10.01  12:37, you wrote:
Warning: Could not find/open font in
/sdr/httpd/Prisa/DATA/private/libs/graficos/intradia.php on line 57

Line 57: ImageTTFText ($O_imagen, 11, 0, 10, 20, $O_colorValor,
arial.ttf,$s_Valor);

arial.ttf is into the same dir.

Any ideas?
I had the same problems while using postscriptfonts.
try this
$font=imagepsloadfont(YOUR.FONT);
you have to look for a substitution for imageepsloadfont maybe it´s 
imagettfloadfont();
- and you have to do this command TWO times. Don´t ask me why, but it works ?!
Hope this helps Oliver


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




RE: [PHP] I NEED HELP WITH PWS AND W98

2001-10-24 Thread Srinivasan Ranganathan

Hi

Oh yes, run apache+php on win 98. works like a wonder.
try the php-win32 site for win98 specific distro.

regards
Srinivasan Ranganathan


   *NEW*   Yahoo! Messenger for SMS   *NEW*
  Now on your ORANGE phone
 Visit http://in.mobile.yahoo.com/smsmgr_signin.html

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




Re: [PHP] aaaaaaaaaaaaaaa

2001-10-24 Thread Douglas Winslow

Franco Breciano wrote:

 a


for($i=0;$i13;$i++){echo chr(97+($i?3:0));}


drw



-- 
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] how do i give optional arguments to functions??

2001-10-24 Thread sunny AT wde

hi all!!

i'm writing functions like - 
---
function top () {
 echo blah blah blah;}
---

what i want to do is make it so that i can do - 
---
function top($image) {
 echo blah blah $image blah; }
---

but also make the $image parameter in the top() as optional. so if
its not there, then tell php not to worry about it.

any ideas??

thanks!

sunny


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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




Re: [PHP] How to protect MySQL password

2001-10-24 Thread Arpad Tamas

On Wednesday 24 October 2001 16:42, Kurt Lieber wrote:
 On Wednesday 24 October 2001 00:30, you wrote:
  What we
  really need is an expert here to give us the low-down on the best
  way to accomplish the best security given regular tools.

 There isn't a way to solve it within the constraints you've
 mentioned (shared server at a hosting provider, apache,
 php-as-a-module)  If apache has read access on a file, which it has
 to have in order to serve it, someone else can get to that file via
 a PHP/Perl/C/whatever script/program.  Yes, you can use a server
 that has php safe_mode enabled, but that doesn't mean your scripts
 are safe -- it just means they're safe from being exploited by
 other php scripts.
If open_basedir is set properly for each user (and safe_mode is on), 
they can't reach each others' files at least from php. Of course if 
one can write and run programs with apache's user in another 
languages (perl, c, whatever) this doesn't help much (unless they can 
be configured in a similar way).


 What about encryption?
I think the encryption just makes someone's (who wants to steal 
something) work a little harder. In order to use the encrypted data, 
you have to decrypt it in php, so your code will contain the 
enc/decription algorithm and the keys that used.

Arpi

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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Richard S. Crawford

function top ($image) {
 if ($image) echo blah blah blah;
 else echo blah blah $image blah;
}

There's probably a more efficient way to do it.


At 09:57 AM 10/24/2001, sunny AT wde wrote:
hi all!!

i'm writing functions like -
---
function top () {
  echo blah blah blah;}
---

what i want to do is make it so that i can do -
---
function top($image) {
  echo blah blah $image blah; }
---

but also make the $image parameter in the top() as optional. so if
its not there, then tell php not to worry about it.

any ideas??

thanks!

sunny


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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


Sliante,
Richard S. Crawford

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

Push the button, Max!


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




[PHP] File sharing

2001-10-24 Thread Victor


I'm trying to access an object as a Singleton. Here is the source code I'm
using.
The problem is that the member objFile from the $test variable is set to an
open file in the class constructor. It works fine, but when I recover it
from the memory, the file handler gets lost in starts being considered an
int.

Has anyone done this before ?

?php
echo(htmlbody);
include (./ConcreteErrorLog/SingletonTest.inc);
$test = new Singleton;
$test-testCreateSingleton();
echo(Creating shared memory.br);
$attachkey=1;
$memorykey = shm_attach($attachkey);
$variablekey=1;
echo(Getting variable from memory. br);
$test2=shm_get_var($memorykey,$variablekey);
echo(Got the variable  . get_class($test2) .  br);
if(!isset($test2) || empty($test2)){
echo(Putting in memory. br);
shm_put_var($memorykey,$variablekey,$test);
$test-testCreateSingleton();
}
echo(The variable must be there by now. br);
$test = shm_get_var($memorykey,1);
echo(Got it. br);
echo(member is now =  . $test-intMember . br);
$test-testCreateSingleton();
if($HTTP_GET_VARS[clear]==yes){
echo(Will remove shared object. br);
shm_remove_var($memorykey,$variablekey);
echo(Shared object removed. br);
}
echo(/body/html);
?


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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Arpad Tamas

On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote:

The default value for $image parameter was missing:

 function top ($image=defaultvalue) {
  if ($image==defaultvalue) echo blah blah blah;
  else echo blah blah $image blah;
 }

Arpi

-- 
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] Toronto Tutorial on Monday Oct.29 7PM

2001-10-24 Thread Rasmus Lerdorf

Turned out there was enough interest.  Details at 
http://www.php.net/~rasmus/toronto.txt

Will be another one in Ottawa on Thursday Nov.1, but I don't have details 
on that one yet.  Watch the PHP calendar at www.php.net for it.

-Rasmus


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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Richard S. Crawford

Hm, is the default attribute necessary?  I've used this sort of approach 
without the default attribute just fine in the past.  Though I admit that 
the default attribute would make me feel more secure.


At 10:30 AM 10/24/2001, Arpad Tamas wrote:
On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote:

The default value for $image parameter was missing:

  function top ($image=defaultvalue) {
   if ($image==defaultvalue) echo blah blah blah;
   else echo blah blah $image blah;
  }
 
 Arpi

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


Sliante,
Richard S. Crawford

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

Push the button, Max!


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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Tamas Arpad

On Wednesday 24 October 2001 19:26, Richard S. Crawford wrote:
 Hm, is the default attribute necessary?  I've used this sort of
 approach without the default attribute just fine in the past. 
 Though I admit that the default attribute would make me feel more
 secure.

Not really necessary, but I like to make code without any warning 
message (it also makes the code more cleaner as you said), and you'll 
get a warning message if there's no parameter given at the function 
call (without the default value). 
Arpi


 At 10:30 AM 10/24/2001, Arpad Tamas wrote:
 On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote:
 
 The default value for $image parameter was missing:
   function top ($image=defaultvalue) {
if ($image==defaultvalue) echo blah blah blah;
else echo blah blah $image blah;
   }
 
  Arpi

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




RE: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Chris Bailey

Check out the manual section on default parameters...

But the basics are:

function top($image = null) {
if ($image) 
...
else
...
}

Or maybe:

That will set image to be null, so that you can call top either as:

top();
or
top($someimage);


-Original Message-
From: sunny AT wde [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 9:58 AM
To: php
Subject: [PHP] how do i give optional arguments to functions??


hi all!!

i'm writing functions like - 
---
function top () {
 echo blah blah blah;}
---

what i want to do is make it so that i can do - 
---
function top($image) {
 echo blah blah $image blah; }
---

but also make the $image parameter in the top() as optional. so if
its not there, then tell php not to worry about it.

any ideas??

thanks!

sunny


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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



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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Richard S. Crawford

Ahh, good point.  Thanks for the tip.  :)


At 10:45 AM 10/24/2001, Tamas Arpad wrote:
Not really necessary, but I like to make code without any warning
message (it also makes the code more cleaner as you said), and you'll
get a warning message if there's no parameter given at the function
call (without the default value).
 Arpi


Sliante,
Richard S. Crawford

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

Push the button, Max!


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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread DL Neil

 On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote:
 
 The default value for $image parameter was missing:
 
  function top ($image=defaultvalue) {
   if ($image==defaultvalue) echo blah blah blah;
   else echo blah blah $image blah;
  }

If the default value can be set to an empty string can the if statement then be 
removed?

   function top ($image=)
   {
  echo blah blah $image blah;
   }

- watch those spaces (if they're present in live data)!
=dn



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




Re: [PHP] COPY TO SENT FOLDER

2001-10-24 Thread richard phynga

use imap_append. That is what that function is for...
it is also how to handle drafts...

check out www.tijuana.com, it is a commercial web based mail service I
wrote entirely in php with IMAP support. It also handles multiple
attachments, multiple attachment forwarding, and sign up 'on-the-fly' i,e,
sign up is instantly avaiable. 

If it does whatyou want I can send you the functions I wrote for it.
However, it is function style programming, not OOP style...
caveat emptor...

richard


--- Jhun Hubac [EMAIL PROTECTED] wrote:
 Hi!
 
 I would like to ask help regarding my PHP script for sending out mails
 and 
 then making a copy of that sent mail to the Sents mailbox. I have been 
 working a sort of  workaround for this by creating a Cc: to myself
 and 
 then performing an imap_mail_move to my INBOX.Sent folder. But the
 problem 
 with this procedure is that the To: header that will be seen in the
 Sents 
 folder would be my email address instead of the legal recipient.  Is it 
 possible to re-write the headers? Are there any procedures in performing
 
 this option for web-based email?
 
 
 -Jhun-
 
 
 
 
 -- 
 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!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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




RE: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Chris Bailey

It could be, but then you would have two spaces in between the 2nd and 3rd
blah, instead of just the one space.  But, depending on your actual
application, this may work out.

-Original Message-
From: DL Neil [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 10:41 AM
To: Arpad Tamas; Richard S. Crawford; sunny AT wde; php
Subject: Re: [PHP] how do i give optional arguments to functions??


 On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote:

 The default value for $image parameter was missing:

  function top ($image=defaultvalue) {
   if ($image==defaultvalue) echo blah blah blah;
   else echo blah blah $image blah;
  }

If the default value can be set to an empty string can the if statement then
be removed?

   function top ($image=)
   {
  echo blah blah $image blah;
   }

- watch those spaces (if they're present in live data)!
=dn



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



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




[PHP] phplib, pear db, metabase, adodb, and native mysql benchmarks

2001-10-24 Thread John Lim

Someone asked me to benchmark PHPLib also.
Here is the revised benchmarks, with some minor speedups for
PEAR DB and Metabase.

Benchmark was to select 82 rows from the products table 200 times.
The tests were repeated 5 times. Connection times were excluded
from the benchmark. Lower values are better. All numbers are in
seconds.

MySQL  1.12 1.12 1.17 1.15 1.14
ADODB  1.43 1.47 1.47 1.44 1.45
PhpLib 1.53 1.62 1.64 1.64 1.57
PEAR   2.91 2.90 2.85 2.83 2.84 (fetchInto)
PEAR   3.14 3.13 3.22 3.12 3.16 (fetchRow)
M'base 4.51 4.55 4.46 4.54 4.52 (numeric columns)
M'base 4.99 4.72 4.71 4.71 4.72 (named columns)

  Average  Overhead
MySQL  1.14   -
ADODB  1.45   27%
PhpLib 1.60   40%
PEAR   2.87  152% (fetchInto)
PEAR   3.15  176% (fetchRow)
M'base 4.52  296% (numeric cols)
M'base 4.77  318% (named cols)

Methodology

Results on Pentium 800 Mhz running Win 2000, PHP 4.0.6 ISAPI on IIS5
with MySQL 3.23, all on the same machine. PEAR DB from PHP 4.0.6,
ADODB 1.40, PhpLib 7.2d and Metabase 1.57 were used.

Code revised on 22nd October 2001. PhpLib tests added 24th October 2001.

Source code for these tests is available from http://phplens.com/lens/adodb/











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




[PHP] Can PHP do what this javascript does...

2001-10-24 Thread chip . wiegand

iTo print/i: a href=javascript:if (window.print != null) {
window.print(); }
 else { alert('Unfortunately, your browser does not support this shortcut.
Please select Print from the File menu.'); }
bClick here/b/a ior/i Select bFile/b
and then bPrint/b from your browser's menu.

Is there an equivelant bit of code to do this printer shortcut with php?

--
Chip Wiegand
Computer Services
www.simradusa.com
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

There is no reason anyone would want a computer in their home.
 --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
1977
  (-- Then why do I have nine? Somebody help me!)


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




Re: [PHP] Can PHP do what this javascript does...

2001-10-24 Thread Duncan Hill

On Wed, 24 Oct 2001 [EMAIL PROTECTED] wrote:

 iTo print/i: a href=javascript:if (window.print != null) {
 window.print(); }
  else { alert('Unfortunately, your browser does not support this shortcut.
 Please select Print from the File menu.'); }
 bClick here/b/a ior/i Select bFile/b
 and then bPrint/b from your browser's menu.

 Is there an equivelant bit of code to do this printer shortcut with
 php?

PHP - _server_ side
Javascript - _client_ side

PHP cannot affect your client like Javascript can.

-- 

Sapere aude
My mind not only wanders, it sometimes leaves completely.


-- 
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] use of system/exec

2001-10-24 Thread John Gurley

Hello,
Could someone please show me an example of code using system or 
exec. Would be great if the string was a unix command.
Cheers
John

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


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




Re: [PHP] Can PHP do what this javascript does...

2001-10-24 Thread Richard S. Crawford

Unfortunately, since PHP lives on the server and JavaScript lives on the 
browser, there really is no way to get PHP to do what you want.

Stick with JavaScript.  There's really no reason not to when you're doing 
client-side programming.


At 11:14 AM 10/24/2001, [EMAIL PROTECTED] wrote:
iTo print/i: a href=javascript:if (window.print != null) {
window.print(); }
  else { alert('Unfortunately, your browser does not support this shortcut.
Please select Print from the File menu.'); }
bClick here/b/a ior/i Select bFile/b
and then bPrint/b from your browser's menu.

Is there an equivelant bit of code to do this printer shortcut with php?

--
Chip Wiegand
Computer Services
www.simradusa.com
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

There is no reason anyone would want a computer in their home.
  --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
1977
   (-- Then why do I have nine? Somebody help me!)


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


Sliante,
Richard S. Crawford

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

Push the button, Max!


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




Re: [PHP] use of system/exec

2001-10-24 Thread Mark

On Wed, 24 Oct 2001 18:19:19 +, John Gurley wrote:
Hello,
Could someone please show me an example of code using system
or
exec. Would be great if the string was a unix command.
Cheers
John

I like backticks the best because they're easiest to deal with.
?
$output=`ls | wc`;
echo $output;
?


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




[PHP] is_int() and is_double

2001-10-24 Thread Michael George

I am having trouble with the is_int() and is_double() functions.  The relevant
parts of the function I'm using are:

---
function lookupProduct( $partNum, $serial )
{
   print( lookupProduct( $partNum, $serial )BR\n ); 
   print( CENTER\n );

   printf( \$partNum: %d does %sappear to be a number, and %sa doubleBR\n,
   $partNum, 
   ( is_numeric( $partNum ) ?  : not  ),
   ( is_double( $partNum ) ?  : not  )
 );
   printf( \$serial: %d does %sappear to be a number, and %sa doubleBR\n,
   $serial, 
   ( is_numeric( $serial ) ?  : not  ),
   ( is_double( $serial ) ?  : not  )
 );
}
---

The function is called after a form submission from HTML.  When I enter
12  14
I get:
---
lookupProduct( 12, 14 )
 $partNum: 12 does appear to be a number, and not a double
  $serial: 14 does appear to be a number, and not a double
---

When I enter
12.514.8
I get:
---
lookupProduct( 12.5, 14.8 )
 $partNum: 12 does appear to be a number, and not a double
  $serial: 14 does appear to be a number, and not a double
---

Why is the function is_double() failing?  I have an analagous problem with the
is_int() function.

Thanks!

-Michael

-- 
In light of the terrorist attack on the U.S.:
They that give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.
-- Benjamin Franklin, 1759

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




[PHP] Re: Redirecting to a new php file

2001-10-24 Thread Mike Frazer

Use the header() function in conjunction with the Location HTTP header:

header(Location: http://host.domain.tld/path/to/file.php;);

This MUST be sent to the browser before ANY other output.  You can execute
as many commands as you like but this must come before any output (and
before the html tag in your file).

Mike Frazer



Sridhar Moparthy [EMAIL PROTECTED] wrote in message
news:001301c15cbc$f38018b0$[EMAIL PROTECTED]...
 Hi All,

 Is there any command in PHP that redirects to a php file from another php
 file?
 If not does any one know how to implement this functionality?

 Thank you,
 Sridhar Moparthy






-- 
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] FORMs (HELP) --- PHP Gurus (Please HELP)

2001-10-24 Thread Miguel Ribeiro

Hi,

How can be possible to call other functions (that have a html pages) from a
first function that also have a html with a form and pass all html variables
without losing them?

I've a problem that from a html form I'm losing all html variables and this
is happening because this form is located in the 3th function (one inside
another)...

If you know a better way to deal with this... I'm interested to learn...
Thanks for all.

Simple example that may work:

file name: xyz.php



function display($ref) {
printf('The REF have %s,$ref);
}

function query() {
echo('FORM ENCTYPE=multipart/form-data NAME=addimovel METHOD=POST
ACTION=xyz.php?pg=1ref=$ref);
echo('TABLE
TR
TDRef/TD
TDINPUT type=text name=ref/TD
/TR
TR
TDINPUT border=0 src=baddaz.jpg
name=ADD width=40 height=40 type=image/TD
/TR
/TABLE
/FORM');
}

// PG options
switch($pg) {
case 1:display($ref);
break;
default:query();
break;
}




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




Re: [PHP] Can PHP do what this javascript does...

2001-10-24 Thread Mike Frazer

Javascript can be embedded in PHP files anyway.  I do a lot of database
management interfaces in PHP and one thing I want to do is protect items
from being accidentally deleted.  I use Javascript to verify that they
intended to click on the link to delete the information.

Remember, PHP files are enhanced HTML files, which means the browser will
parse them exactly the same as a standard HTML file.

Mike Frazer





Richard S. Crawford [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Unfortunately, since PHP lives on the server and JavaScript lives on the
browser, there really is no way to get PHP to do what you want.

Stick with JavaScript.  There's really no reason not to when you're doing
client-side programming.


At 11:14 AM 10/24/2001, [EMAIL PROTECTED] wrote:
iTo print/i: a href=javascript:if (window.print != null) {
window.print(); }
  else { alert('Unfortunately, your browser does not support this shortcut.
Please select Print from the File menu.'); }
bClick here/b/a ior/i Select bFile/b
and then bPrint/b from your browser's menu.

Is there an equivelant bit of code to do this printer shortcut with php?

--
Chip Wiegand
Computer Services
www.simradusa.com
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

There is no reason anyone would want a computer in their home.
  --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
1977
   (-- Then why do I have nine? Somebody help me!)


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


Sliante,
Richard S. Crawford

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

Push the button, Max!




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




Re: [PHP] sorting an array of objects

2001-10-24 Thread Matt McClanahan

On Wed, Oct 24, 2001 at 10:43:53AM +0100, L Melville wrote:

 Is it possible to sort a class array using array multisort, I have two items
 in each class that I wish to sort by, one is a text and the other is the
 first item in an array within within each class. i.e.;-
 
 $class[$index]-text;
 $class[$index]-array[0];
 
 how can I do this?

I'd use usort() instead.  http://www.php.net/manual/en/function.usort.php

The manual page has a couple examples for sorting objects by their member
variables.

Matt

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




[PHP] URL variables

2001-10-24 Thread Clint Tredway

How do I reference URL variables..?

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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread Mike Frazer

Don't forget: if a function has multiple arguments the optional ones must be
to the RIGHT of the required ones:

function testing123($one, $two=2, $three=3)// Good
function testing123($one=1, $two, $three=3)// Bad
function testing123($one=1, $two=2, $three)// Bad

Mike Frazer



Chris Bailey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 It could be, but then you would have two spaces in between the 2nd and 3rd
 blah, instead of just the one space.  But, depending on your actual
 application, this may work out.

 -Original Message-
 From: DL Neil [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 24, 2001 10:41 AM
 To: Arpad Tamas; Richard S. Crawford; sunny AT wde; php
 Subject: Re: [PHP] how do i give optional arguments to functions??


  On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote:
 
  The default value for $image parameter was missing:
 
   function top ($image=defaultvalue) {
if ($image==defaultvalue) echo blah blah blah;
else echo blah blah $image blah;
   }

 If the default value can be set to an empty string can the if statement
then
 be removed?

function top ($image=)
{
   echo blah blah $image blah;
}

 - watch those spaces (if they're present in live data)!
 =dn



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





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




[PHP] Re: [PHP-DB] array-problems

2001-10-24 Thread Jim Lucas

Try this:

 BEGIN:PHP-CODE 

$result = mysql_query (SELECT DISTINCT date FROM linktracker WHERE name
LIKE '$PHP_AUTH_USER' GROUP BY date ORDER BY date);
if (mysql_num_rows($result))
{
  for($i=0;$icount($row);$i++)
  {
$date = array(
  begin = array($i = $row[date]),
  end = array($i = $row[date])
  );
  }
} else {
  print (Sorry, no record were found.);
}

function drawSelect($which)
{
  global $date;
  foreach($date[$which] AS $date_begin)
  {
?
option value=?=$date_begin??=$date_begin?/option
?
  }

}

?
table
  tr
tdBegindate/td
tdEnddate/td
  /tr
  tr
tdform method=post action=index.php name=date_select
input type=hidden name=action value=date_select
select name=date_begin
?
drawSelect(begin);
?
/select
/td
tdselect name=date_end
?
rsort($date[end]);

drawSelect(end);
?
/select
/td
  /tr
  tr
td colspan=2input type=submit name=Submit
value=Submit/form/td
  /tr/table

 END:PHP-CODE 

btw - you need to watch your closing ''  you are missing a few.  Plus to
get distince to work right you need to use the GROUP BY clause.

Jim

- Original Message -
From: Bart Verbeek [EMAIL PROTECTED]
To: Php-General-list [EMAIL PROTECTED]; PHP-DB mailinglist
[EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 12:23 PM
Subject: [PHP-DB] array-problems


 Hello,
 Can anyone help me with this script I'm using?

 I've saved dates in a database and want to make two select-lists of these
 dates in a html-form.
 I want to select each unique date one time (no doubles).
 List 1 is used to set the begin-date of the query for the report, List 2
 will
 set the end-date and must be reversed.
 When the form is processed the data selected between the begin-date and
the
 end-date has to be show.

 I can't seem to get my code to work: the select-lists stay empty after
 processing the code below.

 Can anyone help? Tips...

 regards,

 Bart


  BEGIN:PHP-CODE 
 $i=0;
  $result = mysql_query (SELECT DISTINCT date FROM linktracker WHERE name
 LIKE '$PHP_AUTH_USER' ORDER BY date);
  if ($row = mysql_fetch_array($result)) {
 do {
   $date = array(
 begin = array($i = $row[date]),
 end = array($i = $row[date])
 );
 $i++;
 } while ($row = mysql_fetch_array($result));
  } else {print (Sorry, no record were found.);
  } //end else $result

 print(tabletrtdBegindate/tdtdEnddate/td/tr\n.
 trtdform method=\post\ action=\index.php\
 name=\date_select\.
 input type=\hidden\ name=\action\
 value=\date_select\.
 select name=\date_begin\);

 while (list($key, $date_begin) = each($date[begin])) {
 echo option value=\.$date_begin  .\ . $date_begin .
 /option\n;
 }

 print(/select/tdtdselect name=\date_end\);

 rsort($date[end]);

 while (list($key, $date_end) = each($date[end])) {
   echo option value=\.$date_end  .\ . $date_end .
 /option\n;
 }

 print(/select/td/tr\ntrtd colspan=\2\.
   input type=\submit\ name=\Submit\ value=\Submit\.
   /form/td/tr/table);

 mysql_free_result ($result);
 mysql_close();
  END:PHP-CODE 


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




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




[PHP] Removing an Array Element

2001-10-24 Thread Jason Caldwell

How can I remove an Array Element from my Array?

For example:

$myArray =
array('100'='jibberjabber','200'='morejibberjabber','0'='');

if(isset($myArray[0]))
// here is where I want to purge Key[0] from the Array all together
;

I check for the presence of Key[0], which may not be the first or last key
in the array, so array_pop won't work... array_splice would be tricky and
would like to avoid creating a FOREACH or FOR loop --

Basically, I just want to know if the Key is set, and if so -- remove it...
is there a simple way to do this?

Thanks
Jason




-- 
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] Trying to subtract...no luck. (Long Code)

2001-10-24 Thread Michael O'Neal

Hi.  I'm trying to figure out how to subtract 1 variable from another, but
I'm not having any luck.

It works on this page:


?php

$db_name = comanche;
$table_name = ProjectTasks;

$connection = @mysql_connect($db,$user,$pass) or die(Couldn't
Connect.);
$db = @mysql_select_db($db_name, $connection) or die(Couldn't select
database.);

$sql =SELECT budget,actual FROM $table_name;

$result = @mysql_query($sql, $connection) or die(Couldn't execute query.);

while ($row = mysql_fetch_array($result)) {
$budget=$row['budget'];
$actual=$row['actual'];
$difference = ($budget - $actual);


echo $budget - $actual = $differencebr;
 
}


$num = @mysql_num_rows($result);

?


But not on this page:

---BEGIN LONG PHP STUFF --

?php


$title = Tasks Maintenance;
include(../inc/hdr.php);
include(header.inc);
include(DateFunctions.inc);


if (!isset($ProjectID)){

echo PThis page must be called from the projects list page with the
tasks link. Alternatively, you can enter the link as
Tasks.php?ProjectID=iProjectID number/iPA HREF=' . $rootpath .
/Projects.php'Project List/A;
exit;
}

if ($submit) {

//initialise no input errors assumed initially before we test
$InputError = 0;

/* actions to take once the user has clicked the submit button
ie the page has called itself with some user input */

//first off validate inputs sensible

if (strlen($TaskName)  50 OR strlen($TaskName)==0) {
$InputError = 1;
echo BRThe task name must be entered and be fifty characters or
less long;
} elseif (!is_date($EarliestStart)) {
$InputError = 1;
echo BRThe date the task was initiated must be specified in the
format dd/mm/;
} elseif (!is_numeric($ExpectedDuration) || $ExpectedDuration0){
$InputError = 1;
echo BRThe expected duration of the task must be specified as a
number - greater or equal to 0; }


if ($InputError !=1){

$SQL_EarliestStart = FormatDateForSQL($EarliestStart);

if (isset($SelectedTask)) {



$sql = UPDATE ProjectTasks SET TaskName='$TaskName',
TaskDescription='$TaskDescription', EarliestStart='$SQL_EarliestStart',
TaskChampion='$TaskChampion', ExpectedDuration=$ExpectedDuration,
Status='$Status', budget='$budget', actual='$actual' WHERE TaskID =
$TaskID;

$result = DB_query($sql,$db);
if (DB_error_no($db) !=0) {
echo The task could not be updated because -  .
DB_error_msg($db) .  The SQL statement used for the update was:BR$sql;
} else {
echo Ptask updated;
unset($SelectedTask);
unset($TaskName);
unset($TaskDescription);
unset($TaskChampion);
unset($EarliestStart);
unset($ExpectedDuration);
unset($Status);
unset($budget);
unset($actual);
}

} else { //not a new task



$sql = INSERT INTO ProjectTasks (ProjectID, TaskName,
TaskDescription, EarliestStart, TaskChampion, ExpectedDuration, Status,
budget, actual) VALUES ($ProjectID, '$TaskName', '$TaskDescription',
'$SQL_EarliestStart', '$TaskChampion', $ExpectedDuration, '$Status',
'$budget', '$actual');

$result = DB_query($sql,$db);
if (DB_error_no($db) !=0) {
echo The task could not be added because -  .
DB_error_msg($db) .  the SQL used to insert the new task was:BR . $sql;
} else {
echo PTask inserted;
unset($TaskName);
unset($TaskDescription);
unset($TaskChampion);
unset($EarliestStart);
unset($ExpectedDuration);
unset($Status);
unset($budget);
unset($actual);
}
}
} else {
echo BRValidation failed, no updates or deletes took place.;
}

} elseif ($delete) {
//the link to delete a selected record was clicked instead of the submit
button

$sql=DELETE FROM ProjectTasks WHERE TaskID=$TaskID;
$result = DB_query($sql,$db);

$sql=DELETE FROM TaskDependancies WHERE TaskID=$TaskID;
$result = DB_query($sql,$db);

$sql=DELETE FROM TaskDependancies WHERE RequiresTaskID=$TaskID;
$result = DB_query($sql,$db);

echo PTask Deleted ! p;
unset($SelectedTask);
unset($TaskName);
unset($TaskDescription);
unset($TaskChampion);
unset($EarliestStart);
unset($ExpectedDuration);
unset($Status);
unset($budget);
unset($actual);
} 


/*Show some details about the master task for which tasks are being
maintained */

$sql = SELECT ProjectName, ProjectDescription, PlayerName, PlayerEmail FROM
ProjectMaster, Players WHERE ProjectMaster.Champion = Players.PlayerID AND
ProjectID = . $ProjectID;

$result = DB_query($sql,$db);
$myrow = 

[PHP] slow mcrypt_create_iv()

2001-10-24 Thread Chuck Theobald


Hi,

I have a system of programs that use mcyrpt routines.  The first few times
I run through the routine containing mcrypt_create_iv it returns quite
quickly, but afterwards, this function can take from 5 to 15 seconds to
return.

The function wrapping the encryption routines is as follows:

  $this-cipher = MCRYPT_TripleDES;
  $this-mcrypt_mode = MCRYPT_MODE_ECB;
  $this-randomizer = MCRYPT_DEV_RANDOM;

  function encrypt_and_hex($input) {
include '/www/php/key.inc';
$td = mcrypt_module_open ($this-cipher, , $this-mcrypt_mode, );
$iv_size = mcrypt_enc_get_iv_size ($td);
$iv = mcrypt_create_iv ($iv_size, $this-randomizer);
mcrypt_generic_init ($td, $key, $iv);
$output = bin2hex(mcrypt_generic ($td, $input));
mcrypt_generic_end ($td);
return $output;
  }

I get similar delays in the decryption routine.  Any ideas as to why it
slows down and/or how to fix it would be appreciated.

Thanks,
Chuck

Chuck Theobald, Technology Manager
ERIC Clearinghouse on Educational Management
5207 University of Oregon, Eugene, OR, 97403-5207
800-438-8841
* 541-346-1662 (voice) * 541-346-2334  (fax) * 541-337-0182 (cell) *
* http://eric.uoregon.edu/ * mailto:[EMAIL PROTECTED] *



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




Re: [PHP] Trying to subtract...no luck. (Long Code)

2001-10-24 Thread Jim Lucas

one problem on the second script you are trying to use variables that are in
an array.

if this is where you are talking about
you need to specify the array[key]

 while ($myrow=DB_fetch_array($result)){


 $difference = ($budget - $actual);

$difference = ($myrow[budget] - $myrow[actual]);




printf(TRTD%s/TDTD%s/TDTD%s/TDTD%s/TDTD%s/TDTD%s/T


- Original Message -
From: Michael O'Neal [EMAIL PROTECTED]
To:  Php-General@Lists. Php. Net [EMAIL PROTECTED]
Sent: Wednesday, October 24, 2001 1:18 PM
Subject: [PHP] Trying to subtract...no luck. (Long Code)


 Hi.  I'm trying to figure out how to subtract 1 variable from another, but
 I'm not having any luck.

 It works on this page:


 ?php

 $db_name = comanche;
 $table_name = ProjectTasks;

 $connection = @mysql_connect($db,$user,$pass) or die(Couldn't
 Connect.);
 $db = @mysql_select_db($db_name, $connection) or die(Couldn't select
 database.);

 $sql =SELECT budget,actual FROM $table_name;

 $result = @mysql_query($sql, $connection) or die(Couldn't execute
query.);

 while ($row = mysql_fetch_array($result)) {
 $budget=$row['budget'];
 $actual=$row['actual'];
 $difference = ($budget - $actual);


 echo $budget - $actual = $differencebr;

 }


 $num = @mysql_num_rows($result);

 ?


 But not on this page:

 ---BEGIN LONG PHP STUFF --

 ?php


 $title = Tasks Maintenance;
 include(../inc/hdr.php);
 include(header.inc);
 include(DateFunctions.inc);


 if (!isset($ProjectID)){

 echo PThis page must be called from the projects list page with the
 tasks link. Alternatively, you can enter the link as
 Tasks.php?ProjectID=iProjectID number/iPA HREF=' . $rootpath .
 /Projects.php'Project List/A;
 exit;
 }

 if ($submit) {

 //initialise no input errors assumed initially before we test
 $InputError = 0;

 /* actions to take once the user has clicked the submit button
 ie the page has called itself with some user input */

 //first off validate inputs sensible

 if (strlen($TaskName)  50 OR strlen($TaskName)==0) {
 $InputError = 1;
 echo BRThe task name must be entered and be fifty characters or
 less long;
 } elseif (!is_date($EarliestStart)) {
 $InputError = 1;
 echo BRThe date the task was initiated must be specified in the
 format dd/mm/;
 } elseif (!is_numeric($ExpectedDuration) || $ExpectedDuration0){
 $InputError = 1;
 echo BRThe expected duration of the task must be specified as a
 number - greater or equal to 0; }


 if ($InputError !=1){

 $SQL_EarliestStart = FormatDateForSQL($EarliestStart);

 if (isset($SelectedTask)) {



 $sql = UPDATE ProjectTasks SET TaskName='$TaskName',
 TaskDescription='$TaskDescription', EarliestStart='$SQL_EarliestStart',
 TaskChampion='$TaskChampion', ExpectedDuration=$ExpectedDuration,
 Status='$Status', budget='$budget', actual='$actual' WHERE TaskID =
 $TaskID;

 $result = DB_query($sql,$db);
 if (DB_error_no($db) !=0) {
 echo The task could not be updated because -  .
 DB_error_msg($db) .  The SQL statement used for the update was:BR$sql;
 } else {
 echo Ptask updated;
 unset($SelectedTask);
 unset($TaskName);
 unset($TaskDescription);
 unset($TaskChampion);
 unset($EarliestStart);
 unset($ExpectedDuration);
 unset($Status);
 unset($budget);
 unset($actual);
 }

 } else { //not a new task



 $sql = INSERT INTO ProjectTasks (ProjectID, TaskName,
 TaskDescription, EarliestStart, TaskChampion, ExpectedDuration, Status,
 budget, actual) VALUES ($ProjectID, '$TaskName', '$TaskDescription',
 '$SQL_EarliestStart', '$TaskChampion', $ExpectedDuration, '$Status',
 '$budget', '$actual');

 $result = DB_query($sql,$db);
 if (DB_error_no($db) !=0) {
 echo The task could not be added because -  .
 DB_error_msg($db) .  the SQL used to insert the new task was:BR .
$sql;
 } else {
 echo PTask inserted;
 unset($TaskName);
 unset($TaskDescription);
 unset($TaskChampion);
 unset($EarliestStart);
 unset($ExpectedDuration);
 unset($Status);
 unset($budget);
 unset($actual);
 }
 }
 } else {
 echo BRValidation failed, no updates or deletes took place.;
 }

 } elseif ($delete) {
 //the link to delete a selected record was clicked instead of the submit
 button

 $sql=DELETE FROM ProjectTasks WHERE TaskID=$TaskID;
 $result = DB_query($sql,$db);

 $sql=DELETE FROM TaskDependancies WHERE TaskID=$TaskID;
 $result = DB_query($sql,$db);

 $sql=DELETE FROM TaskDependancies WHERE 

RE: [PHP] problem pattern matching a url with question mark

2001-10-24 Thread sgibbs

ah, sorry about the confusion. The url I provided is just an example of a
url containing a question mark for which I'm trying to find a pattern match
in my content text.  


-Original Message-
From: Neil Freeman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 4:16 AM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] problem pattern matching a url with question mark


Why does your URL contain .asp?

[EMAIL PROTECTED] wrote:

 I found the following code currently used on our website to match a
url
 expression. Unfortunately, when I added a question mark, the webpage
that
 contained the url with the question mark just hung and would not
load into
 my browser at all. Currently, the url links only up to the question
mark.

 Here's the url I'm trying to get to work:
 http://www.thejakartapost.com/yesterdaydetail.asp?fileid=20011018.G07

 Can you look at the code below and tell me what I'm doing wrong?

 - Shawna

 ORIGINAL CODE

 // this will find web addresses and encapsulate each one in a standard
 anchor

 while(ereg(http://([\/~_\.0-9A-Za-z#-]+), $content, $match)){
 $http_old = $match[0];
 $http = dubdubdub . $match[1] . $match[2];
 $url = A
HREF=\javascript:externalURL('$http')\;$http/A;
 $content = ereg_replace($http_old, $url, $content);
 };

 $content = ereg_replace(dubdubdub, http://;, $content);

 CODE WITH QUESTION MARK

 // this will find web addresses and encapsulate each one in a standard
 anchor

 while(ereg(http://([\/~_\.0-9A-Za-z#-?]+), $content, $match)){
 $http_old = $match[0];
 $http = dubdubdub . $match[1] . $match[2];
 $url = A
HREF=\javascript:externalURL('$http')\;$http/A;
 $content = ereg_replace($http_old, $url, $content);
 };

 $content = ereg_replace(dubdubdub, http://;, $content);

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

 ***
  This message was virus checked with: SAVI 3.50
  last updated 23rd October 2001
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]



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




Re: [PHP] Opening a new page when done

2001-10-24 Thread Chuck

If you are going to use the javascript solution, be sure to add a noscript
container for browsers that do not support javascript or have it disabled:

SCRIPT language=JavaScript1.1
 !--
 location.replace(new-location.html);
 //--
 /SCRIPT
 NOSCRIPT
 META http-equiv=Refresh content=0; URL=wheredoyouwanttogotoday.ugh
 /NOSCRIPT

Of course, pure PHP is far superior... :-)

Chuck


James Fairbairn wrote:

 just print the following at the point where you decide you want to redirect:

 script language=JavaScript
 !--
 location.href=whereveryouwannago.php;
 //--
 /script

 a better alternative is to send a redirection header with the response, but
 this depends on you not sending any HTML output to the browser before
 processing is complete:

 ?php
 header(Location: whereveryouwannago.php);
 exit; // don't do any more processing after this redirect.
 ?

 hope this helps.

 james


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




Re: [PHP] Can PHP do what this javascript does...

2001-10-24 Thread Mike Eheler

There's a really long method of doing it that would work, but would 
involve server-side browser detection, and a database containing a list 
of browsers that support print shortcuts.

Stick with the JS.

Mike

[EMAIL PROTECTED] wrote:

iTo print/i: a href=javascript:if (window.print != null) {
window.print(); }
 else { alert('Unfortunately, your browser does not support this shortcut.
Please select Print from the File menu.'); }
bClick here/b/a ior/i Select bFile/b
and then bPrint/b from your browser's menu.

Is there an equivelant bit of code to do this printer shortcut with php?

--
Chip Wiegand
Computer Services
www.simradusa.com
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138

There is no reason anyone would want a computer in their home.
 --Ken Olson, president, chairman and founder of Digital Equipment Corp.,
1977
  (-- Then why do I have nine? Somebody help me!)





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




Re: [PHP] how do i give optional arguments to functions??

2001-10-24 Thread John A. Grant

Chris Bailey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Check out the manual section on default parameters...

 But the basics are:

 function top($image = null) {
 if ($image)

Shouldn't that be:

function top($image=null)
if ($image)

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here





-- 
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] PHP connetion of mySQL

2001-10-24 Thread Kacey A. Murphy

Keep getting this error, anyone know why ..
Using dreamweaver and Phakt plugin for PHP and everytime I connect inside
dreamweaver it works fine, but once posted to the web I get an error. 

Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password:
YES) in /home/sites/site2/web/atkins/adodb/adodb-mysql.inc.php on line 113

Thnaks





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




  1   2   >