[PHP] Multiply - seemed to be so very easy

2002-11-11 Thread Tomasz Ciesielski
Hi. That's my problem: 
class MYCLASS { 
var $z = array(); 
function addOne($PRODUCT_ID,$IL,$PR) { 
$this-z[$PRODUCT_ID]=array(IL = $IL, 
PR = $PR); 
} 
function myPrice() { 
$cn = 0.0; 
reset($this-z); 
while (list($id,$vals) = each($this-z)) { 
problem here! - $cn=$cn + $vals[PR]*$vals[IL]; 
} 
reset($this-z); 
return $cn; 
} 
} 

Example to above: 
$this-z[1] = array (IL = 1, PR = 634.4); 
then function myPrice() counts $cn as 634 (not as 634.4)!!! 
It works like that even when I convert $vals[PR] and $vals
[IL] to floats. 

What's the problem?!?! 

Thank's for any help :) 


---
Prawdziwe okazje nie zdarzaj si czsto!
Zobacz pen ofert!  http://zakupy.wp.pl 



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




Re: [PHP] h/1 tag

2002-11-11 Thread Hugh Danaher
John, 
Google search turned up nada.  Perhaps it's just a typo.
Hugh
- Original Message - 
From: @ Edwin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, November 10, 2002 11:08 PM
Subject: Re: [PHP] h/1 tag


 
 John Meyer [EMAIL PROTECTED] wrote:
 
  I'm doing some PHP work, and I've come across the h/1 tag.  What,
 exactly,
  is this?
 
 Could be a new tag--M$ Frontpage style :)
 
 Anyway, what does it do? It may not even be a tag--perhaps a secret
 code...
 
 - E
 
 
 -- 
 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] SELECT MULTIPLE...

2002-11-11 Thread Bsantos PHP
Hello:

I'm building an internal messaging system for small biz companies and I
can't really go longer

Problem is, I use some fields to make the message form and one of them must
be a select multiple form element wich refers to messaging persons. This is
my form:

table
tr
 td height=15 valign=topP class=P1Para:/P/td
 td
  SELECT NAME=receptor[] size=6 multiple
  ?
  //Legenda: eu - significa eusers || pu - significa preparar lista de
utilizadores
  $eu_pu_result = mysql_query(SELECT u.name, u.email FROM users u);
  while ($eu_pu = mysql_fetch_row($eu_pu_result)) {
   for ($i=0;$i1;$i++) {
echooption$eu_pu[0];
   }
  }
  ?
  /select
 /td
/tr
tr
 td height=15 valign=topP class=P1Prioridade:/P/td
 td
  select name=priority
   option value=MínimaMínima/option
   option SELECTED value=NormalNormal/option
   option value=PrioritáriaPrioritária/option
   option value=UrgenteUrgente/option
  /select
 /td
/tr
tr
 td height=15 valign=topP class=P1Assunto:/P/td
 tdinput type=text name=title size=66 value=? pv($frm[title])
?/td
/tr
tr
 td height=15 valign=topP class=P1Descrição:/P/td
 tdtextarea name=description cols=50 rows=8?
pv($frm[description]) ?/textarea/td
/tr
tr
 tdnbsp;!--EmptyCellContent--/td
 tdinput type=submit value=?=$frm[submit_caption] ?/td
/tr
   /table

After this, the page should reload on submit, but I keep getting the
warning:

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: categories in
c:/apache/htdocs/sites/mail/admin/eusers.php on line 120

All but the last, I think they appear because then page reloaded can't see
any more the array of people (select form).

But... How can I solve the problem?

This is the file that is the page itself, as above in the warnings, called
by:eusers.php:

?
/***
***
 * FUNCTIONS


*/

function print_add_product_form($category_id = 0) {
/* print a blank product form so we can add a new product */

 global $mfi, $ME;

 /* set default values for the reset of the fields */
 $frm[categories] = array($category_id);
 $frm[newmode] = insert;
 $frm[receptor] = ;
 $frm[recipient] = ;
 $frm[priority] = ;
 $frm[title] = ;
 $frm[description] = ;
 $frm[on_special] = ;
 $frm[submit_caption] = Enviar;

 /* build the categories listbox options, preselect the top item */
 build_category_tree($category_options, $frm[categories]);

 include(templates/eusers_form.php);
}

function print_edit_product_form($id) {
/* print a product form so we can edit the selected product */

 global $mfi, $ME;

 /* load up the information for the product */
 $qid = db_query(
 SELECT receptor, recipient, priority, title, description, stage, on_special
 FROM products
 WHERE id = $id
 );
 $frm = db_fetch_array($qid);

 /* load up the categories for the product */
 $qid = db_query(
 SELECT category_id
 FROM products_categories
 WHERE product_id = $id
 );

 $frm[categories] = array();
 while ($cat = db_fetch_object($qid)) {
  $frm[categories][] = $cat-category_id;
 }

 /* set values for the form */
 $frm[newmode] = update;
 $frm[submit_caption] = Enviar;

 /* build the categories listbox options, preselect the selected item */
 build_category_tree($category_options, $frm[categories]);

 include(templates/eusers_edit_form.php);
}

function delete_product($id) {
/* delete the product specified by $id, we have to delete the product and
then
 * the appropriate entries from the products_categories table.  this should
be
 * wrapped inside a transaction, unfortunately MySQL currently does not
support
 * transactions. */

 global $mfi, $ME;

 /* load up the information for the product */
 $qid = db_query(
 SELECT title
 FROM products
 WHERE id = $id
 );
 $prod = db_fetch_object($qid);

 /* delete this product */
 $qid = db_query(
 DELETE FROM products
 WHERE id = $id
 );

 /* delete this product from the products_categories table */
 $qid = db_query(
 DELETE FROM products_categories
 WHERE product_id = $id
 );

 include(templates/eusers_deleted.php);
}

function insert_product($id, $frm) {
/* add a new subproduct under the parent $id.  all the fields that we want
are
 * going to in the variable $frm */

 global $mfi, $ME;

 $on_special = checked($frm[on_special]);

 /* add the product into the products 

Re: [PHP] Submit hitting enter problem

2002-11-11 Thread Richard Allsebrook
One point nobody seems to have raised about why its important to quote
attribute values ...

?
$Value=foo bar;
echo INPUT type=text value=$Value;
?

will produce the following code in the browser

INPUT type=text value=foo bar

and renders in the browser (testing in ie6) as a text box containing only
the word foo

(The browser sets the value to foo and things bar is an unknown attribute so
correctly ignores it)

quoting the attribute value fixes it

?
$Value=foo bar;
echo INPUT type='text' value='$Value'
?

produces

INPUT type='text' value='foo bar'

Jason Wong [EMAIL PROTECTED] wrote in message
news:20021233.17744.php-general;gremlins.com.hk...
 On Monday 11 November 2002 10:44, rija wrote:
  What am I missing?
 
  My form does not submit when I hit enter in the text box.
  I do something approximately like this :
 
  form action=index.php?s=add method=post
  
  input type=text name=bongabe value=something
  ...
  input type=submit value=submit name=submit
 

 What happens when ENTER is pressed depends on what browser you're using.
 Different browsers exhibit different behaviours, eg the old versions of
 Netscape (v4 and before) does not submit on ENTER. Also, put quotes around
 your attribute values eg:

 input type=text name=bongabe value=something

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

 /*
 The more I know men the more I like my horse.
 */




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




Re: [PHP] SELECT MULTIPLE...

2002-11-11 Thread Jason Wong
On Monday 11 November 2002 17:51, Bsantos PHP wrote:
 Hello:

 I'm building an internal messaging system for small biz companies and I
 can't really go longer

 Problem is, I use some fields to make the message form and one of them must
 be a select multiple form element wich refers to messaging persons. This
 is my form:


[snip]

 After this, the page should reload on submit, but I keep getting the
 warning:

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: categories in
 c:/apache/htdocs/sites/mail/admin/eusers.php on line 120

Which is line 110 and line 120? 

I'm certainly not going to count the lines in your code to see which lines 
they refer to. 

If you want people to help you, you should make it easier for them to do so by 
indicating which lines are being referred to as 110  120.

 All but the last, I think they appear because then page reloaded can't see
 any more the array of people (select form).

Well, try using print_r() on all your important variables at strategic places 
in your code to see that they contain what you expect them to contain.

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

/*
Utility is when you have one telephone, luxury is when you have two,
opulence is when you have three -- and paradise is when you have none.
-- Doug Larson
*/


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




Re: [PHP] Submit hitting enter problem

2002-11-11 Thread Jason Wong
On Monday 11 November 2002 17:59, Richard Allsebrook wrote:
 One point nobody seems to have raised about why its important to quote
 attribute values ...

 ?
 $Value=foo bar;
 echo INPUT type=text value=$Value;
 ?

 will produce the following code in the browser

 INPUT type=text value=foo bar

 and renders in the browser (testing in ie6) as a text box containing only
 the word foo

 (The browser sets the value to foo and things bar is an unknown attribute
 so correctly ignores it)

 quoting the attribute value fixes it

 ?
 $Value=foo bar;
 echo INPUT type='text' value='$Value'
 ?

 produces

 INPUT type='text' value='foo bar'

The OP is aware of this and has pointed it out :)

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

/*
Start every day off with a smile and get it over with.
-- W.C. Fields
*/


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




Re: [PHP] Multiply - seemed to be so very easy

2002-11-11 Thread Jason Wong
On Monday 11 November 2002 17:20, Tomasz Ciesielski wrote:
 Hi. That's my problem:
 class MYCLASS {
 var $z = array();
 function addOne($PRODUCT_ID,$IL,$PR) {
 $this-z[$PRODUCT_ID]=array(IL = $IL,
 PR = $PR);
 }
 function myPrice() {
 $cn = 0.0;
 reset($this-z);
 while (list($id,$vals) = each($this-z)) {
 problem here! - $cn=$cn + $vals[PR]*$vals[IL];

Be creative! 

- Use print() on $vals[PR] and $vals[IL] to see what they contain
- assign them to temp variables, then assign their multiplied value to a third 
temp variable, then print() all three.
- you get the idea.

 }
 reset($this-z);
 return $cn;
 }
 }

 Example to above:
 $this-z[1] = array (IL = 1, PR = 634.4);
 then function myPrice() counts $cn as 634 (not as 634.4)!!!
 It works like that even when I convert $vals[PR] and $vals
 [IL] to floats.

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

/*
Bilbo's First Law:
You cannot count friends that are all packed up in barrels.
*/


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




Re: [PHP] SELECT MULTIPLE...

2002-11-11 Thread Bsantos PHP
Sorry People:

I really forget that:

Line 110:

VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]', '$frm[title]',
'$frm[description]', now(), '$on_special')

which makes part of:

if (!isset ($receptor[])) {
  $receptor[] = {0,0,0,0,0,0};
 } else {
 }
 for ($i=0;$i6;$i++) {
   $qid = db_query(
INSERT INTO products (receptor, recipient, priority, title, description,
date_added, on_special)
VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]', '$frm[title]',
'$frm[description]', now(), '$on_special')
   );
 }

Line 120:

for ($i = 0; $i  count($frm[categories]); $i++) {

which makes part of:

$product_id = db_insert_id();

 /* add this product under the specified categories */
 for ($i = 0; $i  count($frm[categories]); $i++) {
  $qid = db_query(
  INSERT INTO products_categories (category_id, product_id)
  VALUES ('{$frm[categories][$i]}', '$product_id')
  );
 }



An this two parts, build a function:

function insert_product($id, $frm) {
/* add a new subproduct under the parent $id.  all the fields that we want
are
 * going to in the variable $frm */

 global $mfi, $ME;

 $on_special = checked($frm[on_special]);

 /* add the product into the products table */
 if (!isset ($receptor[])) {
  $receptor[] = {0,0,0,0,0,0};
 } else {
 }
 for ($i=0;$i6;$i++) {
   $qid = db_query(
INSERT INTO products (receptor, recipient, priority, title, description,
date_added, on_special)
VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]', '$frm[title]',
'$frm[description]', now(), '$on_special')
   );
 }


