Re: [PHP] Linked drop down selection lists and dynamically generatedlinks

2002-07-07 Thread Alberto Serra

Naintara Jain wrote:
 this is of course, keeping in mind, that your backend (database data) is not
 changing every few seconds. If you are dealing with dynamic data, such that
 the list options might be changing at every moment then you would need the
 latest database data and PHP would need to be used after the selection in
 the 1st list.

ðÒÉ×ÅÔ!

True! If you have dynamic stuff you might consider having an invisible 
entity on your page that gets refreshed at constant intervals with a 
server call and contains a flag result. Any time the flag is set 
user-interaction will fire the PHP refresh, while you will still be 
using javascript when possible.

This will save you a lot of user complaints. People hate to wait for a 
second. It's maaad world :)

This road leaves a potential inconsistency problem that you shall solve 
on the final PHP call: user might send in the data before the flag is 
set. In that case you shall refresh the data and ask the user to repeat 
input. It's called an optimistic strategy :)

Actually, whether you can use it or not depends on the update frequency 
of your dynamic data. Plus some tailoring on the intervals (you don't 
want to kill your server by sending it millions of check-the-content 
requests). Decision is based on the number of users and the update 
frequency.

ÐÏËÁ
áÌØÂÅÒÔÏ


-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Re: preg_match or not?

2002-07-07 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Steve Fitzgerald) wrote:

 I have been struggling for a couple of hours now trying to write a
 preg_match expression to validate a dollar amount - the user may or may
 not put in the decimals so I want to allow only digits plus a possible
 period followed by two more digits. My eyes are now swimming and I just
 can't seem to get right. This is what I have at the moment:
 
 if (!preg_match(/[\d]+([\.]{1}[\d]{2})?/, $form_data[amount])) //
 wrong amount
 
 but it still allows invalid input. Can anyone help or is there a better
 way to do it?

It sounds like you need an exact match; note that your regex is matching 
against substrings, thus additional invalid characters are allowed to pass. 
Anchor the pattern, so that it essentially says From beginning to end, the 
only chars allowed are one or more digits, optionally followed by the 
combination of a period then two more digits.  (The ^ and $ special 
chars are anchors.)

A regex special character loses it specialness when it's either escaped 
with a backslash, or included within a square-bracketed character class; 
you don't need to do both.

The {1} is implied; you don't need it.

if (preg_match(/^\d+(\.\d{2})?$/, $form_data[amount]))
   {echo Validated!;}
else
  {exit(That's not a dollar amount.);}

-- 
CC

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




[PHP] Re: preg_match or not?

2002-07-07 Thread Steve Fitzgerald

Thanks, thats hit the nail on the head, and my headache is a whole lot better!
Steve

Cc Zona wrote:

 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] (Steve Fitzgerald) wrote:

  I have been struggling for a couple of hours now trying to write a
  preg_match expression to validate a dollar amount - the user may or may
  not put in the decimals so I want to allow only digits plus a possible
  period followed by two more digits. My eyes are now swimming and I just
  can't seem to get right. This is what I have at the moment:
 
  if (!preg_match(/[\d]+([\.]{1}[\d]{2})?/, $form_data[amount])) //
  wrong amount
 
  but it still allows invalid input. Can anyone help or is there a better
  way to do it?

 It sounds like you need an exact match; note that your regex is matching
 against substrings, thus additional invalid characters are allowed to pass.
 Anchor the pattern, so that it essentially says From beginning to end, the
 only chars allowed are one or more digits, optionally followed by the
 combination of a period then two more digits.  (The ^ and $ special
 chars are anchors.)

 A regex special character loses it specialness when it's either escaped
 with a backslash, or included within a square-bracketed character class;
 you don't need to do both.

 The {1} is implied; you don't need it.

 if (preg_match(/^\d+(\.\d{2})?$/, $form_data[amount]))
{echo Validated!;}
 else
   {exit(That's not a dollar amount.);}

 --
 CC


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




[PHP] Authorization

2002-07-07 Thread Chris Schoeman

I am using the folowing script for authorization:

$username =  test;
$password =  123;

function authenticate() {
  Header( WWW-authenticate: basic realm=\Protected\);
  Header( HTTP/1.0 401 Unauthorized);
  echo   Gebruikersnaam en/of wachtwoord is niet goed ingevuld!\n;
  exit;
}

function CheckPwd($user,$pass) {
  global $username,$password;
  return ($user != $username || $pass != $password) ? false : true;
}

if(!isset($PHP_AUTH_USER)) {
  authenticate();
}
elseif(!CheckPwd($PHP_AUTH_USER,$PHP_AUTH_PW)) {
  authenticate();
}

On my hosting provider this script works fine, om my own computer
where I
run a server it doesn't work.
I run an Internet Information Server on my own computer.

Anyone has an idea.

Chris

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




[PHP] Problem with SQL query

2002-07-07 Thread JJ Harrison

I can't figure out what is wrong with this:

$query = select count(*) as monthly_views from visitors group by
extract('year', time), extract('month', time) order by monthly_view desc
limit 1;
$result = mysql_query($query);
echo $query;
$row = mysql_fetch_array($result);
echo $row['monthly_views'];
echo mysql_error();


I get this:

select count(*) as monthly_views from visitors group by extract('year',
time), extract('month', time) order by monthly_view desc limit 1
Warning: Supplied argument is not a valid MySQL result resource in
C:\Inetpub\TecEco_PHP\stats_interface\summary.php on line 76
You have an error in your SQL syntax near ''year', time), extract('month',
time) order by monthly_view desc limit 1' at line 1

I don't know any advanced SQL so I don't know how to debug this.

I am using mySQL. The person who gave me this code appeared to be using
postgreSQL if that makes any differance


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



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




Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

 I can't figure out what is wrong with this:
 
 $query = select count(*) as monthly_views from visitors group by
  extract('year', time), extract('month', time) order by monthly_view desc
  limit 1;

AFAIK this is no ANSI SQL, which is why is not portable. Your query 
should really be

SELECT
extract('year', time),
extract('month', time)
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   monthly_view desc
limit 1

*BUT* extract doesn't seem to be a MYSQL function, you most probably 
need to use DATE_FORMAT. Look in the Mysql docs for this.

As a general ANSI rule group by functions *need* the fields on which 
result is grouped to appear *first* in the query. Take half an hour to 
look at the GROUP BY docs in MySQL online manual, everything will become 
much clearer.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

I forgot to add:

SELECT
extract('year', time),
extract('month', time),
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   monthly_view desc
limit 1

I take it that you have a *monthly_view* column in your table that is 
not the *monthly_views* alias yoiu use in your query. if that's a typo 
and you mean to order by the numebr of visitors (that is, you want the 
most visited month on top of the result) your query should probably look 
like:

SELECT
extract('year', time),
extract('month', time),
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   3 desc
limit 1

That's because most databases (and I guess MySql is no exception) will 
not be able to use an alias in their GROUP BY, ORDER BY clauses. But you 
may want to try, maybe MySql *is* an exception, after all.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Splitting up a timestamp?

2002-07-07 Thread Tony Harrison

Hi. I please need some help with converting a MySQL timestamp into something
easily read. Any help at all is most appreciated, thanks.



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




Re: [PHP] Splitting up a timestamp?

2002-07-07 Thread Alberto Serra

Tony Harrison wrote:
 Hi. I please need some help with converting a MySQL timestamp into something
 easily read. Any help at all is most appreciated, thanks.
 


ðÒÉ×ÅÔ!

use DATE_FORMAT. (it's a MYSQL function, not a PHP one). Look for it in 
the online MySQL manual.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] transporting variable via post to another site

2002-07-07 Thread andy

Hi there,

I do have a multisite form. There are several fields on page 1 and several
on page 2.

Everything works fine exept of error handling. Which means if a user wants
to go back from step 2 to one and has already filled in some data in site 2
he will loose this data for sure. It is not possible to transport the data
via get anymor because the text is way to long.

So how could this be done with post? I tryed to include a hidden text field,
but since this must be another form (action links to page 1) I can't get the
value of the entered data.

Has anybody a good idea, or even experiance in this?

Thanx,

Andy





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




[PHP] About submitting multipart.forms

2002-07-07 Thread MG Lim

Hello,

has anyone met with this problem.. using IE to submit multipart forms. in
text fields if there is  ... all text after it will disappear..quite a
nuisance when submitting

mg
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.373 / Virus Database: 208 - Release Date: 01/07/2002


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




Re: [PHP] inserting linebrakes in multisite forms

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

andy wrote:
 One Form has a textfield, I submit it to another html site where there is
 another form with a textfield. Inside this textfield I place a hidden field
 with the value of the field from page 1 then I submit to the actual php site
 inserting the values into a db.

So, let's see if I got you right:

Form 1: a textfield, you submit it to another page (no matter whether it 
is on the same host or not, this should not make any difference)

Form 2 contains:
   1) a hidden field with the value from form 1
   2) another text field for new user input
You submit form 2 and nl2br does not work on the values of the hidden 
field. Right?

If that is so it's simply because once the value gets put in 
form2/field1 it has already lost the new lines.
So you should run nl2br on it *before* it gets submitted the second 
time. Do it when you send the value to form2.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] About submitting multipart.forms

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

MG Lim wrote:
 has anyone met with this problem.. using IE to submit multipart forms. in
 text fields if there is  ... all text after it will disappear..quite a
 nuisance when submitting

yes, all dangerous chars should be substituted. Like quot; for the  
symbol. It's not just IE, it's any browser.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] transporting variable via post to another site

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

andy wrote:
 Everything works fine exept of error handling. Which means if a user wants
 to go back from step 2 to one and has already filled in some data in site 2
 he will loose this data for sure. It is not possible to transport the data
 via get anymor because the text is way to long.

Okay, this means Form 1 can be entered from two directions:
   1) the usual sequence (that is, the way users usually get to it)
   2) getting back from Form 2

