RE: [PHP] Nested IF's (Is there a LIMIT ?) <<<<< SOLVED

2002-06-14 Thread Daniel Negron/KBE


I re-arranged the order of IF execution all together.  Email Validation
First then Form Validation.
Thanx  Martin and Miguel for your responses.  Finally going to bed, have to
be up in 3 hours.



Thank You

<><><><><><><><><><><><><><><><>

Daniel Negrón
Lotus Notes Administrator / Developer
KB Electronics, Inc.
954.346.4900x122
http://www.kbelectronics.com

<><><><><><><><><><><><><><><><>


   

Martin Towell  

   
world.net>cc: [EMAIL PROTECTED]

  Subject: RE: [PHP] Nested IF's  (Is 
there a LIMIT ?) 
06/14/2002 

02:56 AM   

   

   





Bracketing looks good

try pulling chunks of code out and gradually add it in to see where the
problem lies

eg (sorry for reformatting your code)




html code in here,






then






html code in here,





etc..
-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 4:53 PM
To: Daniel Negron/KBE
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Nested IF's (Is there a LIMIT ?)


I am too lazy to count your braces for you, but no, there's not really a
limit to how many ifs you can nest.

It helps to use an editor that flashes the bracket's companion when you
type or edit one. That way you can easily see whether they're balanced in
the right place.

miguel

On Fri, 14 Jun 2002, Daniel Negron/KBE wrote:
> This is my code, it seems that either I have the curly brackets in the
> wrong place OR there is a limit to how many times you can set IF's.  So
> before I pull out the shotgun, and take out this machine, I figure I
would
> ask the "Cousel Of the PHP OverLords".
>
> So you know, I happen to also be using "validateEmailFormat"  that was
> suggested a few minutes ago by Manuel... Thanx by the way, you saved me
> some time.
> I also chage the permissions on the files on the server to 777 so there
> would be no mistake.
> I also changed the order of the IF statements for the validateEmail
class.
> I have run it both ways with the same result.
>
> TIA
>
>  include "config.php";
> include "form_validator.class";
> include "validateEmailFormat.php";
> if ($submit) {
>   if ($form_complete)
> {
>   $my_form = new form_validator;
> if($my_form ->validate_fields("first, last, email, company, address,
city,
> state, zip, phone")) {
>   $isValid = validateEmailFormat($email);
>  if(!$isValid) {
> echo "Your Email Address Is InValid, \n Please Press
> your Web Browsers 'BACK' button and re-enter your email address";
>   }else{
>   $db = mysql_connect($dbhost,$dbuname,$dbpass);
>   mysql_select_db($dbname,$db);
>   $sql = "INSERT INTO $prefix";
>   $sql .= "(first, last, email, company, address, city, state,
zip,
> phone, fax, mobile, comments)";
>   $sql .= "VALUES";
>   $sql .= "('$first', '$last', '$email', '$company', '$address',
> '$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')";
>   $result = mysql_query($sql);
>  if (!$result) {echo("error: " . mysql_error() . "\n$sql\n");}
>   echo "Thank You for your submission.One of our agents
> will review your submission and forward your username and password.\n";
>   echo "You will not receive this email instantly\n";
>   }else{
>   echo ($my_form->error_message . "");
>}
>   }
>  }
> }
> else
> {
> ?>
> 
> 
> html code in here,
> 
> 
>  }
> ?>
>
>
>
> Thank You
>
> <><><><><><><><><><><><><><><><>
>
> Daniel Negrón
> Lotus Notes Administrator / Developer
> KB Electronics, Inc.
> 954.346.4900x122
> http://www.kbelectronics.com
>
> <><><><><><><><><><><><><><><><>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

--
PHP General Mailing List (http:/

RE: [PHP] Advanced User Authentication <--- solved

2002-06-14 Thread Chris Bunting

Hi All,
  Here is a link to an easy to use session program. Has all the code needed 
I think. This is what I have been using to get used to sessions and all.

http://www.trios.org/php/sessions/

Hope this helps soneone,
Chris

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




[PHP] Linux DBG-GUI

2002-06-14 Thread Philipp Melab

I'm using SuSE 8.0 and i need a free GUI to use with DBG.

yours   Philipp

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




[PHP] HTTP Compression

2002-06-14 Thread Webmaster do Aborla.net

Hi,

I would like to know how can I compress the output of PHP through Zlib.


Thanking in advance,
Nuno Lopes



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




[PHP] "fishcart" on win98

2002-06-14 Thread savaidis


I have a problem trying to install Fishcart on my win98 system.(Also a
ActivePerl problem)
Has anyone succeed this?

PS Sorry for non-topic. I had no answer from the "fishchart" list.


Makis



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




[PHP] row pointer

2002-06-14 Thread Zac Hillier

Hi

I'm looking for a php function that will return the position of the pointer
in a mysql recordset.

I found mysql_data_seek, but this appears to only move the pointer, I need
to get the equivalent row number for the pointer position before moving it,
then return to the same position.

Can anyone help?

Thanks

Zac


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




RE: [PHP] beginner in PHP

2002-06-14 Thread Tim Ward

You're insetting the variables within the chout() function only This has no
effect on
the local copies as they are not in scope here. You have successfully
destroyed the
session so when you refresh they are unset.

What I do with sessions is keep them all within a session array so you can
then destroy
the session locally by unsetting that array. If I have a function that I
want to change session
variables at all I make it take the session in as a parameter and pass it
back as the return value.


Tim Ward

> -Original Message-
> From: Phillip Perry [SMTP:[EMAIL PROTECTED]]
> Sent: 13 June 2002 19:45
> To:   Tim Ward; Martin Towell; Tom Rogers; Php
> Subject:  RE: [PHP] beginner in PHP
> 
> Yes, here is the checkout code I used...
> 
> function chout(){
>   session_destroy();
>   unset ($mycart);
>   unset ($cart_items);
>   echo "Thank you for shopping!";
>   }
> 
> Any suggestions?
> 
> -Original Message-
> From: Tim Ward [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 4:18 AM
> To: Martin Towell; Tom Rogers; Php; Phillip Perry
> Subject: RE: [PHP] beginner in PHP
> 
> 
> From the symptoms it sounds like you're destroying the session okay but
> leaving the variables
> In the script. Are you sure you're unsetting them at the appropriate scope
> level. 
> 
> Tim Ward
> www.chessish.com  
> 
>   --
>   From:  Phillip Perry [SMTP:[EMAIL PROTECTED]]
>   Sent:  13 June 2002 05:18
>   To:  Martin Towell; Tom Rogers; Php
>   Subject:  RE: [PHP] beginner in PHP
> 
>   Thanks Martin!! That really helped out a lot. And thanks to all who
> tried to
>   help me. I appreciate it!
> 
>   I have one other question that is really not so much important as it
> is
>   annoying, but I can't figure it out myself.
> 
>   I'm practicing with sessions. What I'm making..if you couldn't tell
> by the
>   array output from before...is a test shopping cart. Now the
> annoyance is
>   that when I click the checkout link it's just supposed to destroy
> the
>   session and reset everything to 0 including the shopping cart. And
> also if
>   an item is clicked, that item gets deleted. With both choices when I
> click
>   once the session does get destroyed, but everything stays on the
> page until
>   I refresh the page. I want the info to get reset when I click the
> link.
>   Here's the delete and checkout code...remember they both do actually
> work,
>   just not as I want. Any suggestions on how to make it refresh on a
> click
>   only?
> 
>   / DELETE SHOPPING CART ITEMS
> 
>   function chout(){
>   session_destroy();
>   $mycart = array();
>   $cart_items = 0;
>   echo "Thank you for shopping!";
>   }
> 
>   if ($action == delnow)
>   {
>   unset($mycart[$itemid]);
>   }
> 
>   // END DELETE SHOPPING CART ITEMS
> 
>   if ($action == checkout)
>   {
>   chout();
>   }
> 
>   -Original Message-
>   From: Martin Towell [mailto:[EMAIL PROTECTED]]
>   Sent: Wednesday, June 12, 2002 11:55 PM
>   To: '[EMAIL PROTECTED]'; Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
> 
> 
>   here's the revised loop
> 
> 
>   $cat_cnt = count($catalog);
>   while (list($key,$value) = each($mycart))
>   {
> for ($j = 0; $j < $cat_cnt; $j++)
>   if ($value == $catalog[$j]["itemcd"])
>   {
> echo $catalog[$j]["unitprice"];
> break;
>   }
>   }
> 
> 
>   -Original Message-
>   From: Martin Towell [mailto:[EMAIL PROTECTED]]
>   Sent: Thursday, June 13, 2002 1:50 PM
>   To: '[EMAIL PROTECTED]'; Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
> 
> 
>   Ah! $catalog is a 2D array - any your if statement is expecting a 1D
>   array...
> 
>   -Original Message-
>   From: Phillip Perry [mailto:[EMAIL PROTECTED]]
>   Sent: Thursday, June 13, 2002 1:52 PM
>   To: Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
> 
> 
>   I meant Martin :) sorry.
> 
>   -Original Message-
>   From: Phillip Perry [mailto:[EMAIL PROTECTED]]
>   Sent: Wednesday, June 12, 2002 11:44 PM
>   To: Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
> 
> 
>   Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4]
> =>
>   roses [5] => roses )
> 
>   1
>   1
> 
>   Your output is different from the last print_r that Tom had me do. I
> wonder
>   why that is
> 
>   -Original Message-
>   From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>   Sent: Wednesday, June 12, 2002 11:44 PM
>   To: [EMAIL PROTECTED]; Php
>   Subject: RE: [PHP] be

[PHP] SSL Support for PHP....

2002-06-14 Thread Brian McGarvie

Right...

Back to the old bombshell of which webserver...

I have'nt seen any reports which say what is better...

Here is my issue:

The webserver I am setting up will potentially host 4 or 5 sites...

How does IIS fair against Apache with servring multiple sites? each site will be 
like... http://customername.ourdomain.co.uk

Also - more an IIS/Apache Q, how do you configure the above to work in both IIS and 
Apache?

We arenot using ASP - yet, but might do at a later date... can IIS and Apache live 
together? if so how would you confirue a site who's PHP is served with Apache and ASP 
with IIS.

SSL Certificates... how do they work on Apache? IIS is a simple Wizard, I've not had 
to set SSL up before.

The hardware config is that machine has 2 nics, one to router for outside world to 
access it, another so the server can access the LAN as components of the 
web-application are VB Apps running on client machines to the LAN manipulating the 
database that is ultimatley used by PHP.

It's Win2k Server, p3 1.7ghz 512mb ram, 120gb raid 5.

The Application is not *launched* as yet, So I'l looking at whither to use Apache/IIS.

Thanks in advance

   Brian M McGarvie...

   [ http://www.the-local-guide.com :: http://www.mcgarvie.net ]

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




Re: [PHP] SSL Support for PHP....

2002-06-14 Thread Chris Bunting

Hello,
  I'm not to sure about the servers. I use Windows XP Pro and I'm coding and 
stuff offline to learn more about php, lasso and mysql. I've been doing this 
awile now but I've had problems with various php/mysql scripts. I usually 
get scripts from hotscripts.com and have prolly about 100 different programs 
running. Just messing moreless.

On IIS 5.0 that comes with WINXP Pro, I ran IIS5.0, MySQL, PHP and Lasso. 
Every once in a while, IIS would hang and would not do anything at all. This 
happened on many propular scripts such as php nuke.

I have also ran the same configuration above along with Cold Fusion and 
tried, Xitami (imatix.com), Omnihttpd, and Apache..

All these servers ran well with no problems. Xitami is slow, Apache is much 
better but I don't care much for non gui stuff, and Omnihttpd is the fastest 
in my opinion.

However, I'm only using this software on a home computer, Gateway 1.5 MHZ 
with 512 MB ram. I am now using apache again on WINXP PRO and all has been 
well for now.

Personally, I like IIS although it does get slow on smaller servers with 
alot of traffic. ASP and the likes slow it down to much for me but other 
than that, there is alot of documentation for seting it up to run various 
programs such as Cold Fusion, Lasso, Php ect.

I know this isn't much help. It's just my thoughts on what I've went through 
recently and just my general thoughts on the server. Remember, Apache on 
WIN2K or any windows machine isn't nearly as fast as on linux.

Chris

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


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




[PHP] Replace characters

2002-06-14 Thread Bård Tommy Nilsen




I am getting the values out from an image with iptcparse, but som
charachters like æ and å (norwegian)
Doesnt work.

I get "F¾rder instead of "Færder" 

And

"StŒende" instead of "Stående".

Could i do anything about this to get i right ??
Could it have somehting to do with it that the images are saved in Mac ??

Please help !



Regards
Bård Tommy Nilsen 

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




Re: [PHP] HTTP Compression

2002-06-14 Thread Daniel Tryba

On Fri, Jun 14, 2002 at 08:58:29AM +0100, Webmaster do Aborla.net wrote:
> I would like to know how can I compress the output of PHP through Zlib.

You mean like:
http://www.php.net/manual/en/function.ob-gzhandler.php

-- 

  Daniel Tryba


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




[PHP] Re: Email validation

2002-06-14 Thread Pedro Pontes

That one does not accept '+'.  In fact, that was the 1st time I ever saw
such a character in an e-mail address. I did not check the RFC, but if it is
valid, just add the '+' char to the reg. exp. like this:

function mailCheck($strEMailAddress)
{
 return eregi("^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$",
$strEMailAddress);
}

This should now accept your mail address.

Regards,

Pedro Alberto Pontes

- Original Message -
From: "Timothy J. Luoma" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: "Pedro Pontes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 04:49
Subject: Re: Email validation


> On Wed, 12 Jun 2002, Pedro Pontes wrote:
>
> > function checkEmail($strEMailAddress)
> > {
> >  return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$",
> > $strEMailAddress);
> > }
> >
> > You have it now :).
>
> I'm still learning my PHP regex... does the above allow someone to have a
> literal "+" in their email address, ala <[EMAIL PROTECTED]> which is
> perfectly valid, but often rejected by "email validators"?
>
> TjL
>
>
>


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