//mail('$frm[receptor]','$frm[title]','$frm[description]','$frm[recipient]')
;

 /* get the product id that was just created */
 $product_id = db_insert_id();

 /* add this product under the specified categories */
 for ($i = 0; $i  count($frm[categories]); $i++) {
  $qid = db_query(
  INSERT INTO products_categories (category_id, product_id)
  VALUES ('{$frm[categories][$i]}', '$product_id')
  );
 }
}

Really sorry... again



Jason Wong [EMAIL PROTECTED] wrote in message
news:20021802.38606.php-general;gremlins.com.hk...
 On Monday 11 November 2002 17:51, Bsantos PHP wrote:
  Hello:
 
  I'm building an internal messaging system for small biz companies and I
  can't really go longer
 
  Problem is, I use some fields to make the message form and one of them
must
  be a select multiple form element wich refers to messaging persons.
This
  is my form:


 [snip]

  After this, the page should reload on submit, but I keep getting the
  warning:
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: categories in
  c:/apache/htdocs/sites/mail/admin/eusers.php on line 120

 Which is line 110 and line 120?

 I'm certainly not going to count the lines in your code to see which lines
 they refer to.

 If you want people to help you, you should make it easier for them to do
so by
 indicating which lines are being referred to as 110  120.

  All but the last, I think they appear because then page reloaded can't
see
  any more the array of people (select form).

 Well, try using print_r() on all your important variables at strategic
places
 in your code to see that they contain what you expect them to contain.

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

 /*
 Utility is when you have one telephone, luxury is when you have two,
 opulence is when you have three -- and paradise is when you have none.
 -- Doug Larson
 */




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




[PHP] Re: PHP installation _ help needed

2002-11-11 Thread Bob G
Hi Prachait.
Many thanks for your reply. I have not added to dll in IIS. I simply
wanted to get off the ground and then build on what I had. So I followed the
operating instructions for InstallationShield and modified the application
mappings for .PHP and .PHP3 to point to C:/PHP.php.exe.I did though
modify the previous IIS with the regedit provided by PHP zip version with
the same results. Since that time I have reloaded ISS so I would have
thought we were back to square one!!

One strange thing though PHP.EXE ignores anything I type into it e.g.
info(). I have downloaded PHP from 2 different mirrors so I would have
thought they were to be trusted.

My thoughts were that PHP.INI might need modification. But what
specifically? The install instructions suggest that it should work as is.

Any Thoughts - Anyone please?

Thanks Bob




Prachait Saxena [EMAIL PROTECTED] wrote in message
news:2002060718.30648.qmail;pb1.pair.com...
 What u had done to install PHP

 added a dll module in IIS or Mapped the php.exe to .php and .php3 or .php4

 Prachait

 Bob G wrote:

  Hi people!
  I have MySQL working with ASP under win2000 and IIS. I have recently
  tried unsuccessfully  to install PHP. Initially I started with zip
binary
  distribution. I tested it with:-
  html
  head
  titlePHP Test/title
  meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
  /head
 
  body bgcolor=#FF text=#00
  ?php echo Hello Worldp; ?
  /body
  /html
  Couldn't be much simpler!
 
  Nothing worked but view source showed the above code. The implication
  being that the sever did not parse the code.
  I then deleted every thing and tried InstallShield with exactly the
same
  result.
  I have reinstalled IIS - no change
  I have added PHP to the application mapping.
  I have given exec permissions to C:/PHP
  The setup instructions say that I must rename PHP TO PHP.INI in WINNT
and
  that is all. Is this true. If not what precisely must I do?
  Failing the .INI question I think I have done everything in the OPINS.
But
  you guys will know better. What have I missed?
  All thoughts gratefully appreciated
  Thanks Bob

 --
 Bye, and  Have a nice day.

 Prachait Saxena
 ---
 Phone :-  +91 - 712 - 544476
 Email :-  [EMAIL PROTECTED]
 ICQ   :-  71855637
 MSN   :-  [EMAIL PROTECTED]
 Yahoo Messenger :- [EMAIL PROTECTED]

 If you do for other's !
 Other's will do for you !!

 Visit me at
 http://www.Prachait.Com/
 http://www.SitesOnTesting.Com/



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




[PHP] Copy Paste URL was [Re: [PHP] Would appreciate thoughts on sessionmanagement ]

2002-11-11 Thread B.C. Lance
one reason that i could think of for not including session id into URL 
and using cookies would be copy  paste.

users could just copy and paste the url and send it to his/her friends. 
and it could be a considerably number of people. imagine couple of 
people clicking on the link. that session will be shared among that no. 
of active people at that particular time. in short, session hijacking 
will occur.

Ernest E Vogelsinger wrote:
At 22:41 10.11.2002, Charles Wiltgen said:
[snip]


I'm about to implement session management, and I'm considering rolling my
own instead of using PHP's.



Hmm - NIH syndrome?
(not invented here)



Specifically, I'm considering using hidden fields for persistent object
properties because (1) I don't want cookies to be an issue, (2) I prefer not
to have session IDs appear in a URL, and (3) I prefer not to use require a
database just to store persistent properties.


[snip] 

As Justin already pointed out you make yourself stick to forms, not
allowing any normal page be session-dependent - but that's only one of
the drawbacks.

The issue that would disturb me the most is data security - if you use the
client browser to store object persistent data this opens up a whole world
of possibilities to hack your data... Of course you could always check if
the hidden fields are still ok, using some md5 or whetever, but why the hassle?

If you don't want cookies (I too don't use them for a session and have
disabled session cookies in our php.ini), PHP will transparently merge the
session identifier into its output (as long as you don't use ob_gzhandler,
that is). But why don't you like the session ID magled into links?

prefer not to use a database - that's not the case with standard php
sessions, they get written to a file somewhere. Just make sure that this
somewhere is
a) read/writable by apache
b) not read/writable by anyone else
and you are (relatively) secure.




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




[PHP] Delivering Custom Content

2002-11-11 Thread Warmonkey
Hello there,

My CS clan has just starting using phpBB for our clan forum. We are planning
to develop a new php based site and wanted to be able to display customised
content on the main page depending on the user logged in. For instance, I
was thinking of having a login box in the corner of the page, and once
logged in, you could navigate to the forum without having to sign in again.

Also, because each user has their own profile, I'd like them to be able to
choose what content/news/announcements they see when they go to the site
etc. An example of stuff like this in action is CS Nation.

Is all this rather ambitious, or can any give some advice/pointers/sources
of info to go on?

Cheers,

Monk's



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




[PHP] refresh

2002-11-11 Thread Shaun
hi,

How do you refresh a page in php?

If i cannot wat is the code or meta(i think) to do so?

Thanks
Shaun



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




[PHP] Re: refresh

2002-11-11 Thread Bsantos PHP
meta http-equiv=refresh content=X, http://www.Y.EXT;
Being:

X - number of seconds
Y - domain
EXT  -type of domain (.net, .pt, .com, .org, etc...)


In PHP you use it also, or you may go to same location as an header (double
check where to do it...):

header(Location: http://www.where_I_am_right_noe.something/this/that/etc;);

Cheers,

bsantos

Shaun [EMAIL PROTECTED] wrote in message
news:2002112327.79700.qmail;pb1.pair.com...
 hi,

 How do you refresh a page in php?

 If i cannot wat is the code or meta(i think) to do so?

 Thanks
 Shaun





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




RE: [PHP] refresh

2002-11-11 Thread Brendon G
http://www.google.com/search?q=meta+refresh+html+code

Google is your friend.

Cheers

Brendon

-Original Message-
From: Shaun [mailto:johan;novtel.co.za]
Sent: Monday, November 11, 2002 9:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] refresh


hi,

How do you refresh a page in php?

If i cannot wat is the code or meta(i think) to do so?

Thanks
Shaun



-- 
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] zend studio (erro)

2002-11-11 Thread dark rotter
hello..


I use Dreamweaver for coding but i knew the zend
studio. When i try run a script, the output window
show me this:

X-Powered-By: PHP/4.2.1

Content-type: text/html



br /
bFatal error/b:  Call to undefined function: 
mssql_connect() in
bE:\cef\hab\frm_diagnostico.php/b on line
b2/bbr /


But when i run this script from my browser, work. I
don't know how i decide this error. My function of
mssql_connect have correct.


ps.: Sorry my english (bad)


ass.: Augusto Flavio

__
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

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




[PHP] mysql_data_seek equivilant in Postgres

2002-11-11 Thread Chris Boget
I'm looking into the feasibility of moving our current
MySQL database to Postgres and have been looking
over the PHP documentation for each, comparing the
functionality.  One of the functions we use alot that
I haven't seen in the pg function list is the equivilant
of mysql_data_seek.  Is there such a function?  The
closest thing I saw was pg_lo_seek() but I don't think
(know, really.  I'm still unsure what Large Objects are
in the pgSQL context) I'll be using LO's.

Any info would be appreciated.  Also, if you have gone
through this (MySQL - pgSQL), I'd love to hear your
experiences.

Chris



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




[PHP] surepay

2002-11-11 Thread Clint Tredway
Has anyone implemented credit card processing with surepay.com using
PHP? 

Any tips would be appreciated.

Clint



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




Re: [PHP] surepay

2002-11-11 Thread Ernest E Vogelsinger
At 15:15 11.11.2002, Clint Tredway spoke out and said:
[snip]
Has anyone implemented credit card processing with surepay.com using
PHP? 

Any tips would be appreciated.
[snip] 

I have, approx. a year ago - what do you need?


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] surepay

2002-11-11 Thread Ernest E Vogelsinger
At 15:15 11.11.2002, Clint Tredway spoke out and said:
[snip]
Has anyone implemented credit card processing with surepay.com using
PHP? 
[snip] 

Ehm - you mean FirePay, right?


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



RE: [PHP] Urgent CPU and|or hdd test

2002-11-11 Thread John W. Holmes
 Is there a way i can test the cpu or the hdd for its serial number in
php
 under linux and win?

Can you do it from the command line? Run the same command through
exec(). You can only get information for the server, not anything about
the client's computer, btw...

---John Holmes...



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




[PHP] automatically updating software

2002-11-11 Thread Peter VanDijck
Hi,
I want to write some (browser based) software that will get installed on
the client's servers, and I want it to update automatically (as in
Windows XP: new updates are downloaded and presented for install). Can
that be done with PHP? Some ideas so far (that will probably betray my
ignorance :): 
- updating images will require write access that may introduce security
issues?
- keeping almost all code in a database and update that?
- or require write access to a directory outside of the web root?
- any existing approaches - apps already doing it?
- what are the limits of updates distributed this way?
- how much extra coding does this method imply?
Peter

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




RE: [PHP] SELECT MULTIPLE...

2002-11-11 Thread John W. Holmes
 Line 110:
 
 VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]',
'$frm[title]',
 '$frm[description]', now(), '$on_special')

Those errors are just warnings. It's telling you that $receptor[1]
does not have a value when it reaches that statement. Does that matter
to you? You may want to throw in a check before this statement that
assigns a default value to $receptor[1]. Or, if it's not supposed to
ever be empty, then you've got some debugging to do. The problem is the
same for your other error, too.

---John Holmes... 



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




[PHP] Logic headache, please help.

2002-11-11 Thread Tony Crockford
Hi all,

brief explanation:

I'm building a select list, to exclude certain directories from a search
(with Ht://dig).

The structure is like this:
select name=exclude
option value=All levels/option
option value=/lv2/|/lv3/|/lv4/Level 1/option
option value=/lv1/|/lv3/|/lv4/Level 2/option
option value=/lv1/|/lv2/|/lv4/Level 3/option
option value=/lv1/|/lv2/|/lv3/Level 4/option
/select

for four levels, where the option value should be all lv's except the
current option level.

I have a variable $maxlevels to count up to however many levels are
required and  I want to make this select list work based on the value of
$maxlevels.

How would you approach the building of the list?

I was going to use a while loop or two, but I'm stuck at the point of
creating the value string which should contain all the levels from 1
to $maxlevels except the current level. which would seem to require some
sort of conditional if $thislevel string is type of approach, but I
can't get my head round it.

Anyone put me out of my misery?

Thanks

Tony





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




RE: [PHP] Urgent CPU and|or hdd test

2002-11-11 Thread Marco Tabini
If you're using linux, you can try to execute this from the command
line:

hdparm -i [device]

to get, among other things, the serial number of a hard drive. You can
then extract it with a simple regular expression.


Marco
-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com


On Mon, 2002-11-11 at 09:38, John W. Holmes wrote:
  Is there a way i can test the cpu or the hdd for its serial number in
 php
  under linux and win?
 
 Can you do it from the command line? Run the same command through
 exec(). You can only get information for the server, not anything about
 the client's computer, btw...
 
 ---John Holmes...
 
 
 
 -- 
 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] Logic headache, please help.

2002-11-11 Thread Marco Tabini
How about building an array of all the levels:

$a = array();

for ($i = 1; $i = $maxlevels; $i++)
$a[] = $i;

then for each level you can create a new array that is the difference
between the original array and an array that contains the current level:

for ($i = 1; $i = $maxlevels; $i++)
$a1 = ;
echo 'option value=' . implode ('|', array_diff ($a, array($i))) .
'Level ' . $i;

I'm not 100% that this will work right off the bat, but it should at
least put you on the right track... if not out of your misery :-)

Hope this helps.


Marco
-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com


On Mon, 2002-11-11 at 09:48, Tony Crockford wrote:
 Hi all,
 
 brief explanation:
 
 I'm building a select list, to exclude certain directories from a search
 (with Ht://dig).
 
 The structure is like this:
 select name=exclude
 option value=All levels/option
 option value=/lv2/|/lv3/|/lv4/Level 1/option
 option value=/lv1/|/lv3/|/lv4/Level 2/option
 option value=/lv1/|/lv2/|/lv4/Level 3/option
 option value=/lv1/|/lv2/|/lv3/Level 4/option
 /select
 
 for four levels, where the option value should be all lv's except the
 current option level.
 
 I have a variable $maxlevels to count up to however many levels are
 required and  I want to make this select list work based on the value of
 $maxlevels.
 
 How would you approach the building of the list?
 
 I was going to use a while loop or two, but I'm stuck at the point of
 creating the value string which should contain all the levels from 1
 to $maxlevels except the current level. which would seem to require some
 sort of conditional if $thislevel string is type of approach, but I
 can't get my head round it.
 
 Anyone put me out of my misery?
 
 Thanks
 
 Tony
 
 
 
 
 
 -- 
 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] Logic headache, please help.

2002-11-11 Thread Tony Crockford




 -Original Message-
 From: Marco Tabini [mailto:marcot;tabini.ca]
 Sent: 11 November 2002 14:46
 To: Tony Crockford
 Cc: Php-GeneralLists. Php. Net
 Subject: Re: [PHP] Logic headache, please help.


 How about building an array of all the levels:

 $a = array();

 for ($i = 1; $i = $maxlevels; $i++)
   $a[] = $i;

 then for each level you can create a new array that is the difference
 between the original array and an array that contains the
 current level:

 for ($i = 1; $i = $maxlevels; $i++)
   $a1 = ;
   echo 'option value=' . implode ('|', array_diff ($a,
 array($i))) .
 'Level ' . $i;

 I'm not 100% that this will work right off the bat, but it should at
 least put you on the right track... if not out of your misery :-)

 Hope this helps.

It looks like it might, but I note this warning in the manual
re:array_diff

Warning
This was broken in PHP 4.0.4!

http://www.php.net/manual/en/function.array-diff.php

is it fixed in 4.06 do you know? (host uses 4.06, I have 4.2.2)

TIA

Tony



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




RE: [PHP] Logic headache, please help.

2002-11-11 Thread Marco Tabini
My guess is it works... but only one way to find out--try it! :-)


Marco
-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com

On Mon, 2002-11-11 at 10:19, Tony Crockford wrote:
 
 
 
 
  -Original Message-
  From: Marco Tabini [mailto:marcot;tabini.ca]
  Sent: 11 November 2002 14:46
  To: Tony Crockford
  Cc: Php-GeneralLists. Php. Net
  Subject: Re: [PHP] Logic headache, please help.
 
 
  How about building an array of all the levels:
 
  $a = array();
 
  for ($i = 1; $i = $maxlevels; $i++)
  $a[] = $i;
 
  then for each level you can create a new array that is the difference
  between the original array and an array that contains the
  current level:
 
  for ($i = 1; $i = $maxlevels; $i++)
  $a1 = ;
  echo 'option value=' . implode ('|', array_diff ($a,
  array($i))) .
  'Level ' . $i;
 
  I'm not 100% that this will work right off the bat, but it should at
  least put you on the right track... if not out of your misery :-)
 
  Hope this helps.
 
 It looks like it might, but I note this warning in the manual
 re:array_diff
 
 Warning
 This was broken in PHP 4.0.4!
 
 http://www.php.net/manual/en/function.array-diff.php
 
 is it fixed in 4.06 do you know? (host uses 4.06, I have 4.2.2)
 
 TIA
 
 Tony
 
 



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




Re: [PHP] automatically updating software

2002-11-11 Thread Charles Wiltgen
Peter VanDijck wrote...

 I want to write some (browser based) software that will get installed on the
 client's servers, and I want it to update automatically (as in Windows XP: new
 updates are downloaded and presented for install). Can that be done with PHP?

I've been considering something similar, and I don't see any reason why it
can't be done.  Ultimately, this is just be using PHP to FTP something from
one place to another with lots of logic on top.

 Some ideas so far (that will probably betray my ignorance :): - updating
 images will require write access that may introduce security issues?

Security issues will prevent you from reading or writing any files that
your PHP process doesn't have permissions for.  In my experience, the only
reliable way to do this is by using FTP using the username and password that
the user will (presumably) give you.

-- 
Charles Wiltgen

   Well, once again my friend, we find that science is a two-headed beast.
One head is nice, it gives us aspirin and other modern conveniences...
but the other head of science is bad!  Oh beware the other head of
science...it bites! -- The Tick





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




Re: [PHP] automatically updating software

2002-11-11 Thread Peter VanDijck

  Some ideas so far (that will probably betray my ignorance :): - updating
  images will require write access that may introduce security issues?
 
 Security issues will prevent you from reading or writing any files that
 your PHP process doesn't have permissions for.  In my experience, the only
 reliable way to do this is by using FTP using the username and password that
 the user will (presumably) give you.

But that's scary for the user (granting some company access to your
server???). Isn't there another way? I was thinking I could keep crucial
function libraries in a database (not sure if that is possible??) and
then just update them like that, no write access hassles. Can that be
done? Can you keep your functions in a database and include them from
there?
Peter

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




[PHP] method chaining

2002-11-11 Thread Terry McBride
Hello,

I have a question about php and OO.  I want to chain methods together having
them performed on the results of the following method.  Meaning something
like $foo-get(bar)-getBaz().

I get the following error from the script bellow.
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';'
in /usr/local/apache/php/testchain.php on line 47

Anybody know why I can't do this?  Anyway to make it it one statement
instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
Is their a config setting or something?

Thanks in advance,
Terry

?php

class Foo
{
var $vector = array();
function Foo()
{}

function put($name, $value)
{
$this-vector[$name] = $value;
return $this-vector[$name];
}

function get($name)
{
return $this-vector[$name];
}

}

class Bar
{
var $baz = ;

function Bar() {}

function setBaz($value)
{
$this-baz = $value;
return $this-baz;
}
function getBaz()
{
return $this-baz;
}
}

$bar = new Bar();
$bar-setBaz(test succeeded);

$foo = new Foo();
$foo-put(bar, $bar);

echo $foo-get(bar)-getBaz(), br;

?


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




[PHP] Re: Copy Paste URL was [Re: [PHP] Would appreciate thoughts onsession management ]

2002-11-11 Thread Charles Wiltgen
B.C. Lance wrote...

 one reason that i could think of for not including session id into URL and
 using cookies would be copy  paste.
 
 users could just copy and paste the url and send it to his/her friends. and it
 could be a considerably number of people. imagine couple of people clicking on
 the link. that session will be shared among that no. of active people at that
 particular time. in short, session hijacking will occur.

True, but my understanding is that I can also check this against the user's
IP address -- not perfect given NAT and proxies and all, but at least you'd
limit the damage.  I'm sure some of the more experienced people on the list
can suggest additional stuff to check against.

-- 
Charles Wiltgen

   Well, once again my friend, we find that science is a two-headed beast.
One head is nice, it gives us aspirin and other modern conveniences...
but the other head of science is bad!  Oh beware the other head of
science...it bites! -- The Tick







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




Re: [PHP] method chaining

2002-11-11 Thread Ernest E Vogelsinger
At 16:53 11.11.2002, Terry McBride spoke out and said:
[snip]
Hello,

I have a question about php and OO.  I want to chain methods together having
them performed on the results of the following method.  Meaning something
like $foo-get(bar)-getBaz().

I get the following error from the script bellow.
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';'
in /usr/local/apache/php/testchain.php on line 47

Anybody know why I can't do this?  Anyway to make it it one statement
instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
Is their a config setting or something?
[snip] 

This is simply not supported in PHP...


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



RE: [PHP] Urgent CPU and|or hdd test

2002-11-11 Thread Ernest E Vogelsinger
At 15:38 11.11.2002, Marco Tabini spoke out and said:
[snip]
If you're using linux, you can try to execute this from the command
line:

hdparm -i [device]

to get, among other things, the serial number of a hard drive. You can
then extract it with a simple regular expression.
[snip] 

Seems to work only on non-SCSI disks - running RHL 7.2 I get

# hdparm -i /dev/sda
/dev/sda:
 operation not supported on SCSI disks

:(

-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] Urgent CPU and|or hdd test

2002-11-11 Thread Thomas \omega\ Henning
Thanks for the information but is there a way to get it in windows aswell?

Thanks

Thomas omega Henning
Marco Tabini [EMAIL PROTECTED] wrote in message
news:1037025483.12570.155.camel;localhost.localdomain...
 If you're using linux, you can try to execute this from the command
 line:

 hdparm -i [device]

 to get, among other things, the serial number of a hard drive. You can
 then extract it with a simple regular expression.


 Marco
 --
 
 php|architect - The magazine for PHP Professionals
 The first monthly worldwide magazine dedicated to PHP programmers
 Check us out on the web at http://www.phparch.com


 On Mon, 2002-11-11 at 09:38, John W. Holmes wrote:
   Is there a way i can test the cpu or the hdd for its serial number in
  php
   under linux and win?
 
  Can you do it from the command line? Run the same command through
  exec(). You can only get information for the server, not anything about
  the client's computer, btw...
 
  ---John Holmes...
 
 
 
  --
  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] automatically updating software

2002-11-11 Thread Charles Wiltgen
Peter VanDijck wrote...

 Security issues will prevent you from reading or writing any files that
 your PHP process doesn't have permissions for.  In my experience, the only
 reliable way to do this is by using FTP using the username and password that
 the user will (presumably) give you.
 
 But that's scary for the user (granting some company access to your
 server???). Isn't there another way? I was thinking I could keep crucial
 function libraries in a database (not sure if that is possible??) and then
 just update them like that, no write access hassles. Can that be done? Can you
 keep your functions in a database and include them from there?

You could use eval(), but that didn't work for me since I had mixed
PHP/XHTML.