If you place a button on Form2 saying go back to form 1 when your user 
presses it just post your current data back to the script of form1. 
*PLUS* you add a hidden field called *FLAGBACK* (or whatever you want to 
call it like.

when the script that prepares form1 is called it must check for 
*FLAGBACK* being present. If not, it will do the same old stuff, if yes 
you just write a new branch that will put the data back into form 1. Easy.

*BUT* all this will never protect your user in case he just presses 
*back* on his browser. Make sure this is well explained on the page.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Problem with SQL query

2002-07-07 Thread JJ Harrison

Thanks for giving me something to look up :)


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Alberto Serra [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ðÒÉ×ÅÔ!

 I forgot to add:

 SELECT
 extract('year', time),
 extract('month', time),
 count(*) as monthly_views
 FROM
 visitors
 group by
extract('year', time),
extract('month', time)
 order by
monthly_view desc
 limit 1

 I take it that you have a *monthly_view* column in your table that is
 not the *monthly_views* alias yoiu use in your query. if that's a typo
 and you mean to order by the numebr of visitors (that is, you want the
 most visited month on top of the result) your query should probably look
 like:

 SELECT
 extract('year', time),
 extract('month', time),
 count(*) as monthly_views
 FROM
 visitors
 group by
extract('year', time),
extract('month', time)
 order by
3 desc
 limit 1

 That's because most databases (and I guess MySql is no exception) will
 not be able to use an alias in their GROUP BY, ORDER BY clauses. But you
 may want to try, maybe MySql *is* an exception, after all.

 ÐÏËÁ
 áÌØÂÅÒÔÏ
 ëÉÅ×


 --


 @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

 LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
 lOrD i'M sHiNiNg...
 YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is...




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




[PHP] Re: suppressing errors with @

2002-07-07 Thread Peter

Doesn't @ surpress output (in general)?
Variables don't usually produce an output so putting @ before it shouldn't
make any difference.


Uri Even-Chen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I tried to suppress warnings in isset expressions (Uninitialized string
 offset warnings).  The original line was something like this:

 if (!(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

 When I added the @ sign like this:

 if (!(isset(@$GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

 My program stopped working, and I got errors like:

 PHP Parse error:  parse error, expecting `T_VARIABLE' or `'$'' 

 Eventually, I put the @ in this place:

 if (!(@isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

 Which works, but why didn't it work the other way?  Is it some kind of
 PHP bug?

 I'm using PHP Version 4.1.2

 Thanks,
 Uri.
 



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




Re: [PHP] Problem with SQL query

2002-07-07 Thread JJ Harrison

No matter what I try I still seem to get the error message.

The coloumn that contains the dates has unix timestamps. I think this is why
it is not working.

I will research it further.

If you can be of any help please tell me.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Alberto Serra [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ðÒÉ×ÅÔ!

 I forgot to add:

 SELECT
 extract('year', time),
 extract('month', time),
 count(*) as monthly_views
 FROM
 visitors
 group by
extract('year', time),
extract('month', time)
 order by
monthly_view desc
 limit 1

 I take it that you have a *monthly_view* column in your table that is
 not the *monthly_views* alias yoiu use in your query. if that's a typo
 and you mean to order by the numebr of visitors (that is, you want the
 most visited month on top of the result) your query should probably look
 like:

 SELECT
 extract('year', time),
 extract('month', time),
 count(*) as monthly_views
 FROM
 visitors
 group by
extract('year', time),
extract('month', time)
 order by
3 desc
 limit 1

 That's because most databases (and I guess MySql is no exception) will
 not be able to use an alias in their GROUP BY, ORDER BY clauses. But you
 may want to try, maybe MySql *is* an exception, after all.

 ÐÏËÁ
 áÌØÂÅÒÔÏ
 ëÉÅ×


 --


 @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

 LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
 lOrD i'M sHiNiNg...
 YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is...




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




Re: [PHP] Problem with SQL query

2002-07-07 Thread JJ Harrison

I have fixed it now don't worry!


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

Alberto Serra [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ðÒÉ×ÅÔ!

 I forgot to add:

 SELECT
 extract('year', time),
 extract('month', time),
 count(*) as monthly_views
 FROM
 visitors
 group by
extract('year', time),
extract('month', time)
 order by
monthly_view desc
 limit 1

 I take it that you have a *monthly_view* column in your table that is
 not the *monthly_views* alias yoiu use in your query. if that's a typo
 and you mean to order by the numebr of visitors (that is, you want the
 most visited month on top of the result) your query should probably look
 like:

 SELECT
 extract('year', time),
 extract('month', time),
 count(*) as monthly_views
 FROM
 visitors
 group by
extract('year', time),
extract('month', time)
 order by
3 desc
 limit 1

 That's because most databases (and I guess MySql is no exception) will
 not be able to use an alias in their GROUP BY, ORDER BY clauses. But you
 may want to try, maybe MySql *is* an exception, after all.

 ÐÏËÁ
 áÌØÂÅÒÔÏ
 ëÉÅ×


 --


 @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

 LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
 lOrD i'M sHiNiNg...
 YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is...




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




[PHP] Plz help w/ global variables

2002-07-07 Thread Anthony Rodriguez

To test global variables, I wrote the following PHP script:

(1)?php
(2)session_start();
(3)session_register(counter);
(4)$counter++;
(5)echo $counter;
(6)// header (location:statistics/contents.php);
(7)?

When the script is called several times, the variable is increased 
accordingly.  Thus, it exists globally.

But when I un-comment line (6), the Web page (contents.php) is displayed 
but I cannot echo the variable.

Why?

Thanks!

Tony

PS: Richard, thank you for your reply, but I still don't understand why is 
not passed.



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




Re: [PHP] Survey: MySQL vs PostgreSQL for PHP

2002-07-07 Thread Pete James

From the php.net manual for pg_fetch_array:

Note: From 4.1.0, row became optional. Calling pg_fetch_array() will
increment internal row counter by 1. 

Ilia A. wrote:
 
 On July 5, 2002 07:54 pm, Pete James wrote:
  Ilia A. wrote:
The biggest annoyance I've come across is
   the fact that while using PostgreSQL with PHP is that when you fetch a
   row you must specify the number of the result, while in MySQL, that is
   handled internally by PHP for you. This means that your PHP scripts must
   track the row numbers themselves.
 
  This is not so... see pg_fetch_array.  Since PHP 4.1.0, you no longer
  need the row number.
 
 It may work without, but according to the manual on php.net
 pg_fetch_array
 pg_fetch_object
 pg_fetch_row
 
 REQUIRE a row number. If that is no longer the case as you claim, perphaps
 someone needs to inform the developers and have them update the
 documentation.
 
 
   Now we come to the actual database speed itself. In this regard in most
   applications MySQL is MUCH faster probably because it has to do allot
   less work then PostgreSQL does. For example, lets analyze the most common
   action performed in a database system, a SELECT. When you do a select in
   MySQL, MySQL internally locks the table for the duration of the select.
   PostgreSQL on the other hand does a row level lock, internally, for every
   row you select.
 
  Is this really what you want?  Doesn't this mean that PostgreSQL would
  be more efficient for larger user volumes?  Locking an entire table
  isn't usually a good thing.
 
 
 Not necessarily, locking entire table has its pluses and minuses. The BIG
 minues is that while the entire table is locked you cannot do anything until
 the lock is released. On the other hand, it is MUCH faster to lock the entire
 table then the inidividual rows. PostgreSQL would be more effecient on a
 system that does lots of locking, but on a system without or few locks MySQL
 will beat it hands down.
 
 Ilia
 FUDforum Core Developer
 [EMAIL PROTECTED]


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


RE: [PHP] Help needed with hexdec();

2002-07-07 Thread Jonathan Rosenberg

I spent many frustrating days debugging a similar problem.  I
don't understand exactly what is going on, but it seems that the
problems revolve around PHP's treatment of an integer as signed
or unsigned.

Through experimentation I determined that the way you specify an
integer constant (decimal or hex) with the sign bit on will
affect how PHP treats that integer.

Try the following: determine the signed decimal equivalents of
the two hex integers in your code  replace the hex
representations with the decimal equivalents.  So, if I'm
remembering correctly (please check my math), the line

if ($a  hexdec())

would become

if ($a  -1)

See if this makes a difference.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, July 06, 2002 5:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Help needed with hexdec();


 Hi Guys,

 I have a problem wich I hope has been solved by someone :-)

 Here's the deal,

 I have to convert a perl script to PHP trying to do so
 I get negative
 values from hexdec(), If I use (int)hexdec() the
 numbers aren't negative
 anymore, but they do not add up to what they should.

 Here's the perl line:
 $a = FF ($a, $b, $c, $d, $temparr[8],  $S11, hex(698098d8));


 this is PHP:
 $a = FF ($a, $b, $c, $d, $temparr[8],  $S11,
 hexdec(698098d8));

 FF is a function:
 function FF($a,$b,$c,$d,$x,$s,$ac)
 {
  $a += F($b,$c,$d) + $x + $ac;
  if ($a  hexdec())
{
$a = substr($a,strlen($a)-9,9) ;
}
  $a = RL($a,$s);
  $a += $b;
  return $a;
 }

 F is also a function:
 function F($x, $y, $z)
 {
  return ((($x)  ($y)) | ((~$x)  ($z)));
 }

 Could anybody tell me what I am missing here?

 e-mail:  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]




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




Re: [PHP] transporting variable via post to another site

2002-07-07 Thread andy

sorry maybe I did explain it not good enough.

The problem is that if a user has entered data in form 2 goes back to form 1
and forward to form 2 again, the data he entered once in form 2 is lost. And
I do not find a way how the get the data out of form 2 because the back
button is placed in form 3 (same site as form2 ) to allow a different action
since we have to link to another site then in form 2.

sounds confusing? I know but I hope I explained it ok

Andy


- Original Message -
From: Alberto Serra [EMAIL PROTECTED]
Newsgroups: php.general
Cc: [EMAIL PROTECTED]
Sent: Sunday, July 07, 2002 1:21 PM
Subject: Re: [PHP] transporting variable via post to another site


 ðÒÉ×ÅÔ!

 andy wrote:
  Everything works fine exept of error handling. Which means if a user
wants
  to go back from step 2 to one and has already filled in some data in
site 2
  he will loose this data for sure. It is not possible to transport the
data
  via get anymor because the text is way to long.

 Okay, this means Form 1 can be entered from two directions:
1) the usual sequence (that is, the way users usually get to it)
2) getting back from Form 2

 If you place a button on Form2 saying go back to form 1 when your user
 presses it just post your current data back to the script of form1.
 *PLUS* you add a hidden field called *FLAGBACK* (or whatever you want to
 call it like.

 when the script that prepares form1 is called it must check for
 *FLAGBACK* being present. If not, it will do the same old stuff, if yes
 you just write a new branch that will put the data back into form 1. Easy.

 *BUT* all this will never protect your user in case he just presses
 *back* on his browser. Make sure this is well explained on the page.

 ÐÏËÁ
 áÌØÂÅÒÔÏ
 ëÉÅ×


 --


 @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

 LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
 lOrD i'M sHiNiNg...
 YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is...



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




Re: [PHP] inserting linebrakes in multisite forms

2002-07-07 Thread andy

Hi alberto,

I did try this out, but somehow this happens:

text br / br / text in new line

br/ is exacly where the linebrakes should be, but instead it is typed on
screen.

Is there a solution for this?

Andy

Alberto Serra [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ðÒÉ×ÅÔ!

 andy wrote:
  One Form has a textfield, I submit it to another html site where there
is
  another form with a textfield. Inside this textfield I place a hidden
field
  with the value of the field from page 1 then I submit to the actual php
site
  inserting the values into a db.

 So, let's see if I got you right:

 Form 1: a textfield, you submit it to another page (no matter whether it
 is on the same host or not, this should not make any difference)

 Form 2 contains:
1) a hidden field with the value from form 1
2) another text field for new user input
 You submit form 2 and nl2br does not work on the values of the hidden
 field. Right?

 If that is so it's simply because once the value gets put in
 form2/field1 it has already lost the new lines.
 So you should run nl2br on it *before* it gets submitted the second
 time. Do it when you send the value to form2.

 ÐÏËÁ
 áÌØÂÅÒÔÏ
 ëÉÅ×


 --


 @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

 LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
 lOrD i'M sHiNiNg...
 YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is
 tHe TeSt, YeS iT iS
 ThE tEsT, yEs It Is...




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




Re: [PHP] transporting variable via post to another site

2002-07-07 Thread Alberto Serra


ðÒÉ×ÅÔ!

andy wrote:
 sorry maybe I did explain it not good enough.
 
 The problem is that if a user has entered data in form 2 goes back to form 1
 and forward to form 2 again, the data he entered once in form 2 is lost. And
 I do not find a way how the get the data out of form 2 because the back
 button is placed in form 3 (same site as form2 ) to allow a different action
 since we have to link to another site then in form 2.
 
 sounds confusing? I know but I hope I explained it ok

Honestly yes, it does :( Cant't you draw a sort of diagram? Besides, I 
will probably also need to know how data is modelled (that is, what your 
tables look like) to give you meaningful advice.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Mailing all the elements of a form

2002-07-07 Thread Justin French

If you just want ALL the fields of the form the appear one after the other
(with something \n after each), then you could just loop through the POST
vars (assuming you used form action=blah.php method=post), which would
be either in the $_POST array or the $HTTP_POST_VARS array.

something like:

?
// untested code

$msg = Type email header here\n\n;

foreach($_POST as $key = $value)
{
$msg .= {$key}: {$value}\n;
}

$msg .= \nEmail footer here;

mail($to, $subject, $msg, $headers);

?

Assuming you had the usual $first_name / $last_name / $email_address /
$password kinda form, this would result in an email something like:
---
Type email header here

first_name: Justin
last_name: French
email_address: [EMAIL PROTECTED]
password: foofoo

Email footer here
---


Warning:

1. this leaves you wide open to evil people submitting evil things via the
form... I'd look at strip_tags(), trimming longer than expected strings,
etc.

2. this doesn't give you much in the way of formatting options, or breaking
the vars into sections


For a totally secure form, with trusted data, I'd be coding the message body
by hand checking to make sure that the values submitted were not suspicious,
and were as expected.

However, for a quick-and-nasty form, or for an intranet where you trust the
submitters (eg your own staff perhaps), this *might* be sufficient.


Justin French




Jeremy Bowen wrote:
 Hey,
 
 I have looked in PHP manual but I cannot seem to find what I am looking for.
 
 I have a very large form that I need to be able to mail. I just don't want
 to have to code all of the field into my mail() function.
 
 Thanks,
 
 Jeremy


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




Re: [PHP] Authorization

2002-07-07 Thread Justin French

You need to tell us what version of PHP you're running in both
environments... this should have been your first step -- detrmining the
difference between the two set-ups, basically using php_info().

My guess is that you're running PHP  4.2 on the local machine, which has a
default setting of register_globals OFF in your php.ini file, which
contradicts what your live server has it set to.

The short answer is to turn register_globals ON, the long answer would be:

1. read the release notes for the recent versions

2. check out the millions of threads and messages in this lists' archives,
mostly with the subject register globals

3. read up on the new predefined variables such as $_POST, $_COOKIE, $_GET,
$_SESSION, etc etc, and learn how to modify your scripts to run in this more
secure manner: 
http://www.php.net/manual/en/language.variables.predefined.php


Justin French



on 07/07/02 6:19 PM, Chris Schoeman ([EMAIL PROTECTED]) wrote:

 I am using the folowing script for authorization:
 
 $username =  test;
 $password =  123;
 
 function authenticate() {
 Header( WWW-authenticate: basic realm=\Protected\);
 Header( HTTP/1.0 401 Unauthorized);
 echo   Gebruikersnaam en/of wachtwoord is niet goed ingevuld!\n;
 exit;
 }
 
 function CheckPwd($user,$pass) {
 global $username,$password;
 return ($user != $username || $pass != $password) ? false : true;
 }
 
 if(!isset($PHP_AUTH_USER)) {
 authenticate();
 }
 elseif(!CheckPwd($PHP_AUTH_USER,$PHP_AUTH_PW)) {
 authenticate();
 }
 
 On my hosting provider this script works fine, om my own computer
 where I
 run a server it doesn't work.
 I run an Internet Information Server on my own computer.
 
 Anyone has an idea.
 
 Chris


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




Re: [PHP] Linked drop down selection lists and dynamically generated links

2002-07-07 Thread Pekka Saarinen

At 7/7/2002, you wrote:
Is there any way of doing this so within a single page?

Can this be done using only PHP or do I need to use Javascripts?
Where would I be able to find examples of code which does this sort of
processing?

Hi,

I would do it in PHP, because you can never ever rely on Javascript (is it 
on? what version? what browser?). Javascript is good for additional UI 
smoothing, but should never be a requirement (nor should cookies be).

Here's a simple quick code (partial) how I'd do it on one php page:

http://photography-on-the.net/php/3_choice_select.php

Use the resulting ID's to query the full data of the product found.

There is source code and db dump link in the bottom of that page. The 
database is very normalized.

I did and debugged this in couple of hours (I know, I'm slow), and this 
needs _plenty_ of more code like clearing choices from product and 
version when platform is changed, and checking valid platform id 
etc... this is just a core which gives you id's for additional queries.

If you improve this please share the code!

Hope this helps,

Pekka
http://photography-on-the.net



Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Miguel Cruz

On Sat, 6 Jul 2002, Richard Lynch wrote:
 I think we both agree that any old certificate is secure from snooping,
 right?

I would disagree with that.

In order to snoop on a connection, you need to have some access to the 
link.

This may be by being in the same building with one of the endpoints, or by 
being in the same building as one of the ISPs involved, or by having 
remotely compromised a machine in one of the above locations.

If you have this access, then you can divert packets. You can move wires
around, or you can outrace a router and take over a connection as it's 
being initiated.

Therefore you can present a certificate which is indistinguishable to the 
client from the real server's self-signed certificate, effectively 
hijacking the session.

 Yes, a CA signed certificate is nominally better than a non-signed one,
 since you know that at some point, somebody paid somebody at least $119
 (US), and that the certificate has the same domain name as the domain name
 of the computer you are now surfing to.
 
 You don't know it's the same computer, though, right?  It could easily be a
 stolen Cert and hijacked domain.
 
 For that matter, you don't know that a CRIMINAL purchased the CA signed
 Certificate in the first place.

No, but the chances of each of these other things happening are 
progressively less.

A certificate signed by a known certificate authority tells you that the 
server you're talking with has a unique token provided to the entity 
named. That's better than not knowing that. 

miguel


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




php-general Digest 7 Jul 2002 17:43:59 -0000 Issue 1450

2002-07-07 Thread php-general-digest-help


php-general Digest 7 Jul 2002 17:43:59 - Issue 1450

Topics (messages 105924 through 105964):

Re: Having more problems
105924 by: Alberto Serra

Linked drop down selection lists and dynamically generated links
105925 by: Peter Goggin
105928 by: Alberto Serra
105929 by: C¨¦sar Aracena
105935 by: Naintara Jain
105936 by: Alberto Serra
105963 by: Pekka Saarinen

Mailing all the elements of a form
105926 by: Jeremy Bowen
105930 by: B.C. Lance
105932 by: C¨¦sar Aracena
105934 by: Alberto Serra
105961 by: Justin French

Re: Thanks - Actually POSTING without javascript
105927 by: B.C. Lance
105931 by: Alberto Serra

preg_match or not?
105933 by: Steve Fitzgerald
105937 by: CC Zona
105938 by: Steve Fitzgerald

Authorization
105939 by: Chris Schoeman
105962 by: Justin French

Problem with SQL query
105940 by: JJ Harrison
105941 by: Alberto Serra
105942 by: Alberto Serra
105951 by: JJ Harrison
105953 by: JJ Harrison
105954 by: JJ Harrison

Splitting up a timestamp?
105943 by: Tony Harrison
105944 by: Alberto Serra

inserting linebrakes in multisite forms
105945 by: andy
105948 by: Alberto Serra
105959 by: andy

transporting variable via post to another site
105946 by: andy
105950 by: Alberto Serra
105958 by: andy
105960 by: Alberto Serra

About submitting multipart.forms
105947 by: MG Lim
105949 by: Alberto Serra

Re: suppressing errors with @
105952 by: Peter

Plz help w/ global variables
105955 by: Anthony Rodriguez

Re: Survey:  MySQL vs PostgreSQL for PHP
105956 by: Pete James

Re: Help needed with hexdec();
105957 by: Jonathan Rosenberg

Re: HTTPS vs. HTTP ?
105964 by: Miguel Cruz

Administrivia:

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

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

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


--

---BeginMessage---

ðÒÉ×ÅÔ!

Shiloh Madsen wrote:
 

 $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
 if (! $LoginDB) {
   print pUnable to connect to the database server at this time./p;
   exit();
 } else {

This can be just:

$LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass) or die('pUnable to 
connect to the database server at this time./p')


 ?php
 }
 ?

Sorry, what exactly are you trying to do here?

As for a general advice:
   1) use libraries. Make yourself a public dibconnect funcion. Chances
  are your user/password will differ depending on where the code gets
  executed (production or development) You don't want to go thru
  hundreds of scripts the recode that, right?
   2) Look for a very old PD class called FastTemplate. I know people
  will object that it adds to general execution and lowers
  performance, but that will allow you to keep your HTML code
  well separated by your scripting. And it does help, especially
  when you are not sure about what you are doing.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


---End Message---
---BeginMessage---

I have two related tables. The first has about 12 records, each of which is
related to about 12 records in the second table.  I want to have two
interconnectedt dropdown list fields. The fisrt is used to select from the
first table and when the value has been selected, use it to determine the
contents of the second drop down list.  Once the second field has been
selected I want to use this data to otain the name of the form to be used to
display data selected using the two fields.

Obviously I can do this by having interrelated pages where the value from
the first fields is carried to the second page and used to populate the
second drop down list. I can then presumably dynamically generate the link
to the required page and pass over what paraeters are needed.

Is there any way of doing this so within a single page?

Can this be done using only PHP or do I need to use Javascripts?
Where would I be able to find examples of code which does this sort of
processing?

Any adivice would be gratefully received.
Regards


Peter Goggin

Regards

Peter Goggin


---End Message---
---BeginMessage---

ðÒÉ×ÅÔ!

Peter Goggin wrote:
 Can this be done using only PHP or do I need to use Javascripts?

managing this in PHP should be considered *only* when jscript is not 
available. It's a matter of load distribution.

When doing client server applications (like the web is) you shall always 
remember that any 

RE: [PHP] Problem with SQL query

2002-07-07 Thread Mark Charette

LIMIT was not included in the SQL92 SQL standards and very few vendors
implement all of SQL99; the use of ANSI standards to promote portable
programs has always been beset by this kind of problems.

Mark Charette
Former ANSI X3H3.1 member

-Original Message-
From: Alberto Serra [mailto:[EMAIL PROTECTED]]
SELECT
extract('year', time),
extract('month', time)
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   monthly_view desc
limit 1


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




Re: [PHP] Having more problems

2002-07-07 Thread Chris Hewitt

Shiloh,

It displays in my Mozilla browser, but maybe the missing BODY and 
/BODY tags would mean it does not display in yours.

HTH
Chris

Shiloh Madsen wrote:


 The newbie is still having troubles heh. Maybe some kind soul can tell 
 me what im doing wrong this time. This is the code for a page I am 
 working on. When I try to bring up the page in a browser, I just get a 
 white page, instead of having the HTML display. Anyone able to tell me 
 why?




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




[PHP] newbie: a couple basic questions

2002-07-07 Thread Alexander Ross

1) in a fuction, does a return statment automatically exit the function as
well?
2) can someone give me a better explination of $HTTP_POST_VARS



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




Re: [PHP] Mailing all the elements of a form

2002-07-07 Thread john



Hi Jeremy

You might try the following:

1. set your form elements up so each input can be accessible as part of an 
associative array e.g.

FORM ...
input type=text name=input_array[forename] value=
input type=text name=input_array[lastname] value=
/FORM

2.  create a trusted fields array in your mailing script:

$trusted_fields = array(forename, surname);

order this array in the order you wish the form items to be mailed, e.g. forename, 
surname, address etc.

3.  loop through each item in the trusted fields array and get the value of the 
corresponding field out of the input_array, build the body of your email and send as 
required - as you go through each field you can do form validation, and format the 
output as required, for example:

foreach ($trusted_fields as $trusted_field) {
  if (!empty($input_array[$trusted_field]))
$body .= $trusted_fields[$trusted_field] . : . $input_array
[$trusted_field] . \n;
}

This in theory will build the body as field: field_value\n.. for each field in the 
the trusted_fields array that is not empty.

code untested - but concept should work.

Rgds

John


 Original Message 
From:   Jeremy Bowen
Date:   Sun 7/7/02 6:31
To: [EMAIL PROTECTED]
Subject:[PHP] Mailing all the elements of a form

Hey,

I have looked in PHP manual but I cannot seem to find what I am looking for.

I have a very large form that I need to be able to mail. I just don't want
to have to code all of the field into my mail() function.

Thanks,

Jeremy


-- 
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] newbie: a couple basic questions

2002-07-07 Thread john



Hi

Yes the return function exits the function - you can specify a return value to 
http://www.php.net/manual/en/function.return.php

HTTP_POST_VARS is depricated (still works though) $_POST has replaced:

http://www.php.net/manual/en/reserved.variables.php#reserved.variables.post

Basically $_POST is an associative array of form values submitted using the POST 
method - you should look at  
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.get to.


Regards

John

 Original Message 
From:   Alexander Ross
Date:   Sun 7/7/02 21:33
To: [EMAIL PROTECTED]
Subject:[PHP] newbie: a couple  basic questions

1) in a fuction, does a return statment automatically exit the function as
well?
2) can someone give me a better explination of $HTTP_POST_VARS



-- 
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] configure breaks at return type of qsort...