RE: [PHP] SSL Support for PHP....

2002-06-14 Thread Brian McGarvie

Also... IF Apache... what version?

> -Original Message-
> From: Brian McGarvie 
> Sent: 14 June 2002 9:14 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] SSL Support for PHP
> 
> 
> Right...
> 
> Back to the old bombshell of which webserver...
> 
> I have'nt seen any reports which say what is better...
> 
> Here is my issue:
> 
> The webserver I am setting up will potentially host 4 or 5 sites...
> 
> How does IIS fair against Apache with servring multiple 
> sites? each site will be like... http://customername.ourdomain.co.uk
> 
> Also - more an IIS/Apache Q, how do you configure the above 
> to work in both IIS and Apache?
> 
> We arenot using ASP - yet, but might do at a later date... 
> can IIS and Apache live together? if so how would you 
> confirue a site who's PHP is served with Apache and ASP with IIS.
> 
> SSL Certificates... how do they work on Apache? IIS is a 
> simple Wizard, I've not had to set SSL up before.
> 
> The hardware config is that machine has 2 nics, one to router 
> for outside world to access it, another so the server can 
> access the LAN as components of the web-application are VB 
> Apps running on client machines to the LAN manipulating the 
> database that is ultimatley used by PHP.
> 
> It's Win2k Server, p3 1.7ghz 512mb ram, 120gb raid 5.
> 
> The Application is not *launched* as yet, So I'l looking at 
> whither to use Apache/IIS.
> 
> Thanks in advance
> 
>Brian M McGarvie...
> 
>[ http://www.the-local-guide.com :: http://www.mcgarvie.net ]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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




[PHP] Re: [PHP-WIN] SSL Support for PHP....

2002-06-14 Thread Stuart Dallas

On Friday, June 14, 2002, 9:13:59 AM, Brian McGarvie wrote:
> How does IIS fair against Apache with servring multiple sites? each site will be 
>like... http://customername.ourdomain.co.uk

Both are capable of serving multiple sites without any issues that I am aware
of.

> Also - more an IIS/Apache Q, how do you configure the above to work in both IIS and 
>Apache?

In IIS you set the host header for the site when you set the IP for the site.
In Apache you use the NameVirtualHost directive. See the MSIIS and Apache docs
for more detailed instructions.

> We arenot using ASP - yet, but might do at a later date... can IIS and Apache live 
>together? if so how would you confirue a site who's PHP is served with Apache and ASP 
>with IIS.

IIS and Apache can live together happily. You have to disable connection
pooling for IIS (can't remember how - there is a knowledge-base article on the
MS site that gives full details).

Why would you want to have Apache serve PHP and IIS serve ASP for the same
site? Why not just have IIS do both?

> SSL Certificates... how do they work on Apache? IIS is a simple Wizard, I've not had 
>to set SSL up before.

Dunno, never used SSL with Apache. Sorry.

I hope that helps.

-- 
Stuart


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




[PHP] get_object_vars()

2002-06-14 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone, 
I'm using get_object_vars() to unset all of the object vars in a
function like this:

function destroy_properties($obj) {

if($properties=get_object_vars($obj)) {
foreach($properties as $key => $val) {
unset($key);
}
return TRUE;
} else return FALSE;
}

problem is, when I print($obj->property); I still get the value? What am
I missing here?

Many thanks...
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9Cb9FHpvrrTa6L5oRAsdTAJ4iC2wNgF4T7UJPnh29oryoe/q2iwCeOhwN
+N6Gx7i62Gyu1q1U/PVKA1M=
=EvX1
-END PGP SIGNATURE-

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




Re: [PHP] Shut down server

2002-06-14 Thread Rosen

Thanks,
but the idea is another user only to start and shutdown the server.

Any ideas ?

Thanks,
Rosen

Bruce Karstedt <[EMAIL PROTECTED]> wrote in message
00ea01c21339$e7856d60$4773d73f@c3">news:00ea01c21339$e7856d60$4773d73f@c3...
> This is a bad idea from a security standpoint. If your server is local,
> login as root and type shutdown. If the system is remote telnet to the
box,
> login, su to root and type reboot. If you use shutdown remotely, there is
no
> way to restart the server.
>
> Bruce Karstedt
> President
> Technology Consulting Associates, Ltd.
> Tel: 847-735-9488
> Fax: 847-735-9474
>
>
> -Original Message-
> From: Lazor, Ed [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 6:29 PM
> To: 'Rosen'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Shut down server
>
> < clip >
>
> I am not a security expert.  Check with others to get their opinion on
> whether this is the best approach.
>
> > -Original Message-
> > The server is Linux Red Hat 7.2
> > > > Can someone tell me how I could make shut down the server ?
> > > > Is it possible ?
>
>



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




Re: [PHP] Reg-Maximum allowed size for uploaded files

2002-06-14 Thread SenthilVelavan

Thanks Chris for your immediate response.Yes we got the error page not found
when we cross 7.5 MB.
How to increase the time out time.Whether we have to edit the httpd.conf or
php.ini file to increase the
time out time.
Any help is appreciated.
thanks in advance,
SenthilVelavan.P

- Original Message -
From: "Chris Bunting" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 11:40 AM
Subject: Re: [PHP] Reg-Maximum allowed size for uploaded files


> A quick search on google shows that yes, Php has a maximum upload filesize
> of 10MB.
>
> Maybe your upload timed out or the session expired if you are using them
> before you got to 10MB or something else happened.
>
> Chris Bunting
>
> _
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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




Re: [PHP] Reg-Maximum allowed size for uploaded files

2002-06-14 Thread Stuart Dallas

On Friday, June 14, 2002, 11:51:22 AM, SenthilVelavan wrote:
> How to increase the time out time.Whether we have to edit the httpd.conf or
> php.ini file to increase the
> time out time.

Per script: http://www.php.net/set_time_limit
In PHP.ini: http://www.php.net/manual/en/configuration.php#ini.max-execution-time

-- 
Stuart


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




Re: [PHP] Extracting from an Array

2002-06-14 Thread Andre Dubuc

Hi John,

Sorry about the delayed mail. Anyway, I kept at it, and debugged every line 
with no success. Finally, I rewote it, and it worked?? 

[Sigh . . . one of those days :>]

Thanks again for all your help. 

Regards,
Andre

On Thursday 13 June 2002 11:28 pm, you wrote:
> Step through your code. What value does $rexpiry have? What do you see
> when you do print_r($Date) ?? Troubleshoot...
>
> ---John Holmes...
>
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 10:36 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Extracting from an Array
> >
> > Hi John,
> >
> >  > /* Using PostgreSQL: it needs $numrows and $row=0 to work. Also set it
>
> to
>
> > choose  only one record in db to simplify testing. Date was set
>
> to 10
>
> > May
> > 1998*/
> > // $db conect stuff
> >
> > $query = "SELECT rexpiry FROM rap WHERE rid = '1024'";
> > $result = pg_exec($db, $query);
> > if (!$result) {printf ("ERROR"); exit;}
> > $numrows = pg_numrows($result);
> > $row = 0;
> >
> > $Row = pg_fetch_array($result,$row);
> > $rexpiry = $Row['rexpiry'];
> > $Date = explode(" ", $rexpiry);
> > $Year = $Date[3];
> > pg_close($db);
> > print $Year;
> >
> > /* 'Year' returns something like "1"  */
> > ?>
> >
> > Btw, according to the error message, there's no such function as
>
> 'RIGHT'
>
> > in
> > PostgreSQl. (Sorry about referring to the string as an array in a
>
> session
>
> > variable -- I've extracted the code from some other stuff that I had
>
> been
>
> > working on.)
> >
> > Sigh. I'd like to know why this doesn't work: how I can extract the
>
> last
>
> > few
> > characters from the array.
> >
> > Regards,
> > Andre
> >
> > On Wednesday 12 June 2002 09:34 pm, you wrote:
> > > I don't understand why you keep referring to the string as an array
>
> in a
>
> > > session variable. Can you show me  how you are issuing the query,
> > > fetching the result, assigning it to the session, etc...
> > >
> > > It should be as easy as this:
> > >
> > >  > > $result = MySQL_query("SELECT RIGHT(date_column,4) AS Year FROM
> > > tablename");
> > > while($row = MySQL_fetch_array($result))
> > > {
> > >   echo $row['Year'];
> > > }
> > > ?>
> > >
> > > You know you could write a simple little script to convert this into
>
> the
>
> > > correct format for a date column.
> > >
> > > If you want to do sorting by year, you can try this:
> > >
> > > SELECT date_column FROM table ORDER BY RIGHT(date_column,4) ASC
> > >
> > > ---John Holmes...
> > >
> > > > -Original Message-
> > > > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, June 12, 2002 9:32 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: [PHP] Extracting from an Array
> > > >
> > > > Hi John,
> > > >
> > > > Yup. I know now that I've caused myself all sorts of grief when I
>
> set
>
> > > it
> > >
> > > > to
> > > > varchar. If I recall correctly (and I set this up four months ago
>
> when
>
> > > I
> > >
> > > > began coding) I couldn't get it format without the crummy little
> > >
> > > dashes.
> > >
> > > > So I
> > > > set it to a string.
> > > >
> > > > Much coding later, I realize that I could solve this problem by
> > >
> > > changing
> > >
> > > > it
> > > > back to 'date' type, but as i'm writing, I remember that this
> > >
> > > particular
> > >
> > > > array has only one use - and in a string format it's easier to
> > >
> > > manipulate.
> > >
> > > > [Bad reason, I guess with hindsight -- perhaps it's a hangover
>
> from my
>
> > > > Paradox PAL days where I needed to format the string for 'other
> > > > purposes'.]
> > > >
> > > > Your last point is precisely what I'm writing about: it IS all
>
> messed
>
> > > up!
> > >
> > > > So,
> > > > the upshot is - live with it, and don't use it; or change it.
>
> Hmmm. I
>
> > > had
> > >
> > > > planned to sort a column by 'Year', but it might be a case of
> > >
> > > 'overkill' -
> > >
> > > > -
> > > > the form is already loaded with enough options.
> > > >
> > > > Now that being said, this is more a problem of why can't I get ALL
>
> of
>
> > > the
> > >
> > > > last part of the array? Suppose I wanted to extarct something that
>
> was
>
> > > not
> > >
> > > > a
> > > > date like: $_SESSION['odd'] which was varchar in the format of
> > >
> > > "Session is
> > >
> > > > closed". Now if I wanted to extract the last part: 'closed' what
>
> I've
>
> > > > tried
> > > > wouldn't work. It would give me: "c" -- how would I get the rest
>
> of
>
> > > the
> > >
> > > > characters?
> > > >
> > > > Thanks for the advice,
> > > > Regards,
> > > > Andre
> > > >
> > > > On Wednesday 12 June 2002 08:25 pm, you wrote:
> > > > > What are the possible reasons that you "need it to be a varchar"
>
> ??
>
> > > Do
> > >
> > > > > you realize how much extra work you are creating for yourself?
>
> Do
>
> > > you
> > >
> > > > > realize that you can have your users enter data in one format,
>
> and
>
> > > > > con

Re: [PHP] Nested IF's (Is there a LIMIT ?)

2002-06-14 Thread Neil Freeman

Maguma Studio for PHP Light will do the job.

Neil

Daniel Negron/KBE wrote:
> **
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 11th June 2002
> **
> 
> 
> I am too lazy to count your braces for you, but no, there's not really a
> limit to how many ifs you can nest.
> 
> It helps to use an editor that flashes the bracket's companion when you
> type or edit one. That way you can easily see whether they're balanced in
> the right place.
> 
> »»»  Do you happen to have the name of  an editor that does that ?  I am
> using dreamweaverMX and UltraEdit, also have EditPlus and TextPad.just
> is case it was one of them.
> 
> 
> Thank You
> 
> <><><><><><><><><><><><><><><><>
> 
> Daniel Negrón
> Lotus Notes Administrator / Developer
> KB Electronics, Inc.
> 954.346.4900x122
> http://www.kbelectronics.com
> 
> <><><><><><><><><><><><><><><><>
> 
> 
> 


-- 

Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com



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




[PHP] Error in enabling Image module in Php

2002-06-14 Thread Arul Venkatesh Kandaswamy

Hello folks,
When i tried to install php.My make command stops with the following error


gd.c:95: conflicting types for `gdIOCtx'
/usr/local/include/gd_io.h:18: previous declaration of `gdIOCtx'
gd.c: In function `php_if_imagecreatefromgif':
gd.c:1209: `gdImageCreateFromGif' undeclared (first use in this function)
gd.c:1209: (Each undeclared identifier is reported only once
gd.c:1209: for each function it appears in.)
gd.c: In function `php_if_imagegif':
gd.c:1404: `gdImageGif' undeclared (first use in this function)
make[3]: *** [gd.lo] Error 1
make[3]: Leaving directory `/usr/local/php-4.0.6/ext/gd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/php-4.0.6/ext/gd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/php-4.0.6/ext'
make: *** [all-recursive] Error 1

My configure option is

./configure --with-apxs=/usr/local/apache/bin/apxs  \
--with-mysql=/usr/local/  \
--with-zlib \
--with-ftp \
--with-gd \
--with-jpeg-dir=/usr/local/lib \
--enable-versioning \
--enable-track-vars=yes \
--enable-url-includes \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--with-config-file-path=/etc

Any help is appreciated
Thanks in Advance
K.Arul Venkatesh


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




[PHP] session variables in OOP....

2002-06-14 Thread Wilbert Enserink

Hi all,


I'm busy building a site which uses OOP. 
Several classes are used to constuct different sections of the final page to be 
displayed. 
The overall class is called class.basepage.php
This is the page which outputs HTML and calls other classes to construct other parts 
of the page.
Now I have this problem: In one of the objects I use session variables. However i get 
the famous error :Cannot send session cookie - headers already sent by (output 
started "


Is there a way to overcome this problem? I mean: the session variable is registered in 
the main part of the page after the class $this->header is called (which writes 
HTML)... now, I don't think I can register the sessionvariable at the top of my script 
since the value of the session var is determined in the main.class...or can I?

I hope you understand my problem and have some tips for me. Below is some code 
snippets I'm using:

thx and regards 

Wilbert Enserink



class.basebape.php---
  header(); ?>// includes a php file which writes HTMLcode functioning as 
the "header" of the HTML page (i.e. navigation menu)
 main(); ?> // includes a php file (main.php) which writes the main part 
of the HTML data
---

---main.php--
echo "a lot of HTML depending on queries and stuff";
session_register($variable);



output browser--
Warning: Cannot send session cookie - headers already sent by (output started at 
/opt/guide/www.designmatcher.com/HTML/wwwtest/class.basepage.php:125) in 
/opt/guide/www.abc.com/HTML/wwwtest/phpincludes/main/main.php on line 400
-

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


[PHP] RE: [PHP-WIN] SSL Support for PHP....

2002-06-14 Thread Brian McGarvie

Basically then there is no real reason for Apache over IIS on win2k server?

I am the admin of the Webservers, but the overall network manager would like to keep 
it MS-centric just because all the rest is.

With our leased line we aqquired 16 ips, so in the IIS config I would just use that IP 
and keep it port 80?

(I will read the manual, I will read the manual, I will read the manual!)

SSL is a must for a few of the 'sites' that will be getting ran.

As for ASP *shudder* I personally don't plan on using it, tho I might experiment with 
asp.net but thats a by-the-by.

I'm kinda trying to verify that using IIS with PHP isapi module is as secure as Apache?

Heres a strange one tho jist on the side: I installed Apache2/PHP on my own machine 
(used for writing code etc) and copied the application to an apache location, and ran 
it, but... there is supposedly files missing according to apache, all is as on the 
other machine - files/code wise.

One last item I need some advise with... is IIS able to handle LOTS of sites accross 
multiple servers? as we have lots of clients so in the future will possibly need a 
machine to load-balance etc and seperate database serving machines - databases 
primarily MsSQL/Access/MySQL.

Btw, thanks Stuart, thats kinda making me feel easier about keeping it IIS.

> -Original Message-
> From: Stuart Dallas [mailto:[EMAIL PROTECTED]]
> Sent: 14 June 2002 10:52 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] SSL Support for PHP
> 
> 
> On Friday, June 14, 2002, 9:13:59 AM, Brian McGarvie wrote:
> > How does IIS fair against Apache with servring multiple 
> sites? each site will be like... http://customername.ourdomain.co.uk
> 
> Both are capable of serving multiple sites without any issues 
> that I am aware
> of.
> 
> > Also - more an IIS/Apache Q, how do you configure the above 
> to work in both IIS and Apache?
> 
> In IIS you set the host header for the site when you set the 
> IP for the site.
> In Apache you use the NameVirtualHost directive. See the 
> MSIIS and Apache docs
> for more detailed instructions.
> 
> > We arenot using ASP - yet, but might do at a later date... 
> can IIS and Apache live together? if so how would you 
> confirue a site who's PHP is served with Apache and ASP with IIS.
> 
> IIS and Apache can live together happily. You have to disable 
> connection
> pooling for IIS (can't remember how - there is a 
> knowledge-base article on the
> MS site that gives full details).
> 
> Why would you want to have Apache serve PHP and IIS serve ASP 
> for the same
> site? Why not just have IIS do both?
> 
> > SSL Certificates... how do they work on Apache? IIS is a 
> simple Wizard, I've not had to set SSL up before.
> 
> Dunno, never used SSL with Apache. Sorry.
> 
> I hope that helps.
> 
> -- 
> Stuart
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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




[PHP] Re: [PHP-WIN] SSL Support for PHP....

2002-06-14 Thread Stuart Dallas

On Friday, June 14, 2002, 11:07:24 AM, Brian McGarvie wrote:
> Basically then there is no real reason for Apache over IIS on win2k server?

Not now Apache 2 is here. Apache 1.x has always been considered by the Apache
group as beta code and therefore not suitable for use in a production
environment. I have been using Apache 2 for development on Win2k since it was
first released to the public and I will upgrade my public server as soon as PHP
releases a production version of their module. I have IIS on the same server
and have never had a problem with them co-existing.

> With our leased line we aqquired 16 ips, so in the IIS config I would just use that 
>IP and keep it port 80?

In the site configuration, click on the "Advanced..." button next to the IP
address. Make sure that each entry has the IP address, port 80 and the host
header set to the site domain name.

> (I will read the manual, I will read the manual, I will read the manual!)

A very good idea ;o)

> SSL is a must for a few of the 'sites' that will be getting ran.

As I said, I have not experience with SSL on Apache, but on IIS it is as simple
as following a wizard.

> I'm kinda trying to verify that using IIS with PHP isapi module is as secure as 
>Apache?

A web server is only as secure as it's administrator is anal. I personally
believe that IIS on Win2k can be made as secure as Apache on any platform, but
not a lot of people agree with that. As for how secure PHP is, most of that
will depend on the scripts rather than the server/PHP interface you're using.

> Heres a strange one tho jist on the side: I installed Apache2/PHP on my own machine 
>(used for writing code etc) and copied the application to an apache location, and ran 
>it, but... there is
> supposedly files missing according to apache, all is as on the other machine - 
>files/code wise.

What files did it say were missing? Were they scripts, modules, what?

> One last item I need some advise with... is IIS able to handle LOTS of sites accross 
>multiple servers? as we have lots of clients so in the future will possibly need a 
>machine to load-balance etc
> and seperate database serving machines - databases primarily MsSQL/Access/MySQL.

Again, here is where my experience falls short. I have not yet had a chance to
be involved in a load-balanced project. However, I would expect that there
would be little difference whether you implement it using IIS or Apache.

> Btw, thanks Stuart, thats kinda making me feel easier about keeping it IIS.

No problem. Don't get me wrong, I think the ?AMP combination
(Linux/FreeBSD/etc, Apache, MySQL and PHP) is unbeatable as a server platform,
but I strongly believe that, done properly, IIS on Win2k is still a strong
platform. The problem is that MS have (purposefully) made IIS accessible to the
average PC user which I think is one of the main reasons that it has *that*
reputation.

-- 
Stuart


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




Re: [PHP] session variables in OOP....

2002-06-14 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Wilbert Enserink declared
> I hope you understand my problem and have some tips for me. Below is some code 
>snippets I'm using:

Actually it's a little tricky to understand ;-)
Have you considered output buffering?
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9Cdq/HpvrrTa6L5oRAqmzAJ99bcz64l6/lfcIqLz4iGKlTLeJHQCeOmsH
e0lahzjczcVE3aFql/+G6+M=
=Fl/c
-END PGP SIGNATURE-

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




RE: [PHP] SSL Support for PHP....

2002-06-14 Thread Henrik Johansson

Hi.

You probably want to use Windows 2000 Server instead; after all, Windows XP
is
more or less targeted against workstations and home use (as of yet). It may
need some tweaking to be suitable for server-use. Consider the complexity of
all DCOM+ components that coexist and rely on various services to excel in
performance and functionality.

I doubt this neither, is of any real use. Just my thoughts on the subject,
and my
practical experience with IIS 5/PHP is limited.

Cheers,
Henrik J.

-Original Message-
From: Chris Bunting [mailto:[EMAIL PROTECTED]]
Sent: den 14 juni 2002 10:41
To: [EMAIL PROTECTED]
Subject: Re: [PHP] SSL Support for PHP


Hello,
  I'm not to sure about the servers. I use Windows XP Pro and I'm coding and

stuff offline to learn more about php, lasso and mysql. I've been doing this

awile now but I've had problems with various php/mysql scripts. I usually 
get scripts from hotscripts.com and have prolly about 100 different programs

running. Just messing moreless.

On IIS 5.0 that comes with WINXP Pro, I ran IIS5.0, MySQL, PHP and Lasso. 
Every once in a while, IIS would hang and would not do anything at all. This

happened on many propular scripts such as php nuke.

I have also ran the same configuration above along with Cold Fusion and 
tried, Xitami (imatix.com), Omnihttpd, and Apache..

All these servers ran well with no problems. Xitami is slow, Apache is much 
better but I don't care much for non gui stuff, and Omnihttpd is the fastest

in my opinion.

However, I'm only using this software on a home computer, Gateway 1.5 MHZ 
with 512 MB ram. I am now using apache again on WINXP PRO and all has been 
well for now.

Personally, I like IIS although it does get slow on smaller servers with 
alot of traffic. ASP and the likes slow it down to much for me but other 
than that, there is alot of documentation for seting it up to run various 
programs such as Cold Fusion, Lasso, Php ect.

I know this isn't much help. It's just my thoughts on what I've went through

recently and just my general thoughts on the server. Remember, Apache on 
WIN2K or any windows machine isn't nearly as fast as on linux.

Chris

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


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



Re: [PHP] session variables in OOP....

2002-06-14 Thread W. Enserink

Hi all,


Nick: thx for the tip, it removed the error, and might further be a good
idea: except:
do you know if I can declare session variables and use them in between the
output buffer statements
like this: (i tried it but it doesn't seem to work)??

greetings Wilbert


include ("class.basepage.php");
ob_start();//start the outputbuffering
$object= new basepage; //object basepage which determines which HTML
to output (due to queries and calcultaions)
session_register($variable);
$extra_variable=$variable+1;
echo "$extra_variable";
ob_get_contents();//show the buffer
ob_end_flush() ;//clear the buffer




- Original Message -
From: "Nick Wilson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 1:59 PM
Subject: Re: [PHP] session variables in OOP


> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> * and then Wilbert Enserink declared
> > I hope you understand my problem and have some tips for me. Below is
some code snippets I'm using:
>
> Actually it's a little tricky to understand ;-)
> Have you considered output buffering?
> - --
> Nick Wilson //  www.explodingnet.com
>
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE9Cdq/HpvrrTa6L5oRAqmzAJ99bcz64l6/lfcIqLz4iGKlTLeJHQCeOmsH
> e0lahzjczcVE3aFql/+G6+M=
> =Fl/c
> -END PGP SIGNATURE-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

- 
Pas de Deux 
Van Mierisstraat 25 
2526 NM Den Haag 
tel 070 4450855 
fax 070 4450852 
http://www.pdd.nl 
[EMAIL PROTECTED] 
-

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




Re: [PHP] session variables in OOP....

2002-06-14 Thread 1LT John W. Holmes

If you want to do it right, don' t output anything, obviously. Instead of
using ECHO, assign all output to a variable within your class. Then, at the
end of the processing, after everything is done, echo out that variable
(which will contain the entire page). Then you can set cookies, sessions,
whatever, at any point.

Or you can use output buffering...

---John Holmes...

- Original Message -
From: "Wilbert Enserink" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 7:44 AM
Subject: [PHP] session variables in OOP


Hi all,


I'm busy building a site which uses OOP.
Several classes are used to constuct different sections of the final page to
be displayed.
The overall class is called class.basepage.php
This is the page which outputs HTML and calls other classes to construct
other parts of the page.
Now I have this problem: In one of the objects I use session variables.
However i get the famous error :Cannot send session cookie - headers
already sent by (output started "


Is there a way to overcome this problem? I mean: the session variable is
registered in the main part of the page after the class $this->header is
called (which writes HTML)... now, I don't think I can register the
sessionvariable at the top of my script since the value of the session var
is determined in the main.class...or can I?

I hope you understand my problem and have some tips for me. Below is some
code snippets I'm using:

thx and regards

Wilbert Enserink



class.basebape.php---
  header(); ?>// includes a php file which writes HTMLcode
functioning as the "header" of the HTML page (i.e. navigation menu)
 main(); ?> // includes a php file (main.php) which writes the
main part of the HTML data
---

---main.php--
echo "a lot of HTML depending on queries and stuff";
session_register($variable);



output browser--
Warning: Cannot send session cookie - headers already sent by (output
started at
/opt/guide/www.designmatcher.com/HTML/wwwtest/class.basepage.php:125) in
/opt/guide/www.abc.com/HTML/wwwtest/phpincludes/main/main.php on line 400
-

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


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




Re: [PHP] MySQL Query Help!!!!

2002-06-14 Thread Mark Gallagher

Chris Kay wrote:
>>The query does not error out it just does not give any records, and I
> 
> Know
> 
> What part of "The query does not error out" do you not understand.
> 
> Why are there so many people willing to say what is wrong with a code but when it 
>comes to
> A solution that go silent.
> 
> I find that the ones most often to find flaws in someones code, are the ones who 
>never provide
> Answers.

I've been on this list for a few months (IIRC), but I don't post much. 
That's because I never provide Answers (being a newbie, and therefore 
not knowing them).

I'm on the list because I want to learn about PHP, and I've found it 
easier in the years I've been online to subscribe to mailing lists or 
(once upon a time) USENET newsgroups and just read the various solutions 
to peoples' problems.

"Where's all this going?", you impatiently ask, perhaps stamping your 
foot.  Well, pause for a second, gentle reader, for you are about to be 
shocked to your very core.

Well, maybe not.  Here goes anyway: I've learnt a lot about PHP simply 
from reading the answers provided by the more intelligent, knowledgeable 
and helpful members of this list.  Guess who's helped the most?

A young (?) man by the unusual name of "John Holmes".

Before you chew people out, Mr Kay, about being perpetually unhelpful, 
you may like to lurk on a list for a while and see if you're actually 
within a stones throw of the truth, or really just spouting off out of 
your own sense of hurt pride.


HTH, HAND!

-- 
Mark Gallagher
http://cyberfuddle.com/infinitebabble/





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




[PHP] XML Feed

2002-06-14 Thread Necro

I am currently trying to implement XML Parsing on a site using the XML News
Feed of another site. The site puts two versions of the news in its file
though:

- 
  Tsunami 2265 Date, Demo
  http://www.shacknews.com/onearticle.x/20959
  

- 
  Tsunami 2265 Date, Demo
  http://www.shacknews.com/onearticle.x/20959
  General
  

I have a script that is meant to parse the file which is downloaded to a
local file hourly. The trouble is that the script tries parsing both lots
and I only wish it to parse the top half and to stop when it reaches the
entries using  tags.

Does anyone have a solution for this? The script below is what I use to echo
the news onto my site. The script attached is the script that is meant to
parse the xml document.

http://www.shacknews.com/shackfeed.xml";;
$refreshtime = time() - 3600;
?>




-

Andrew.




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


[PHP] Passing variables from one page to another

2002-06-14 Thread Don

Hi,

Does anyone have a PHP method of passing variables from a form to another page without 
using "sessions" or encoding within the URL?

I remember someone mentioning a class but I lost the reference. My site uses PHP 
4.0.1Pl1

Thanks,
Don


[PHP] Quick question

2002-06-14 Thread Dan McCullough

I have a form, and if someone doesnt fill in a field it returns and asks them to 
filling in the
missing field.  I have made it so that the person doesnt lose everything, currently 
they will lose
radio button information or checkbox information.  Can someone tell me how to best 
keep it so the
checkboxes stay checked or radio buttons stay selected.

thanks,

dan

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




[PHP] getting help on php

2002-06-14 Thread Hotmail

Dear sir,

I have two questions :

1- Is there a function in php that refreshes my page ?

2- Is there a function that lets me open a new window ?



Re: [PHP] Passing variables from one page to another

2002-06-14 Thread Jason Wong

On Friday 14 June 2002 22:16, Don wrote:
> Hi,
>
> Does anyone have a PHP method of passing variables from a form to another
> page without using "sessions" or encoding within the URL?
>
> I remember someone mentioning a class but I lost the reference. My site
> uses PHP 4.0.1Pl1

Use POST.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
It has long been an axiom of mine that the little things are infinitely
the most important.
-- Sir Arthur Conan Doyle, "A Case of Identity"
*/


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




Re: [PHP] Quick question

2002-06-14 Thread Marek Kilimajer

Quick answer:



the same for radio boxes.

Dan McCullough wrote:

>I have a form, and if someone doesnt fill in a field it returns and asks them to 
>filling in the
>missing field.  I have made it so that the person doesnt lose everything, currently 
>they will lose
>radio button information or checkbox information.  Can someone tell me how to best 
>keep it so the
>checkboxes stay checked or radio buttons stay selected.
>
>thanks,
>
>dan
>
>__
>Do You Yahoo!?
>Yahoo! - Official partner of 2002 FIFA World Cup
>http://fifaworldcup.yahoo.com
>
>  
>



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




Re: [PHP] getting help on php

2002-06-14 Thread R'twick Niceorgaw

1. use META TAGS to refresh the page
2. use javascript to open a new window
- Original Message - 
From: "Hotmail" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 10:36 AM
Subject: [PHP] getting help on php


Dear sir,

I have two questions :

1- Is there a function in php that refreshes my page ?

2- Is there a function that lets me open a new window ?




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




Re: [PHP] getting help on php

2002-06-14 Thread Jason Wong

On Friday 14 June 2002 22:36, Hotmail wrote:
> 1- Is there a function in php that refreshes my page ?

Short answer, no. Longer answer depends on what you want to do and what you 
mean by 'refresh page'.

> 2- Is there a function that lets me open a new window ?

No, that's a client-side operation, use javascript.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Good news from afar can bring you a welcome visitor.
*/


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




[PHP] Editor

2002-06-14 Thread Adrian Greeman

I am just surprised that noone mentioned HTML-Kit among all the editors
suggested.  I think it is fine and it even gives you a quick preview in
browser window  for HTML.  It gives you PHP among various other options
colouring the code differently and you can just highlight code to surround
it with php tags for example.

Does Java and other stuff too.

Lots of plug-ins endlessly under development

And it's FREE.

I have it plugged in as the external text editor of choice with Dreamweaver.





Regards


Adrian Greeman


Telephone +44 20 8672 9661
Mobile +44 780 329 7447

e-mail:-
[EMAIL PROTECTED]

or

[EMAIL PROTECTED]


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




[PHP] Imgeupload to mysql beyond 1 kb fails

2002-06-14 Thread Are Haugsdal

Hi

Images under 1 kb uploads and shows fine. Images larger than this is
inserted into database, with correct file size, but does not show when
calling a php file get_image.php as a image.

Below is from my database, the image with id 33 does not show, the image
with id 34 do show. When having the larger image, it only shows a broken
link, not the image.

I can´t see any reason for this ??

Endre Slett 33 [BLOB]hydra.gif4023image/gif
Endre Slett 34 [BLOB]hjerte.gif597  image/gif

Regards
Are Haugsdal







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




[PHP] Imgeupload to mysql beyond 1 kb fails

2002-06-14 Thread Are Haugsdal

Hi

Images under 1 kb uploads and shows fine. Images larger than this is
inserted into database, with correct file size, but does not show when
calling a php file get_image.php as a image.

Below is from my database, the image with id 33 does not show, the image
with id 34 do show. When having the larger image, it only shows a broken
link, not the image.

I can´t see any reason for this ??

Endre Slett 33 [BLOB]hydra.gif4023image/gif
Endre Slett 34 [BLOB]hjerte.gif597  image/gif

Regards
Are Haugsdal









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




[PHP] protect code or something like..

2002-06-14 Thread Rodrigo Peres

Hi list,

I have a project that was develop in a partnership, now this partners
doesn't so partners anymore :-/
My question is there's a way to create a protection that I can trace if the
software was installed in other servers?? I mean not hide the code, but put
an important include of the project in another server and generate a log of
the acess to it, or anything that can "tell me" who is installed and running
the system.

Thank's

Rodrigo



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




[PHP] Beginning /< and end of word /> in eregi_replace

2002-06-14 Thread John S. Huggins


Can it be true that PHP does not implement the beginning and end of word
syntax of regular expressions?

In builing a bad word filter, I find this...

  $outstring = eregi_replace("badword$","goodword",$stringtocheck);

will find an occurance of the 'badword' at the end of the string and
replace it.

Similarly,

  $outstring = eregi_replace("^badword","goodword",$stringtocheck);

will find an occurance of the 'badword' at the beginning of the string
and replace it.

Also,

  $outstring = eregi_replace("badword","goodword",$stringtocheck);

will find all occurances of 'badword' even if they are part of a longer
not so bad word like 'badwordage' and replace it.

Then,

  $outstring = eregi_replace(" badword ","goodword",$stringtocheck);

will help me isolate just the actual bad word, but not those at the
beginning and end of a string or that end in a period or comma.

So I could make a rule for each possible placement of badword in a string
and then do this for each vulger term I try to filter.  Or I could just
do... 

  $outstring = eregi_replace("/","goodword",$stringtocheck);

Which should find any occurance of 'badword' and nothing more anywhere in
the string.  It works in grep.  It works in bash.  It does not seem to
work in PHP.

Anybody know what I might be doing wrong?

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




Re: [PHP] Editor

2002-06-14 Thread cal

URL??
:)
*
* Cal Evans
* Techno-Mage
* http://www.calevans.com
*

- Original Message -
From: "Adrian Greeman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 8:18 AM
Subject: [PHP] Editor


> I am just surprised that noone mentioned HTML-Kit among all the editors
> suggested.  I think it is fine and it even gives you a quick preview in
> browser window  for HTML.  It gives you PHP among various other options
> colouring the code differently and you can just highlight code to surround
> it with php tags for example.
>
> Does Java and other stuff too.
>
> Lots of plug-ins endlessly under development
>
> And it's FREE.
>
> I have it plugged in as the external text editor of choice with
Dreamweaver.
>
>
>
>
>
> Regards
>
>
> Adrian Greeman
>
>
> Telephone +44 20 8672 9661
> Mobile +44 780 329 7447
>
> e-mail:-
> [EMAIL PROTECTED]
>
> or
>
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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




[PHP] Regular expression newbie question, convert this: [::word1 \" word2\" word3::] to : ".word1 " word2 " word3."

2002-06-14 Thread Lance

hi, i have been banging my head against the wall for hours trying to 
figure the expression out to perform the following:

covert this:
[::word1 \" word2 \" word3::]

to:
".word1 " word2 " word3."

i would definitely appreciate any help given on this.

thanks beforehand.
lance


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




Re: [PHP] session variables in OOP....

2002-06-14 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then W. Enserink declared
> Nick: thx for the tip, it removed the error, and might further be a good
> idea: except:
> do you know if I can declare session variables and use them in between the
> output buffer statements
> like this: (i tried it but it doesn't seem to work)??

Sorry, not sure, I've never actually had cause to use output buffering.
You might want to ask the question specifically in a new thread. In
fact: Please do, I'd be very interested to hear what the others think
;-)
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9ChHWHpvrrTa6L5oRAiucAJ9Zpydunune2hmPjaBvyMAE9GpYCQCfSJZy
/2SzYVUDutkYu5821iyjscI=
=rBgs
-END PGP SIGNATURE-

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




Re: [PHP] Editor

2002-06-14 Thread 1LT John W. Holmes

Google??

http://www.google.com/search?hl=en&ie=UTF8&oe=UTF8&q=HTML-Kit

---John Holmes...

- Original Message -
From: <[EMAIL PROTECTED]>
To: "Adrian Greeman" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 11:38 AM
Subject: Re: [PHP] Editor


> URL??
> :)
> *
> * Cal Evans
> * Techno-Mage
> * http://www.calevans.com
> *
>
> - Original Message -
> From: "Adrian Greeman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 14, 2002 8:18 AM
> Subject: [PHP] Editor
>
>
> > I am just surprised that noone mentioned HTML-Kit among all the editors
> > suggested.  I think it is fine and it even gives you a quick preview in
> > browser window  for HTML.  It gives you PHP among various other options
> > colouring the code differently and you can just highlight code to
surround
> > it with php tags for example.
> >
> > Does Java and other stuff too.
> >
> > Lots of plug-ins endlessly under development
> >
> > And it's FREE.
> >
> > I have it plugged in as the external text editor of choice with
> Dreamweaver.
> >
> >
> >
> >
> >
> > Regards
> >
> >
> > Adrian Greeman
> >
> >
> > Telephone +44 20 8672 9661
> > Mobile +44 780 329 7447
> >
> > e-mail:-
> > [EMAIL PROTECTED]
> >
> > or
> >
> > [EMAIL PROTECTED]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] Beginning /< and end of word /> in eregi_replace

2002-06-14 Thread 1LT John W. Holmes

You have your answer, just use this:

$outstring = eregi_replace("badword","goodword",$stringtocheck);

It'll replace it whether it's at the beginning or end of a string, embedded
in a word, or by itself. Isn't that what you want?

Actually, it'd be better and faster to just use str_replace() instead of a
regular expression...

---John Holmes...

- Original Message -
From: "John S. Huggins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 11:37 AM
Subject: [PHP] Beginning /< and end of word /> in eregi_replace


>
> Can it be true that PHP does not implement the beginning and end of word
> syntax of regular expressions?
>
> In builing a bad word filter, I find this...
>
>   $outstring = eregi_replace("badword$","goodword",$stringtocheck);
>
> will find an occurance of the 'badword' at the end of the string and
> replace it.
>
> Similarly,
>
>   $outstring = eregi_replace("^badword","goodword",$stringtocheck);
>
> will find an occurance of the 'badword' at the beginning of the string
> and replace it.
>
> Also,
>
>   $outstring = eregi_replace("badword","goodword",$stringtocheck);
>
> will find all occurances of 'badword' even if they are part of a longer
> not so bad word like 'badwordage' and replace it.
>
> Then,
>
>   $outstring = eregi_replace(" badword ","goodword",$stringtocheck);
>
> will help me isolate just the actual bad word, but not those at the
> beginning and end of a string or that end in a period or comma.
>
> So I could make a rule for each possible placement of badword in a string
> and then do this for each vulger term I try to filter.  Or I could just
> do...
>
>   $outstring = eregi_replace("/","goodword",$stringtocheck);
>
> Which should find any occurance of 'badword' and nothing more anywhere in
> the string.  It works in grep.  It works in bash.  It does not seem to
> work in PHP.
>
> Anybody know what I might be doing wrong?
>
> **
>
> John Huggins
> VANet
>
> [EMAIL PROTECTED]
> http://www.va.net/
>
> **
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] protect code or something like..

2002-06-14 Thread 1LT John W. Holmes

Kind of. You can have it include() or fopen() something from another server
and do whatever.

But you have to realize that the code is still open on their page, so they
can bypass or just comment out whatever you are trying to do.

Search the archives, too. Wasn't there a huge discussion on this a couple
months ago??

---John Holmes...

- Original Message -
From: "Rodrigo Peres" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 11:37 AM
Subject: [PHP] protect code or something like..


> Hi list,
>
> I have a project that was develop in a partnership, now this partners
> doesn't so partners anymore :-/
> My question is there's a way to create a protection that I can trace if
the
> software was installed in other servers?? I mean not hide the code, but
put
> an important include of the project in another server and generate a log
of
> the acess to it, or anything that can "tell me" who is installed and
running
> the system.
>
> Thank's
>
> Rodrigo
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] Passing variables from one page to another

2002-06-14 Thread 1LT John W. Holmes

Plain and simple...you have four options: COOKIE, GET, POST, SESSION.

So, load all of your data into a cookie or load it into hidden elements in a
form and submit it somewhere...

Okay?

---John Holmes...

- Original Message -
From: "Don" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 10:16 AM
Subject: [PHP] Passing variables from one page to another


Hi,

Does anyone have a PHP method of passing variables from a form to another
page without using "sessions" or encoding within the URL?

I remember someone mentioning a class but I lost the reference. My site uses
PHP 4.0.1Pl1

Thanks,
Don


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




Re: [PHP] XML Feed

2002-06-14 Thread Analysis & Solutions

On Fri, Jun 14, 2002 at 11:35:04PM +1000, Necro wrote:
> I am currently trying to implement XML Parsing on a site using the XML News
> Feed of another site. The site puts two versions of the news in its file
> though:
> 
> - 
>   Tsunami 2265 Date, Demo
>   http://www.shacknews.com/onearticle.x/20959
>   
> 
> - 
>   Tsunami 2265 Date, Demo
>   http://www.shacknews.com/onearticle.x/20959
>   General
>   

Man, that's REALLY bad XML.


> I have a script that is meant to parse the file which is downloaded to a
> local file hourly. The trouble is that the script tries parsing both lots
> and I only wish it to parse the top half and to stop when it reaches the
> entries using  tags.

I'd stop when it hits the ending  tag.

Take a look at http://www.analysisandsolutions.com/code/phpxml.htm.  For 
your case, in the EndHandler() function, put in the case 'ITEM'  In that 
case, have the code process the data you've accumulated and exit.


But, if you want to stick with your methodology, below, here's a 
possibility:


if ((filemtime($rdffile) < $refreshtime) || (filesize($rdffile) == 0)) {
   $RDF = fopen( $rdffile, 'w' ) or die( "Cannot open $rdffile" );
   $FILE = fopen( $remote, 'r' ) or die( "Cannot open $remote" );

   while (!feof( $FILE )) {
  $Line = fgets( $FILE, 1024 );
  fwrite( $RDF, $Line);
  if ( preg_match('/<\/item>/', $Line) ) {
 break;
  }
   }

   fclose( $RDF );
   fclose( $FILE );
}


-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Fast Templates to embed data into Flash files ?

2002-06-14 Thread Girish Nath

Hi

I'm about to start a project which involves building a 'website on a CD'.
There will be similar areas and layouts, just containing different data,
within the site pages. The pages will be a HTML framework containing Flash
and QuickTime files etc.

I've worked with Fast Templates and liked the technique used to separate
design and data and was wondering if anyone has filled content in Flash
files using a Fast Template type technique.

The final step would be to "freeze" the contents into static .swf files so
they can be cut to a CD (so basically the data needs to end up inside Flash
files)

I'm researching this option because it may save a lot of work in future if i
build other products on a similar theme.

Thanks


Girish
--
www.girishnath.co.uk



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




[PHP] Dreamweaver MX?

2002-06-14 Thread Lazor, Ed

Does Dreamweaver MX have good PHP support?

Thanks,

-Ed
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] Shut down server

2002-06-14 Thread Lazor, Ed

Could you restate this question?  Sorry, I don't understand what you're
asking.

> -Original Message-
> but the idea is another user only to start and shutdown the server.
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] Evaluation. Easy Question but I need some help

2002-06-14 Thread Dan McCullough

I'm trying to evaluate form submissions.  When I return a form submission cause of a 
missing field
I want the radio and checkboxes to reflect what the client submitted.  So if somone 
forgets to
fill in their address, but has done everything else fine, I dont want them to have to 
refill out
the form.

So how would I in PHP say if $var == "value1" then this radio button is checked?  And 
how do I do
it and keeping the code compact?

=

"Theres no such thing as a problem unless the servers are on fire!"


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: [PHP] Shut down server

2002-06-14 Thread Rosen

Hi,
I want to make server on Linux Red Hat 7.2 to shutdown from WEB interface.
A'll not have any access to this server. Server will not be connected to
Internet - it's local for organization. I want one men from them only to
turn on computer and to shutdown server via WEB interface without any
administrative rights on server.

I tried to shut down server with exex("/sbin/poweroff") but nothing
happened!
Can someone tell me how I could make shut down the server via PHP command or
executing Linux command?
Is it possible ?

Thanks,
Rosen


Ed Lazor <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Could you restate this question?  Sorry, I don't understand what you're
> asking.
>
> > -Original Message-
> > but the idea is another user only to start and shutdown the server.
>
>

> This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.



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




RE: [PHP] Evaluation. Easy Question but I need some help

2002-06-14 Thread Lazor, Ed


> So how would I in PHP say if $var == "value1" then this radio 
> button is checked?  And how do I do
> it and keeping the code compact?

 >

 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] Anyone have any experience with the EXEC function?

2002-06-14 Thread Batch

I am trying to exec a perl script from my php code.

Here is what I have:

exec("perlpath/perlscript.pl $var", $array)

The perl script runs fine as I am piping the results to a txt file also...so
I know that the script is running fine.  I am printing the result of the
perl script to STDOUT which is what is recommended in order to retrieve the
result of the perl script back into PHP through the $array variable set
above.

However in my php the $array is always empty?  After the perl script has run
I am doing this in PHP:
$error = $array[0];
echo "$error";

Is my syntax correct?  Any help is greatly appreciated.

Thank you,

Batch



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




Re: [PHP] Beginning /< and end of word /> in eregi_replace

2002-06-14 Thread John S. Huggins

On Fri, 14 Jun 2002, 1LT John W. Holmes wrote:

>-You have your answer, just use this:
>-
>-$outstring = eregi_replace("badword","goodword",$stringtocheck);
>-
>-It'll replace it whether it's at the beginning or end of a string, embedded
>-in a word, or by itself. Isn't that what you want?
>-

Not quite.  I want to replace words like "ass" and leave works like
"assumption" in place.

Actually, I did find the answer to the beginning and end of word regex
syntax.  It is.

  $outstring = \
  eregi_replace("[[:<:]]badword[[:>:]]","goodword",$stringtocheck);

This constrains the word and will only act if it is surrounded by
non-alpha characters.  It acts just like /< and />.  I found this answer
in the MySQL web page of all things...

  http://www.mysql.com/doc/R/e/Regexp.html

Thanks for your input.

John

>-Actually, it'd be better and faster to just use str_replace() instead of a
>-regular expression...
>-
>John Holmes...
>-
>-- Original Message -
>-From: "John S. Huggins" <[EMAIL PROTECTED]>
>-To: <[EMAIL PROTECTED]>
>-Sent: Friday, June 14, 2002 11:37 AM
>-Subject: [PHP] Beginning /< and end of word /> in eregi_replace
>-
>-
>->
>-> Can it be true that PHP does not implement the beginning and end of word
>-> syntax of regular expressions?
>->
>-> In builing a bad word filter, I find this...
>->
>->   $outstring = eregi_replace("badword$","goodword",$stringtocheck);
>->
>-> will find an occurance of the 'badword' at the end of the string and
>-> replace it.
>->
>-> Similarly,
>->
>->   $outstring = eregi_replace("^badword","goodword",$stringtocheck);
>->
>-> will find an occurance of the 'badword' at the beginning of the string
>-> and replace it.
>->
>-> Also,
>->
>->   $outstring = eregi_replace("badword","goodword",$stringtocheck);
>->
>-> will find all occurances of 'badword' even if they are part of a longer
>-> not so bad word like 'badwordage' and replace it.
>->
>-> Then,
>->
>->   $outstring = eregi_replace(" badword ","goodword",$stringtocheck);
>->
>-> will help me isolate just the actual bad word, but not those at the
>-> beginning and end of a string or that end in a period or comma.
>->
>-> So I could make a rule for each possible placement of badword in a string
>-> and then do this for each vulger term I try to filter.  Or I could just
>-> do...
>->
>->   $outstring = eregi_replace("/","goodword",$stringtocheck);
>->
>-> Which should find any occurance of 'badword' and nothing more anywhere in
>-> the string.  It works in grep.  It works in bash.  It does not seem to
>-> work in PHP.
>->
>-> Anybody know what I might be doing wrong?
>->
>-> **
>->
>-> John Huggins
>-> VANet
>->
>-> [EMAIL PROTECTED]
>-> http://www.va.net/
>->
>-> **
>->
>->
>-> --
>-> PHP General Mailing List (http://www.php.net/)
>-> To unsubscribe, visit: http://www.php.net/unsub.php
>->
>-
>-
>--- 
>-PHP General Mailing List (http://www.php.net/)
>-To unsubscribe, visit: http://www.php.net/unsub.php
>-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP] closing mysql connections

2002-06-14 Thread David McInnis

How necessary is this?  Don't connections close automatically after the
page finishes executing?  

What are the general rules for closing connections and freeing query
results?

David McInnis


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




Re: [PHP] Anyone have any experience with the EXEC function?

2002-06-14 Thread Jason Wong

On Saturday 15 June 2002 00:57, Batch wrote:
> I am trying to exec a perl script from my php code.
>
> Here is what I have:
>
> exec("perlpath/perlscript.pl $var", $array)

Using exec() like this would put the exit code of your perl script into $array 
-- which isn't what you want. Use shell_exec() or backticks:

$array = `perlpath/perlscript.pl $var`;

Note that $array is in fact a string and not an array!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You have all the characteristics of a popular politician: a horrible voice,
bad breeding, and a vulgar manner.
-- Aristophanes
*/


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




RE: [PHP] closing mysql connections

2002-06-14 Thread Lazor, Ed


> How necessary is this?  

Very.

> Don't connections close automatically after the page finishes executing?

Correct.  All variables are released and all connections are closed
automatically by PHP upon script completion.

> What are the general rules for closing connections and freeing query
> results?

General rule:  Thank PHP for taking care of it for you.

-Ed

 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re: [PHP] row pointer

2002-06-14 Thread Analysis & Solutions

Hey Zac:

On Fri, Jun 14, 2002 at 08:59:02AM +0100, Zac Hillier wrote:
> 
> I'm looking for a php function that will return the position of the pointer
> in a mysql recordset.

I don't think there is one.  You could use a counter variable as you're 
looping through each row to keep track of where you are.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] get_object_vars()

2002-06-14 Thread Analysis & Solutions

Hi Nick:

On Fri, Jun 14, 2002 at 12:02:45PM +0200, Nick Wilson wrote:
> 
> function destroy_properties($obj) {
> if($properties=get_object_vars($obj)) {
> foreach($properties as $key => $val) {
> unset($key);

Try this: unset($obj->$key);

> problem is, when I print($obj->property); I still get the value? What am
> I missing here?

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Regular expression newbie question, convert this: [::word1 \" word2 \" word3::] to : ".word1 " word2 " word3."

2002-06-14 Thread Analysis & Solutions

Lance:

On Fri, Jun 14, 2002 at 11:41:34PM +0800, Lance wrote:
> 
> [::word1 \" word2 \" word3::]
> to:
> ".word1 " word2 " word3."

While I don't know if this is really what you need, it does do exactly 
what you want to do in your example:

   $Replace['\\']  = '';
   $Replace['::']   = '.';
   $Replace['[']   = '';
   $Replace[']'] = '';

   $UserInput = '[::word1 \" word2 \" word3::]';

   echo strtr($UserInput, $Replace);

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] Dreamweaver MX?

2002-06-14 Thread John Holmes

Yes, download it and see. Gives you a GUI to program recordsets from the
database, and drag and drop for results. Other PHP stuff along with
highlighting built in. If it didn't cost so much, I'd recommend it.

---John Holmes...

> -Original Message-
> From: Lazor, Ed [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 12:39 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Dreamweaver MX?
> 
> Does Dreamweaver MX have good PHP support?
> 
> Thanks,
> 
> -Ed
> 
>

**
> **
> This message is intended for the sole use of the individual and entity
to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you
are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy,
disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please
immediately
> advise the sender by reply email and delete the message.  Thank you
very
> much.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] closing mysql connections

2002-06-14 Thread John Holmes

Use it in your code; it'd be a good programming habit to get into.

--John Holmes...

> -Original Message-
> From: David McInnis [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 12:57 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] closing mysql connections
> 
> How necessary is this?  Don't connections close automatically after
the
> page finishes executing?
> 
> What are the general rules for closing connections and freeing query
> results?
> 
> David McInnis
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Re: Dreamweaver MX?

2002-06-14 Thread Alexandru COSTIN

Hello

> Does Dreamweaver MX have good PHP support?
Their initial support (PHP_MySQL as known as a server model) is quite nice.
However, we have released PHAkt 2 MX (still free and GPL and kicking)
, with a lot of goodies included:

PHAkt 2 beta improvements over the PHP_MySQL Server Model
 - Multiple Database support (using ADOdb 2.0.0)
ADOdb improvements to correctly return data types
 - Unified Database Connection 
   The UltraDev and the PHP connection are now unified in a single 
connection using HTTP access.
 - User Authentication Server Behaviors
 - Master / Detail page set creation server behavior
 - Create Dynamic tables from RecordSets
 - Recordset Insert / Update Form
 - Go to related / detail page
 - Improved RecordSet (Using Limited Recordset for improved performance)
 - Code Reuse (Using functions.inc.php)
 - Small-Size generated files
   For example, an "Update Record" page has 26 lines of PHP code of 60 total 
lines

PHAkt 2 final new features
 - Date Locale support
 - Multiple and extensible recordset support
 - Other speed and usability improvements 

Even if the final version will be released in a week or two, 
we are confident that our server model is a very good improvement over the MM one.

Alexandru
> 
> Thanks,
> 
> -Ed
>  
> 

> This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.


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




RE: [PHP] row pointer

2002-06-14 Thread John Holmes

Keep track of it yourself as you loop through the data. Maybe if you
explained what you need "overall" then we could suggest a method...

---John Holmes...

> -Original Message-
> From: Zac Hillier [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 3:59 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] row pointer
> 
> Hi
> 
> I'm looking for a php function that will return the position of the
> pointer
> in a mysql recordset.
> 
> I found mysql_data_seek, but this appears to only move the pointer, I
need
> to get the equivalent row number for the pointer position before
moving
> it,
> then return to the same position.
> 
> Can anyone help?
> 
> Thanks
> 
> Zac
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Header URL question

2002-06-14 Thread Jay Blanchard

I wanted to return to a specific page in a small web app I am writing, which
is based on a variable for each individual record. I just tried

header("Location: customer.php?" . $btn . ""); exit;

and although syntactically correct it did not work. I am going to try a
couple of other things but I wanted to see if any of you had thoughts on
this.

HAGW!

Jay



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




RE: [PHP] Header URL question

2002-06-14 Thread Jay Blanchard

oops, never mind, I think I see the problem...a missing "btn="

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 12:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Header URL question


I wanted to return to a specific page in a small web app I am writing, which
is based on a variable for each individual record. I just tried

header("Location: customer.php?" . $btn . ""); exit;

and although syntactically correct it did not work. I am going to try a
couple of other things but I wanted to see if any of you had thoughts on
this.

HAGW!

Jay



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





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




[PHP] Variable Result is not displayed

2002-06-14 Thread J0s

Hi there,

To work on some scripts, I have install PHP 4.02 on a IIS 5.1 server.
(on my own XP machine)
I have setuped PHP following install.txt procedure.

When I try to run my scripts they works fine exept for the variables results
that are not displayed.
I have upload this script on my web site and all is working fine.
So I assume there is a misconfiguration on my PHP.ini or a missing extension
or .

Thanks for your help.

J0s




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




Re: [PHP] Dreamweaver MX?

2002-06-14 Thread Jas

It also has support for snippits, or a code library that you can add, edit
or delete.  Saves alot of time in re-using code.  I definately recommend it,
not only for that reason for but for the code debugging options available.
HTH
Jas

"John Holmes" <[EMAIL PROTECTED]> wrote in message
002101c213ca$36cfba20$b402a8c0@mango">news:002101c213ca$36cfba20$b402a8c0@mango...
> Yes, download it and see. Gives you a GUI to program recordsets from the
> database, and drag and drop for results. Other PHP stuff along with
> highlighting built in. If it didn't cost so much, I'd recommend it.
>
> ---John Holmes...
>
> > -Original Message-
> > From: Lazor, Ed [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 14, 2002 12:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Dreamweaver MX?
> >
> > Does Dreamweaver MX have good PHP support?
> >
> > Thanks,
> >
> > -Ed
> >
> >
> 
> **
> > **
> > This message is intended for the sole use of the individual and entity
> to
> > whom it is addressed, and may contain information that is privileged,
> > confidential and exempt from disclosure under applicable law.  If you
> are
> > not the intended addressee, nor authorized to receive for the intended
> > addressee, you are hereby notified that you may not use, copy,
> disclose or
> > distribute to anyone the message or any information contained in the
> > message.  If you have received this message in error, please
> immediately
> > advise the sender by reply email and delete the message.  Thank you
> very
> > much.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




RE: [PHP] Variable Result is not displayed

2002-06-14 Thread Lazor, Ed

Could you include some of your code?

> -Original Message-
> When I try to run my scripts they works fine exept for the 
> variables results
> that are not displayed.
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] Dreamweaver MX?

2002-06-14 Thread Lazor, Ed

Thanks everyone.  I'll check it out.

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

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] beginner in PHP

2002-06-14 Thread Phillip Perry

So how do I affect the local copies of the variables. The global() doesn't
seem to work. Should I take everything out of the function and just use if
statements?

-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 3:46 AM
To: [EMAIL PROTECTED]; Tim Ward; Martin Towell; Tom Rogers; Php
Subject: RE: [PHP] beginner in PHP


You're insetting the variables within the chout() function only This has no
effect on
the local copies as they are not in scope here. You have successfully
destroyed the
session so when you refresh they are unset.

What I do with sessions is keep them all within a session array so you can
then destroy
the session locally by unsetting that array. If I have a function that I
want to change session
variables at all I make it take the session in as a parameter and pass it
back as the return value.


Tim Ward

> -Original Message-
> From: Phillip Perry [SMTP:[EMAIL PROTECTED]]
> Sent: 13 June 2002 19:45
> To:   Tim Ward; Martin Towell; Tom Rogers; Php
> Subject:  RE: [PHP] beginner in PHP
>
> Yes, here is the checkout code I used...
>
> function chout(){
>   session_destroy();
>   unset ($mycart);
>   unset ($cart_items);
>   echo "Thank you for shopping!";
>   }
>
> Any suggestions?
>
> -Original Message-
> From: Tim Ward [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 4:18 AM
> To: Martin Towell; Tom Rogers; Php; Phillip Perry
> Subject: RE: [PHP] beginner in PHP
>
>
> From the symptoms it sounds like you're destroying the session okay but
> leaving the variables
> In the script. Are you sure you're unsetting them at the appropriate scope
> level.
>
> Tim Ward
> www.chessish.com 
>
>   --
>   From:  Phillip Perry [SMTP:[EMAIL PROTECTED]]
>   Sent:  13 June 2002 05:18
>   To:  Martin Towell; Tom Rogers; Php
>   Subject:  RE: [PHP] beginner in PHP
>
>   Thanks Martin!! That really helped out a lot. And thanks to all who
> tried to
>   help me. I appreciate it!
>
>   I have one other question that is really not so much important as it
> is
>   annoying, but I can't figure it out myself.
>
>   I'm practicing with sessions. What I'm making..if you couldn't tell
> by the
>   array output from before...is a test shopping cart. Now the
> annoyance is
>   that when I click the checkout link it's just supposed to destroy
> the
>   session and reset everything to 0 including the shopping cart. And
> also if
>   an item is clicked, that item gets deleted. With both choices when I
> click
>   once the session does get destroyed, but everything stays on the
> page until
>   I refresh the page. I want the info to get reset when I click the
> link.
>   Here's the delete and checkout code...remember they both do actually
> work,
>   just not as I want. Any suggestions on how to make it refresh on a
> click
>   only?
>
>   / DELETE SHOPPING CART ITEMS
>
>   function chout(){
>   session_destroy();
>   $mycart = array();
>   $cart_items = 0;
>   echo "Thank you for shopping!";
>   }
>
>   if ($action == delnow)
>   {
>   unset($mycart[$itemid]);
>   }
>
>   // END DELETE SHOPPING CART ITEMS
>
>   if ($action == checkout)
>   {
>   chout();
>   }
>
>   -Original Message-
>   From: Martin Towell [mailto:[EMAIL PROTECTED]]
>   Sent: Wednesday, June 12, 2002 11:55 PM
>   To: '[EMAIL PROTECTED]'; Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
>
>
>   here's the revised loop
>
>
>   $cat_cnt = count($catalog);
>   while (list($key,$value) = each($mycart))
>   {
> for ($j = 0; $j < $cat_cnt; $j++)
>   if ($value == $catalog[$j]["itemcd"])
>   {
> echo $catalog[$j]["unitprice"];
> break;
>   }
>   }
>
>
>   -Original Message-
>   From: Martin Towell [mailto:[EMAIL PROTECTED]]
>   Sent: Thursday, June 13, 2002 1:50 PM
>   To: '[EMAIL PROTECTED]'; Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
>
>
>   Ah! $catalog is a 2D array - any your if statement is expecting a 1D
>   array...
>
>   -Original Message-
>   From: Phillip Perry [mailto:[EMAIL PROTECTED]]
>   Sent: Thursday, June 13, 2002 1:52 PM
>   To: Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
>
>
>   I meant Martin :) sorry.
>
>   -Original Message-
>   From: Phillip Perry [mailto:[EMAIL PROTECTED]]
>   Sent: Wednesday, June 12, 2002 11:44 PM
>   To: Tom Rogers; Php
>   Subject: RE: [PHP] beginner in PHP
>
>
>   Array ( [0] => gerainiums [1] => roses [2] => roses [3] => roses [4]
> =>
>   roses [5] => roses 

[PHP] Re: Variable Result is not displayed

2002-06-14 Thread J0s

Here is an example of  the test script.

sample.php


Nota : The variable are passed throught a Flash form.

In this case, if the script is uploaded on my web site the result is :
Name Test works as a Web developper in Montreal. He/She can be contacted at
: My Web Site.

But on my own machine the result is :
works as a Web in. He/She can be contacted at :.



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




RE: [PHP] Re: Variable Result is not displayed

2002-06-14 Thread Lazor, Ed

make sure global variables are enabled in your php.ini

> -Original Message-
> From: J0s [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 11:52 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Variable Result is not displayed
> 
> 
> Here is an example of  the test script.
> 
> sample.php
>  
> $result=$who." works as a ".$what." in ".$where.". He/She can 
> be contacted
> at: ".$web.".";
> 
> print "&result=".$result;
> 
> print "&loading=NO";
> 
> ?>
> 
> Nota : The variable are passed throught a Flash form.
> 
> In this case, if the script is uploaded on my web site the result is :
> Name Test works as a Web developper in Montreal. He/She can 
> be contacted at
> : My Web Site.
> 
> But on my own machine the result is :
> works as a Web in. He/She can be contacted at :.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] XML and parameter entities

2002-06-14 Thread Pawel

Hello,

I'm having a hard time getting expat to parse parameter entities and I'm 
wondering if any one tried this before (general entities work fine)

sample xml:



%common_entities;
]>
.
-

as the name suggests, the file "00-entities-00" contains common general 
entities shared between multiple .xml's
Expat's external_entity_ref_handler doesn't catch parameter entities, but 
I'm not even sure it should.

How should I parse this ?


Any hints appreciated
Pawel

PS. php version 4.3.0-dev (cli) (yesterday's cvs)


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




Re: [PHP] Re: Variable Result is not displayed

2002-06-14 Thread J0s

Thanks a lot!
Ok this programm began to be interesting.
I will try to stop to be a Newbie.

: ))

"Ed Lazor" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> make sure global variables are enabled in your php.ini
>
> > -Original Message-
> > From: J0s [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 14, 2002 11:52 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Re: Variable Result is not displayed
> >
> >
> > Here is an example of  the test script.
> >
> > sample.php
> >  >
> > $result=$who." works as a ".$what." in ".$where.". He/She can
> > be contacted
> > at: ".$web.".";
> >
> > print "&result=".$result;
> >
> > print "&loading=NO";
> >
> > ?>
> >
> > Nota : The variable are passed throught a Flash form.
> >
> > In this case, if the script is uploaded on my web site the result is :
> > Name Test works as a Web developper in Montreal. He/She can
> > be contacted at
> > : My Web Site.
> >
> > But on my own machine the result is :
> > works as a Web in. He/She can be contacted at :.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>

> This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.



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




[PHP] Question about global variables

2002-06-14 Thread Don

Hi,

Don't know if this is possible but is there a way to create a single variable (in my 
case, a two dimensional array) that is global to my site?  This is regardless of which 
page is initially loaded BUT I need to have it empty first time in.

I am trying to implement a 'stack' feature where I can place/remove information 
into/out of the array.

Thanks,
Don


RE: [PHP] bulk mail()

2002-06-14 Thread Jeff Field

I've been doing the following sending personalized mail to 600+ recipients,
so far without any signs of discomfort anywhere:

set_time_limit($total_rows * 1);  // up the script timeout 1 second per
email

BTW, I use qmail; not sendmail.  As I've never used sendmail, I don't know
if this is part of your problem or not.  I'm guessing a bit, but based on
600+ emails, I'd say that the script itself takes about 10-15 seconds; the
mail to be delivered takes a bit longer, perhaps another minute or two.

Jeff

> -Original Message-
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 6:45 AM
> To: php
> Subject: [PHP] bulk mail()
>
>
> Hi all,
>
> I've got a mailing on a website, with email address' / names / etc in a
> MySQL table.
>
> I think there's around 120 on it at the moment.
>
> I've been noticing a growing lag on the sending of mail though...
> I've got a
> script which takes a message from a form, then runs a while loop
> through the
> rows of the mailing_list table, replacing a special string with the
> subscribers name, and sending using the mail() command.
>
> However, this time, the script actually failed, with a "failure when
> attempting to access blah.com/foo.php" (the sending script).  I
> have no idea
> if SOME people got the email, or what, and have no idea how to check.
>
> So, I make the assumption that as the mailing list has grown, the script
> time has slowed... now it's too big (or the server was too busy)
> to process
> all the emails before the script timed out.
>
>
> If I didn't want to personalise the emails, I'm sure the script
> would run a
> lot quicker with every address in the Bcc header, but since we personalise
> each email, I can't see any option other than using mail() 200
> times...  and
> it's only going to get a lot worse as we climb to 1000+.
>
> So, what options do I have?
>
> Break the mailing list up into batches of 40 or so?  How would I implement
> something like this?
>
>
> Any advice / concepts / ideas welcome!
>
>
> Justin French
> 
> Creative Director
> http://Indent.com.au
> 
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] Question about global variables

2002-06-14 Thread Kevin Stone

I don't think this is possible to setup a global way you're thinking, but I
do believe that you can still accomplish the effect you're looking for.
First of all, exactly what kind of information will you be storing in the
array?  You say it needs to be empty the 'first time in'.  Does that mean
per user?
-Kevin

- Original Message -
From: "Don" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 1:08 PM
Subject: [PHP] Question about global variables


Hi,

Don't know if this is possible but is there a way to create a single
variable (in my case, a two dimensional array) that is global to my site?
This is regardless of which page is initially loaded BUT I need to have it
empty first time in.

I am trying to implement a 'stack' feature where I can place/remove
information into/out of the array.

Thanks,
Don



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




RE: [PHP] bulk mail()

2002-06-14 Thread Pawel


> > -Original Message-
> > From: Justin French [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 12, 2002 6:45 AM
> > To: php
> > Subject: [PHP] bulk mail()
> >
> >
> > Hi all,
> >
> > I've got a mailing on a website, with email address' / names / etc in a
> > MySQL table.
> >
> > I think there's around 120 on it at the moment.
> >
> > I've been noticing a growing lag on the sending of mail though...
> > I've got a
> > script which takes a message from a form, then runs a while loop
> > through the
> > rows of the mailing_list table, replacing a special string with the
> > subscribers name, and sending using the mail() command.
> >

You're using something like mysql_fetch_array and not querying the db 120 
times I hope.

> > However, this time, the script actually failed, with a "failure when
> > attempting to access blah.com/foo.php" (the sending script).  I
> > have no idea
> > if SOME people got the email, or what, and have no idea how to check.>

go through the your MTA's logs (long and painful process)


> > So, I make the assumption that as the mailing list has grown, the script
> > time has slowed... now it's too big (or the server was too busy)
> > to process
> > all the emails before the script timed out.

The time your MTA takes to process the emails has nothing to do with this.
120 calls to mail() should not time out, maybe you have a complicated 
regexp for fixing that name in the emails
what's the body of your while() loop ?


> >
> > If I didn't want to personalise the emails, I'm sure the script
> > would run a
> > lot quicker with every address in the Bcc header, but since we personalise
> > each email, I can't see any option other than using mail() 200
> > times...  and
> > it's only going to get a lot worse as we climb to 1000+.
> >

putting 120 email addresses in one bcc will surely get your email 
classified as spam

> > So, what options do I have?
> >
> > Break the mailing list up into batches of 40 or so?  How would I implement
> > something like this?
> >

you could try adding a column in your db that will reflect the last time 
you've sent an email to that person. Then you could just append "LIMIT 40" 
to your select query, but updating the column requires a separate query (1 
update per email if you want to know exactly how got the email and who didn't)

Pawel


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




Re: [PHP] Question about global variables

2002-06-14 Thread remery

Cookies
Session variables
- Original Message - 
From: "Don" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 2:08 PM
Subject: [PHP] Question about global variables


Hi,

Don't know if this is possible but is there a way to create a single variable (in my 
case, a two dimensional array) that is global to my site?  This is regardless of which 
page is initially loaded BUT I need to have it empty first time in.

I am trying to implement a 'stack' feature where I can place/remove information 
into/out of the array.

Thanks,
Don



[PHP] Re: php server on Windows

2002-06-14 Thread Peter

You can run PHP as a module / extension for apache or let Apache load and
run the php.exe program for each php file.
Loading and running the program in quick succession strains the system
somewht but the extension is always loaded and is just used when needed -
much faster and efficient.


"Phil Schwarzmann" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> So I'm thinking about setting up a little php/mysql web server here at
> work and want to use Windows as my platform instead of Linux and have a
> couple questions...
>
> I know that PHP on Windows has some limitations as compared to Linux.
> What are these limitations?
>
> Which version of Windows would be best ?
>
> Is this gonna be a real pain in the ass to get PHP & MySQL & Apache &
> Windows to get along well?
>
> Can I use IIS instead of Apache ?
>
> Thanks!
>



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




[PHP] PHP Chat Program?

2002-06-14 Thread Devin Atencio


Dear PHP Users,

I have a client who currently has a website setup with iChat which
is several years old and we are currently having problems with it. I need
to find a PHP Chat program that will be very easy and simple. I just
wanted to see if anyone here has used a program and really likes
it and can recomment it ?

Devin Atencio

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




[PHP] 'CC' and 'BCC' in mail function

2002-06-14 Thread Sridhar Moparthy

Hi All,

Does any one know how to make mail() function to send mail to 'CC' and 'BCC'
address. I have tried to keep 'CC' and BCC' in header, but it is not
working. Mail function is sending the message to 'To' address but not to
'CC' and 'BCC'.

I am using WinNT, IIS and PHP 4.0.6.

Here is the part of my code.

$to = $HTTP_POST_VARS["to_address"];
$from = $HTTP_POST_VARS["from_address"];
$cc = $HTTP_POST_VARS["cc_address"];
$bcc = $HTTP_POST_VARS["bcc_address"];
$subject = $HTTP_POST_VARS["subject"];
$message = $HTTP_POST_VARS["message"];
$header .= "From: [EMAIL PROTECTED]\r\n";

if ($cc <> "" )
{
$header .= "Cc: ".$cc."\r\n";
}

if  ($bcc <> "")
{
$header .= "Bcc: ".$bcc."\r\n";
}

if ($to <>"")
{
if (mail($to,$subject,$message,$header))
{
// Do some thing
}
else
{
// Do some thing else
}
}


-Original Message-
From: Devin Atencio [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 5:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Chat Program?



Dear PHP Users,

I have a client who currently has a website setup with iChat which
is several years old and we are currently having problems with it. I need
to find a PHP Chat program that will be very easy and simple. I just
wanted to see if anyone here has used a program and really likes
it and can recomment it ?

Devin Atencio

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


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




[PHP] PHP Installation Win98/Apache error....

2002-06-14 Thread Phil Schwarzmann

So I'm trying to install PHP on win98 with Apache2.
 
I got these nice instructions from...
 
http://www.webmasterbase.com/article.php?pid=30&aid=525
 
After I make the following addition to my httpd.conf file, I get an
error when I try to start Apache again...
 
ADDITION TO HTTPD.CONF:
LoadModule php4_module c:/php/sapi/php4apache.dll

ERROR WHEN STARTING APACHE:
Cannot load c:/php/sapi/php4apache.dll into server: One of the library
ilfes needed to run this application cannot be found.
 
...I checked in the sapi directory and php4apache.dll is indeed in
there.
 
One other thing - One part of the instructions said to do this...
 
Find the file called php4ts.dll in the PHP folder and copy it to the
System32 subfolder of your Windows folder (e.g. C:\Windows\System32).
 
Well, there is no php4ts.dll file anywhere on my PC.  There is however
a php4ts.lib file.  Maybe this has something to do with it?  
 
Thanks for your help!!!





RE: [PHP] PHP Installation Win98/Apache error....

2002-06-14 Thread Lazor, Ed

You missed a step in copying DLLs.  I don't remember which one, but it's the
dll files found in
c:\php 



> -Original Message-
> From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 2:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP Installation Win98/Apache error
> 
> 
> So I'm trying to install PHP on win98 with Apache2.
>  
> I got these nice instructions from...
>  
> http://www.webmasterbase.com/article.php?pid=30&aid=525
>  
> After I make the following addition to my httpd.conf file, I get an
> error when I try to start Apache again...
>  
> ADDITION TO HTTPD.CONF:
> LoadModule php4_module c:/php/sapi/php4apache.dll
> 
> ERROR WHEN STARTING APACHE:
> Cannot load c:/php/sapi/php4apache.dll into server: One of the library
> ilfes needed to run this application cannot be found.
>  
> ...I checked in the sapi directory and php4apache.dll is indeed in
> there.
>  
> One other thing - One part of the instructions said to do this...
>  
> Find the file called php4ts.dll in the PHP folder and copy it to the
> System32 subfolder of your Windows folder (e.g. C:\Windows\System32).
>  
> Well, there is no php4ts.dll file anywhere on my PC.  There is however
> a php4ts.lib file.  Maybe this has something to do with it?  
>  
> Thanks for your help!!!
> 
> 
> 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




[PHP] ucwords() usage QUICKIE

2002-06-14 Thread Daniel Negron/KBE

Hi All,

 I am trying to figure out how to use ucwords here :
if (submit)
$db = mysql_connect($dbhost,$dbuname,$dbpass);
  mysql_select_db($dbname,$db);
  ucwords($sql)  <  Is this correct ?
  $sql = "INSERT INTO $prefix";
  $sql .= "(first, last, email, company, address, city, state, zip,
phone, fax, mobile, comments)";
  $sql .= "VALUES";
  $sql .= "('$first', '$last', '$email', '$company', '$address',
'$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')";
also can you do this @ field level ?


Danny


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




RE: [PHP] ucwords() usage QUICKIE

2002-06-14 Thread Lazor, Ed

Looks like it, but you're missing the semi-colon at the end of the line.

> -Original Message-
> From: Daniel Negron/KBE [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 2:06 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] ucwords() usage QUICKIE
> 
> 
> Hi All,
> 
>  I am trying to figure out how to use ucwords here :
> if (submit)
> $db = mysql_connect($dbhost,$dbuname,$dbpass);
>   mysql_select_db($dbname,$db);
>   ucwords($sql)  <  Is this correct ?
>   $sql = "INSERT INTO $prefix";
>   $sql .= "(first, last, email, company, address, 
> city, state, zip,
> phone, fax, mobile, comments)";
>   $sql .= "VALUES";
>   $sql .= "('$first', '$last', '$email', '$company', 
> '$address',
> '$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')";
> also can you do this @ field level ?
> 
> 
> Danny
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




Re: [PHP] ucwords() usage QUICKIE

2002-06-14 Thread Julie Meloni

DNK>  I am trying to figure out how to use ucwords here :
DNK> if (submit)
DNK> $db = mysql_connect($dbhost,$dbuname,$dbpass);
DNK>   mysql_select_db($dbname,$db);
DNK>   ucwords($sql)  <  Is this correct ?
DNK>   $sql = "INSERT INTO $prefix";
DNK>   $sql .= "(first, last, email, company, address, city, state, zip,
DNK> phone, fax, mobile, comments)";
DNK>   $sql .= "VALUES";
DNK>   $sql .= "('$first', '$last', '$email', '$company', '$address',
DNK> '$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')";
DNK> also can you do this @ field level ?

Currently, you are ucwords-ing an empty string.  That being said, I'm
not sure what you are trying to do anyway. ucwords() upper-cases the first letter of 
words in a string.
(http://www.php.net/manual/en/function.ucwords.php)

such as:

$string = "this is a test";
$newstring = ucwords($string);
echo $newstring // This Is A Test


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP] ucwords() usage QUICKIE

2002-06-14 Thread 1LT John W. Holmes

You pass a string to the function and it returns a string with each word
starting with an uppercase.

$string = "hello world";

$new_string = ucwords($string);

echo $new_string; // Displays 'Hello World'

---John Holmes...

- Original Message -
From: "Daniel Negron/KBE" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 5:06 PM
Subject: [PHP] ucwords() usage QUICKIE


> Hi All,
>
>  I am trying to figure out how to use ucwords here :
> if (submit)
> $db = mysql_connect($dbhost,$dbuname,$dbpass);
>   mysql_select_db($dbname,$db);
>   ucwords($sql)  <  Is this correct ?
>   $sql = "INSERT INTO $prefix";
>   $sql .= "(first, last, email, company, address, city, state,
zip,
> phone, fax, mobile, comments)";
>   $sql .= "VALUES";
>   $sql .= "('$first', '$last', '$email', '$company', '$address',
> '$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')";
> also can you do this @ field level ?
>
>
> Danny
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] 'CC' and 'BCC' in mail function

2002-06-14 Thread Richard Baskett

Take a look at http://www.php.net/manual/en/function.mail.php#AEN39855 for
ways of doing complex mails.. You can indeed do CC's and BCC's you just add
them in the header area.  Study the example, it works beautifully and will
do everything you stated.

Plus there are classes out there that will allow you to do everything you
could possibly ever want to do with email.. So take a look on google if you
want to get into multi part messages, attachments, html, etc etc.

Cheers!

Rick

Don't dismiss a good idea simply because you don't like the source. -
Unknown


> From: Stuart Dallas <[EMAIL PROTECTED]>
> Organization: SharedServer.net
> Reply-To: Stuart Dallas <[EMAIL PROTECTED]>
> Date: Fri, 14 Jun 2002 22:14:35 +0100
> To: [EMAIL PROTECTED], [EMAIL PROTECTED]
> Subject: Re: [PHP] 'CC' and 'BCC' in mail function
> 
> On Friday, June 14, 2002 at 10:01:24 PM, Sridhar Moparthy wrote:
>> Does any one know how to make mail() function to send mail to 'CC' and 'BCC'
>> address. I have tried to keep 'CC' and BCC' in header, but it is not
>> working. Mail function is sending the message to 'To' address but not to
>> 'CC' and 'BCC'.
> > if (mail($to,$subject,$message,$header))
> 
> 
> The mail function sends the message to the addresses in the first parameter,
> so
> you need to specify all the users you want the message to go to in $to.
> 
> PS. I (and I'm sure there are others) would prefer it if you could create a
> new
> thread for a new topic. It makes things a lot easier to follow.
> 
> -- 
> Stuart
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




[PHP] Sessions... wtf is wrong?!

2002-06-14 Thread Rick Kukiela

Okay, I was running php 4.1.2 on freebsd 4.5 with the build
args --with-mysql --enable-track-vars and --with-apxs... I started
implimenting session code. When my code wouldnt work I looked on the boards
and found that there was a bug with that version, so i wiped out php and
upgraded to php 4.2.1. Using the default php.ini file and the example code
given off the website for sessions I get the folowing error:

Warning: Failed to write session data (files). Please verify that the
current setting of session.save_path is correct (/tmp) in Unknown on line 0

just so you all know, /tmp is drwxrwxrwt and is owned by root.wheel.

I double check after the script. No session data has been written. I tried
changing the save path to /usr/local/apache/sessions and then gave that
folder 777 and made it owned by nobody... Same error accept its changed to
reflect the new save path instead of /tmp... either way its broke and I need
it working very badly. Im sick of ripping my hair out. Can anyone help me?
please?!?


Rick


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




Re: [PHP] Sessions... wtf is wrong?!

2002-06-14 Thread Rick Kukiela

This is an ls -la from /tmp

[rick@wacky /tmp]$ ls -la
total 58
drwxrwxrwt3 root wheel 512 Jun 14 14:20 .
drwxr-xr-x   22 root wheel1024 Jun 13 16:39 ..
drwxr-xr-x2 root wheel 512 Apr 29 14:43 .webmin
-rw-rw-rw-1 root wheel   46193 Jun 11 14:11 1hz2b
-rw-rw-rw-1 root wheel2539 Jun 11 14:11 21hz2b
-rw---1 root wheel 126 Apr 25 14:28 EdP.amKqAY
srwxrwxrwx1 mysqlwheel   0 Jun 14 14:20 mysql.sock
-rw---1 root wheel   0 Apr 26 03:01 periodic.NCNBF4riSi

- Original Message -
From: "Lazor, Ed" <[EMAIL PROTECTED]>
To: "'Rick Kukiela'" <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 4:44 PM
Subject: RE: [PHP] Sessions... wtf is wrong?!


> Are there read only files in that directory that are blocking things?
>
> > -Original Message-
> > From: Rick Kukiela [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 14, 2002 2:41 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Sessions... wtf is wrong?!
> >
> >
> > Okay, I was running php 4.1.2 on freebsd 4.5 with the build
> > args --with-mysql --enable-track-vars and --with-apxs... I started
> > implimenting session code. When my code wouldnt work I looked
> > on the boards
> > and found that there was a bug with that version, so i wiped
> > out php and
> > upgraded to php 4.2.1. Using the default php.ini file and the
> > example code
> > given off the website for sessions I get the folowing error:
> >
> > Warning: Failed to write session data (files). Please verify that the
> > current setting of session.save_path is correct (/tmp) in
> > Unknown on line 0
> >
> > just so you all know, /tmp is drwxrwxrwt and is owned by root.wheel.
> >
> > I double check after the script. No session data has been
> > written. I tried
> > changing the save path to /usr/local/apache/sessions and then
> > gave that
> > folder 777 and made it owned by nobody... Same error accept
> > its changed to
> > reflect the new save path instead of /tmp... either way its
> > broke and I need
> > it working very badly. Im sick of ripping my hair out. Can
> > anyone help me?
> > please?!?
> >
> >
> > Rick
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>

> This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.
>


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




Re: [PHP] Editor

2002-06-14 Thread Chris Bunting

PHP Editors List...

http://www.itworks.demon.co.uk/phpeditors.htm

Check out http://www.php.net

The links section is handy at times...


Chris

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


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




Re: [PHP] row pointer

2002-06-14 Thread Zac Hillier

John, Dan & All,

Thanks for your response, perhaps if I tell you more of the story then it'll
make more sense. I'm afraid I seem to have an ability for asking cryptic
questions.

Below is the code I'm using, it is meant to check for a list of between 10
and 50 words in a table then return the key of the words found, for the
words not in the table they should be added to the table.

It seems to work fine, but in a effort to make the code more efficient I
realised that at present I'm walking through a lot of the recordset for each
keyword. But that the majority of the recordset would be in the same order
as the keywords. So if I can add a little extra code that says if the next
record in the recordset is not the word I'm trying to find then walk through
the recordset, if you reach the end then start at the beginning and go
down-to the initial row. This should confirm that the word is not in the
recordset and so needs to be added, but leave the recordset in the correct
place to check the next word.

However to do this I thought initialy I would need to identify the row the
recordset was presently at. However now I understand I need to push the
recordset into an array then use this array to loop through finding the
key's and the words that need to be added. However saying it and coding it
seem to be two completely different things, can anyone help me getting
started? Hope this makes some sense? If you have any other comments on the
code to improve it or good coding practice I would appreciate your comments
as I'm still new to this.

Thanks

Zac

Code:

#--create select statement for getting keywords from table
$fndWrds = '';
foreach($kywrd as $val) {
 $fndWrds .= "wrd = '$val' OR ";
}

#-- add test word to get a result regardless
$fndWrds .= "wrd = 'test'";

#-- get present keywords from db
$dbKy = mysql_query("SELECT ky, wrd FROM ".$site_no."kywrdInd WHERE
$fndWrds;");

#--create kywrd index array for index to be used in update value list
$indx = array();

#--create update value lists to later add record into lookup table
$vlst = '';

foreach($kywrd as $key => $val) {
 $fnd = 0;
 While ($kyRw = mysql_fetch_array($dbKy)) {
  if($kyRw['wrd'] == $val) {
   $fnd = 1;
   $indx[$key] = $kyRw['ky'];
   break 1;
  }
 }
 #-- reset pointer of db array back to begining
 mysql_data_seek($dbKy, 0);

 #-- if not in db then add word to db then set index
 if($fnd == 0) {
  if(! mysql_query("INSERT INTO ".$site_no."kywrdInd (wrd) values
('".$val."');")) echo 'Word not added';
  $indx[$key] = mysql_insert_id();
 }

 #-- check to see that each word has an index value
 if($indx[$key]) {
  #--create value list for update into lookup table
  $vlst .= "($compID," . $indx[$key] . "," . $scr[$key] . "), ";
 } else {
  echo 'no index set for keyword, word = '.$val.' index = '.$key.'';
 }


- Original Message -
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'Zac Hillier'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 6:42 PM
Subject: RE: [PHP] row pointer


> Keep track of it yourself as you loop through the data. Maybe if you
> explained what you need "overall" then we could suggest a method...
>
> ---John Holmes...
>
> > -Original Message-
> > From: Zac Hillier [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 14, 2002 3:59 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] row pointer
> >
> > Hi
> >
> > I'm looking for a php function that will return the position of the
> > pointer
> > in a mysql recordset.
> >
> > I found mysql_data_seek, but this appears to only move the pointer, I
> need
> > to get the equivalent row number for the pointer position before
> moving
> > it,
> > then return to the same position.
> >
> > Can anyone help?
> >
> > Thanks
> >
> > Zac
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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




Re: [PHP] row pointer

2002-06-14 Thread 1LT John W. Holmes

So you just want to insert a bunch of words into the table if they aren't
there already? Why not make the column unique and just insert them. Ignore
the warnings about duplicates...

---John Holmes...

- Original Message -
From: "Zac Hillier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Analysis & Solutions"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 5:54 PM
Subject: Re: [PHP] row pointer


> John, Dan & All,
>
> Thanks for your response, perhaps if I tell you more of the story then
it'll
> make more sense. I'm afraid I seem to have an ability for asking cryptic
> questions.
>
> Below is the code I'm using, it is meant to check for a list of between 10
> and 50 words in a table then return the key of the words found, for the
> words not in the table they should be added to the table.
>
> It seems to work fine, but in a effort to make the code more efficient I
> realised that at present I'm walking through a lot of the recordset for
each
> keyword. But that the majority of the recordset would be in the same order
> as the keywords. So if I can add a little extra code that says if the next
> record in the recordset is not the word I'm trying to find then walk
through
> the recordset, if you reach the end then start at the beginning and go
> down-to the initial row. This should confirm that the word is not in the
> recordset and so needs to be added, but leave the recordset in the correct
> place to check the next word.
>
> However to do this I thought initialy I would need to identify the row the
> recordset was presently at. However now I understand I need to push the
> recordset into an array then use this array to loop through finding the
> key's and the words that need to be added. However saying it and coding it
> seem to be two completely different things, can anyone help me getting
> started? Hope this makes some sense? If you have any other comments on the
> code to improve it or good coding practice I would appreciate your
comments
> as I'm still new to this.
>
> Thanks
>
> Zac
>
> Code:
>
> #--create select statement for getting keywords from table
> $fndWrds = '';
> foreach($kywrd as $val) {
>  $fndWrds .= "wrd = '$val' OR ";
> }
>
> #-- add test word to get a result regardless
> $fndWrds .= "wrd = 'test'";
>
> #-- get present keywords from db
> $dbKy = mysql_query("SELECT ky, wrd FROM ".$site_no."kywrdInd WHERE
> $fndWrds;");
>
> #--create kywrd index array for index to be used in update value list
> $indx = array();
>
> #--create update value lists to later add record into lookup table
> $vlst = '';
>
> foreach($kywrd as $key => $val) {
>  $fnd = 0;
>  While ($kyRw = mysql_fetch_array($dbKy)) {
>   if($kyRw['wrd'] == $val) {
>$fnd = 1;
>$indx[$key] = $kyRw['ky'];
>break 1;
>   }
>  }
>  #-- reset pointer of db array back to begining
>  mysql_data_seek($dbKy, 0);
>
>  #-- if not in db then add word to db then set index
>  if($fnd == 0) {
>   if(! mysql_query("INSERT INTO ".$site_no."kywrdInd (wrd) values
> ('".$val."');")) echo 'Word not added';
>   $indx[$key] = mysql_insert_id();
>  }
>
>  #-- check to see that each word has an index value
>  if($indx[$key]) {
>   #--create value list for update into lookup table
>   $vlst .= "($compID," . $indx[$key] . "," . $scr[$key] . "), ";
>  } else {
>   echo 'no index set for keyword, word = '.$val.' index = '.$key.'';
>  }
>
>
> - Original Message -
> From: "John Holmes" <[EMAIL PROTECTED]>
> To: "'Zac Hillier'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, June 14, 2002 6:42 PM
> Subject: RE: [PHP] row pointer
>
>
> > Keep track of it yourself as you loop through the data. Maybe if you
> > explained what you need "overall" then we could suggest a method...
> >
> > ---John Holmes...
> >
> > > -Original Message-
> > > From: Zac Hillier [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, June 14, 2002 3:59 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] row pointer
> > >
> > > Hi
> > >
> > > I'm looking for a php function that will return the position of the
> > > pointer
> > > in a mysql recordset.
> > >
> > > I found mysql_data_seek, but this appears to only move the pointer, I
> > need
> > > to get the equivalent row number for the pointer position before
> > moving
> > > it,
> > > then return to the same position.
> > >
> > > Can anyone help?
> > >
> > > Thanks
> > >
> > > Zac
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>


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




[PHP] search parse?

2002-06-14 Thread Lazor, Ed

Does anyone have a good function for parsing a search string into SQL?  I
know it will depend on the name of the field and table I'm searching
through.  Anything close will be helpful.  An example search string would
be:

beer AND pizza NOT anchovies

and the resulting search string would be

select ID, Title from Products where Title like '%beer%' AND Title like
'%pizza%' AND Title NOT LIKE '%anchovies%';


Another example search string would be:

beer OR pizza AND movies

Thanks! =)

-Ed

 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




  1   2   >