-- Charles Wiltgen


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




Re: [PHP] method chaining

2002-11-11 Thread Maxim Maletsky
work around:

$obj = $foo-get(bar);
$obj-getBaz();

it is a better way as you don't have to re-repeat the function code and
re-pass the oblect.

--
Maxim Maletsky
[EMAIL PROTECTED]



Terry McBride [EMAIL PROTECTED] wrote... :

 Hello,
 
 I have a question about php and OO.  I want to chain methods together having
 them performed on the results of the following method.  Meaning something
 like $foo-get(bar)-getBaz().
 
 I get the following error from the script bellow.
 Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';'
 in /usr/local/apache/php/testchain.php on line 47
 
 Anybody know why I can't do this?  Anyway to make it it one statement
 instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
 Is their a config setting or something?
 
 Thanks in advance,
 Terry
 
 ?php
 
 class Foo
 {
 var $vector = array();
 function Foo()
 {}
 
 function put($name, $value)
 {
 $this-vector[$name] = $value;
 return $this-vector[$name];
 }
 
 function get($name)
 {
 return $this-vector[$name];
 }
 
 }
 
 class Bar
 {
 var $baz = ;
 
 function Bar() {}
 
 function setBaz($value)
 {
 $this-baz = $value;
 return $this-baz;
 }
 function getBaz()
 {
 return $this-baz;
 }
 }
 
 $bar = new Bar();
 $bar-setBaz(test succeeded);
 
 $foo = new Foo();
 $foo-put(bar, $bar);
 
 echo $foo-get(bar)-getBaz(), br;
 
 ?
 
 
 -- 
 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] zend studio (erro)

2002-11-11 Thread Brad Young

The Zend Studio comes with both a local debugger (for convenient local-machine / 
offline debugging) as well as remote server debugger (for 'the real deal').

If you work with the local debugger, the local version of php is used, which includes 
core php, but not any extensions.  The function mssql_connect() is not a core php 
function, so the local debugger doesn't recognize it.

All you have to do is use the server debugger, where you have all the php extension 
modules actually installed.

Brad

-Original Message-
From: dark rotter [mailto:darkrotter;yahoo.com]
Sent: Monday, November 11, 2002 2:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] zend studio (erro)


hello..


I use Dreamweaver for coding but i knew the zend
studio. When i try run a script, the output window
show me this:

X-Powered-By: PHP/4.2.1

Content-type: text/html



br /
bFatal error/b:  Call to undefined function: 
mssql_connect() in
bE:\cef\hab\frm_diagnostico.php/b on line
b2/bbr /


But when i run this script from my browser, work. I
don't know how i decide this error. My function of
mssql_connect have correct.


ps.: Sorry my english (bad)


ass.: Augusto Flavio



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




Re: [PHP] method chaining

2002-11-11 Thread Johan Ohlin
If I have understood correctly what you want to do then this will do fine...

$foo-${$foo-get(bar)}-getBaz();

/ Johan

- Original Message -
From: Terry McBride [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 4:53 PM
Subject: [PHP] method chaining


 Hello,

 I have a question about php and OO.  I want to chain methods together
having
 them performed on the results of the following method.  Meaning something
 like $foo-get(bar)-getBaz().

 I get the following error from the script bellow.
 Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or
';'
 in /usr/local/apache/php/testchain.php on line 47

 Anybody know why I can't do this?  Anyway to make it it one statement
 instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
 Is their a config setting or something?

 Thanks in advance,
 Terry

 ?php

 class Foo
 {
 var $vector = array();
 function Foo()
 {}

 function put($name, $value)
 {
 $this-vector[$name] = $value;
 return $this-vector[$name];
 }

 function get($name)
 {
 return $this-vector[$name];
 }

 }

 class Bar
 {
 var $baz = ;

 function Bar() {}

 function setBaz($value)
 {
 $this-baz = $value;
 return $this-baz;
 }
 function getBaz()
 {
 return $this-baz;
 }
 }

 $bar = new Bar();
 $bar-setBaz(test succeeded);

 $foo = new Foo();
 $foo-put(bar, $bar);

 echo $foo-get(bar)-getBaz(), br;

 ?


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

2002-11-11 Thread Terry McBride
At this point, I respectfully disagree.  To say it's not supported is one
thing but to say it's better or more efficient convincingly requires more.
Tell me why :)

Who's repeating/repassing?
 I'm under the impression it would be faster for the interpreter if the
statement were chained, also a copy (memory) of the object would be not be
required.   Oops, I mis-spoke, actually a copy would be required due to the
the referencing conventions - perhaps this is not useful anyway given what I
really want is...
$tmp = $foo-get(bar);  // note the 
$tmp-alterBarSomeWay();  // $tmp-getBaz();

No way to do that in one line.  I think the reference conventions are odd.
I can pass a variable to a function not knowing it may be referenced and
altered (unless I check the signature), but I have to know that what I'm
receiving from a function is a reference in order to grab it properly!?

I wish I knew why these decisions went the way the did.

Terry

- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: Terry McBride [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 11:20 AM
Subject: Re: [PHP] method chaining


 work around:

 $obj = $foo-get(bar);
 $obj-getBaz();

 it is a better way as you don't have to re-repeat the function code and
 re-pass the oblect.

 --
 Maxim Maletsky
 [EMAIL PROTECTED]



 Terry McBride [EMAIL PROTECTED] wrote... :

  Hello,
 
  I have a question about php and OO.  I want to chain methods together
having
  them performed on the results of the following method.  Meaning
something
  like $foo-get(bar)-getBaz().
 
  I get the following error from the script bellow.
  Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or
';'
  in /usr/local/apache/php/testchain.php on line 47
 
  Anybody know why I can't do this?  Anyway to make it it one statement
  instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
  Is their a config setting or something?
 
  Thanks in advance,
  Terry
 
  ?php
 
  class Foo
  {
  var $vector = array();
  function Foo()
  {}
 
  function put($name, $value)
  {
  $this-vector[$name] = $value;
  return $this-vector[$name];
  }
 
  function get($name)
  {
  return $this-vector[$name];
  }
 
  }
 
  class Bar
  {
  var $baz = ;
 
  function Bar() {}
 
  function setBaz($value)
  {
  $this-baz = $value;
  return $this-baz;
  }
  function getBaz()
  {
  return $this-baz;
  }
  }
 
  $bar = new Bar();
  $bar-setBaz(test succeeded);
 
  $foo = new Foo();
  $foo-put(bar, $bar);
 
  echo $foo-get(bar)-getBaz(), br;
 
  ?
 
 
  --
  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] method chaining

2002-11-11 Thread Terry McBride
Thanks Johan,

I tried your suggestion but got:
Fatal error: Call to a member function on a non-object in
/usr/local/apache/php/testchain.php on line 47

I think you might have me on the right track though :)
I tried this as well: ${$foo-get(bar)}-getBaz();  but got the same
error.

Terry


- Original Message -
From: Johan Ohlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 11:45 AM
Subject: Re: [PHP] method chaining


 If I have understood correctly what you want to do then this will do
fine...

 $foo-${$foo-get(bar)}-getBaz();

 / Johan

 - Original Message -
 From: Terry McBride [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 11, 2002 4:53 PM
 Subject: [PHP] method chaining


  Hello,
 
  I have a question about php and OO.  I want to chain methods together
 having
  them performed on the results of the following method.  Meaning
something
  like $foo-get(bar)-getBaz().
 
  I get the following error from the script bellow.
  Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or
 ';'
  in /usr/local/apache/php/testchain.php on line 47
 
  Anybody know why I can't do this?  Anyway to make it it one statement
  instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
  Is their a config setting or something?
 
  Thanks in advance,
  Terry
 
  ?php
 
  class Foo
  {
  var $vector = array();
  function Foo()
  {}
 
  function put($name, $value)
  {
  $this-vector[$name] = $value;
  return $this-vector[$name];
  }
 
  function get($name)
  {
  return $this-vector[$name];
  }
 
  }
 
  class Bar
  {
  var $baz = ;
 
  function Bar() {}
 
  function setBaz($value)
  {
  $this-baz = $value;
  return $this-baz;
  }
  function getBaz()
  {
  return $this-baz;
  }
  }
 
  $bar = new Bar();
  $bar-setBaz(test succeeded);
 
  $foo = new Foo();
  $foo-put(bar, $bar);
 
  echo $foo-get(bar)-getBaz(), br;
 
  ?
 
 
  --
  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] [ANN] Zip code db available with latitude and longitude

2002-11-11 Thread Bret L Conard
I too would prefer not to get spammed on the list.

As an additional note. I have the exact data and got it for free with a
little searching on government web sites : )


Bret

- Original Message -
From: Ernest E Vogelsinger [EMAIL PROTECTED]
To: Brian Dunning [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 12:04 PM
Subject: Re: [PHP] [ANN] Zip code db available with latitude and longitude


 At 17:58 11.11.2002, Brian Dunning spoke out and said:
 [snip]
 Zipwise has done all of the hard work for you.
 [snip]

 Thanks a lot for that, but I'd prefer not to be spammed on this list.


 --
O Ernest E. Vogelsinger
(\) ICQ #13394035
 ^ http://www.vogelsinger.at/



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




Re: [PHP] [ANN] Zip code db available with latitude and longitude

2002-11-11 Thread Bret L Conard

h


lol




  - Original Message - 
  From: Ernest E Vogelsinger 
  To: Bret L Conard 
  Sent: Monday, November 11, 2002 12:12 PM
  Subject: Re: [PHP] [ANN] Zip code db available with latitude and longitude


  At 18:11 11.11.2002, you said:
  [snip]
  I too would prefer not to get spammed on the list.
  
  As an additional note. I have the exact data and got it for free with a
  little searching on government web sites : )
  [snip] 

  you're going to sell it? *lol*


  -- 
 O Ernest E. Vogelsinger 
 (\) ICQ #13394035 
  ^ http://www.vogelsinger.at/





Re: [PHP] Anchor Link?

2002-11-11 Thread Ernest E Vogelsinger
At 19:06 11.11.2002, Doug Coning spoke out and said:
[snip]
http://www.galapagosstudios.com/test2/viewdesigns.php?pri=1sec=1sid=1#Ga
rment

It works, however, IE says there is an error on the page.  I believe the
error is probably with mixing the variables with the anchor tag.

Does anyone know how to fix this?
[snip] 

As far as I remember the correct syntax for anchored URL's is
http://server_name/document_identifier#anchor?query

Therfore your link should more correctly read
http://www.galapagosstudios.com/test2/viewdesigns.php#Garment?pri=1sec=
http://www.galapagosstudios.com/test2/viewdesigns.php#Garment?pri=1sec=1sid=1



-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] method chaining

2002-11-11 Thread Terry McBride
Noted.  You would have to change the signature of the function to function 
getBar().

The statement still applies - even part of the point.

I'm really just wondering why things are the way they are.  Maybe I'm
thinking php is supposed to be more OO than it is.  Who wants to deal with
copies of objects so much that you have to specify if you want to work with
the actual object (by referencing)?  Why not $foo = clone($object) if you
want a copy? Why? Why? Why?  : p
Perhaps I'm just hoping to plant seeds for future versions (yeah right!).

T

- Original Message -
From: Ernest E Vogelsinger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 12:02 PM
Subject: Re: [PHP] method chaining


 At 17:57 11.11.2002, Terry McBride spoke out and said:
 [snip]
 $tmp = $foo-get(bar);  // note the 
 $tmp-alterBarSomeWay();  // $tmp-getBaz();
 
 No way to do that in one line.  I think the reference conventions are
odd.
 I can pass a variable to a function not knowing it may be referenced and
 altered (unless I check the signature), but I have to know that what I'm
 receiving from a function is a reference in order to grab it properly!?
 [snip]

 Note that both parties need to know the reference...

 assuming
 function foo::get($id) {return $something;}

 it will not help (as to my knowledge) when you say
 $tmp = $foo-get('baz');

 The function must be coded as
 function foo::get($id) {return $something;}

 to return a reference. AND you have to accept the reference, or you'd get