2002-07-07 Thread Alexander Skwar

Hallo.

I'm trying to compile PHP 4.2.1 on a SuSE 7.2 server and can't go on 
because of the following error:

checking for MySQL support... yes
checking size of char... 1
checking size of int... (cached) 4
checking size of long... (cached) 4
checking size of long long... 8
checking for size_t... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for uid_t in sys/types.h... (cached) yes
checking for type ulong... yes
checking for type uchar... no
checking for type uint... yes
checking for type ushort... yes
checking for int8... no
checking base type of last arg to accept... socklen_t
checking return type of qsort... void
configure: error: Cannot find header files under /usr/include/mysql
Bad exit status from /home/askwar/RPM/tmp/rpm-tmp.64223 (%build)

config.log has these last lines:

configure:39891: checking base type of last arg to accept
configure:39919: g++ -c   -DEAPI_MM -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -DHARD_SERV
ER_LIMIT=2048 -DDYNAMIC_MODULE_LIMIT=128 -DLINUX=22 -DMOD_SSL=208103 
-DEAPI -DUSE_EXPAT co
nftest.C 15
configure:39968: checking return type of qsort
configure:39985: gcc -c -O2 -m486 -fno-strength-reduce -fPIC 
-DHAVE_LIBDL=1  -I/usr/includ
e/gd  -DEAPI_MM -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-DHARD_SERVER_LIMIT=2048 -DDYNA
MIC_MODULE_LIMIT=128 -DLINUX=22 -DMOD_SSL=208103 -DEAPI -DUSE_EXPAT 
conftest.c 15
configure:39975: warning: garbage at end of `#ifdef' argument

I called configure with these parameters:

CFLAGS=-O2 -m486 -fno-strength-reduce -fPIC -DHAVE_LIBDL=1 \
-I/usr/include/gd \
LDFLAGS= \
EXTRA_LIBS=-L/usr/X11R6/lib/ -lpng -lXpm -lssl -lncurses \
./configure i386-suse-linux --prefix=/usr/share --datadir=/usr/share/php 
--bindir=/usr/bin --libdir=/usr/share --includedir=/usr/include 
--with-config-file-path=/etc --with-exec-dir=/usr/lib/php/bin --with-mm 
--with-apxs=/usr/sbin/apxs --enable-versioning --enable-yp 
--enable-bcmath --enable-trans-sid --enable-inline-optimization 
--enable-track-vars --enable-magic-quotes --enable-safe-mode 
--enable-sockets --enable-sysvsem --enable-sysvshm --enable-shmop 
--enable-calendar --enable-mbstring --enable-mbstr-enc-trans 
--enable-exif --enable-memory-limit --enable-wddx --enable-filepro 
--enable-dbase --enable-ctype --disable-debug 
--enable-force-cgi-redirect --enable-discard-path --enable-sigchild 
--with-pear=/usr/share/php/pear --with-pgsql=/usr 
--with-mysql=/usr/include/mysql --with-imap=yes --with-imap 
--with-imap-ssl --with-curl --enable-cli --with-mhash --with-ming 
--with-recode --with-iconv --with-dom --with-dom-xslt --with-dom-exslt 
--with-gd=yes --enable-gd-native-ttf --enable-gd-imgstrttf 
--with-tiff-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr 
--with-xpm-dir=/usr/X11R6 --with-ttf --with-freetype 
--with-freetype-dir=/usr/include/freetype2 --with-t1lib --with-zlib=yes 
--with-bz2 --with-gmp --with-mcal=/usr --with-sablot --with-ftp 
--enable-ftp --with-gdbm --with-ndbm --with-qtdom=/usr/lib/qt 
--with-openssl --with-snmp --enable-ucd-snmp-hack --with-gettext 
--with-mcrypt --with-ncurses --enable-dbx --enable-mbregex

When I use --with-mysql instead of --with-mysql=/usr/include/mysql, I 
can compile PHP with no errors.  /usr/include/mysql contains:

host:/S.u.S.E. # ls -la /usr/include/mysql
total 256
drwxr-xr-x2 root root 4096 Jun 25 16:10 .
drwxr-xr-x   57 root root 8192 Jul  7 22:02 ..
-rw-r--r--1 root root 3864 Jun 18  2001 chardefs.h
-rw-r--r--1 root root 3437 Jun 18  2001 dbug.h
-rw-r--r--1 root root 1979 Jun 18  2001 errmsg.h
-rw-r--r--1 root root 9263 Jun 18  2001 history.h
-rw-r--r--1 root root 3449 Jun 18  2001 keymaps.h
-rw-r--r--1 root root 5846 Jun 18  2001 m_ctype.h
-rw-r--r--1 root root 7452 Jun 18  2001 m_string.h
-rw-r--r--1 root root19072 Jun 18  2001 my_config.h
-rw-r--r--1 root root30141 Jun 18  2001 my_global.h
-rw-r--r--1 root root 1579 Jun 18  2001 my_list.h
-rw-r--r--1 root root 1324 Jun 18  2001 my_net.h
-rw-r--r--1 root root 1206 Jun 18  2001 my_no_pthread.h
-rw-r--r--1 root root21161 Jun 18  2001 my_pthread.h
-rw-r--r--1 root root24248 Jun 18  2001 my_sys.h
-rw-r--r--1 root root10562 Jun 18  2001 mysql.h
-rw-r--r--1 root root 8598 Jun 18  2001 mysql_com.h
-rw-r--r--1 root root  558 Jun 18  2001 mysql_version.h
-rw-r--r--1 root root 6959 Jun 18  2001 mysqld_error.h
-rw-r--r--1 root root 5836 Jun 18  2001 raid.h
-rw-r--r--1 root root24120 Jun 18  2001 readline.h
-rw-r--r--1 root root 1605 Jun 18  2001 sslopt-case.h
-rw-r--r--1 root root 1296 Jun 18  2001 slopt-longopts.h
-rw-r--r--1 root root 1235 Jun 18  2001 sslopt-usage.h

[PHP] Error: Unable to fork (PHP 4.21)

2002-07-07 Thread Kevin Stone

I've searched the entire archives and google for a solution to this.  There
are plenty of references to the Unable to fork error.. most having to do
with a bug in PHP 4.02.  I writing the script for a remote Windows server
running PHP 4.21 so the bug shouldn't be a problem.. I can only assume I am
not doing it correctly.  The script simply needs to convert a file using
ImageMagick stored in c:\Program Files\ImageMagick...

I've tried..
$cmd = c:\\Program Files\\ImageMagick\\convert -quality
80 -antialias -sample '.$x.x.$y.' '$obj' '$dest';
system($cmd);

And on a tip that I found in the list archives I tried..
$cmd = convert /c dir c:\\Program Files\\ImageMagick -quality
80 -antialias -sample '.$x.x.$y.' '$obj' '$dest';
system($cmd);

Both return Unable to Fork errors..
Warning: Unable to fork [convert /c dir c:\Program
Files\ImageMagick -quality 80 -antialias -sample '320x240'
'C:\PHP\uploadtemp\php43.tmp' 'e:/NLObjects/thumb.jpg'] in
c:\inetpub\wwwroot\exchange_tmp\uploadtest.php on line 72

I have used ImageMagick successfully on a UNIX server.  But I didn't have to
specify the location of the convert tool.  This is Windows server and I
really don't have a clue if I am doing this correctly.  Any help will be
greatly appreciated.

-Kevin


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




[PHP] mail function question

2002-07-07 Thread Kirk Babb

I'm using argosoft's mailserver with SMTP authentication, and would like to
know how to pass the usr  pwd inside php's mail() function.  Please help me
out here, I've RT*M without gaining an understanding of this.

TIA,

Kirk



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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Richard Lynch

In public key cryptography, it is the *keys*, not the digital 
certificate that encrypt/decrypt the communication.

Okay.

I break into his co-lo, I walk off with his computer, and I break into his
office, I walk off with his computers, I kill the guy, and I kidnap his
wife.

I have everything.

I have his Certs, his keys, his server, his domain, *EVERYTHING*.

This is not *IMPOSSIBLE*, no matter how unlikely it is painted.

But let me paint a more-likely scenario.

Some guy sets up a tiny on-line retail shop on his $20/month ISP. 
Whoo-Hooo!

He gets hacked, never even notices, and his Certs and keys are all stolen. 
Meanwhile, the guy good enough to do that is also good enough to routinely
hijack his domain name for short periods of time.

Game Over.

How about another, even *easier* scenario.

I set up a nice little retail shop that specializes in hard-to-find items. 
I scour the 'net for things people can't seem to find anywhere else, not
even eBay.  Nothing big or really expensive, just odd parts and pieces of
things.

I build a nice big web-site catalog shopping cart.

I buy a Cert for a whopping $119.

I collect the credit cards for a day or two, I charge them nine ways to
Sunday, and I take off.

Game Over.

How about an even *easier* scenario:

I find a web-site that is storing the credit-card numbers in their database,
and rip them off.

Game Over.

that issued his certificate, he may as well let you run your rogue site 
off of his server; it's the same difference.

Exactly!

Or, he may as well be the criminal and *GET* a CA signed certificate for
his criminal web-site.

I do not trust that a CA Signed Cert is worth the bits its stored in.

If you trust Microsoft with Security, shop away.

Think of it this way. Let's use https://www.amazon.com/ as an example. 
Do you trust doing business with them? I sure do; at least I trust 100% 
that my HTTP requests are going to get to the www.amazon.com server 
safely. If someone stole their SSL certificate:

Forget amazon.com.

Real-world example from *MY* personal life:  Stick with unknowncompany.com
-- a site you do *NOT* know, you do *NOT* trust, but they are the only ones
that have the power-supply you need to run your laptop.

You can:
A) Throw away your laptop.
B) Risk the fact that an unknown site with a CA Signed Certificate
(Ooh I'm impressed (not)) is the only one who can sell you the part you
need to power the laptop.
C) Try (and fail miserably) to find the part in real stores, and go back
to A or B.

Yes, this really happened to me.

Yes, I really bought the thing on-line.

No, I had no trust that they weren't crooks or at least incompetents.

Yes, that's why the current system is insufficient.

Yes, that's why I think it is ridiculous that people have essentially been
trained to trust that little lock icon in the browser, no matter how naive
that is, and how untrustworthy it is.

Now, on to stealing their domain name. All of a sudden, Amazon is 
getting no traffic. Think they won't notice?

Again, forget Amazon.

There *ARE* on-line retailers who don't get any traffic, whose ISP's are so
crappy their site is down all the time.

Think they would notice?

How quickly?

What's their response?  Call up the ISP and complain, and the ISP says
Hmmm, it's working okay now.  Probably just a network outage

Think it matters since the 
HTTP requests you'll be receiving can't be decrypted by you anyway?

Assume I've also stolen their Cert and keys and whatever else it takes to
steal your credit card number.

Yes, there are fewer sites where that's possible, but is it 0?  No.  Is it
growing, as more and more mom-n-pop on-line stores are built on $20/month
hosts with crappy Security?

Are you telling me you've never walked in to an eCommerce site to find
major, huge, gaping holes in their security?

Are you telling me those sites don't exist?

Actually, assume the other way around -- I've hacked his server, stolen his
Certs and private keys, and now...

Can I *sometimes* hijack his domain name, for brief periods of time?  Say, a
few minutes?  Just long enough to steal a few CC numbers, and then blip!
un-steal it?

Okay, *I* can't do it, but aren't there a fair number of hackers out there
that can?

Who's gonna notice that?  Some orders go missing?  The site is mysteriously
down or off the net for a few minutes, or maybe even *less* than a
minute.  A couple customer complaints.  Maybe even a customer swears up and
down that we must have lost his CC # because it's the only place he used
it.  *MAYBE* a good company will catch on.  I bet against.

But let's even assume our site-owner *NOTICES* his stolen domain name, and
maybe even knows he got hacked and the Certs and keys all got stolen.

Let's even give them the benefit of the doubt and assume they reported the
hack within, oh 24 hours, to their CA and they get a shiny new Certificate.

I, Richard Lynch, do *NOT* trust the CA Signers (Microsoft, et al) to
correctly respond to a security problem.  I know 

[PHP] Re: Plz help w/ global variables

2002-07-07 Thread Richard Lynch

To test global variables, I wrote the following PHP script:

(1)?php
(2)session_start();
(3)session_register(counter);
(4)$counter++;
(5)echo $counter;
(6)// header (location:statistics/contents.php);

PS: Richard, thank you for your reply, but I still don't understand why is 
not passed.

Once you tell the browser to go somewhere else, *EVERYTHING* else you might
have told it is ignored.

It might not be the way it ought to be, but that's the way it is.

One of the things it will ignore is the Cookies sent with session_start()

So if the browser ignores those Cookies, it doesn't them back on the next
page, and PHP doesn't realize it's the same browser.

*IF* you alter your header() to include the SESSION ID that the cookies
should have sent, you will achieve success:

header(Location: statistics/contents.php?PHPSESSID=, session_id());

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] please I want them to erase me of their mail lists

2002-07-07 Thread Rodolfo Contreras T.

please I want them to erase me of their mail lists

sincerely

Rodolfo Contreras



[PHP] flip function

2002-07-07 Thread Garland Foster

Hi all,

Call me crazy if you want but I'm programming Haskell Code in PHP :-). I 
need some help to find a way to implement the Haskell flip function. Let 
me introduce flip:

Flip receives two arguments: arg1 and arg2
arg1 must be the name of a function taking two arguments, name it f(x1,x2)
arg2 is any variable

Flip returns a function taking one argument, name it g(x), if you
call g(foo) then the result will be the same as calling f(foo,arg2).

Example:
function add($x1,$x2) {return $x1+$x2;}
$newfunc = flip(add,23);
$result = $newfunc(12);
// $result should be 23+12

I've tried with create function, for example:

function flip($f,$arg) {
   return create_function('$y','return '.$f.($arg.',$y);');
}

But if you use flip(foo,$o1) where o1 is an object then it won't work.

There should be some workaround using references and who knows what... 
but I'm too old to find it, ideas?

Garland.


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




[PHP] Printing Problem

2002-07-07 Thread Chris Kay


I'll repeat my ealier question because some people can not think for
themselves..

I want to run a print job of 200+ invoices

I have a javascript code to open a print dialog box and
Then go to next invoice and do the loop..

Problem I am having is that I want it to pause if the ok button on the 
dialog Box is not pressed..
When I run the script it fly's throught and brings up a heap of printer
Dialog boxes which causes me to ctrl+alt+del...

Anyway or pausing the script untill ok is pressed?

Thanks in advance..

(PS: I have sent this to this group because
1. The loop is done in php and NOT javascript
2. My question is regarding php and pausing the loop and not
with the javascript code)


---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for
Business

---



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




Re: [PHP] configure breaks at return type of qsort...

2002-07-07 Thread Alexander Skwar

Alexander Skwar wrote:

 When I use --with-mysql instead of --with-mysql=/usr/include/mysql, I 
 can compile PHP with no errors.  /usr/include/mysql contains:

Solved.  I need to call --with-mysql=/usr and not use the full path to 
the mysql includes.

Alexander Skwar
-- 
How to quote: http://learn.to/quote (german) http://quote.6x.to (en)
Homepage: http://www.iso-top.de   |  Jabber: [EMAIL PROTECTED]
iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 15 hours 26 minutes


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




RE: [PHP] Calander with highlighting

2002-07-07 Thread Peter

George,

it's not quite what I'm looking for but it's very similar to what I am after  would 
go along way to acheiving what I am after..

 
 
 Take a look at http://www.bucharest-accommodation.ro/flat_univstudio.php
 .That is what you want?
 
 --
 
 
 Best regards,
 George Nicolae
 


[PHP] Re: mail function question

2002-07-07 Thread Manuel Lemos

Hello,

On 07/07/2002 07:49 PM, Kirk Babb wrote:
 I'm using argosoft's mailserver with SMTP authentication, and would like to
 know how to pass the usr  pwd inside php's mail() function.  Please help me
 out here, I've RT*M without gaining an understanding of this.

No, mail() function does not have any support for authentication.

You may want to try to use this SMTP client message sending class that 
supports most common forms of SMTP authentication automatically.

http://www.phpclasses.org/smtpclass


-- 

Regards,
Manuel Lemos


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




RE: [PHP] Buy Sell

2002-07-07 Thread Peter

you could do some little modifcations to something like phpnuke ( http://phpnuke.org) 
that could work for you.. it's primarily a news style format where people can post 
things to .. but you can set it so the administrator has to aprove any posts to the 
site..

Cheers


 -Original Message-
 From: César Aracena [mailto:[EMAIL PROTECTED]]
 Sent: Friday, 28 June 2002 3:50 AM
 To: PHP General List
 Subject: [PHP] Buy  Sell
 
 
 Hi all.
  
 Have anyone used a PHP pre-made program before that can manage
 classifieds by only administrator managed? I want to set up a Buy  Sell
 site for houses, vehicles, etc… Pretty much like a Real State on-line
 site.
  
 Any help appreciated,
  
 Cesar Aracena mailto:[EMAIL PROTECTED] 
 CE / MCSE+I
 Neuquen, Argentina
 +54.299.6356688
 +54.299.4466621
  
 


RE: [PHP] Re: suppressing errors with @

2002-07-07 Thread Martin Towell

I use it in front of variables (never tried it on $GLOBALS, etc though)

eg: (using register_globals = on  thingo  - hey don't blame me, it's the
tech guys who have it on, and there's too much legacy code to turn it off :(
- anyway)

?
  if (@$var) { echo Yep, var is there; } else { echo nope; }
?


-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 06, 2002 7:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: suppressing errors with @


No, it's not a PHP bug.  The @ can not be used before a PHP variables, or
PHP pre-defined variables like $GLOBALS, $_SESSION, $_GET, $HTTP_POST_VARS,
etc.  The @ is used only before the PHP function as far as I know of.

FletchSOD
Uri Even-Chen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I tried to suppress warnings in isset expressions (Uninitialized string
 offset warnings).  The original line was something like this:

 if (!(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

 When I added the @ sign like this:

 if (!(isset(@$GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

 My program stopped working, and I got errors like:

 PHP Parse error:  parse error, expecting `T_VARIABLE' or `'$'' 

 Eventually, I put the @ in this place:

 if (!(@isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))

 Which works, but why didn't it work the other way?  Is it some kind of
 PHP bug?

 I'm using PHP Version 4.1.2

 Thanks,
 Uri.
 



-- 
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] HTTPS vs. HTTP ?

2002-07-07 Thread Mark Charette

Or, even easier and no tech, I get a low-paying job in some convenience
store, and make copies of the credit card receipts.

Game Over.

Using a credit card anywhere involves trust. Period. End of story.

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]

How about an even *easier* scenario:

I find a web-site that is storing the credit-card numbers in their database,
and rip them off.

Game Over.


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




[PHP] Re: mail function question

2002-07-07 Thread Kirk Babb

Thanks - I'm heading there now.  I appreciate the help.

-Kirk


Manuel Lemos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 On 07/07/2002 07:49 PM, Kirk Babb wrote:
  I'm using argosoft's mailserver with SMTP authentication, and would like
to
  know how to pass the usr  pwd inside php's mail() function.  Please
help me
  out here, I've RT*M without gaining an understanding of this.

 No, mail() function does not have any support for authentication.

 You may want to try to use this SMTP client message sending class that
 supports most common forms of SMTP authentication automatically.

 http://www.phpclasses.org/smtpclass


 --

 Regards,
 Manuel Lemos




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




Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

Mark Charette wrote:
 LIMIT was not included in the SQL92 SQL standards and very few vendors
 implement all of SQL99; the use of ANSI standards to promote portable
 programs has always been beset by this kind of problems.

Yes, and vendors just love to have proprietary standards to protect 
their market shares. The basic idea is that since you cannot just switch 
from an engine to another without seriously risking your application 
stability you will tolerate the yes, it's a known bug answer, whenever 
your 100 thousand dollars application cannot print a simple data report 
because trying to set fonts size will crash the current job. Or when 
real numbers are returned with a different values from the one you wrote 
in.

Not talking about MeAndMyFriendJoe'sXperimentalSQLMachineGun 0.0, That 
was Oracle 7.3 with Developer (fonts) and Oracle 8.something under WinNT 
(floating real number values).

Eventually they solved both the problems (I have to say they even did it 
quick) but you can imagine the atmosphere when the final customer had to 
be told that they had invested an overall amount of 25k$ a day for 2 
years just not to be able to print a common report and that Oracle just 
answered yes, it's a known bug - bug precedence level: low.

Which actually meant: go ** yourselves, we ain't got no time for your 
stupid customers. If only they could switch engine... But they switched 
to their lawyers in instead and kept the engine running, because no ANSI 
was there (and because we all knew that no better stability was to be 
found on other vendors anyway).

Some things in escaping the ANSI standard are useful, though. Things like
Oracle's DECODE and the LIMIT clause do make query sets smaller and 
quicker.
And yet, IMHO most of the opposition to ANSI comes from a mere 
commercial point of view.

This way vendors can keep releasing poor alpha stuff and call it a 
stable release without having to worry about spending test money. Test 
is something you are going to do yourself, paying for it with your own 
money and your own professional credibility. No wonder vendors are happy 
with it.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] flip function

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

 I've tried with create function, for example:
 
 function flip($f,$arg) {
   return create_function('$y','return '.$f.($arg.',$y);');
 }
 
 But if you use flip(foo,$o1) where o1 is an object then it won't work.

Never tried that on Haskell coding, but it did solve most of my trouble 
with objects:

function flip($f,$arg) {
return create_function('$y','return '.$f.($arg.',$y);');
}

then

flip(foo,$o1)

I guess you will need same experimental work (and a lot of patience), 
but once you can fix the root problem usually everything else goes okay.

Just watch out for null returns. If you return an unassigned variable 
from an object member the most fantastic things begin to happen. And 
before reinstalling PHP from scratch (and exploring all of the 4 letters 
words you can think of) you should really check that you just simply did 
not end over an unassigned variable :)

ÐÏËÁ
áÌØÂÅÒÔÏ


-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Chris Shiflett

I think I'm going to forget trying to explain the technical details, 
because somehow this conversation is completely missing the point now. :)

SSL allows you to be sure that your credit card number is getting safely 
and securely to the Web site identified by a certain domain name. That's 
all it does, but that is not something trivial. Are you trusting a 
domain name by trusting SSL? No, not exactly. You are trusting the 
system that I explained in great detail to ensure that your 
communication is reaching that domain name securely (not just 
encrypted). This is a significant thing, and it is a system that I have 
great respect for.

Everything else is no different than using your credit card at a 
physical establishment, so it's not really helpful to debate those 
points anyway.

Chris

P.S. - CA means Certificate Authority. CA means Certification and 
Accreditation. The two cannot be used interchangeably.


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




Re: [PHP] inserting linebrakes in multisite forms

2002-07-07 Thread Miguel Cruz

On Sun, 7 Jul 2002, andy wrote:
 Alberto Serra [EMAIL PROTECTED] schrieb:
 andy wrote:
 One Form has a textfield, I submit it to another html site where there
 is another form with a textfield. Inside this textfield I place a
 hidden field with the value of the field from page 1 then I submit to
 the actual php site inserting the values into a db.

 So, let's see if I got you right:

 Form 1: a textfield, you submit it to another page (no matter whether it
 is on the same host or not, this should not make any difference)

 Form 2 contains:
1) a hidden field with the value from form 1
2) another text field for new user input
 You submit form 2 and nl2br does not work on the values of the hidden
 field. Right?

 If that is so it's simply because once the value gets put in
 form2/field1 it has already lost the new lines.
 So you should run nl2br on it *before* it gets submitted the second
 time. Do it when you send the value to form2.

 I did try this out, but somehow this happens:
 
 text br / br / text in new line
 
 br/ is exacly where the linebrakes should be, but instead it is typed on
 screen.
 
 Is there a solution for this?

That looks like the result of htmlentities(nl2br($string)).

Do it the other way around.

Better yet, don't call nl2br or htmlentities or anything else on data that
you are inserting into your database. Madness that way lies.
Instead, use those functions only when outputting data to the browser.

miguel

P.S. Please stop spamming the rec.travel.* newsgroups.


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




[PHP] PHP/mysql connection problem

2002-07-07 Thread Jo

Hey all, this is probably more to do with Mysql but I figured i'd ask here as well.

The problem:
When connecting to the mysql server on the local machine its fine, but when you 
connect to a remote machine 
eg $db = mysql_connect(x.x.x.x, user, password);
and request something from the database, it connects, BUT it takes about 5 minutes...


any ideas???

Jo



Re: [PHP] Printing Problem

2002-07-07 Thread Miguel Cruz

On Mon, 8 Jul 2002, Chris Kay wrote:
 I'll repeat my ealier question because some people can not think for
 themselves..

Why insult people who are trying to help you? Nobody gets paid to read 
this list; they're doing it to be nice.

 I want to run a print job of 200+ invoices
 
 I have a javascript code to open a print dialog box and
 Then go to next invoice and do the loop..
 
 Problem I am having is that I want it to pause if the ok button on the 
 dialog Box is not pressed..
 When I run the script it fly's throught and brings up a heap of printer
 Dialog boxes which causes me to ctrl+alt+del...
 
 Anyway or pausing the script untill ok is pressed?

You are running into client behavior that is out of your control. If I had
to print that much stuff, I'd generate one big document containing all of
them, and insert page breaks. Then it would go as a single print job.  If
your operator is using IE, Try something like p
style=page-break-before:always at the top of each new invoice. 
Otherwise, generate RTF or PDF.

miguel


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Justin French

on 08/07/02 10:48 AM, Mark Charette ([EMAIL PROTECTED]) wrote:

 Or, even easier and no tech, I get a low-paying job in some convenience
 store, and make copies of the credit card receipts.
 
 Game Over.
 
 Using a credit card anywhere involves trust. Period. End of story.