a
 copy.


 --
O Ernest E. Vogelsinger
(\) ICQ #13394035
 ^ http://www.vogelsinger.at/



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




Re: [PHP] Re: Copy Paste URL was [Re: [PHP] Would appreciate thoughts on session management ]

2002-11-11 Thread Jason Wong
On Monday 11 November 2002 23:56, Charles Wiltgen wrote:
 B.C. Lance wrote...

  one reason that i could think of for not including session id into URL
  and using cookies would be copy  paste.
 
  users could just copy and paste the url and send it to his/her friends.
  and it could be a considerably number of people. imagine couple of people
  clicking on the link. that session will be shared among that no. of
  active people at that particular time. in short, session hijacking will
  occur.

 True, but my understanding is that I can also check this against the user's
 IP address -- not perfect given NAT and proxies and all, but at least you'd
 limit the damage.  I'm sure some of the more experienced people on the list
 can suggest additional stuff to check against.

Check out this recent thread:

http://marc.theaimsgroup.com/?l=php-generalm=103621442315093w=2

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

/*
As Will Rogers would have said, There is no such things as a free variable.
*/


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




RE: [PHP] [ANN] Zip code db available with latitude and longitude

2002-11-11 Thread John W. Holmes
This is actually a pretty common question on here, so it's good to know
of another source to point people to. 

---John Holmes...

 -Original Message-
 From: Bret L Conard [mailto:bretlc;donet.com]
 Sent: Monday, November 11, 2002 12:11 PM
 To: Brian Dunning; Ernest E Vogelsinger
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] [ANN] Zip code db available with latitude and
longitude
 
 I too would prefer not to get spammed on the list.
 
 As an additional note. I have the exact data and got it for free
with
 a
 little searching on government web sites : )
 
 
 Bret
 
 - Original Message -
 From: Ernest E Vogelsinger [EMAIL PROTECTED]
 To: Brian Dunning [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, November 11, 2002 12:04 PM
 Subject: Re: [PHP] [ANN] Zip code db available with latitude and
longitude
 
 
  At 17:58 11.11.2002, Brian Dunning spoke out and said:
  [snip]
  Zipwise has done all of the hard work for you.
  [snip]
 
  Thanks a lot for that, but I'd prefer not to be spammed on this
list.
 
 
  --
 O Ernest E. Vogelsinger
 (\) ICQ #13394035
  ^ http://www.vogelsinger.at/
 
 
 
 --
 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] [ANN] Zip code db available with latitude and longitude

2002-11-11 Thread Jason Wong
On Tuesday 12 November 2002 01:26, John W. Holmes wrote:
 This is actually a pretty common question on here, so it's good to know
 of another source to point people to.

You really meant ... so it's good to know that if people search the archives 
they'll find another source [of zip code db]. ;-)

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

/*
Encyclopedia for sale by father.  Son knows everything.
*/


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




RE: [PHP] [ANN] Zip code db available with latitude and longitude

2002-11-11 Thread John W. Holmes
 On Tuesday 12 November 2002 01:26, John W. Holmes wrote:
  This is actually a pretty common question on here, so it's good to
know
  of another source to point people to.
 
 You really meant ... so it's good to know that if people search the
 archives
 they'll find another source [of zip code db]. ;-)

Yeah, yeah... of course that's what I meant! :)

---John Holmes...



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




[PHP] time out when uploading.. PLEASE HELP ME :)

2002-11-11 Thread Eduardo M. Bragatto
I'm using a simple php script called upload.php, here's the source:

?php

move_uploaded_file($userfile, /my/dir);

?

But I keep getting an error message:

Fatal error: Maximum execution time of 20 seconds exceeded in 
D:\dominios\E\escolas-es\spe\upload.php on line 3

Then, I've tried to increase the time limit with the set_time_limit
(the server isn't running on safe-mode, so I can use it, I've tested
this function and it really works):

?php

set_time_limit(600);

move_uploaded_file($userfile, /my/dir);

?

But the error doesn't stop! When I send small files, it works, but 
larges files, that takes more than 20 seconds to upload, results in
this error. It seems that the php script begins only AFTER upload,
so when the files are big, it waits until the time exceed. How can I
workaround this problem? Please help me out!

		[[]]'s Bragatto



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



[PHP] Building Menus based on User Rights

2002-11-11 Thread Ray Seals
I would like for my pages to generate HTML code based on a users
rights.  For example I have a table called user and it looks like this

useridpasswordadminuser
--
memypassY
you   yourpass   Y

When a person logs in they are authenticated against this table.  Once
they are logged in I would like to build a page with a few links.  If
the person has a Y in the admin, I would like to offer an additional
link on the page for some admin functions.

My question is this, when a person logs in I know the user name and
password is stored in the $_POST global.  How long does that stay
available.  Can I recall the userid and password, query the database and
then generate a page based on those results?  Would I be better off
using the session information or setting cookies?

I'm at the crossroads and not sure which trail to start going down.


Ray
-- 
---
Is the Internet down?


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




Re: [PHP] starting recompiled php as a cgi-interpreter

2002-11-11 Thread info
Hi Maxim,

can you please be so kind to forward me the according link to
the manual regarding the installation of php as cgi.

On the www.php.net site there is not much about php as a cgi interpreter.

Thank u

Oliver Etzel

lowcost domains
lowcost serverhousing www.t-host.de

  - Original Message - 
  From: Maxim Maletsky 
  To: [EMAIL PROTECTED] 
  Cc: [EMAIL PROTECTED] 
  Sent: Saturday, November 09, 2002 11:05 PM
  Subject: Re: [PHP] starting recompiled php as a cgi-interpreter



  read the manual regarding the installation of php as cgi. There you will
  find the clues. I am not very sure what exactly you meant.

  -- 
  Maxim Maletsky
  [EMAIL PROTECTED]


  On Sat, 9 Nov 2002 15:34:47 +0100 [EMAIL PROTECTED] wrote:

   Hi PHP-List,
   
   Oh sorry, more concrete for an easy question:
   
   How can I start up this new and recompiled version of PHP which was
   recompiled
   -not as a DSO-
but runs PHP as a CGI-Interpreter???
   
   How can I start this fresh and recompiled PHP as a CGI-Interpreter??
   
   How to start and fire up?
   Please help.
   
   Oliver Etzel
   lowcost domains
   lowcost serverhousing www.t-host.com
   
   
   -- 
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
   




Re: [PHP] starting recompiled php as a cgi-interpreter

2002-11-11 Thread Tom Woody
I did a search for cgi in the online documentation, and the first item
was this:

http://www.php.net/manual/en/printwn/install.commandline.php

On Mon, 11 Nov 2002 19:10:08 +0100
[EMAIL PROTECTED] wrote:

 Hi Maxim,
 
 can you please be so kind to forward me the according link to
 the manual regarding the installation of php as cgi.
 
 On the www.php.net site there is not much about php as a cgi
 interpreter.
 
 Thank u
 
 Oliver Etzel
 
 lowcost domains
 lowcost serverhousing www.t-host.de
 
   - Original Message - 
   From: Maxim Maletsky 
   To: [EMAIL PROTECTED] 
   Cc: [EMAIL PROTECTED] 
   Sent: Saturday, November 09, 2002 11:05 PM
   Subject: Re: [PHP] starting recompiled php as a cgi-interpreter
 
 
 
   read the manual regarding the installation of php as cgi. There you
   will find the clues. I am not very sure what exactly you meant.
 
   -- 
   Maxim Maletsky
   [EMAIL PROTECTED]
 
 
   On Sat, 9 Nov 2002 15:34:47 +0100 [EMAIL PROTECTED] wrote:
 
Hi PHP-List,

Oh sorry, more concrete for an easy question:

How can I start up this new and recompiled version of PHP which
was recompiled
-not as a DSO-
 but runs PHP as a CGI-Interpreter???

How can I start this fresh and recompiled PHP as a
CGI-Interpreter??

How to start and fire up?
Please help.

Oliver Etzel
lowcost domains
lowcost serverhousing www.t-host.com


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

 
 


-- 
Tom

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




Re: [PHP] starting recompiled php as a cgi-interpreter

2002-11-11 Thread Maxim Maletsky

here:
http://www.php.net/manual/en/install.apache.php



--
Maxim Maletsky
[EMAIL PROTECTED]



[EMAIL PROTECTED] wrote... :

 Hi Maxim,
 
 can you please be so kind to forward me the according link to
 the manual regarding the installation of php as cgi.
 
 On the www.php.net site there is not much about php as a cgi interpreter.
 
 Thank u
 
 Oliver Etzel
 
 lowcost domains
 lowcost serverhousing www.t-host.de
 
   - Original Message - 
   From: Maxim Maletsky 
   To: [EMAIL PROTECTED] 
   Cc: [EMAIL PROTECTED] 
   Sent: Saturday, November 09, 2002 11:05 PM
   Subject: Re: [PHP] starting recompiled php as a cgi-interpreter
 
 
 
   read the manual regarding the installation of php as cgi. There you will
   find the clues. I am not very sure what exactly you meant.
 
   -- 
   Maxim Maletsky
   [EMAIL PROTECTED]
 
 
   On Sat, 9 Nov 2002 15:34:47 +0100 [EMAIL PROTECTED] wrote:
 
Hi PHP-List,

Oh sorry, more concrete for an easy question:

How can I start up this new and recompiled version of PHP which was
recompiled
-not as a DSO-
 but runs PHP as a CGI-Interpreter???

How can I start this fresh and recompiled PHP as a CGI-Interpreter??

How to start and fire up?
Please help.

Oliver Etzel
lowcost domains
lowcost serverhousing www.t-host.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] preg_split() - pattern problem

2002-11-11 Thread Tobias Talltorp
How would I write the pattern for this preg_split()?
/T.*O.*B/, seems to only return the first and last portion of the string
(1: Once upon a time, 2: going for a walk).

$string = Once upon a time T:O.B there was a T.O,B duck who was T-O'B going
for a walk;

$array = preg_split('/T.*O.*B/', $string, -1, PREG_SPLIT_OFFSET_CAPTURE);

for ($i=0; $isizeof($array); $i++) {
 echo $array[$i].br;
}

Any thoughts?
// Tobias



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




RE: [PHP] method chaining

2002-11-11 Thread Ford, Mike [LSS]
 -Original Message-
 From: Terry McBride [mailto:terry;boxitllc.com]
 Sent: 11 November 2002 15:53
 
 I have a question about php and OO.  I want to chain methods 
 together having
 them performed on the results of the following method.  
 Meaning something
 like $foo-get(bar)-getBaz().
 
 I get the following error from the script bellow.
 Parse error: parse error, unexpected T_OBJECT_OPERATOR, 
 expecting ',' or ';'
 in /usr/local/apache/php/testchain.php on line 47
 
 Anybody know why I can't do this?  Anyway to make it it one statement
 instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
 Is their a config setting or something?

As already noted, this doesn't work currently -- however, as I understand
it,
Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 
 it does work in Zend Engine 2, and so should make an appearance in PHP 5.

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




RE: [PHP] method chaining

2002-11-11 Thread Ford, Mike [LSS]
Apologies for the previous truncated version of this -- dunno what happened there!!

 -Original Message-
 From: Terry McBride [mailto:terry;boxitllc.com]
 Sent: 11 November 2002 15:53
 
 I have a question about php and OO.  I want to chain methods 
 together having
 them performed on the results of the following method.  
 Meaning something
 like $foo-get(bar)-getBaz().
 
 I get the following error from the script bellow.
 Parse error: parse error, unexpected T_OBJECT_OPERATOR, 
 expecting ',' or ';'
 in /usr/local/apache/php/testchain.php on line 47
 
 Anybody know why I can't do this?  Anyway to make it it one statement
 instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
 Is their a config setting or something?

As already noted, this doesn't work currently -- however, as I understand it, it does 
work in Zend Engine 2 and so should make an appearance in PHP 5.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 
 it does work in Zend Engine 2, and so should make an appearance in PHP 5.

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




[PHP] form question ???

2002-11-11 Thread Jim Hatridge

HI all...

looking at the code below. It works and I get what I want on the screen. BUT 
it leaves a gap between the top lines and where the table starts equal to the 
size of the table, ie if the table is 5 lines long the gap is 5 lines etc. 

Any ideas what I'm doing wrong?

Thanks,

JIM

##

form action=page2.php method=post

?php
  $db = mysql_connect(localhost, , XX);
  mysql_select_db(WartHog,$db);
$result = mysql_query(select * from inventory order by name, $db);

echo (table border=1);
$i=0;
while ($myrow = mysql_fetch_array($result)) {
$c= (++$i%2? 'yellow':'white');

if($Odate == substr($myrow[name],0,6)) {
echo(TR bgcolor=\$c\TDinput type=\hidden\ name=\id[]\   
value=\$id\/TD);
echo(TDinput type=\hidden\ name=\idx[]\  
value=\$myrow[0]\/TD);
echo(TDinput type=\text\ SIZE=4 MAXLENGTH=4  
name=\quantities[]\/TD);
printf( td%s/tdtd%s/tdBR/tr, $myrow[name], 
$myrow[details]);
}
};
echo /table;
?
input type=submit name=submit value=Save Order
/form
##

-- 
Vielfeind -- Viel Ehr'
Antiamerikanische Propaganda in der Philatelie des 20. Jahrhunderts
  http:/www.fecundswamp.net/~hatridge/stamps/index.html

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




Re: [PHP] [ANN] Zip code db available with latitude and longitude

2002-11-11 Thread UberGoober
I've been down the road of getting all that data from the Free government
sources. And I'll tell ya, spending the $130 to get this data is more than
worth the week I spent getting everything together from census data. Think
it through, if you bill out @ $100/hour as a developer, you basically more
than pay for it.

I'm not however advocating spamming this list.. That is pretty crappy of
them to do that. I do wish I that I had known about this when I was doing my
research though.


Bret L Conard [EMAIL PROTECTED] wrote in message
news:004701c289a5$d3dd4ca0$02fea8c0;BretLConard...

h


lol




  - Original Message -
  From: Ernest E Vogelsinger
  To: Bret L Conard
  Sent: Monday, November 11, 2002 12:12 PM
  Subject: Re: [PHP] [ANN] Zip code db available with latitude and longitude


  At 18:11 11.11.2002, you said:
  [snip]
  I too would prefer not to get spammed on the list.
  
  As an additional note. I have the exact data and got it for free with
a
  little searching on government web sites : )
  [snip]

  you're going to sell it? *lol*


  --
 O Ernest E. Vogelsinger
 (\) ICQ #13394035
  ^ http://www.vogelsinger.at/





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




Re: [PHP] Building Menus based on User Rights

2002-11-11 Thread Jason Wong
On Tuesday 12 November 2002 02:05, Ray Seals wrote:

 I would like for my pages to generate HTML code based on a users
 rights.  For example I have a table called user and it looks like this

 useridpasswordadminuser
 --
 memypassY
 you   yourpass   Y

 When a person logs in they are authenticated against this table.  Once
 they are logged in I would like to build a page with a few links.  If
 the person has a Y in the admin, I would like to offer an additional
 link on the page for some admin functions.

 My question is this, when a person logs in I know the user name and
 password is stored in the $_POST global.  How long does that stay
 available. 

For all practical purposes[1] just treat it as if it's not available after the 
person is logged in.

 Can I recall the userid and password, query the database and
 then generate a page based on those results? 

Yes, but see [1].

 Would I be better off
 using the session information or setting cookies?

You definitely want to be looking at sessions. Search for some user 
authentication tutorials.

[1] Unless you continue propagating the login info (user/password) via hidden 
elements in a form (which btw, is a very foolish thing to do) they would only 
be available on the page that is handling your login.


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

/*
Experience is not what happens to you; it is what you do with what happens
to you.
-- Aldous Huxley
*/


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




Re: [PHP] preg_split() - pattern problem

2002-11-11 Thread Jason Wong
On Tuesday 12 November 2002 02:26, Tobias Talltorp wrote:
 How would I write the pattern for this preg_split()?
 /T.*O.*B/, seems to only return the first and last portion of the string
 (1: Once upon a time, 2: going for a walk).

 $string = Once upon a time T:O.B there was a T.O,B duck who was T-O'B
 going for a walk;

 $array = preg_split('/T.*O.*B/', $string, -1, PREG_SPLIT_OFFSET_CAPTURE);

It's doing a greedy match, thus your pattern is actually matching 

{T:O.B there was a T.O,B duck who was T-O'B}

1) Check whether there's a flag in PRCE to do ungreedy matches.

or 

2) Maybe you really meant your pattern to be /T.O.B/ which matches 

T{any single char}O{any single char}B


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

/*
Save energy: be apathetic.
*/


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




RE: [PHP] form question ???

2002-11-11 Thread Ford, Mike [LSS]
 -Original Message-
 From: Jim Hatridge [mailto:hatridge;fecundswamp.net]
 Sent: 11 November 2002 16:27
 
 looking at the code below. It works and I get what I want on 
 the screen. BUT 
 it leaves a gap between the top lines and where the table 
 starts equal to the 
 size of the table, ie if the table is 5 lines long the gap is 
 5 lines etc. 
 
 Any ideas what I'm doing wrong?
[snip] 
   printf( td%s/tdtd%s/tdBR/tr, 

Yes -- that BR between the /td and the /tr is most likely the culprit.
Most browsers of my experience tend to render *any* content that is not
correctly positioned within container tags above the table.

Cheers!

Mike

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

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




Re: [PHP] method chaining

2002-11-11 Thread Terry McBride

- Original Message -
From: Ford, Mike [LSS] [EMAIL PROTECTED]
To: 'Terry McBride' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 1:33 PM
Subject: RE: [PHP] method chaining


 Apologies for the previous truncated version of this -- dunno what
happened there!!

  -Original Message-
  From: Terry McBride [mailto:terry;boxitllc.com]
  Sent: 11 November 2002 15:53
 
  I have a question about php and OO.  I want to chain methods
  together having
  them performed on the results of the following method.
  Meaning something
  like $foo-get(bar)-getBaz().
 
  I get the following error from the script bellow.
  Parse error: parse error, unexpected T_OBJECT_OPERATOR,
  expecting ',' or ';'
  in /usr/local/apache/php/testchain.php on line 47
 
  Anybody know why I can't do this?  Anyway to make it it one statement
  instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
  Is their a config setting or something?

 As already noted, this doesn't work currently -- however, as I understand
it, it does work in Zend Engine 2 and so should make an appearance in PHP 5.

 Cheers!

 Mike

 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
  it does work in Zend Engine 2, and so should make an appearance in PHP 5.



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




[PHP] Resource type numbers

2002-11-11 Thread Gerard Samuel
Im debugging a script that opens a connection to a pop3 server.
When I var dump the return of fsockopen() from the script Im debugging, 
I get - resource(38) of type (socket)
I made up a dummy script to see what I would get and the return of 
fsockopen is  - resource(1) of type (socket)

My dummy script is able to to recieve a +OK from the pop3 server but the 
other file is getting an empty string.
Is there a difference between 1 and 38??

Thanks...

---
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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



Re: [PHP] method chaining

2002-11-11 Thread Terry McBride
Thanks!
Yep, this is good.  Thanks for letting me know.

http://www.zend.com/engine2/ZendEngine-2.0.pdf

It's all been done b4 -- already been brought up :p

Terry


- Original Message -
From: Ford, Mike [LSS] [EMAIL PROTECTED]
To: 'Terry McBride' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 11, 2002 1:33 PM
Subject: RE: [PHP] method chaining


 Apologies for the previous truncated version of this -- dunno what
happened there!!

  -Original Message-
  From: Terry McBride [mailto:terry;boxitllc.com]
  Sent: 11 November 2002 15:53
 
  I have a question about php and OO.  I want to chain methods
  together having
  them performed on the results of the following method.
  Meaning something
  like $foo-get(bar)-getBaz().
 
  I get the following error from the script bellow.
  Parse error: parse error, unexpected T_OBJECT_OPERATOR,
  expecting ',' or ';'
  in /usr/local/apache/php/testchain.php on line 47
 
  Anybody know why I can't do this?  Anyway to make it it one statement
  instead of $tmp = $foo-get(bar); $tmp-getBaz(); -- lame --?
  Is their a config setting or something?

 As already noted, this doesn't work currently -- however, as I understand
it, it does work in Zend Engine 2 and so should make an appearance in PHP 5.

 Cheers!

 Mike

 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
  it does work in Zend Engine 2, and so should make an appearance in PHP 5.



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




[PHP] Need CyberCash MCK for Linux

2002-11-11 Thread Peter Janett
I'm moving a site over from a Sun server to a Linux server, and need the
CyberCash MCK software to install on the Linux box.

I know that Verisign has purchased and swallowed CyberCash into their
PayFlowPro system, but I just need to move an existing, functioning site
that uses CyberCash.

So, anyone know where (or have a copy) of the CyberCash MCK software for
Linux?

Thanks,

Peter Janett

New Media One Web Services





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




Re: [PHP] preg_split() - pattern problem

2002-11-11 Thread Jonathan Sharp
I believe it's U so try /T.*0.*B/U

-js


Jason Wong wrote:
 On Tuesday 12 November 2002 02:26, Tobias Talltorp wrote:
 
How would I write the pattern for this preg_split()?
/T.*O.*B/, seems to only return the first and last portion of the string
(1: Once upon a time, 2: going for a walk).

$string = Once upon a time T:O.B there was a T.O,B duck who was T-O'B
going for a walk;

$array = preg_split('/T.*O.*B/', $string, -1, PREG_SPLIT_OFFSET_CAPTURE);
 
 
 It's doing a greedy match, thus your pattern is actually matching 
 
 {T:O.B there was a T.O,B duck who was T-O'B}
 
 1) Check whether there's a flag in PRCE to do ungreedy matches.
 
 or 
 
 2) Maybe you really meant your pattern to be /T.O.B/ which matches 
 
 T{any single char}O{any single char}B
 
 




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




[PHP] _POST _GET

2002-11-11 Thread GC
Hi-
Can I use both _GET and _POST in the same php file?  Thanks!!
-Greg



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




[PHP] Running PHP code into JavaScript if-else clause

2002-11-11 Thread Wagner Marini
JavaScrip and PHP together
Hey ALL,
 I really do not understand what's going on.
 In my code below I try to inform the user that the number added to him
already exists in database but in my JavaScrit's if-else the line ?php
$tst = TRUE; ? ever run, even the user wants to add the number.
What's happened??

Thanks,
WMarini/


---
...
body

?php
 $tst = FALSE;
 ...

$contact_ins = insert into contato (nome) values ('$name');;
mysql_query( $contact_ins ) OR die( mysql_error() );

//Check if numero exists.
if( CheckNumber( $numero ) ) {
?

   script language=JavaScript
 if ( window.confirm(Number to be added exists.\nContinue?) ) {
   //The user wants to add the number defined.
   ?php $tst = FALSE; ?
   break;
 }
 else {  //User does not want to add the number.
   ?php $tst = TRUE; ?
   ;
 }
   /script

?php
  }

   if( $tst == FALSE ) {
 //Add the number, Don't care!
  ...
   }
 ...
?

/body
/html

---

--
Wagner Marini 



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




[PHP] Browser upload timeout