Couldn't agree more.  Went out for lunch yesterday, and the waiter had my
card for at least 5 minutes.  Worse still, they've probably got 5 years of
receipts and cc#'s (with signatures!!) stored in  a cardboard box in their
office.

I think the only difference (I guess) between the offline and online worlds
is that 1000's of CC#'s stored online in a digital format (eg database) is a
lot more enticing than 1000's of cc#'s stored on little bits of paper.

I guess to a hacker the thought of breaking a password is a little more
enticing than breaking a window too!


Justin French


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




Re: [PHP] Retrieving/Displaying hyperlinked images with PHP

2002-07-07 Thread Miguel Cruz

On Sat, 6 Jul 2002, markbm wrote:
 I am trying to build a product detail page that pulls data from a
 MYSQL database using PHP. The data for the page includes product images,
 which I am trying to link to (i.e. from their location on the web
 server) instead of loading the images into the database. However, I
 cannot find any sample code that seems to work. Two questions:
 
 1. Is this possible (i.e. to store the HYPERLINK to the image in the
 database , and as the results are returned to the product detail screen,
 the image file will be displayed)? OR RATHER do I need to store the
 physical image file in the database location and query it that way?

It's obviously much easier to store the link or the file name in the 
database. In fact, it's so easy that I can't guess offhand what aspect of 
it you might be having trouble with. Perhaps you could show some more code 
and explain the symptoms you are observing.

miguel


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




Re: [PHP] PHP/mysql connection problem

2002-07-07 Thread Chris Shiflett

Jo wrote:

The problem:
When connecting to the mysql server on the local machine its fine, but when you 
connect to a remote machine 
eg $db = mysql_connect(x.x.x.x, user, password);
and request something from the database, it connects, BUT it takes about 5 minutes...


I have an idea, yes. Make sure that the machine you are connecting to 
can do a reverse lookup on the machine you are connecting from. Meaning, 
either your DNS has to be properly configured to include thie remote 
machine, or you need to add it to your /etc/hosts file.

To see whether I'm even on the right track, try to telnet or ftp 
manually rather than make a database connection. You should see the same 
timeout condition occur, because the remote machine will basically try 
to see who is connecting, and if it can't figure it out, it's going to 
first time out before giving up.

Happy hacking.

Chris


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




Re: [PHP] Sockets 'requested address is not valid in its context'

2002-07-07 Thread Miguel Cruz

On Sat, 6 Jul 2002, Zac Hillier wrote:
 I'm opening a port on a remote machine presently I'm using fsockopen() which
 is fine for opening the port and sending data however I'm having trouble
 reading data back from the port.
 
 So I've considered using socket functions but do not appear to be able to
 get a connection. When I run the code below pointing to 127.0.0.1 everything
 runs fine however when I point to 192.168.123.193 (Another machine on the
 local network without a server running) I get these errors.

You can't bind to a socket on another machine. You have to bind the socket
to a local address (i.e., on your machine) and then either listen for
incoming connections or initiate an outbound connection from that socket.

miguel


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




RE: [PHP] PHP/mysql connection problem

2002-07-07 Thread Peter


 Hey all, this is probably more to do with Mysql but I figured i'd 
 ask here as well.
 
 The problem:
 When connecting to the mysql server on the local machine its 
 fine, but when you connect to a remote machine 
 eg $db = mysql_connect(x.x.x.x, user, password);
 and request something from the database, it connects, BUT it 
 takes about 5 minutes...
that depends on load on the server  or network i think... how much info are you tring 
to get? try it will a very small amount and see if there is a difference...


Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Tracker 1

Personally, I think the concept of NEEDING https is a bit rediculous.

Generally, trying to get through the front door, would be the same as
trying to get through a concrete wall with a baseball bat...

Now, finding a back door, and getting at THEIR database is the REAL key.
people don't generally try and hack routers... most current router systems
haven't been hacked.. there are attempts, same as anything else.. it just
isn't very common.

if you can steal the keys, you can steal the database, which holds more
than stealing a site for a few minutes.

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 In public key cryptography, it is the *keys*, not the digital
 certificate that encrypt/decrypt the communication.

 Okay.

 I break into his co-lo, I walk off with his computer, and I break into his
 office, I walk off with his computers, I kill the guy, and I kidnap his
 wife.

 I have everything.

 I have his Certs, his keys, his server, his domain, *EVERYTHING*.

 This is not *IMPOSSIBLE*, no matter how unlikely it is painted.

 But let me paint a more-likely scenario.

 Some guy sets up a tiny on-line retail shop on his $20/month ISP.
 Whoo-Hooo!

 He gets hacked, never even notices, and his Certs and keys are all stolen.
 Meanwhile, the guy good enough to do that is also good enough to routinely
 hijack his domain name for short periods of time.

 Game Over.

 How about another, even *easier* scenario.

 I set up a nice little retail shop that specializes in hard-to-find items.
 I scour the 'net for things people can't seem to find anywhere else, not
 even eBay.  Nothing big or really expensive, just odd parts and pieces of
 things.

 I build a nice big web-site catalog shopping cart.

 I buy a Cert for a whopping $119.

 I collect the credit cards for a day or two, I charge them nine ways to
 Sunday, and I take off.

 Game Over.

 How about an even *easier* scenario:

 I find a web-site that is storing the credit-card numbers in their database,
 and rip them off.

 Game Over.

 that issued his certificate, he may as well let you run your rogue site
 off of his server; it's the same difference.

 Exactly!

 Or, he may as well be the criminal and *GET* a CA signed certificate for
 his criminal web-site.

 I do not trust that a CA Signed Cert is worth the bits its stored in.

 If you trust Microsoft with Security, shop away.

 Think of it this way. Let's use https://www.amazon.com/ as an example.
 Do you trust doing business with them? I sure do; at least I trust 100%
 that my HTTP requests are going to get to the www.amazon.com server
 safely. If someone stole their SSL certificate:

 Forget amazon.com.

 Real-world example from *MY* personal life:  Stick with unknowncompany.com
 -- a site you do *NOT* know, you do *NOT* trust, but they are the only ones
 that have the power-supply you need to run your laptop.

 You can:
 A) Throw away your laptop.
 B) Risk the fact that an unknown site with a CA Signed Certificate
 (Ooh I'm impressed (not)) is the only one who can sell you the part you
 need to power the laptop.
 C) Try (and fail miserably) to find the part in real stores, and go back
 to A or B.

 Yes, this really happened to me.

 Yes, I really bought the thing on-line.

 No, I had no trust that they weren't crooks or at least incompetents.

 Yes, that's why the current system is insufficient.

 Yes, that's why I think it is ridiculous that people have essentially been
 trained to trust that little lock icon in the browser, no matter how naive
 that is, and how untrustworthy it is.

 Now, on to stealing their domain name. All of a sudden, Amazon is
 getting no traffic. Think they won't notice?

 Again, forget Amazon.

 There *ARE* on-line retailers who don't get any traffic, whose ISP's are so
 crappy their site is down all the time.

 Think they would notice?

 How quickly?

 What's their response?  Call up the ISP and complain, and the ISP says
 Hmmm, it's working okay now.  Probably just a network outage

 Think it matters since the
 HTTP requests you'll be receiving can't be decrypted by you anyway?

 Assume I've also stolen their Cert and keys and whatever else it takes to
 steal your credit card number.

 Yes, there are fewer sites where that's possible, but is it 0?  No.  Is it
 growing, as more and more mom-n-pop on-line stores are built on $20/month
 hosts with crappy Security?

 Are you telling me you've never walked in to an eCommerce site to find
 major, huge, gaping holes in their security?

 Are you telling me those sites don't exist?

 Actually, assume the 

Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

 Chris Shiflett wrote:
 it is very misleading and would indicate that I 
 have very little knowledge about PKI systems, 

Come on, nobody here would ever think of that. Especially since most of 
us (put me as first one in the list) should know much more about PKI 
ourselves before judging anybody's knowledge :) Which is why we keep 
making questions that sometimes may be pretty absurd.

 I was trying to point out 
 how insecure this model would be if encryption were all that SSL 
 provided and the only trust involved was the trust of a domain name.

Yes, I've got it now.

 No government, as far as I know, can break the public key cryptography 
 currently being used by most SSL-enabled sites (using the strong 
 security - 128 bit certificates). This includes the United States.

I was saying this because I remember (maaany years ago, when the whole 
PGP thing started) reading some fire exchanges about RSA keys and the 
way the encrypting chips were going to be friendly to american eyes. 
Honestly, at that time I was not that interested to the issue and I just 
gave it a quick read, which left me with a wrong opinion.

 Now, SSL only encrypts your communication in transit, of course. I'm 
 sure your local government could find a way to make the entity you are 
 communicating with release the information in the communication to them. 
 This is, of course, outside the scope of SSL.

And outside the scope of my worries :) I am responsible for the software 
I deliver, whatever happens out of it is none of my bag :)

 However, it is adequate to know that one key is used to do the 
 encrypting, while the other is used for the decrypting. These are 
 generally referred to as public and private keys, because one is made 
 available to the public while the other is kept safely stored (in the 
 case of Web browsers, it is stored in the certificate repository of the 
 browser).

Yes, glad that I did use PGP sometimes :) this part is clear :) So 
Verisign is actually just signing the key as I did on PGP and that 
means anyone trusting me can trust you if they receive a message signed 
with your key, because when evaluating the message they will now it';s 
been signed by a key that I would trust myself. Right? Man, I don't even 
wanna imagine where and how Verisign password is kept LOLOL

 Digital certificates solve this problem. A digital certificate, as RSA 
 describes it, is a document that says:
 
 I guarantee that this particular public key is associated with this 
 particular user; Trust me!

So actually, when you spend your $200 what happens is:
   1) Verisign (or whoever) starts a process to control they really wanna
  play with you (and this has nothing to do with IT or SSL, they will
  have their own policies)
   2) Verisign (or whoever) starts a process to control your public key
  and possibly something else in your system
   3) If the above has a positive answer they just sign your kay and hand
  it over to you. So there is no need for a central db. Trust is *in*
  the key and need not be searched for. The only thing to do is to
  verify that the trusting key has not been revoked.

That is, if it works like PGP. But this is probably too easy, as this 
way they would have no way to revoke my key without invalidating all 
keys on this planet. So this is a simplification. But just tell me if I 
got the basic message.

 So, assuming for the moment that we trust the certificate, we can assume 
 that a particular public key belongs to a particular user. For example, 
 you can be guaranteed that a public key belongs to me (Chris Shiflett) 
 and thus, only Chris Shiflett will be able to decrypt the communication. 
 If someone is trying to pose as me, you may send them encrypted 
 communication, but they won't be able to decrypt it.

Yes, because they have stolen the public key and could crypt the 
question but since they have not the private key they cannot open the 
answer.

 Well, I disagree that this has nothing to do with the SSL protocol 
 itself. Identification is a very important part of enabling secure 
 transactions to take place over the Web. Without this, there would be no 
 ecommerce as it has been dubbed.
...
 Of course, as users of Web browsers such as Netscape and Internet 
 Explorer, we have to trust AOL/Time Warner and Microsoft, respectively, 
 (yeah, scary thought) to only trust CAs that have high integrity, 
 security, etc. An extensive CA (Certification and Accredidation) 
 process is used to make this guarantee.

Yes, but this is the part I doubt. When I buy a certificate from Kiev, 
how on earth those guys sitting in Washington are to know who I am and 
what I do for a living? They will have to handle the job to someone 
else. This layering of delegations will include banks and governmental 
stuff, and there is no such thing as a government that will not accept 
bribery.

Chris, what me and Richard doubt is *NOT* the tech factor. That part is 
okay. But is a 

[PHP] newbie: question about question marks

2002-07-07 Thread Alexander Ross

Can someone explain to me what the ? does.  I have a vague idea of what it
means in a URL (please cearify that) but I haven't the slightest what it
means in php code.  Thanks for your help

Alex



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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Miguel Cruz

On Mon, 8 Jul 2002, Alberto Serra wrote:
 Chris Shiflett wrote:
 Of course, as users of Web browsers such as Netscape and Internet 
 Explorer, we have to trust AOL/Time Warner and Microsoft, respectively, 
 (yeah, scary thought) to only trust CAs that have high integrity, 
 security, etc. An extensive CA (Certification and Accredidation) 
 process is used to make this guarantee.
 
 Yes, but this is the part I doubt. When I buy a certificate from Kiev, 
 how on earth those guys sitting in Washington are to know who I am and 
 what I do for a living? They will have to handle the job to someone 
 else. This layering of delegations will include banks and governmental 
 stuff, and there is no such thing as a government that will not accept 
 bribery.

We (in the USA) bought our corporate certificate from Thawte, a company in
South Africa.

You wouldn't believe the amount of stuff they had me dredge up; it was
like a scavenger hunt. I had to get the lawyers to dig out the official
incorporation documents; I had to get accounting to dig out all sorts of
tax bills; I had to get phone bills and executive signatures and who knows
what else. When I sent them some Delaware incorporation document, they
were familiar enough with the format to know that an (unnumbered) page was
missing, and to ask me to find it and fax it to them.

 What we *do not* believe (correct me Richard if I misunderstood you) is 
 that Verisign (or whoever in their place) will actually do more than 
 verifying that www.goodguys.org is really existing and it's there. And 
 this is just a protection against hackers but has nothing to with 
 consumer's privacy or security. People at goodguys.org will not be 
 checked anyway as far as they behaviour as a company is concerbed (that 
 would cost *much* more than $200 and it would be way to easy for the 
 crooks to buy themselves a virginity by doubling the money).

Nobody thinks they're checking whether or not goodguys.com are good guys. 
It is your job as a consumer to research them. Once you have researched 
them and decided to do business with them, the certificate authority gives 
you a pretty solid basis for believing that you actually are dealing with 
the people you were prepared to trust. That's the point.

miguel


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




RE: [PHP] Printing Problem

2002-07-07 Thread Chris Kay



Thank you

That's what I was asking for and needed to know, 
I had thought of something along those lines but was interested if
anyone had found a 
Different way, I was not intending to insult anyone, was just implying
that I not be made a fool When people have not real and thought about my
email.

Sorry if I upset anyone.


---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for
Business

---




-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 08, 2002 11:29 AM
To: Chris Kay
Cc: PHP General List
Subject: Re: [PHP] Printing Problem


On Mon, 8 Jul 2002, Chris Kay wrote:
 I'll repeat my ealier question because some people can not think for 
 themselves..

Why insult people who are trying to help you? Nobody gets paid to read 
this list; they're doing it to be nice.

 I want to run a print job of 200+ invoices
 
 I have a javascript code to open a print dialog box and
 Then go to next invoice and do the loop..
 
 Problem I am having is that I want it to pause if the ok button on the
 dialog Box is not pressed..
 When I run the script it fly's throught and brings up a heap of
printer
 Dialog boxes which causes me to ctrl+alt+del...
 
 Anyway or pausing the script untill ok is pressed?

You are running into client behavior that is out of your control. If I
had to print that much stuff, I'd generate one big document containing
all of them, and insert page breaks. Then it would go as a single print
job.  If your operator is using IE, Try something like p
style=page-break-before:always at the top of each new invoice. 
Otherwise, generate RTF or PDF.

miguel


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




Re: [PHP] newbie: question about question marks

2002-07-07 Thread Miguel Cruz

On Sun, 7 Jul 2002, Alexander Ross wrote:
 Can someone explain to me what the ? does.  I have a vague idea of what
 it means in a URL (please cearify that) but I haven't the slightest what
 it means in php code.  Thanks for your help