2002-11-11 Thread Scott Teresi
I am using a PHP script which allows the user to upload files through a
browser (the script opens an FTP session behind the scenes). The problem is,
all browsers (on Mac and PC platforms) often time out after a random amount
of time, between five minutes and a couple hours or sometimes not at all.
They display a dialog box saying something like the connection was
refused. Usually this means a file can't be uploaded if it's sufficiently
large, say, 5-10 megs.

The browser appears to be waiting for a response from the server during the
upload, which of course doesn't come until the upload is complete.

Has anyone found a way to work around this problem? I suspect that this
problem will occur no matter what scripting language is used, because it's
simply a function of the browser's handling of INPUT TYPE=FILE in a
form. I've already tried setting PHP's max_execution_limit in the php.ini
file, and I use ftp_set_option($connection, FTP_TIMEOUT_SEC, 1);.

Thanks for any help!

Scott Teresi
[EMAIL PROTECTED]


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




RE: [PHP] _POST _GET

2002-11-11 Thread Nick Richardson
yes

-Original Message-
From: GC [mailto:gregchagnon;hotmail.com] 
Sent: Monday, November 11, 2002 11:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] _POST  _GET


Hi-
Can I use both _GET and _POST in the same php file?  Thanks!! -Greg



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

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


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




Re: [PHP] _POST _GET

2002-11-11 Thread .: B i g D o g :.
Basically your form is going to use one or the other

you might be able to do this...

form action=file.php?op=submit method=post name=someform
/form

Then you can use _GET to get the op=submit and use _POST for the form...

never tried so i do not know...but in theory it should work...


On Mon, 2002-11-11 at 19:26, GC wrote:
 Hi-
 Can I use both _GET and _POST in the same php file?  Thanks!!
 -Greg
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



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




[PHP] Socket Connections Was: Re: [PHP] Resource type numbers

2002-11-11 Thread Gerard Samuel
Ok, I think I found out why the script Im debbugging is returning an 
empty string.
1.  It opens a socket to the mailserver with fsockopen
2.  It checks the greeting by reading using fgets()
3.  Then it check the reponse by supplying the username to the 
fsockopen() connection
4.  It returns an empty string.

It seems as if the first time fgets() was used on the open connection, 
it reads it to EOF.
Any further attemps would fail because the data from the socket 
connection is at EOF.
I tried to rewind() it, but rewind() doens't take socket resource.
So, going by what this script is trying to do, (I have no experience 
with this), is it correct to assume, that with each attempt to talk to 
the server,
a new connection must be made to read data from it??

If you want more info, feel free to ask...
Thanks

Gerard Samuel wrote:

Im debugging a script that opens a connection to a pop3 server.
When I var dump the return of fsockopen() from the script Im 
debugging, I get - resource(38) of type (socket)
I made up a dummy script to see what I would get and the return of 
fsockopen is  - resource(1) of type (socket)

My dummy script is able to to recieve a +OK from the pop3 server but 
the other file is getting an empty string.
Is there a difference between 1 and 38??

Thanks...

---
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




RE: [PHP] _POST _GET

2002-11-11 Thread Nick Richardson
One thing to watch out for when doing this is that all browsers do not
support the ?foo=blah in the action attribute of the form tag.  IE and
Mozilla can handle it fine, but (and what a surprise this is) Netscape
will sometime have some trouble with it (mostly in older versions
(4.x)).  But this is the only way that get and post can be combined in
the same form.

As far as using the same php file to generate different forms (some get,
some post)... Yes that's easy. :)


-Original Message-
From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
Sent: Monday, November 11, 2002 4:31 AM
To: GC
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] _POST  _GET


Basically your form is going to use one or the other

you might be able to do this...

form action=file.php?op=submit method=post name=someform /form

Then you can use _GET to get the op=submit and use _POST for the form...

never tried so i do not know...but in theory it should work...


On Mon, 2002-11-11 at 19:26, GC wrote:
 Hi-
 Can I use both _GET and _POST in the same php file?  Thanks!! -Greg
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



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

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


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




RE: [PHP] _POST _GET

2002-11-11 Thread John W. Holmes
 Hi-
 Can I use both _GET and _POST in the same php file?  Thanks!!
 -Greg

Yes, you can use both in your code, but only one method is going to be
valid when your page is requested by a user. A user can't request a page
with both a GET and POST request at the same time.

---John Holmes...



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




[PHP] Exec()ing two strings, using same shell?

2002-11-11 Thread Leif K-Brooks
Sorry if I'm using the wrong words - not sure of the exact terminology. 
Anyway, is there a way to exec() two statments in the same shell?  Example:
//On win32 test machine
exec(cd somedir);
print `dir`;
//Outputs directory listing for c:\, not c:\somedir
//But is there a way to get the directory listing for somedir instead?
// I know I could do `dir c:\someidr`, but I'm doing more complex stuff 
than this example.

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



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



[PHP] ImageFill Segmentation Fault

2002-11-11 Thread kevin
Allo,

I am trying to do a dynamic image as a welcome type thing for a site using 
the GD libraries. I was working on a development machine with 4.0.6 and GIF 
support and things worked fine. When I (finally) was able to check out the 
live machine it was 4.0.6 but no GIF support. Ok , I think no problem.. I got 
PNG. So I converted the image to PNG and rejig the code but it doesn't work 
now. I am getting a segmentation fault from imagefill when I try to use an 
image resource created using ImageCreateFromPNG.

Does anyone have any experience of this or any clues as to what I can do.. I 
think in the mean time I am going to try using JPGs! :)

Kevin

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




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Nick Richardson
Yes, there is a DLL for it, but getting PHP to know it is there is where
I'm having the problem - I don’t know how to get PHP to under windows to
do the equivalent of --with-mcrypt in configure under linux. - maybe I
havn't registered the mcrypt dll's correctly or something like that...
But I just can't get it to work.

Everytime I try to do it I get 'call to undefined function . '

//Nick

-Original Message-
From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
Sent: Monday, November 11, 2002 4:37 AM
To: Nick Richardson
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?



is there not a dll for mcrypt?


On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
 I asked this before, but didn't get a response.
 
 Anyone out there have any experience a/o know where I can find 
 information on getting the mcrypt functionality to work under Win32 - 
 I have found a port of mcrypt for Win32, and also learned that you can

 compile it using cygwin - but I don’t know how to register mcrypt w/ 
 PHP and 'turn on' the mcrypt* functions.
 
 If anyone has any information or urls / how-tos it would be greatly 
 appreciated!
 
 Thanks!
 
 //Nick Richardson
 // [EMAIL PROTECTED]
 
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
-- 
.: B i g D o g :.



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

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


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




[PHP] test

2002-11-11 Thread James Johnson
test



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




RE: [PHP] Exec()ing two strings, using same shell?

2002-11-11 Thread Nick Richardson
Exec(dir c:\somedir) or exec(cd somedir  dir)

i.e. $dirContent = one of the above;
print($dirContent);


-Original Message-
From: Leif K-Brooks [mailto:eurleif;buyer-brokerage.com] 
Sent: Monday, November 11, 2002 11:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Exec()ing two strings, using same shell?


Sorry if I'm using the wrong words - not sure of the exact terminology. 
 Anyway, is there a way to exec() two statments in the same shell?
Example: //On win32 test machine exec(cd somedir); print `dir`;
//Outputs directory listing for c:\, not c:\somedir //But is there a way
to get the directory listing for somedir instead? // I know I could do
`dir c:\someidr`, but I'm doing more complex stuff 
than this example.

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



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

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


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




Re: [PHP] Running PHP code into JavaScript if-else clause

2002-11-11 Thread John Nichel
Php runs on the server, JavaScript runs on the browser.

If your function CheckNumber( $numero ) validates true, the script is 
going to out put your JavaScript, but the JavaScript will NOT change 
your php values no matter what the user selects.

Wagner Marini wrote:
JavaScrip and PHP together
Hey ALL,
 I really do not understand what's going on.
 In my code below I try to inform the user that the number added to him
already exists in database but in my JavaScrit's if-else the line ?php
$tst = TRUE; ? ever run, even the user wants to add the number.
What's happened??

Thanks,
WMarini/


---
...
body

?php
 $tst = FALSE;
 ...

$contact_ins = insert into contato (nome) values ('$name');;
mysql_query( $contact_ins ) OR die( mysql_error() );

//Check if numero exists.
if( CheckNumber( $numero ) ) {
?

   script language=JavaScript
 if ( window.confirm(Number to be added exists.\nContinue?) ) {
   //The user wants to add the number defined.
   ?php $tst = FALSE; ?
   break;
 }
 else {  //User does not want to add the number.
   ?php $tst = TRUE; ?
   ;
 }
   /script

?php
  }

   if( $tst == FALSE ) {
 //Add the number, Don't care!
  ...
   }
 ...
?

/body
/html

---

--
Wagner Marini 






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




Re: [PHP] _POST _GET

2002-11-11 Thread Greg
Thanks everyone :)
-Greg

John W. Holmes [EMAIL PROTECTED] wrote in message
news:001f01c289b9$bebdf3b0$7c02a8c0;coconut...
  Hi-
  Can I use both _GET and _POST in the same php file?  Thanks!!
  -Greg

 Yes, you can use both in your code, but only one method is going to be
 valid when your page is requested by a user. A user can't request a page
 with both a GET and POST request at the same time.

 ---John Holmes...





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




RE: [PHP] test

2002-11-11 Thread John Meyer

I never do well on tests.  Always forget my pencil.

-Original Message-
From: James Johnson [mailto:james;owell.com]
Sent: Monday, November 11, 2002 11:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] test


test



-- 
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] Building Menus based on User Rights

2002-11-11 Thread Ray Seals
I found an article 1 of 6 parts by Ben Rowe on devarticles.com.  It
looks like he is doing what I want to accomplish but I have to wait for
the other 5 articles.  When a user logs in he writes a record to MYSQL
for the session.  That record holds certain variables for the session.

Your reply helps, I'm new to all of this and not really a programmer but
I would rather learn to do it the right way than the easy way.

Ray

On Mon, 2002-11-11 at 12:30, Jason Wong wrote:
 On Tuesday 12 November 2002 02:05, Ray Seals wrote:
 
  I would like for my pages to generate HTML code based on a users
  rights.  For example I have a table called user and it looks like this
 
  useridpasswordadminuser
  --
  memypassY
  you   yourpass   Y
 
  When a person logs in they are authenticated against this table.  Once
  they are logged in I would like to build a page with a few links.  If
  the person has a Y in the admin, I would like to offer an additional
  link on the page for some admin functions.
 
  My question is this, when a person logs in I know the user name and
  password is stored in the $_POST global.  How long does that stay
  available. 
 
 For all practical purposes[1] just treat it as if it's not available after the 
 person is logged in.
 
  Can I recall the userid and password, query the database and
  then generate a page based on those results? 
 
 Yes, but see [1].
 
  Would I be better off
  using the session information or setting cookies?
 
 You definitely want to be looking at sessions. Search for some user 
 authentication tutorials.
 
 [1] Unless you continue propagating the login info (user/password) via hidden 
 elements in a form (which btw, is a very foolish thing to do) they would only 
 be available on the page that is handling your login.
 
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 
 /*
 Experience is not what happens to you; it is what you do with what happens
 to you.
   -- Aldous Huxley
 */
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
---
Is the Internet down?


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




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread .: B i g D o g :.
You need to uncomment the dll in the php.ini file...do a search for it
and then uncomment it or add it to the php.ini file...

That will load it...

*Note: i would add that directory to your path that contains the mcrypt
dll or all dlls for php and the extension directory to...