Read about the ternary operator at:

  http://www.php.net/manual/en/language.operators.comparison.php

miguel


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




[PHP] MING

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

has anyone been using MING extension in a production environment? Is it 
robust?

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Chris Shiflett

Alberto Serra wrote:

 However, it is adequate to know that one key is used to do the 
 encrypting, while the other is used for the decrypting. These are 
 generally referred to as public and private keys, because one is made 
 available to the public while the other is kept safely stored (in the 
 case of Web browsers, it is stored in the certificate repository of 
 the browser).


 Yes, glad that I did use PGP sometimes :) this part is clear :) So 
 Verisign is actually just signing the key as I did on PGP and that 
 means anyone trusting me can trust you if they receive a message 
 signed with your key, because when evaluating the message they will 
 now it';s been signed by a key that I would trust myself. Right?


I have very little experience with PGP, so I can't confirm the 
similarities here. However, I think you may be still misunderstanding 
the role of VeriSign (I could easily be wrong). I'll explain it again 
briefly, just to be certain.

The asymmetric cryptography that guarantees your HTTP communication 
cannot be decrypted except by the final recipient is only half (or less 
than half) of the battle. You need to also have some sort of assurance 
that the final recipient is who they claim to be and not an imposter.

When you apply for a digital certificate from VeriSign, you must present 
a request in a specific format. Part of this process of purchase 
involves you proving that you are the holder of the public key (verified 
by the generation of the request by your Web server software) and the 
legitimate owner of the specific domain name the certificate is being 
used for. With this information, VeriSign will use the fact that pretty 
much every Web client on the planet trusts VeriSign to issue you a 
certificate that says:

We, VeriSign, assure you that the following public key belongs to 
www.niceguy.org.

This means that nearly every Web client on the planet will trust that 
the public key mentioned in that digital certificate really belongs to 
www.niceguy.org, so any communication encrypted with it can only be 
decrypted by the private key of www.niceguy.org.

 Digital certificates solve this problem. A digital certificate, as 
 RSA describes it, is a document that says:

 I guarantee that this particular public key is associated with this 
 particular user; Trust me!


 So actually, when you spend your $200 what happens is:
   1) Verisign (or whoever) starts a process to control they really wanna
  play with you (and this has nothing to do with IT or SSL, they will
  have their own policies)
   2) Verisign (or whoever) starts a process to control your public key
  and possibly something else in your system
   3) If the above has a positive answer they just sign your kay and hand
  it over to you. So there is no need for a central db. Trust is *in*
  the key and need not be searched for. The only thing to do is to
  verify that the trusting key has not been revoked.


VeriSign doesn't do extensive checks on your use of the digital 
certificate, because that is all outside of the scope of SSL. Their 
methods are to ensure that the claim they are making in the digital 
certificate (mentioned above) is true. Since that's all they're 
guaranteeing, that's all they need to ensure.

Also, VeriSign does keep a central repository of all digital 
certificates it has issued. Next time you are on an SSL site, go into 
the security configuration menus specific to your browser and see if you 
can find a way to verify the certificate. This will manually kick off 
the process to verify the certificate with the CA. You can revoke a 
certificate to make it fail this check and pretty much render it 
useless, except that people can still use it to encrypt email.

 So, assuming for the moment that we trust the certificate, we can 
 assume that a particular public key belongs to a particular user. For 
 example, you can be guaranteed that a public key belongs to me (Chris 
 Shiflett) and thus, only Chris Shiflett will be able to decrypt the 
 communication. If someone is trying to pose as me, you may send them 
 encrypted communication, but they won't be able to decrypt it.


 Yes, because they have stolen the public key and could crypt the 
 question but since they have not the private key they cannot open the 
 answer. 


Actually, what I meant here is not that they will even use the public 
key, but that other people whose browsers are tricked into thinking 
they're really talking to www.niceguy.org will use niceguy.org's public 
key to encrypt the communication. Then, only niceguy.org will be able to 
decrypt the communication, regardless of who receives it.

The digital certificate is quite public itself. If you go to an 
SSL-enabled site, you can view theirs (since they have to present it to 
your browser). The statement it makes doesn't change, so it doesn't 
matter if the criminal has possession of it; it's public anyway (just 
like the key). The private key is the 

Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Chris Shiflett

Miguel Cruz wrote:

Nobody thinks they're checking whether or not goodguys.com are good guys. 
It is your job as a consumer to research them. Once you have researched 
them and decided to do business with them, the certificate authority gives 
you a pretty solid basis for believing that you actually are dealing with 
the people you were prepared to trust. That's the point.


Miguel is absolutely right, and he probably did a better job at making 
this more clear, since I seem to be failing miserably. :)



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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

This is for Chris and Miguel and all the people who threw in infos.

I just wanted to thank you all :) It's been really useful, and yes 
Chris, I guess you should post an explanation of the process somewhere. 
Most of us are prepared to use HTTPS but we can hardly explain our 
customers (and ourselves) what the hell we are doing.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] ini_set() broken?

2002-07-07 Thread Greg Donald


This code doesn't work:

?
if(ini_set(register_globals, 0))
  echo ini_set success;
else
  echo ini_set failed;
?

At http://php.net/ini_set it states the following setting is possible:

register_globals 0 PHP_INI_ALL

Translated, PHP_INI_ALL means: Entry can be set anywhere

So does anyone know why my code doesn't work then?  ini_set() seems 
broken.  Can anyone confirm or deny?

I am using PHP 4.2.1 and on this particular project I am moving existing 
code from a Linux/Apache setup where I developed it, to it's home on a 
microsoft/iis server.  Obviously I do not have access to the php.ini file.

Thanks in advance.. :)


-- 
---
Greg Donald
http://destiney.com/public.key
---



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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Miguel Cruz

On Sun, 7 Jul 2002, Greg Donald wrote:
 This code doesn't work:
 
 ?
 if(ini_set(register_globals, 0))
   echo ini_set success;
 else
   echo ini_set failed;
 ?

Please don't say this code doesn't work. Say why you think it didn't 
work, whether that's because you received an error message, or a specific 
expected outcome was not realized, or whatever. Otherwise it doesn't 
really tell us anything. Obviously it doesn't work or you wouldn't be 
posting it.

 At http://php.net/ini_set it states the following setting is possible:
 
 register_globals 0 PHP_INI_ALL
 
 Translated, PHP_INI_ALL means: Entry can be set anywhere
 
 So does anyone know why my code doesn't work then?  ini_set() seems 
 broken.  Can anyone confirm or deny?

I believe the issue here is that by the time your PHP code starts
executing and gets to the ini_set call, it's too late to register the
globals (which must happen before execution begins). Therefore I'd suggest
looking into .htaccess or whatever the IIS equivalent is. If there's no
equivalent then I'd suggest throwing the server out the window.

miguel


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




[PHP] is their a jobs mailing list?

2002-07-07 Thread Peter J. Schoenster

Hi,

I was here first:

http://www.php.net/manual/en/faq.mailinglist.php#faq.mailinglist.guideline

 Before you post to the list please have a look in this FAQ 

But I found nothing about a jobs mailing list. I'm really a Perl programmer and 
we have jobs.perl.org which has a list which does a really good job. 

A person from Houston, TX asked me if I knew of any PHP people in Houston. 
I advertise on Google and Overture as a developer for hire.

I don't sugget he post to this list as I'm not sure of the etiquette and I've never 
seen jobs posted to this list; I know they are accepted heartily on the 
mod_perl list. 

Anything simple but effective like this site for PHP?

http://jobs.perl.org/

Peter




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




Re: [PHP] Retrieving/Displaying hyperlinked images with PHP

2002-07-07 Thread markbm

Thanks for the reply. The question is how to pull that hyperlink/file
location and display the image file on a PHP page. Basically, the text in
the FRONT_REND field is just an image name (1855.jpg), and I store the
prefix to that location on the page. I have included all the code from my
page belowthe issue at hand is noted by //Problem Area//. Note also,
that all fields above this item are simply just retrieving text from a db
field not retrieving a file from the db/web server location. Again, thanks
for your help.

CODE:
===

body



?php



$db = mysql_connect(localhost, username, password);



mysql_select_db(dbname,$db);



$result = mysql_query(SELECT * FROM PRODUCTS,$db);


printf(ID: %sbr\n, mysql_result($result,0,ID));
printf(HPG_PLAN_ID: %sbr\n, mysql_result($result,0,HPG_PLAN_ID));
printf(DESIGNER: %sbr\n, mysql_result($result,0,DESIGNER));
printf(PLAN_NAME: %sbr\n, mysql_result($result,0,PLAN_NAME));
printf(EXTERIOR: %sbr\n, mysql_result($result,0,EXTERIOR));
printf(NUM_BEDROOMS: %sbr\n, mysql_result($result,0,NUM_BEDROOMS));
printf(NUM_BATHS: %sbr\n, mysql_result($result,0,NUM_BATHS));
printf(NUM_FLOORS: %sbr\n, mysql_result($result,0,NUM_FLOORS));
printf(GARAGE: %sbr\n, mysql_result($result,0,GARAGE));
printf(NUM_CARS: %sbr\n, mysql_result($result,0,NUM_CARS));
printf(FOUNDATION: %sbr\n, mysql_result($result,0,FOUNDATION));
printf(MAT_LIST: %sbr\n, mysql_result($result,0,MAT_LIST));
printf(COLOR_REND: %sbr\n, mysql_result($result,0,COLOR_REND));
printf(PICTURES: %sbr\n, mysql_result($result,0,PICTURES));
printf(REPRODUCIBLE: %sbr\n, mysql_result($result,0,REPRODUCIBLE));
printf(RR_REVERSE: %sbr\n, mysql_result($result,0,RR_REVERSE));
printf(MIRROR_REV: %sbr\n, mysql_result($result,0,MIRROR_REV));
printf(CAD_FILES: %sbr\n, mysql_result($result,0,CAD_FILES));
printf(BONUS_ROOM: %sbr\n, mysql_result($result,0,BONUS_ROOM));
printf(WIDTH: %sbr\n, mysql_result($result,0,WIDTH));
printf(DEPTH: %sbr\n, mysql_result($result,0,DEPTH));
printf(HEAT_SQ_FT: %sbr\n, mysql_result($result,0,HEAT_SQ_FT));
printf(UNHEAT_SQ_FT: %sbr\n, mysql_result($result,0,UNHEAT_SQ_FT));
printf(TOTAL_SQ_FT: %sbr\n, mysql_result($result,0,TOTAL_SQ_FT));
printf(ROOF_TYPE: %sbr\n, mysql_result($result,0,ROOF_TYPE));
printf(ROOF_PITCH: %sbr\n, mysql_result($result,0,ROOF_PITCH));
printf(SEC_ROOF_PITCH: %sbr\n,
mysql_result($result,0,SEC_ROOF_PITCH));
printf(MAIN_CEIL_HEIGHT: %sbr\n,
mysql_result($result,0,MAIN_CEIL_HEIGHT));
printf(PLAN_DESCRIPTION: %sbr\n,
mysql_result($result,0,PLAN_DESCRIPTION));
printf(REL_PLAN1: %sbr\n, mysql_result($result,0,REL_PLAN1));
printf(REL_PLAN2: %sbr\n, mysql_result($result,0,REL_PLAN2));
printf(REL_PLAN3: %sbr\n, mysql_result($result,0,REL_PLAN3));
printf(REL_PLAN4: %sbr\n, mysql_result($result,0,REL_PLAN4));
printf(REL_PLAN5: %sbr\n, mysql_result($result,0,REL_PLAN5));
printf(REL_PLAN6: %sbr\n, mysql_result($result,0,REL_PLAN6));
printf(REL_PLAN7: %sbr\n, mysql_result($result,0,REL_PLAN7));
printf(REL_PLAN8: %sbr\n, mysql_result($result,0,REL_PLAN8));
printf(REL_PLAN9: %sbr\n, mysql_result($result,0,REL_PLAN9));

//Problem code //

// Then show image and/or details
echo img src=http://www.website.com/images/.$result[FRONT_REND].;;


//printf(FRONT_REND: %sbr\n, mysql_result($result,0,'a
href=FRONT_REND/a'));
printf(REAR_REND: %sbr\n, mysql_result($result,0,REAR_REND));
printf(SIDE_REND1: %sbr\n, mysql_result($result,0,SIDE_REND1));
printf(SIDE_REND2: %sbr\n, mysql_result($result,0,SIDE_REND2));
printf(THMBNAIL_IMG: %sbr\n, mysql_result($result,0,THMBNAIL_IMG));
printf(FLRPLAN_1: %sbr\n, mysql_result($result,0,FLRPLAN_1));
printf(FLRPLAN_2: %sbr\n, mysql_result($result,0,FLRPLAN_2));
printf(FLRPLAN_3: %sbr\n, mysql_result($result,0,FLRPLAN_3));
printf(OTHER_IMG1: %sbr\n, mysql_result($result,0,OTHER_IMG1));
printf(OTHER_IMG2: %sbr\n, mysql_result($result,0,OTHER_IMG2));
printf(NUM_HITS: %sbr\n, mysql_result($result,0,NUM_HITS));
printf(PAYPAL_BUTTON: %sbr\n, mysql_result($result,0,PAYPAL_BUTTON));





?



/body

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sat, 6 Jul 2002, markbm wrote:
  I am trying to build a product detail page that pulls data from a
  MYSQL database using PHP. The data for the page includes product images,
  which I am trying to link to (i.e. from their location on the web
  server) instead of loading the images into the database. However, I
  cannot find any sample code that seems to work. Two questions:
 
  1. Is this possible (i.e. to store the HYPERLINK to the image in the
  database , and as the results are returned to the product detail screen,
  the image file will be displayed)? OR RATHER do I need to store the
  physical image file in the database location and query it that way?

 It's obviously much easier to store the link or the file name in the
 database. In fact, it's so easy that I can't guess offhand what aspect of
 it you might be having trouble with. 

Re: [PHP] ini_set() broken?

2002-07-07 Thread Greg Donald

On Sun, 7 Jul 2002, Miguel Cruz wrote:

 ?
 if(ini_set(register_globals, 0))
   echo ini_set success;
 else
   echo ini_set failed;
 ?

Please don't say this code doesn't work. Say why you think it didn't 
work, whether that's because you received an error message, or a specific 

Uhh.. I don't have any thoughts as to why it doesn't work, that's why I 
posted.  The function itself appears broken, my code is a test to that 
notion.  If you can't be helpful then feel free to shutup..

expected outcome was not realized, or whatever. Otherwise it doesn't 
really tell us anything. Obviously it doesn't work or you wouldn't be 
posting it.

Yes, the obvious is always pretty easy to restate.  If you need more 
explanation than the code itself I don't knwo what to tell you.

 At http://php.net/ini_set it states the following setting is possible:
 
 register_globals 0 PHP_INI_ALL
 
 Translated, PHP_INI_ALL means: Entry can be set anywhere
 
 So does anyone know why my code doesn't work then?  ini_set() seems 
 broken.  Can anyone confirm or deny?

I believe the issue here is that by the time your PHP code starts
executing and gets to the ini_set call, it's too late to register the

gets to the ini_set call - what do you mean?  The code I posted is all 
there is to the entire script.  Where else would I use the ini_set() 
function except at the very beginning of a script?

globals (which must happen before execution begins). Therefore I'd suggest
looking into .htaccess or whatever the IIS equivalent is. If there's no

Thanks but I have no idea about IIS, that's why I posted, to see if this 
might be an IIS specific issue some other windows users experienced. 

equivalent then I'd suggest throwing the server out the window.

Yes..


-- 
---
Greg Donald
http://destiney.com/public.key
---



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




RE: [PHP] ini_set() broken?

2002-07-07 Thread Martin Towell



On Sun, 7 Jul 2002, Miguel Cruz wrote:

 ?
 if(ini_set(register_globals, 0))
   echo ini_set success;
 else
   echo ini_set failed;
 ?

[snip]

I haven't tried this code, but I assume you're trying to say that ini_set
failed is displayed, but you're expecting the other output to be displayed.
Am I correct there?

What happens if you use http://localhost/file.php?var=something or whatever
your test script's path is and have this line at the end of the script
  echo var = |$var|;

does $var contain anything. If it doesn't, then ini_set() worked...
otherwise.. um... find other way of doing it(??)

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




[PHP] compare variables from text fields...

2002-07-07 Thread Jas

What is the best function or operator to compare two text strings being
inputted by a text field within a form?  Any help is appreciated.
Thanks in advance,
Jas



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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Chris Shiflett

Greg Donald wrote:

If you can't be helpful then feel free to shutup..


Please don't attack people who freely give their time to try and help 
you. Mr. Cruz did not ridicule you in any way but merely asked that you 
be more specific than, it doesn't work, which is very good advice and 
a sincere attempt at helping you solve your problem. I can vouch that 
participating on this list and attempting to give helpful answers takes 
a great deal of time and there is absolutely no benefit, so try to be 
more respectful.

I refer you to this URL:

http://www.tuxedo.org/~esr/faqs/smart-questions.html

Chris


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




[PHP] support@bignickel.net

2002-07-07 Thread Jas

http://www.adobe.com/products/premiere/demodnld.html#win



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




RE: [PHP] ini_set() broken?

2002-07-07 Thread Greg Donald

On Mon, 8 Jul 2002, Martin Towell wrote:

 ?
 if(ini_set(register_globals, 0))
   echo ini_set success;
 else
   echo ini_set failed;
 ?

I haven't tried this code

Then why comment on it?

but I assume you're trying to say that ini_set
failed is displayed, but you're expecting the other output to be displayed.
Am I correct there?

Yes, is it not obvious enough from just reading the code?  I am showing 
that the ini_set() function is not working properly, as per the manual. 
The manual states that ini_set() returns the old value on success and 
FALSE on failure.  My script always returns false.  Any idea why?

What happens if you use http://localhost/file.php?var=something or whatever
your test script's path is and have this line at the end of the script
  echo var = |$var|;

What does this prove or disprove in relation to the ini_set() function?  
If you knew anything about the function then you would see I am passing it 
a big fat zero in the second parameter, just as the manual states I can. I 
also tried Off and off, same results.

does $var contain anything. If it doesn't, then ini_set() worked...
otherwise.. um... find other way of doing it(??)

Yes..  another way, any suggestions?


-- 
---
Greg Donald
http://destiney.com/public.key
---



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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Greg Donald

On Sun, 7 Jul 2002, Chris Shiflett wrote:

I refer you to this URL:

http://www.tuxedo.org/~esr/faqs/smart-questions.html

I refer you to this URL: http://php.net/ini_set and ask why does this 
function not work as per the manual? 

Again, here is my code:

?
if(ini_set(register_globals, 0))
  echo ini_set success;
else
  echo ini_set failed;
?


-- 
---
Greg Donald
http://destiney.com/public.key
---



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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Jason Wong

Greg Donald said:
 On Sun, 7 Jul 2002, Miguel Cruz wrote:

 ?
 if(ini_set(register_globals, 0))
   echo ini_set success;
 else
   echo ini_set failed;
 ?

Please don't say this code doesn't work. Say why you think it didn't
 work, whether that's because you received an error message, or a
 specific

 Uhh.. I don't have any thoughts as to why it doesn't work, that's why I
 posted.

Even if you don't know _why_ it didn't work, you could at least state what
you _expected_ to see and what you _actually_ saw.

 The function itself appears broken, my code is a test to that
 notion.  If you can't be helpful then feel free to shutup..

It would be helpful on your part if you had stated your problem clearly.

expected outcome was not realized, or whatever. Otherwise it doesn't
 really tell us anything. Obviously it doesn't work or you wouldn't be
 posting it.

Absolutely.

 Yes, the obvious is always pretty easy to restate.  If you need more
 explanation than the code itself I don't knwo what to tell you.

Again, what you expected to happen, and what actually happened are usually
a good starting points.

 At http://php.net/ini_set it states the following setting is
 possible:

 register_globals 0 PHP_INI_ALL

 Translated, PHP_INI_ALL means: Entry can be set anywhere

I'm not sure about this, but I don't think it was possible in previous
versions PHP.

 So does anyone know why my code doesn't work then?  ini_set() seems
 broken.  Can anyone confirm or deny?

I believe the issue here is that by the time your PHP code starts
 executing and gets to the ini_set call, it's too late to register the

 gets to the ini_set call - what do you mean?  The code I posted is all
  there is to the entire script.  Where else would I use the ini_set()
 function except at the very beginning of a script?

Because PHP registers the globals etc (if enabled) then starts working on
your code.

Anyway, regardless of whether or not it is possible to set
register_globals at run-time, your code would be better re-written as:

?
 if (ini_set(register_globals, 0) !== FALSE)
   echo ini_set success;
 else
   echo ini_set failed;
?

Because, if you RTFM, ini_set() will return the existing value of whatever
you're setting. Thus if register_globals was already disabled then your
original code would return ini_set failed everytime.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk



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




Re: [PHP] Retrieving/Displaying hyperlinked images with PHP

2002-07-07 Thread Miguel Cruz

Instead of:

echo img src=http://www.website.com/images/.$result[FRONT_REND].;;

Wouldn't you want it to be:

echo img src='http://www.website.com/images/; . mysql_result($result, 
0, 'FRONT_REND') . '';

...?

miguel

On Sun, 7 Jul 2002, markbm wrote:
 Thanks for the reply. The question is how to pull that hyperlink/file
 location and display the image file on a PHP page. Basically, the text in
 the FRONT_REND field is just an image name (1855.jpg), and I store the
 prefix to that location on the page. I have included all the code from my
 page belowthe issue at hand is noted by //Problem Area//. Note also,
 that all fields above this item are simply just retrieving text from a db
 field not retrieving a file from the db/web server location. Again, thanks
 for your help.
 
 CODE:
 ===
 
 body
 
 
 
 ?php
 
 
 
 $db = mysql_connect(localhost, username, password);
 
 
 
 mysql_select_db(dbname,$db);
 
 
 
 $result = mysql_query(SELECT * FROM PRODUCTS,$db);
 
 
 printf(ID: %sbr\n, mysql_result($result,0,ID));
 printf(HPG_PLAN_ID: %sbr\n, mysql_result($result,0,HPG_PLAN_ID));
 printf(DESIGNER: %sbr\n, mysql_result($result,0,DESIGNER));
 printf(PLAN_NAME: %sbr\n, mysql_result($result,0,PLAN_NAME));
 printf(EXTERIOR: %sbr\n, mysql_result($result,0,EXTERIOR));
 printf(NUM_BEDROOMS: %sbr\n, mysql_result($result,0,NUM_BEDROOMS));
 printf(NUM_BATHS: %sbr\n, mysql_result($result,0,NUM_BATHS));
 printf(NUM_FLOORS: %sbr\n, mysql_result($result,0,NUM_FLOORS));
 printf(GARAGE: %sbr\n, mysql_result($result,0,GARAGE));
 printf(NUM_CARS: %sbr\n, mysql_result($result,0,NUM_CARS));
 printf(FOUNDATION: %sbr\n, mysql_result($result,0,FOUNDATION));
 printf(MAT_LIST: %sbr\n, mysql_result($result,0,MAT_LIST));
 printf(COLOR_REND: %sbr\n, mysql_result($result,0,COLOR_REND));
 printf(PICTURES: %sbr\n, mysql_result($result,0,PICTURES));
 printf(REPRODUCIBLE: %sbr\n, mysql_result($result,0,REPRODUCIBLE));
 printf(RR_REVERSE: %sbr\n, mysql_result($result,0,RR_REVERSE));
 printf(MIRROR_REV: %sbr\n, mysql_result($result,0,MIRROR_REV));
 printf(CAD_FILES: %sbr\n, mysql_result($result,0,CAD_FILES));
 printf(BONUS_ROOM: %sbr\n, mysql_result($result,0,BONUS_ROOM));
 printf(WIDTH: %sbr\n, mysql_result($result,0,WIDTH));
 printf(DEPTH: %sbr\n, mysql_result($result,0,DEPTH));
 printf(HEAT_SQ_FT: %sbr\n, mysql_result($result,0,HEAT_SQ_FT));
 printf(UNHEAT_SQ_FT: %sbr\n, mysql_result($result,0,UNHEAT_SQ_FT));
 printf(TOTAL_SQ_FT: %sbr\n, mysql_result($result,0,TOTAL_SQ_FT));
 printf(ROOF_TYPE: %sbr\n, mysql_result($result,0,ROOF_TYPE));
 printf(ROOF_PITCH: %sbr\n, mysql_result($result,0,ROOF_PITCH));
 printf(SEC_ROOF_PITCH: %sbr\n,
 mysql_result($result,0,SEC_ROOF_PITCH));
 printf(MAIN_CEIL_HEIGHT: %sbr\n,
 mysql_result($result,0,MAIN_CEIL_HEIGHT));
 printf(PLAN_DESCRIPTION: %sbr\n,
 mysql_result($result,0,PLAN_DESCRIPTION));
 printf(REL_PLAN1: %sbr\n, mysql_result($result,0,REL_PLAN1));
 printf(REL_PLAN2: %sbr\n, mysql_result($result,0,REL_PLAN2));
 printf(REL_PLAN3: %sbr\n, mysql_result($result,0,REL_PLAN3));
 printf(REL_PLAN4: %sbr\n, mysql_result($result,0,REL_PLAN4));
 printf(REL_PLAN5: %sbr\n, mysql_result($result,0,REL_PLAN5));
 printf(REL_PLAN6: %sbr\n, mysql_result($result,0,REL_PLAN6));
 printf(REL_PLAN7: %sbr\n, mysql_result($result,0,REL_PLAN7));
 printf(REL_PLAN8: %sbr\n, mysql_result($result,0,REL_PLAN8));
 printf(REL_PLAN9: %sbr\n, mysql_result($result,0,REL_PLAN9));
 
 //Problem code //
 
 // Then show image and/or details
 echo img src=http://www.website.com/images/.$result[FRONT_REND].;;
 
 
 //printf(FRONT_REND: %sbr\n, mysql_result($result,0,'a
 href=FRONT_REND/a'));
 printf(REAR_REND: %sbr\n, mysql_result($result,0,REAR_REND));
 printf(SIDE_REND1: %sbr\n, mysql_result($result,0,SIDE_REND1));
 printf(SIDE_REND2: %sbr\n, mysql_result($result,0,SIDE_REND2));
 printf(THMBNAIL_IMG: %sbr\n, mysql_result($result,0,THMBNAIL_IMG));
 printf(FLRPLAN_1: %sbr\n, mysql_result($result,0,FLRPLAN_1));
 printf(FLRPLAN_2: %sbr\n, mysql_result($result,0,FLRPLAN_2));
 printf(FLRPLAN_3: %sbr\n, mysql_result($result,0,FLRPLAN_3));
 printf(OTHER_IMG1: %sbr\n, mysql_result($result,0,OTHER_IMG1));
 printf(OTHER_IMG2: %sbr\n, mysql_result($result,0,OTHER_IMG2));
 printf(NUM_HITS: %sbr\n, mysql_result($result,0,NUM_HITS));
 printf(PAYPAL_BUTTON: %sbr\n, mysql_result($result,0,PAYPAL_BUTTON));
 
 
 
 
 
 ?
 
 
 
 /body
 
 Miguel Cruz [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  On Sat, 6 Jul 2002, markbm wrote:
   I am trying to build a product detail page that pulls data from a
   MYSQL database using PHP. The data for the page includes product images,
   which I am trying to link to (i.e. from their location on the web
   server) instead of loading the images into the database. However, I
   cannot find any sample code that seems to work. Two questions:
  
   1. Is this possible (i.e. to store the HYPERLINK to the image in the
   database , and as the results are 

Re: [PHP] compare variables from text fields...

2002-07-07 Thread Justin French

In what way do you want to compare them?  to see if they are the same
string? the same type of var?  different?  greater than?  less than?

My guess is that you want them to be the same (as in the case of two
passwords), in which case it's simple:

?

if($_POST['pass1'] == $_POST['pass2'])
{
$passwords_match = 1;
}

?

Of course if you looked in the manual for comparison operators, or even did
a search for comparison, you would have found this quite easy.


If I haven't guessed your question correctly, please provide more
information.

maybe something like levenshtein() is what you want.  Of course, reading
through the string based functions in the manual would also help :)


Justin French



on 08/07/02 1:45 PM, Jas ([EMAIL PROTECTED]) wrote:

 What is the best function or operator to compare two text strings being
 inputted by a text field within a form?  Any help is appreciated.
 Thanks in advance,
 Jas
 
 


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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Miguel Cruz

On Sun, 7 Jul 2002, Greg Donald wrote:
 On Sun, 7 Jul 2002, Miguel Cruz wrote:
 ?
 if(ini_set(register_globals, 0))
   echo ini_set success;
 else
   echo ini_set failed;
 ?

 Please don't say this code doesn't work. Say why you think it didn't 
 work, whether that's because you received an error message, or a 
 specific 
 
 Uhh.. I don't have any thoughts as to why it doesn't work, that's why I 
 posted.  The function itself appears broken, my code is a test to that 
 notion. 

I can see where my wording was ambiguous. By why you think it didn't
work, I don't mean the explanation for its failure to function, but
rather the experience you had that convinced you it was not working.

Obviously something happened to make you decide that it wasn't working. We 
need to know what that was. Maybe it was an error message. Maybe it was a 
plume of smoke rising from your computer. Maybe it was some sort of weird 
behavior of your program. It's just a general thing: We can't read your 
mind. Or at least I can't.

 If you can't be helpful then feel free to shutup..

Well, I did go on to answer your question. It could've been worse.

 So does anyone know why my code doesn't work then?  ini_set() seems 
 broken.  Can anyone confirm or deny?

 I believe the issue here is that by the time your PHP code starts
 executing and gets to the ini_set call, it's too late to register the
 
 gets to the ini_set call - what do you mean?  The code I posted is all 
 there is to the entire script.  Where else would I use the ini_set() 
 function except at the very beginning of a script?

Before your code starts, there is a whole bunch of initialization that
takes place in the script engine. It looks at its settings to see how it
should behave. It gathers all the data that came from the web server
(details about the user's request, etc.). It learns about its environment.
It populates global variables.

Having done these, it starts looking at your code. By this time it's too
late to change the way those prior steps were taken. It's like waiting
until the plane has taken off (i.e., execution of your code has begun) and
then telling the flight attendant you wished it were headed to Chicago
instead of Detroit.

miguel


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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Chris Shiflett

Greg Donald wrote:

On Sun, 7 Jul 2002, Chris Shiflett wrote:

I refer you to this URL:

http://www.tuxedo.org/~esr/faqs/smart-questions.html



I refer you to this URL: http://php.net/ini_set and ask why does this 
function not work as per the manual? 

Again, here is my code:

?
if(ini_set(register_globals, 0))
  echo ini_set success;
else
  echo ini_set failed;
?


Why should I help you when you can't:

1. Follow simple instructions
2. Treat others who have tried to help you with respect.

Suffice it to say that ini_set() is not broken; your logic above is. 
Behave like an adult, and I might explain more.

Chris


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




Re: [PHP] compare variables from text fields...

2002-07-07 Thread Miguel Cruz

On Sun, 7 Jul 2002, Jas wrote:
 What is the best function or operator to compare two text strings being
 inputted by a text field within a form?  Any help is appreciated.

== is always handy.

Depending on your needs, you may want to throw in a couple calls to
strlower (if you don't care about case matching). If you are even more 
flexible, look into soundex, levenshtein, metaphone, and similar_text. 
They're all documented in the online manual, and each provides a different 
sort of flexibility for dealing with variant spelling, etc.

miguel


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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Greg Donald

On Mon, 8 Jul 2002, Jason Wong wrote:

?
 if (ini_set(register_globals, 0) !== FALSE)
   echo ini_set success;
 else
   echo ini_set failed;
?

Finally someone interested in helping find my error.

Thanks alot!


-- 
---
Greg Donald
http://destiney.com/public.key
---



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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Tom Rogers

Hi
If you check with phpinfo() you will see that it is getting set to 1 or 0 
but by the time your script is run it is too late for it to have any effect.
Also ini_get('registar_globals') will not return the current state.
I have no idea why, it looks like one of those undocumented safety features...
Tom


At 10:50 PM 7/07/2002 -0500, Greg Donald wrote:
On Sun, 7 Jul 2002, Chris Shiflett wrote:

 I refer you to this URL:
 
 http://www.tuxedo.org/~esr/faqs/smart-questions.html

I refer you to this URL: http://php.net/ini_set and ask why does this
function not work as per the manual?

Again, here is my code:

?
if(ini_set(register_globals, 0))
   echo ini_set success;
else
   echo ini_set failed;
?


--
---
Greg Donald
http://destiney.com/public.key
---



--
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] Re: PHP: Script Security: Best coding practices

2002-07-07 Thread olinux

A little off your request, but may be of interest:

Top 21 PHP Programming Mistakes from Zend.com
http://www.zend.com/zend/art/mistake1.php
http://www.zend.com/zend/art/mistake2.php

olinux


 On 07/04/2002 02:24 AM, Jean-Christian Imbeault
 wrote:
  I am trying to figure out what are some Bad Things
 (tm) when it comes to 
  secure PHP programming and how to avoid them.
  
  I am looking for a kind of best practices for
 security list for PHP 
  programming. Do's and Don't, or a list of common
 pitfalls and how to 
  avoid them.
  
  Can anyone point me to such a list or tutorial?


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Jason Wong

Tom Rogers said:
 Hi
 If you check with phpinfo() you will see that it is getting set to 1 or
 0  but by the time your script is run it is too late for it to have any
 effect.

I just checked with an old PHP manual (probably 4.1.X) and
register_globals can only be set in PHP_INI_PERDIR  PHP_INI_SYSTEM, ie
cannot be set at run-time. So either they changed the behaviour in 4.2.X,
or the latest manual is wrong.

 Also ini_get('registar_globals') will not return the current
 state.

No, but ini_get('register_globals') will :)

 I have no idea why, it looks like one of those undocumented
 safety features... Tom

However, in the one instance where I used it, it returned 'Off'. My guess
is that it returns whatever was defined in php.ini. Thus if in php.ini you
had defined register_globals = 1, then ini_get('register_globals') returns
1.

It would be much better and less confusing if ini_get() returns values in
a consistent notation, eg for booleans it should either return (0/1) OR
(false/true).

Another gotcha that I've come across is when setting register_globals (may
or may not apply to other settings) in the apache conf file.