On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
 Yes, there is a DLL for it, but getting PHP to know it is there is where
 I'm having the problem - I don’t know how to get PHP to under windows to
 do the equivalent of --with-mcrypt in configure under linux. - maybe I
 havn't registered the mcrypt dll's correctly or something like that...
 But I just can't get it to work.
 
 Everytime I try to do it I get 'call to undefined function . '
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
 Sent: Monday, November 11, 2002 4:37 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 
 is there not a dll for mcrypt?
 
 
 On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
  I asked this before, but didn't get a response.
  
  Anyone out there have any experience a/o know where I can find 
  information on getting the mcrypt functionality to work under Win32 - 
  I have found a port of mcrypt for Win32, and also learned that you can
 
  compile it using cygwin - but I don’t know how to register mcrypt w/ 
  PHP and 'turn on' the mcrypt* functions.
  
  If anyone has any information or urls / how-tos it would be greatly 
  appreciated!
  
  Thanks!
  
  //Nick Richardson
  // [EMAIL PROTECTED]
  
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
 -- 
 .: B i g D o g :.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



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




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Nick Richardson
I will try that - Thanks for the suggestion.  If it was something that
simple, I'm going to shoot myself :)

Thanks!

//Nick

-Original Message-
From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
Sent: Monday, November 11, 2002 4:50 AM
To: Nick Richardson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


You need to uncomment the dll in the php.ini file...do a search for it
and then uncomment it or add it to the php.ini file...

That will load it...

*Note: i would add that directory to your path that contains the mcrypt
dll or all dlls for php and the extension directory to...


On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
 Yes, there is a DLL for it, but getting PHP to know it is there is 
 where I'm having the problem - I don’t know how to get PHP to under 
 windows to do the equivalent of --with-mcrypt in configure under 
 linux. - maybe I havn't registered the mcrypt dll's correctly or 
 something like that... But I just can't get it to work.
 
 Everytime I try to do it I get 'call to undefined function . '
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:bigdog;venticon.com]
 Sent: Monday, November 11, 2002 4:37 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 
 is there not a dll for mcrypt?
 
 
 On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
  I asked this before, but didn't get a response.
  
  Anyone out there have any experience a/o know where I can find
  information on getting the mcrypt functionality to work under Win32
- 
  I have found a port of mcrypt for Win32, and also learned that you
can
 
  compile it using cygwin - but I don’t know how to register mcrypt w/
  PHP and 'turn on' the mcrypt* functions.
  
  If anyone has any information or urls / how-tos it would be greatly
  appreciated!
  
  Thanks!
  
  //Nick Richardson
  // [EMAIL PROTECTED]
  
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
  NO!
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
 --
 .: B i g D o g :.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



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

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


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




[PHP] Undefined Variable errors

2002-11-11 Thread James Johnson
Hello,

I'm migrating to PHP from ColdFusion.

I've been running some sample scripts I have found in various places and all
of them throw an error:

Notice: Undefined variable: varname in
c:\inetpub\wwwroot\myphpcalendar\somefile.php on line someline.

In ColdFusion, I can use the cfparam tag to preset a variable. I've tried
the following code to define the variable in PHP, but it doesn't work:

if (!isset($VarName)) {
$VarName = 0;
}

Is there a setting in php.ini or a call in the beginning of the script that
I need to use?

Thanks,

James Johnson
Owell Technologies
[EMAIL PROTECTED]



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




RE: [PHP] Undefined Variable errors

2002-11-11 Thread John W. Holmes
 I'm migrating to PHP from ColdFusion.
 
 I've been running some sample scripts I have found in various places
and
 all
 of them throw an error:
 
 Notice: Undefined variable: varname in
 c:\inetpub\wwwroot\myphpcalendar\somefile.php on line someline.
 
 In ColdFusion, I can use the cfparam tag to preset a variable. I've
 tried
 the following code to define the variable in PHP, but it doesn't work:
 
 if (!isset($VarName)) {
 $VarName = 0;
 }

How does that not work? It should, as long as you're including the
line before the others that are giving you the notice.

You can also turn down your error_reporting setting in php.ini. You can
turn off notices and just see warnings. There is an example within
php.ini.

---John Holmes...



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




[PHP] MD4 and lanman hash

2002-11-11 Thread Greg
Hi-
Does anyone know how I can craete md4 and lanman hashes with php?  Thanks!!
-Greg



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




[PHP] phpMyAdmin please help

2002-11-11 Thread Iguider
Hi
I have a furom working under php 4.0  and when I upgrade it to php 4.2  by installing 
the new version of easyphp 1.6.0.0 . the new phpMyAdmin is 2.2.6 .
when I run the forum or I tried to re-create a tables in mySQL database  with a 
install.php it shows me the following errors :

Warning: Unknown MySQL Server Host 'mySQL' (22) in e:\program 
files\easyphp\www\forum\database.php on line 7

Warning: MySQL Connection Failed: Unknown MySQL Server Host 'mySQL' (22) in e:\program 
files\easyphp\www\forum\database.php on line 7

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in 
e:\program files\easyphp\www\forum\database.php on line 8

are there in phpMyAdmin where to give a database username and password ? when I copy 
the old database and i try to start the forum it shows me acces denied to  
namelocalhost  (password : ok) .
Please help


 



[PHP] cyrus / php

2002-11-11 Thread Greg
Does anyone know of a way to add cyrus users through php?  I've looked at
web-cyradm but that relies on mysql...Thanks again!
-Greg



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




[PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Nick Richardson
I asked this before, but didn't get a response.

Anyone out there have any experience a/o know where I can find
information on getting the mcrypt functionality to work under Win32 - I
have found a port of mcrypt for Win32, and also learned that you can
compile it using cygwin - but I don’t know how to register mcrypt w/ PHP
and 'turn on' the mcrypt* functions.

If anyone has any information or urls / how-tos it would be greatly
appreciated!

Thanks!

//Nick Richardson
// [EMAIL PROTECTED]


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 



Re: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread .: B i g D o g :.

is there not a dll for mcrypt?


On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
 I asked this before, but didn't get a response.
 
 Anyone out there have any experience a/o know where I can find
 information on getting the mcrypt functionality to work under Win32 - I
 have found a port of mcrypt for Win32, and also learned that you can
 compile it using cygwin - but I don’t know how to register mcrypt w/ PHP
 and 'turn on' the mcrypt* functions.
 
 If anyone has any information or urls / how-tos it would be greatly
 appreciated!
 
 Thanks!
 
 //Nick Richardson
 // [EMAIL PROTECTED]
 
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
-- 
.: B i g D o g :.



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




Re: [PHP] form question ???

2002-11-11 Thread Tom Rogers
Hi,

Tuesday, November 12, 2002, 2:27:10 AM, you wrote:

JH HI all...

JH looking at the code below. It works and I get what I want on the screen. BUT 
JH it leaves a gap between the top lines and where the table starts equal to the 
JH size of the table, ie if the table is 5 lines long the gap is 5 lines etc. 

JH Any ideas what I'm doing wrong?

JH Thanks,

JH JIM

JH ##

JH form action=page2.php method=post

JH ?php
JH   $db = mysql_connect(localhost, , XX);
JH   mysql_select_db(WartHog,$db);
JH $result = mysql_query(select * from inventory order by name, $db);

JH echo (table border=1);
JH $i=0;
JH while ($myrow = mysql_fetch_array($result)) {
JH $c= (++$i%2? 'yellow':'white');

JH if($Odate == substr($myrow[name],0,6)) {
JH echo(TR bgcolor=\$c\TDinput type=\hidden\ name=\id[]\  
 
value=\$id\/TD);
JH echo(TDinput type=\hidden\ name=\idx[]\  
value=\$myrow[0]\/TD);
JH echo(TDinput type=\text\ SIZE=4 MAXLENGTH=4  
JH name=\quantities[]\/TD);
JH printf( td%s/tdtd%s/tdBR/tr, $myrow[name], 
JH $myrow[details]);
JH }
JH };
JH echo /table;
?
JH input type=submit name=submit value=Save Order
JH /form
JH ##


get rid of the br tag here /tdBR/tr

-- 
regards,
Tom


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




[PHP] wildcard search?

2002-11-11 Thread Håkan
I'm trying to make a small and simple search function, but it only works for
exact searches, and I can't figure out how to make a wildcard search, if I
do it in the php or in the mysql_query, can't really find anything about it
and I don't know what to look for on php.net

Håkan



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




Re: [PHP] phpMyAdmin please help

2002-11-11 Thread John Nichel
Look at the config.inc.php file in the phpMyAdmin install directory.

Iguider wrote:

Hi
I have a furom working under php 4.0  and when I upgrade it to php 4.2  by installing the new version of easyphp 1.6.0.0 . the new phpMyAdmin is 2.2.6 .
when I run the forum or I tried to re-create a tables in mySQL database  with a install.php it shows me the following errors :

Warning: Unknown MySQL Server Host 'mySQL' (22) in e:\program files\easyphp\www\forum\database.php on line 7

Warning: MySQL Connection Failed: Unknown MySQL Server Host 'mySQL' (22) in e:\program files\easyphp\www\forum\database.php on line 7

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in e:\program files\easyphp\www\forum\database.php on line 8

are there in phpMyAdmin where to give a database username and password ? when I copy the old database and i try to start the forum it shows me acces denied to  namelocalhost  (password : ok) .
Please help


 



--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




Re: [PHP] wildcard search?

2002-11-11 Thread Rasmus Lerdorf
That's because this is a MySQL-specific question and you should be reading
the MySQL documentation or asking on the MySQL list.

-Rasmus

On Mon, 11 Nov 2002, Håkan wrote:

 I'm trying to make a small and simple search function, but it only works for
 exact searches, and I can't figure out how to make a wildcard search, if I
 do it in the php or in the mysql_query, can't really find anything about it
 and I don't know what to look for on php.net

 Håkan



 --
 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] wildcard search?

2002-11-11 Thread John W. Holmes
You'll do it in the database, not PHP.

Look into using LIKE in your query...

SELECT * FROM yourtable WHERE column LIKE '%searchterm%'

The % characters are wildcards that'll match any amount of characters.
You can use _ to match a single character. 

You could also look at FULL-TEXT indexing in MySQL to create a better
search feature.

---John Holmes...

 -Original Message-
 From: Håkan [mailto:hw2k;barrysworld.com]
 Sent: Monday, November 11, 2002 4:43 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] wildcard search?
 
 I'm trying to make a small and simple search function, but it only
works
 for
 exact searches, and I can't figure out how to make a wildcard search,
if I
 do it in the php or in the mysql_query, can't really find anything
about
 it
 and I don't know what to look for on php.net
 
 Håkan
 
 
 
 --
 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] wildcard search?

2002-11-11 Thread John Nichel
RTFM...

http://www.mysql.com/doc/en/Pattern_matching.html

Håkan wrote:

I'm trying to make a small and simple search function, but it only works for
exact searches, and I can't figure out how to make a wildcard search, if I
do it in the php or in the mysql_query, can't really find anything about it
and I don't know what to look for on php.net

Håkan






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




[PHP] Need Help in installation of PHP, appache and MySQL on Linux

2002-11-11 Thread ppf

Hi All:
I got php/mysql/appache on my windows machine, it
works fine 
Now i have to install appache/php/mysql on Linux 6.1
red hat. I had searched the php.net for intallation
document, but  it didn't have much detailed
description. I am new to Linux also, if u guys know
some URL or doc pls let me know
Thanks in advance
  Pradeep
  

__
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

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




Re: [PHP] Need Help in installation of PHP, appache and MySQL onLinux

2002-11-11 Thread John Nichel
http://www.php.net/manual/en/install.unix.php

You'll make it easier on yourself installing MySQL from the rpm's on 
your RedHat CD's.

rpm -ivh mysql-xxx-.rpm

Be sure to install both the server and client of MySQL.

ppf wrote:
Hi All:
I got php/mysql/appache on my windows machine, it
works fine 
Now i have to install appache/php/mysql on Linux 6.1
red hat. I had searched the php.net for intallation
document, but  it didn't have much detailed
description. I am new to Linux also, if u guys know
some URL or doc pls let me know
Thanks in advance
  Pradeep
  

__
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2



--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




  1   2   >