This does NOT work:
  php_value register_globals On

Whereas this does work:
  php_value register_globals 1


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk



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




Re: [PHP] Survey: MySQL vs PostgreSQL for PHP

2002-07-07 Thread Analysis Solutions

On Fri, Jul 05, 2002 at 01:59:48PM -0700, Lazor, Ed wrote:

 How many here feel PostgreSQL has surpassed MySQL as the better backend for
 PHP?  This would be based on performance (speed, scalability, etc.) and
 features.

I've been using MySQL/PHP for quite some time.  Several months ago, I
wanted to port a project over to PostgreSQL.  I found everything about pg
(eg the website, documentation, installation process) far less straight
ahead than MySQL.  So much so, that I didn't get around to actually
installing pg.

Plus, as others have pointed out, the supporting functions in PHP aren't
as powerful/diverse.  For example, there's no insert id function.

--Dan

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

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




Re: [PHP] ini_set() broken?

2002-07-07 Thread Tom Rogers

Hi
Even with the correct spelling it returns null (php-4.2.1)

$x = ini_get('register_globals');
echo current settings = .$x.br;

Tom

At 12:43 PM 8/07/2002 +0800, Jason Wong wrote:
Tom Rogers said:
  Hi
  If you check with phpinfo() you will see that it is getting set to 1 or
  0  but by the time your script is run it is too late for it to have any
  effect.

I just checked with an old PHP manual (probably 4.1.X) and
register_globals can only be set in PHP_INI_PERDIR  PHP_INI_SYSTEM, ie
cannot be set at run-time. So either they changed the behaviour in 4.2.X,
or the latest manual is wrong.

  Also ini_get('registar_globals') will not return the current
  state.

No, but ini_get('register_globals') will :)

  I have no idea why, it looks like one of those undocumented
  safety features... Tom

However, in the one instance where I used it, it returned 'Off'. My guess
is that it returns whatever was defined in php.ini. Thus if in php.ini you
had defined register_globals = 1, then ini_get('register_globals') returns
1.

It would be much better and less confusing if ini_get() returns values in
a consistent notation, eg for booleans it should either return (0/1) OR
(false/true).

Another gotcha that I've come across is when setting register_globals (may
or may not apply to other settings) in the apache conf file.

This does NOT work:
   php_value register_globals On

Whereas this does work:
   php_value register_globals 1


--
Jason Wong - Gremlins Associates - www.gremlins.com.hk



--
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] Retrieving/Displaying hyperlinked images with PHP

2002-07-07 Thread César Aracena

 -Original Message-
 From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 08, 2002 12:56 AM
 To: markbm
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Retrieving/Displaying hyperlinked images with PHP
 
 Instead of:
 
 echo img
src=http://www.website.com/images/.$result[FRONT_REND].;;
 
 Wouldn't you want it to be:
 
 echo img src='http://www.website.com/images/; .
mysql_result($result,
 0, 'FRONT_REND') . '';
 
 ...?
 
 miguel


[César L. Aracena] What Miguel says here is completely true... you do
need to call the resulting query the right way. I guess you tried to
follow an example I or someone else gave you before in order to work
with an array made from the resulting query. You should read some useful
lessons and tricks about using arrays at www.php.net in order to be able
to recognize them first and then work with them... quite handy feature I
should add.

C.

 
 On Sun, 7 Jul 2002, markbm wrote:
  Thanks for the reply. The question is how to pull that
hyperlink/file
  location and display the image file on a PHP page. Basically, the
text
 in
  the FRONT_REND field is just an image name (1855.jpg), and I store
the
  prefix to that location on the page. I have included all the code
from
 my
  page belowthe issue at hand is noted by //Problem Area//. Note
also,
  that all fields above this item are simply just retrieving text from
a
 db
  field not retrieving a file from the db/web server location. Again,
 thanks
  for your help.
 
  CODE:
  ===
 
  body
 
 
 
  ?php
 
 
 
  $db = mysql_connect(localhost, username, password);
 
 
 
  mysql_select_db(dbname,$db);
 
 
 
  $result = mysql_query(SELECT * FROM PRODUCTS,$db);
 
 
  printf(ID: %sbr\n, mysql_result($result,0,ID));
  printf(HPG_PLAN_ID: %sbr\n,
mysql_result($result,0,HPG_PLAN_ID));
  printf(DESIGNER: %sbr\n, mysql_result($result,0,DESIGNER));
  printf(PLAN_NAME: %sbr\n, mysql_result($result,0,PLAN_NAME));
  printf(EXTERIOR: %sbr\n, mysql_result($result,0,EXTERIOR));
  printf(NUM_BEDROOMS: %sbr\n,
 mysql_result($result,0,NUM_BEDROOMS));
  printf(NUM_BATHS: %sbr\n, mysql_result($result,0,NUM_BATHS));
  printf(NUM_FLOORS: %sbr\n,
mysql_result($result,0,NUM_FLOORS));
  printf(GARAGE: %sbr\n, mysql_result($result,0,GARAGE));
  printf(NUM_CARS: %sbr\n, mysql_result($result,0,NUM_CARS));
  printf(FOUNDATION: %sbr\n,
mysql_result($result,0,FOUNDATION));
  printf(MAT_LIST: %sbr\n, mysql_result($result,0,MAT_LIST));
  printf(COLOR_REND: %sbr\n,
mysql_result($result,0,COLOR_REND));
  printf(PICTURES: %sbr\n, mysql_result($result,0,PICTURES));
  printf(REPRODUCIBLE: %sbr\n,
 mysql_result($result,0,REPRODUCIBLE));
  printf(RR_REVERSE: %sbr\n,
mysql_result($result,0,RR_REVERSE));
  printf(MIRROR_REV: %sbr\n,
mysql_result($result,0,MIRROR_REV));
  printf(CAD_FILES: %sbr\n, mysql_result($result,0,CAD_FILES));
  printf(BONUS_ROOM: %sbr\n,
mysql_result($result,0,BONUS_ROOM));
  printf(WIDTH: %sbr\n, mysql_result($result,0,WIDTH));
  printf(DEPTH: %sbr\n, mysql_result($result,0,DEPTH));
  printf(HEAT_SQ_FT: %sbr\n,
mysql_result($result,0,HEAT_SQ_FT));
  printf(UNHEAT_SQ_FT: %sbr\n,
 mysql_result($result,0,UNHEAT_SQ_FT));
  printf(TOTAL_SQ_FT: %sbr\n,
mysql_result($result,0,TOTAL_SQ_FT));
  printf(ROOF_TYPE: %sbr\n, mysql_result($result,0,ROOF_TYPE));
  printf(ROOF_PITCH: %sbr\n,
mysql_result($result,0,ROOF_PITCH));
  printf(SEC_ROOF_PITCH: %sbr\n,
  mysql_result($result,0,SEC_ROOF_PITCH));
  printf(MAIN_CEIL_HEIGHT: %sbr\n,
  mysql_result($result,0,MAIN_CEIL_HEIGHT));
  printf(PLAN_DESCRIPTION: %sbr\n,
  mysql_result($result,0,PLAN_DESCRIPTION));
  printf(REL_PLAN1: %sbr\n, mysql_result($result,0,REL_PLAN1));
  printf(REL_PLAN2: %sbr\n, mysql_result($result,0,REL_PLAN2));
  printf(REL_PLAN3: %sbr\n, mysql_result($result,0,REL_PLAN3));
  printf(REL_PLAN4: %sbr\n, mysql_result($result,0,REL_PLAN4));
  printf(REL_PLAN5: %sbr\n, mysql_result($result,0,REL_PLAN5));
  printf(REL_PLAN6: %sbr\n, mysql_result($result,0,REL_PLAN6));
  printf(REL_PLAN7: %sbr\n, mysql_result($result,0,REL_PLAN7));
  printf(REL_PLAN8: %sbr\n, mysql_result($result,0,REL_PLAN8));
  printf(REL_PLAN9: %sbr\n, mysql_result($result,0,REL_PLAN9));
 
  //Problem code //
 
  // Then show image and/or details
  echo img
src=http://www.website.com/images/.$result[FRONT_REND].;;
 
 
  //printf(FRONT_REND: %sbr\n, mysql_result($result,0,'a
  href=FRONT_REND/a'));
  printf(REAR_REND: %sbr\n, mysql_result($result,0,REAR_REND));
  printf(SIDE_REND1: %sbr\n,
mysql_result($result,0,SIDE_REND1));
  printf(SIDE_REND2: %sbr\n,
mysql_result($result,0,SIDE_REND2));
  printf(THMBNAIL_IMG: %sbr\n,
 mysql_result($result,0,THMBNAIL_IMG));
  printf(FLRPLAN_1: %sbr\n, mysql_result($result,0,FLRPLAN_1));
  printf(FLRPLAN_2: %sbr\n, mysql_result($result,0,FLRPLAN_2));
  printf(FLRPLAN_3: %sbr\n, mysql_result($result,0,FLRPLAN_3));
  printf(OTHER_IMG1: %sbr\n,
mysql_result($result,0,OTHER_IMG1));
  printf(OTHER_IMG2: %sbr\n,

Re: [PHP] Splitting up a timestamp?

2002-07-07 Thread Analysis Solutions

Tony:

On Sun, Jul 07, 2002 at 11:40:27AM +0100, Tony Harrison wrote:

 Hi. I please need some help with converting a MySQL timestamp into something
 easily read. Any help at all is most appreciated, thanks.

There are a lot of ways to do that.  I'd go for the date_format() function 
in MySQL.

--Dan

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

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




Re: [PHP] is their a jobs mailing list?

2002-07-07 Thread Rasmus Lerdorf

Job postings are fine on this list.  Some people will invariably gripe,
but overall people like to see that there are jobs out there involving
PHP.  And it they don't, well tough.  None of the people who help run this
list, including myself have any problems with them.

-Rasmus

On Sun, 7 Jul 2002, Peter J. Schoenster wrote:

 Hi,

 I was here first:

 http://www.php.net/manual/en/faq.mailinglist.php#faq.mailinglist.guideline

  Before you post to the list please have a look in this FAQ

 But I found nothing about a jobs mailing list. I'm really a Perl programmer and
 we have jobs.perl.org which has a list which does a really good job.

 A person from Houston, TX asked me if I knew of any PHP people in Houston.
 I advertise on Google and Overture as a developer for hire.

 I don't sugget he post to this list as I'm not sure of the etiquette and I've never
 seen jobs posted to this list; I know they are accepted heartily on the
 mod_perl list.

 Anything simple but effective like this site for PHP?

 http://jobs.perl.org/

 Peter




 --
 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] Referencing function return value

2002-07-07 Thread Anas Mughal


I have a general question about referencing...

Would it be safe to reference a function return value?
My main concern is that once the function goes out of scope, is that variable cleaned 
up or would it stay around because there is a new reference to it.

I am coming from the C++ and Java world. I know how it works there! However, I am 
unsure about PHP. Instead of trying out a test script. I wish to know more about 
language design. So, I would be assured of its support for future versions of the 
language.

Thank you very much.






-
Do You Yahoo!?
New! SBC Yahoo! Dial - 1st Month Free  unlimited access


Re: [PHP] Referencing function return value

2002-07-07 Thread Miguel Cruz

On Sun, 7 Jul 2002, Anas Mughal wrote:
 I have a general question about referencing...
 
 Would it be safe to reference a function return value?

Sure, unless the function returned a reference itself, in which case you 
have to continue keeping track of the validity of that reference (i.e., if 
its object gets unset(), I'm pretty sure it becomes invalid).

If a function returns a scalar or array, it's recreated in the caller's
context and will remain there until you explicitly get rid of it. It's not
like C where strings are pointers whose contents can disappear out from
under you at any moment.

miguel


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