php-general Digest 5 Sep 2007 11:53:37 -0000 Issue 5001

2007-09-05 Thread php-general-digest-help

php-general Digest 5 Sep 2007 11:53:37 - Issue 5001

Topics (messages 261705 through 261720):

Re: PHP Developer Required]
261705 by: tedd
261720 by: mlists

Re: Dealing with auto-increment in MySQL
261706 by: brian
261708 by: tedd

Re: Pragmatically changing a Record Number
261707 by: tedd
261710 by: brian

Re: MySQL, PHPMyAdmin, GRANT, headaches
261709 by: tedd

Re: Command line socket server and SSL
261711 by: Chris
261712 by: Paul
261714 by: Greg Donald
261715 by: Paul

Re: urldecode  header
261713 by: Greg Donald

Re: Bind function parameters with create_function ('currying')]
261716 by: Richard Heyes

Problem With mysql_query
261717 by: Brian Welter
261718 by: Zoltán Németh
261719 by: Stut

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

At 4:05 PM -0400 9/4/07, Robert Cummings wrote:

On Tue, 2007-09-04 at 14:28 -0400, Greg Gay wrote:
  Rob/mlists


So, you can get that much?  :-)

I knew my MSc would pay off some day.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com
---End Message---
---BeginMessage---

A university, which hypes the need for an education, charges a fortune
for it (causing people to go into massive debt to get it), and then
turns around an offers less than a living wage is hypocritical.

Becoming university staff takes a couple years, after which salaries
are competivitive with the going rates.  So for the first couple of
years you get taken advantage of and then, maybe, you will get paid
more!

That is just not fair.



On Tue, 2007-09-04 at 14:28 -0400, Greg Gay wrote:
 Rob/mlists
 
 You're certainly not encouraging PHP programmers to get involved with
 paid open source projects. That's a guaranteed $50,000 a yr, a little
 low perhaps by industry standards, but it is a reasonable starting rate,
 and gets your foot in the door.
 
 You should have a look at who the employer is, and what they do. They
 (we) are
 looking for a person who has done their research. This is more than
 just a job. It has the potential to introduce applicants to a world of
 experience, not just code crunching, but getting involved with the
 groups who introduce new technologies and working on leading edge
 projects (groups like the W3C, IMS, ISO, AICC, and many others) .
 Experiences you won't get as a programmer for your average software
 developer. The ATRC is involved with most standards bodies around the
 world, and has dozen of open source projects on the go.
 
 Becoming university staff takes a couple years, after which salaries are
 competivitive with the going rates. Not to mention a full set of
 benefits, pension, excellent working environment, including flexible
 working hours, travel benefits, free university course (get a masters or
 phd for nothing) etc. Most staff start on a casual/contract basis before
 being moved into the main stream. Our established programmers do earn in
 the 90-100G per year, with benefits on top of that. All included, that's
 somewhere in the $60/hr range, with $0 expenses.
 
 You're auto machanic btw, has overhead included in that rate, so that's
 a rather poor comparison. How much do you think he really makes an hour,
 after paying expenses out of that $99? And of course 4% isn't a bonus.
 Contract workers are paid that weekly, while staff accumulate it so they
 can take holidays and get paid.
 
 
 greg
 
 
 
 
 Robert Cummings wrote:
  On Mon, 2007-09-03 at 13:47 -0400, mlists wrote:
 
 Wow!
 
 Spend $100K on a university degree in computer science, work
 successfully for five years with all the major technologies, and then
 get paid $25 per hour?
 
 
  The poster didn't mention anything about being competent.
 
 
 My auto mechanic charges an average of $99 per hour.
 
 Sounds like a great deal for the university. Maybe the successful
 candidate can work off his student loans.
 
 
  Well 100k is a bit high for a 4 year program. And then again it depends
  on whether you had to move away from your parents to attend university.
  If you live within commute range of your university then you can get
  away with 20 to 30k expenses in Canada (depending on University). If you
  have to cover rent then it's a different story :) That said, Toronto is
  one of the most expensive cities in Canada in which to live. IMHO he
  still thinks the tech sector is in a depression and developers with 5
  years experience can be had for a pittance. What made me laugh was the
  4% vacation pay. That's a legal requirement in Canada for full time
  employment. Not a bonus.
 
  Cheers,
  Rob.
 
---End Message---
---BeginMessage---

tedd wrote:

Jason:

Well, at least you 

Re: [PHP] Command line socket server and SSL

2007-09-05 Thread Paul
Below you have described a client. I'm talking about a 
server. That was clear in my original post.

-Paul W

Greg Donald wrote:

On Tue, 4 Sep 2007, Paul wrote:

Which part do you need help with? The SSL part or the command line or the
port or ... ?

http://www.php.net/openssl
http://www.php.net/sockets


I am familiar with the above links. What I cannot locate is anything that
indicates that a cmd line socket program in PHP can do SSL. Can you locate
such? Is it in the openssl document somewhere and I missed it?


Whether the script is command line or not has nothing to do with it's ability 
to connect to a host on a specific port.  You just connect to the port the 
secure socket is located on, usually 443.

#!/usr/bin/env php
?php
$s = socket_create( AF_INET, SOCK_STREAM, SOL_TCP );
socket_set_nonblock( $s );
socket_connect( $s, example.com, 443 );
socket_set_block( $s );
switch( socket_select( $r = array( $s ), $w = array( $s ), $f = array( $s ), 5 
) )
{
case 2:
echo [-] Connection Refused\n;
break;
case 1:
echo [+] Connected\n;
break;
case 0:
echo [-] Timeout\n;
break;
}




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



[Fwd: Re: [PHP] Bind function parameters with create_function ('currying')]

2007-09-05 Thread Richard Heyes


--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support
---BeginMessage---
Of course, my apologies.
I've simplified it from the actual code and also removed the string
parameter as the object one is the problem:

// create the model and replacer function
 $model = new $modelName();
 $replacer = curryModelReplacer($($model);
 // ...

 /** Curries model_replacer. */
 function curryModelReplacer($model) {
return create_function('$matches', return modelReplacer($model,
 \$matches););
 }

 /** The callback for preg_replace_callback. */
 function modelReplacer($model, $matches) {
// do the replacement...
 }


So effectively I want to create a new anonymous function wrapping
modelReplacer which has the $model parameter already set. The problem is
obviously that I can't put $model in the string.
Is there a better alternative approach for currying in PHP that will enable
me to bind an object to a parameter?

TIA,
--rob


On 9/4/07, Richard Heyes [EMAIL PROTECTED] wrote:

  I have a function which is my callback for preg_replace_callback - and
 it
  needs to be able to access a string and an object outside of itself.
  When I call create_function I can insert the string, but without
 serializing
  the object I can't figure out how to make it available to the function
  without making it global, which seems nasty.
 
  I've tried 'currying' the function - creating a new function out of it
 with
  the string and object parameters bound, but have the same problem - I
 can't
  get the object into the function.
  Can anyone point me towards a good solution? I guess I could also create
 a
  class with the one function, but that seems a wee bit messy to me.

 It would be helpful if you could post a bare-bones example.

 --
 Richard Heyes
 +44 (0)800 0213 172
 http://www.websupportsolutions.co.uk

 Knowledge Base and HelpDesk software
 that can cut the cost of online support




-- 
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
There's a whale there's a whale there's a whale fish he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.
---End Message---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problem With mysql_query

2007-09-05 Thread Brian Welter
I have the following code and it doesn't behave properly but I can't find my
error. The code is designed to validate user login. When I pass in an
invalid email name to the checkLogin function it returns a result, not FALSE
as the documentation describes. I can SELECT * from the table being used and
read out all of the data so I know that the DB connection is valid and that
I can compose a valid query. I have looked and looked at this code and can
find no error, does anyone see an error here. When the check if (!$result)
fails i.e. even thought the email/password are not in the db a none zero
result is returned, the calls to mysql_fetch_assoc () return empty strings.
The only clue I may have is that when I call mysql_free_result($result) I
get a warning saying that $result is not a valid resource. I sure I'm doing
something stupid but I just can't see it. Any help would be great!

 

 

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml;

head

meta http-equiv=Content-Type content=text/html; charset=utf-8 /

titleUntitled Document/title

/head

 

body

?php

global $db;



$db = mysql_connect('localhost', '', '', ''); 

if (!$db) {

die(Unable to connect to database: .
mysql_connect_error());

}

$selected = mysql_select_db(, $db) or die( Unable to
select database);

if (checkLogin([EMAIL PROTECTED]', '1')) {

echo Success;

} else {

echo Failure;

}

if(checkLogin('duck', '2') )) {

echo Success;

} else {

echo Failure;

}

 

function checkLogin($e, $p) {

$ans = 0;

$emailcheck = $e;

$passwdcheck = $p;

$result = 0;

$query = SELECT * FROM maillist WHERE
email='$emailcheck' AND passwd='$passcheck'; 

$result = mysql_query($query);

if (!$result) {

echo h4UserName is FALSE name is:
$eh4;

echo h4Password is FALSE name is:
$ph4;

$ans = 0;

} else {

$row = mysql_fetch_assoc($result);

$em = $row['email'];

$pw = $row['passwd'];

echo pAccepted ;

echo User $em ;

echo Password $pw/p;

$ans = 1;

}

return($ans);

} //checkLogin

mysql_free_result($result);

mysql_close($db);

?

/body

/html

 



Re: [PHP] Problem With mysql_query

2007-09-05 Thread Zoltán Németh
2007. 09. 5, szerda keltezéssel 16.31-kor Brian Welter ezt írta:
 I have the following code and it doesn't behave properly but I can't find my
 error. The code is designed to validate user login. When I pass in an
 invalid email name to the checkLogin function it returns a result, not FALSE
 as the documentation describes. I can SELECT * from the table being used and
 read out all of the data so I know that the DB connection is valid and that
 I can compose a valid query. I have looked and looked at this code and can
 find no error, does anyone see an error here. When the check if (!$result)
 fails i.e. even thought the email/password are not in the db a none zero
 result is returned, the calls to mysql_fetch_assoc () return empty strings.
 The only clue I may have is that when I call mysql_free_result($result) I
 get a warning saying that $result is not a valid resource. I sure I'm doing
 something stupid but I just can't see it. Any help would be great!
 

I don't know what is causing your problems but I put some comments below
in your code

  
 
 
 
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 
 html xmlns=http://www.w3.org/1999/xhtml;
 
 head
 
 meta http-equiv=Content-Type content=text/html; charset=utf-8 /
 
 titleUntitled Document/title
 
 /head
 
  
 
 body
 
 ?php
 
 global $db;
 
 
 
 $db = mysql_connect('localhost', '', '', ''); 
 
 if (!$db) {
 
 die(Unable to connect to database: .
 mysql_connect_error());
 
 }
 
 $selected = mysql_select_db(, $db) or die( Unable to
 select database);
 
 if (checkLogin([EMAIL PROTECTED]', '1')) {
 
 echo Success;
 
 } else {
 
 echo Failure;
 
 }
 
 if(checkLogin('duck', '2') )) {
 
 echo Success;
 
 } else {
 
 echo Failure;
 
 }
 
  
 
 function checkLogin($e, $p) {
 
 $ans = 0;
 
 $emailcheck = $e;
 
 $passwdcheck = $p;
 
 $result = 0;
 
 $query = SELECT * FROM maillist WHERE
 email='$emailcheck' AND passwd='$passcheck'; 

here you put $passcheck in the query which does not exist (you create
$passwdcheck above).
btw, why not call the parameters their real name from the start?
these 3 lines:
function checkLogin($e, $p) {
$emailcheck = $e;
$passwdcheck = $p;

are the same as:
function checkLogin($emailcheck, $passwdcheck) {

(I see later you use the variables $e and $p in the echo statements. I
suggest decide which to use and use only one - probably the longer names
would be better since they inform you about the variable. Imagine if you
see this code 3 years later, could you guess what is in $e? And could
you guess what is in $emailcheck?)

and you don't have to initialise $result to 0, because it will be
initialised to the mysql_query return value 2 lines later anyway

hope that helps
Zoltán Németh

 
 $result = mysql_query($query);
 
 if (!$result) {
 
 echo h4UserName is FALSE name is:
 $eh4;
 
 echo h4Password is FALSE name is:
 $ph4;
 
 $ans = 0;
 
 } else {
 
 $row = mysql_fetch_assoc($result);
 
 $em = $row['email'];
 
 $pw = $row['passwd'];
 
 echo pAccepted ;
 
 echo User $em ;
 
 echo Password $pw/p;
 
 $ans = 1;
 
 }
 
 return($ans);
 
 } //checkLogin
 
 mysql_free_result($result);
 
 mysql_close($db);
 
 ?
 
 /body
 
 /html
 
  
 

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



Re: [PHP] Problem With mysql_query

2007-09-05 Thread Stut

Brian Welter wrote:

I have the following code and it doesn't behave properly but I can't find my
error. The code is designed to validate user login. When I pass in an
invalid email name to the checkLogin function it returns a result, not FALSE
as the documentation describes. I can SELECT * from the table being used and
read out all of the data so I know that the DB connection is valid and that
I can compose a valid query. I have looked and looked at this code and can
find no error, does anyone see an error here. When the check if (!$result)
fails i.e. even thought the email/password are not in the db a none zero
result is returned, the calls to mysql_fetch_assoc () return empty strings.
The only clue I may have is that when I call mysql_free_result($result) I
get a warning saying that $result is not a valid resource. I sure I'm doing
something stupid but I just can't see it. Any help would be great!


As the documentation states, mysql_query will return false when it 
encounters an error. Not finding any matching rows is not an error. Use 
mysql_num_rows to check if any matching rows were returned.


I would also recommend that you enable notices in your php.ini as your 
code will cause at least 2 notices to be generated, both of which would 
have given you a clue as to where the problem lies.


-Stut

--
http://stut.net/

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread mlists

A university, which hypes the need for an education, charges a fortune
for it (causing people to go into massive debt to get it), and then
turns around an offers less than a living wage is hypocritical.

Becoming university staff takes a couple years, after which salaries
are competivitive with the going rates.  So for the first couple of
years you get taken advantage of and then, maybe, you will get paid
more!

That is just not fair.



On Tue, 2007-09-04 at 14:28 -0400, Greg Gay wrote:
 Rob/mlists
 
 You're certainly not encouraging PHP programmers to get involved with
 paid open source projects. That's a guaranteed $50,000 a yr, a little
 low perhaps by industry standards, but it is a reasonable starting rate,
 and gets your foot in the door.
 
 You should have a look at who the employer is, and what they do. They
 (we) are
 looking for a person who has done their research. This is more than
 just a job. It has the potential to introduce applicants to a world of
 experience, not just code crunching, but getting involved with the
 groups who introduce new technologies and working on leading edge
 projects (groups like the W3C, IMS, ISO, AICC, and many others) .
 Experiences you won't get as a programmer for your average software
 developer. The ATRC is involved with most standards bodies around the
 world, and has dozen of open source projects on the go.
 
 Becoming university staff takes a couple years, after which salaries are
 competivitive with the going rates. Not to mention a full set of
 benefits, pension, excellent working environment, including flexible
 working hours, travel benefits, free university course (get a masters or
 phd for nothing) etc. Most staff start on a casual/contract basis before
 being moved into the main stream. Our established programmers do earn in
 the 90-100G per year, with benefits on top of that. All included, that's
 somewhere in the $60/hr range, with $0 expenses.
 
 You're auto machanic btw, has overhead included in that rate, so that's
 a rather poor comparison. How much do you think he really makes an hour,
 after paying expenses out of that $99? And of course 4% isn't a bonus.
 Contract workers are paid that weekly, while staff accumulate it so they
 can take holidays and get paid.
 
 
 greg
 
 
 
 
 Robert Cummings wrote:
  On Mon, 2007-09-03 at 13:47 -0400, mlists wrote:
 
 Wow!
 
 Spend $100K on a university degree in computer science, work
 successfully for five years with all the major technologies, and then
 get paid $25 per hour?
 
 
  The poster didn't mention anything about being competent.
 
 
 My auto mechanic charges an average of $99 per hour.
 
 Sounds like a great deal for the university. Maybe the successful
 candidate can work off his student loans.
 
 
  Well 100k is a bit high for a 4 year program. And then again it depends
  on whether you had to move away from your parents to attend university.
  If you live within commute range of your university then you can get
  away with 20 to 30k expenses in Canada (depending on University). If you
  have to cover rent then it's a different story :) That said, Toronto is
  one of the most expensive cities in Canada in which to live. IMHO he
  still thinks the tech sector is in a depression and developers with 5
  years experience can be had for a pittance. What made me laugh was the
  4% vacation pay. That's a legal requirement in Canada for full time
  employment. Not a bonus.
 
  Cheers,
  Rob.
 

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



Re: [PHP] Pragmatically changing a Record Number

2007-09-05 Thread tedd

At 9:04 PM -0400 9/4/07, brian wrote:
You're being pissy again. It really reflects poorly on you and, i 
suspect, it's keeping you from truly understanding what it is that 
i'm trying to help you with.



Enough said on this subject, besides I don't think you're reading
what I write correctly anyway.


I read it twice (correctly, even!). Mostly because your 
stubborness fascinates me. Like a moth to a flame, really.


Well then, I apologize for my perceived pissyness -- it was not 
intentional, but rather replying as I felt proper.


As for me understanding, I do.

As for help, I'm not asking for any.

As for this, thread, let's let it drop.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] opcode question

2007-09-05 Thread Frank Höger

Hello,

I recently came across an invalid opcode 137/8/8 error. I couldn't 
find anything on the net regarding this specific error. Where can I find 
documentation concerning opcodes and particularly this error?



Regards

Frank

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



Re: [PHP] opcode question

2007-09-05 Thread Rob Desbois
Hi,

I believe this would be a bug - report it at http://bugs.php.net/ with the
exact error output and a minimal example script.

--rob

On 9/5/07, Frank Höger [EMAIL PROTECTED] wrote:

 Hello,

 I recently came across an invalid opcode 137/8/8 error. I couldn't
 find anything on the net regarding this specific error. Where can I find
 documentation concerning opcodes and particularly this error?


 Regards

 Frank

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




-- 
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
There's a whale there's a whale there's a whale fish he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.


Re: [PHP] opcode question

2007-09-05 Thread Robert Cummings
On Wed, 2007-09-05 at 14:15 +0200, Frank Höger wrote:
 Hello,
 
 I recently came across an invalid opcode 137/8/8 error. I couldn't 
 find anything on the net regarding this specific error. Where can I find 
 documentation concerning opcodes and particularly this error?

I took your exact quoted string above, plugged it into Google, added
php and got the following:

http://bugs.php.net/bug.php?id=30266

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Greg Gay
Some people just have to whine. It's too bad people on this list have to
put up with this behaviour.

We do have a position available for someone who wants to work, and climb
the ladder into what could be a lifelong career working with a leading
edge group of developers.  It is a foot in the door position, with
potential to turn into a staff position, as most of these positions do,
and a secure, well paying career with many benefits. You can find out
more about some of the work undertaken at the centre by visiting the Web
site.

http://atrc.utoronto.ca/index.php?option=com_contenttask=blogcategoryid=26Itemid=109

greg


mlists wrote:

A university, which hypes the need for an education, charges a fortune
for it (causing people to go into massive debt to get it), and then
turns around an offers less than a living wage is hypocritical.

Becoming university staff takes a couple years, after which salaries
are competivitive with the going rates.  So for the first couple of
years you get taken advantage of and then, maybe, you will get paid
more!

That is just not fair.



On Tue, 2007-09-04 at 14:28 -0400, Greg Gay wrote:
  

Rob/mlists

You're certainly not encouraging PHP programmers to get involved with
paid open source projects. That's a guaranteed $50,000 a yr, a little
low perhaps by industry standards, but it is a reasonable starting rate,
and gets your foot in the door.

You should have a look at who the employer is, and what they do. They
(we) are
looking for a person who has done their research. This is more than
just a job. It has the potential to introduce applicants to a world of
experience, not just code crunching, but getting involved with the
groups who introduce new technologies and working on leading edge
projects (groups like the W3C, IMS, ISO, AICC, and many others) .
Experiences you won't get as a programmer for your average software
developer. The ATRC is involved with most standards bodies around the
world, and has dozen of open source projects on the go.

Becoming university staff takes a couple years, after which salaries are
competivitive with the going rates. Not to mention a full set of
benefits, pension, excellent working environment, including flexible
working hours, travel benefits, free university course (get a masters or
phd for nothing) etc. Most staff start on a casual/contract basis before
being moved into the main stream. Our established programmers do earn in
the 90-100G per year, with benefits on top of that. All included, that's
somewhere in the $60/hr range, with $0 expenses.

You're auto machanic btw, has overhead included in that rate, so that's
a rather poor comparison. How much do you think he really makes an hour,
after paying expenses out of that $99? And of course 4% isn't a bonus.
Contract workers are paid that weekly, while staff accumulate it so they
can take holidays and get paid.


greg




Robert Cummings wrote:


On Mon, 2007-09-03 at 13:47 -0400, mlists wrote:

  

Wow!

Spend $100K on a university degree in computer science, work
successfully for five years with all the major technologies, and then
get paid $25 per hour?


The poster didn't mention anything about being competent.


  

My auto mechanic charges an average of $99 per hour.

Sounds like a great deal for the university. Maybe the successful
candidate can work off his student loans.


Well 100k is a bit high for a 4 year program. And then again it depends
on whether you had to move away from your parents to attend university.
If you live within commute range of your university then you can get
away with 20 to 30k expenses in Canada (depending on University). If you
have to cover rent then it's a different story :) That said, Toronto is
one of the most expensive cities in Canada in which to live. IMHO he
still thinks the tech sector is in a depression and developers with 5
years experience can be had for a pittance. What made me laugh was the
4% vacation pay. That's a legal requirement in Canada for full time
employment. Not a bonus.

Cheers,
Rob.
  


  


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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Robert Cummings
On Wed, 2007-09-05 at 09:18 -0400, Greg Gay wrote:
 
 http://atrc.utoronto.ca/index.php?option=com_contenttask=blogcategoryid=26Itemid=109

VRML... it makes me cry how it never came to be as popular as it could
have been.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Dan Shirah
I personally think it sounds like a pretty fun job with a lot of potential.
Even if you don't get hired on as staff after the contract is up, you're
still potentially walking away with:
1 - Some excellent business contacts
2 - First hand experience in developing their new applications
3 - More marketability
All of which can help you in getting the job you might really want.

And, while this job may not be ideal for many programmers out there with
that much experience under their belt, you know there is always that
person who has lost their job and is trying hard to find something/anything
to support their family.

So, thank you Greg for posting this opportunity for people to look at.

My only question is.is that $50,000 Canadian dollars or American? :)


On 9/5/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Wed, 2007-09-05 at 09:18 -0400, Greg Gay wrote:
 
 
 http://atrc.utoronto.ca/index.php?option=com_contenttask=blogcategoryid=26Itemid=109

 VRML... it makes me cry how it never came to be as popular as it could
 have been.

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
 ...

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




Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Greg Gay


Dan Shirah wrote:

My only question is.is that $50,000 Canadian dollars or American? :)

  

It's in Canadian dollars. Though there's not much difference between
Canadian and American dollars any more.

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



[PHP] Opening a file

2007-09-05 Thread Dan Shirah
Good Morning!

Opening this file is proving to be a pain. I have a folder that contains a
PHP page and a text file. I am trying to open the contents of the txt file
using file() but it keeps erroring out. Below is the code I'm using to try
and open it:

?php
$fruit = apple);
$lines = file(fruits.txt);
if (in_array($fruit,$lines))
  {
  $a = Y;
  }
?

So, I'm setting my variable, opening my file as an array in $lines, then
checking to see if my variable is in the array, and if it is, assign a value
ot a new variable.  However, I am getting the following error:

PHP Warning: in_array()
[function.in-arrayhttp://develop1/credit%20card%20processing/function.in-array]:
Wrong datatype for second argument

Any ideas?


[PHP] Re: Opening a file

2007-09-05 Thread Dan Shirah
Correction, I am now getting this error:

PHP Warning: file(fruits.txt)
[function.filehttp://develop1/credit%20card%20processing/function.file]:
failed to open stream: No such file or directory
PHP Warning: in_array()
[function.in-arrayhttp://develop1/credit%20card%20processing/function.in-array]:
Wrong datatype for second argument

But the file IS in the same folder.


On 9/5/07, Dan Shirah [EMAIL PROTECTED] wrote:

 Good Morning!

 Opening this file is proving to be a pain. I have a folder that contains a
 PHP page and a text file. I am trying to open the contents of the txt file
 using file() but it keeps erroring out. Below is the code I'm using to try
 and open it:

 ?php
 $fruit = apple);
 $lines = file(fruits.txt);
 if (in_array($fruit,$lines))
   {
   $a = Y;
   }
 ?

 So, I'm setting my variable, opening my file as an array in $lines, then
 checking to see if my variable is in the array, and if it is, assign a value
 ot a new variable.  However, I am getting the following error:

 PHP Warning: in_array() 
 [function.in-arrayhttp://develop1/credit%20card%20processing/function.in-array]:
 Wrong datatype for second argument

 Any ideas?



Re: [PHP] Opening a file

2007-09-05 Thread Richard Davey
Hi Dan,

Wednesday, September 5, 2007, 3:24:43 PM, you wrote:

 Opening this file is proving to be a pain. I have a folder that contains a
 PHP page and a text file. I am trying to open the contents of the txt file
 using file() but it keeps erroring out. Below is the code I'm using to try
 and open it:

 ?php
 $fruit = apple);
 $lines = file(fruits.txt);
 if (in_array($fruit,$lines))
   {
   $a = Y;
   }
?

 So, I'm setting my variable, opening my file as an array in $lines, then
 checking to see if my variable is in the array, and if it is, assign a value
 ot a new variable.  However, I am getting the following error:

 PHP Warning: in_array()
 [function.in-arrayhttp://develop1/credit%20card%20processing/function.in-array]:
 Wrong datatype for second argument

The call to file() has probably failed.

Check to see if $lines === false, if so that is your problem. In which
case you probably need to address the path to fruits.txt, or check
file permissions.

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

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



Re: [PHP] Opening a file

2007-09-05 Thread Dan Shirah
I did a

if ($lines === false) {
echo lines is false;
}

like you suggested and it displays that text...but it still make no sense.
mypage.php and fruits.txt are in the same folder, on the same server.  There
isn't any permissions issues.

So, if mypage.php and fruits.txt are in the same folder, then $lines =
file(fruits.txt) should be valid.


On 9/5/07, Richard Davey [EMAIL PROTECTED] wrote:

 Hi Dan,

 Wednesday, September 5, 2007, 3:24:43 PM, you wrote:

  Opening this file is proving to be a pain. I have a folder that contains
 a
  PHP page and a text file. I am trying to open the contents of the txt
 file
  using file() but it keeps erroring out. Below is the code I'm using to
 try
  and open it:

  ?php
  $fruit = apple);
  $lines = file(fruits.txt);
  if (in_array($fruit,$lines))
{
$a = Y;
}
 ?

  So, I'm setting my variable, opening my file as an array in $lines, then
  checking to see if my variable is in the array, and if it is, assign a
 value
  ot a new variable.  However, I am getting the following error:

  PHP Warning: in_array()
  [function.in-array
 http://develop1/credit%20card%20processing/function.in-array]:
  Wrong datatype for second argument

 The call to file() has probably failed.

 Check to see if $lines === false, if so that is your problem. In which
 case you probably need to address the path to fruits.txt, or check
 file permissions.

 Cheers,

 Rich
 --
 Zend Certified Engineer
 http://www.corephp.co.uk

 Never trust a computer you can't throw out of a window




RE: [PHP] Opening a file

2007-09-05 Thread Jay Blanchard
[snip]
I did a

if ($lines === false) {
echo lines is false;
}

like you suggested and it displays that text...but it still make no
sense.
mypage.php and fruits.txt are in the same folder, on the same server.
There
isn't any permissions issues.

So, if mypage.php and fruits.txt are in the same folder, then $lines =
file(fruits.txt) should be valid.
[/snip]

Are they the same owners? What exactly are the permissions on
fruits.txt?

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



Re: [PHP] Opening a file

2007-09-05 Thread Dan Shirah
mypage.php and fruits.txt have the same permissions.

The IUSR(internet user) account has the following permissions:
Read  Execute
Read




On 9/5/07, Jay Blanchard [EMAIL PROTECTED] wrote:

 [snip]
 I did a

 if ($lines === false) {
 echo lines is false;
 }

 like you suggested and it displays that text...but it still make no
 sense.
 mypage.php and fruits.txt are in the same folder, on the same server.
 There
 isn't any permissions issues.

 So, if mypage.php and fruits.txt are in the same folder, then $lines =
 file(fruits.txt) should be valid.
 [/snip]

 Are they the same owners? What exactly are the permissions on
 fruits.txt?



Re: [PHP] Opening a file

2007-09-05 Thread Stut

Dan Shirah wrote:

I did a

if ($lines === false) {
echo lines is false;
}

like you suggested and it displays that text...but it still make no sense.
mypage.php and fruits.txt are in the same folder, on the same server.  There
isn't any permissions issues.

So, if mypage.php and fruits.txt are in the same folder, then $lines =
file(fruits.txt) should be valid.


Is mypage.php the script you're calling or is it being included from a 
script in a different directory? The 'current directory' is the 
directory of the main script, not included scripts. Use 
dirname(__FILE__) to get the path to the current script.


-Stut

--
http://stut.net/

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



Re: [PHP] Opening a file

2007-09-05 Thread Dan Shirah
Toppage.php -

?php
include 'Process/order/mypage.php';
if ($a !=Y) {
echo  ;
}
else {
?
LOTS OF HTML
?php } ?

Mypage.php -

?php
$fruit = echo apple;
$lines = file(users.txt);
if (in_array($fruit,$lines))
  {
  $a = Y;
  }
else {
?
LOTS OF HTML
?php } ?

So:
fruits.txt is contained in the same folder as mypage.php.
mypage.php tries to pull the data contained in fruits.txt to see if the data
matches
toppage.php has mypage.php inserted as an include and checks for the result
of $a and processes accordingly.

On 9/5/07, Stut [EMAIL PROTECTED] wrote:

 Dan Shirah wrote:
  I did a
 
  if ($lines === false) {
  echo lines is false;
  }
 
  like you suggested and it displays that text...but it still make no
 sense.
  mypage.php and fruits.txt are in the same folder, on the same
 server.  There
  isn't any permissions issues.
 
  So, if mypage.php and fruits.txt are in the same folder, then $lines =
  file(fruits.txt) should be valid.

 Is mypage.php the script you're calling or is it being included from a
 script in a different directory? The 'current directory' is the
 directory of the main script, not included scripts. Use
 dirname(__FILE__) to get the path to the current script.

 -Stut

 --
 http://stut.net/



Re: [PHP] Opening a file

2007-09-05 Thread Stut

Dan Shirah wrote:

So:
fruits.txt is contained in the same folder as mypage.php.
mypage.php tries to pull the data contained in fruits.txt to see if the 
data matches
toppage.php has mypage.php inserted as an include and checks for the 
result of $a and processes accordingly.


In that case your CWD in mypage.php is two levels above where mypage.php 
is. Change the line that reads the file to...


$lines = file(dirname(__FILE__).'/users.txt');

...and it should work fine.

-Stut

--
http://stut.net/

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



Re: [PHP] Opening a file

2007-09-05 Thread brian

Dan Shirah wrote:

Good Morning!

Opening this file is proving to be a pain. I have a folder that contains a
PHP page and a text file. I am trying to open the contents of the txt file
using file() but it keeps erroring out. Below is the code I'm using to try
and open it:

?php
$fruit = apple);
$lines = file(fruits.txt);
if (in_array($fruit,$lines))
  {
  $a = Y;
  }
?

So, I'm setting my variable, opening my file as an array in $lines, then
checking to see if my variable is in the array, and if it is, assign a value
ot a new variable.  However, I am getting the following error:

PHP Warning: in_array()
[function.in-arrayhttp://develop1/credit%20card%20processing/function.in-array]:
Wrong datatype for second argument



Have you tried passing the full path to the file? Make sure you use the 
entire filesystem path (from root). If you're not sure what that is, you 
can get it easily like so:


// say your file lives within your site's home at /mydir/fruits.txt

$filepath = ${_SERVER['DOCUMENT_ROOT']}/mydir/fruits.txt;

brian

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



Re: [PHP] Problem With mysql_query

2007-09-05 Thread Janet Valade

Brian Welter wrote:

I have the following code and it doesn't behave properly but I can't find my
error. The code is designed to validate user login. When I pass in an
invalid email name to the checkLogin function it returns a result, not FALSE
as the documentation describes. I can SELECT * from the table being used and
read out all of the data so I know that the DB connection is valid and that
I can compose a valid query. I have looked and looked at this code and can
find no error, does anyone see an error here. When the check if (!$result)
fails i.e. even thought the email/password are not in the db a none zero
result is returned, the calls to mysql_fetch_assoc () return empty strings.
The only clue I may have is that when I call mysql_free_result($result) I
get a warning saying that $result is not a valid resource. I sure I'm doing
something stupid but I just can't see it. Any help would be great!

 

 


!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml;

head

meta http-equiv=Content-Type content=text/html; charset=utf-8 /

titleUntitled Document/title

/head

 


body

?php

global $db;



$db = mysql_connect('localhost', '', '', ''); 


if (!$db) {

die(Unable to connect to database: .
mysql_connect_error());

}

$selected = mysql_select_db(, $db) or die( Unable to
select database);

if (checkLogin([EMAIL PROTECTED]', '1')) {

echo Success;

} else {

echo Failure;

}

if(checkLogin('duck', '2') )) {

echo Success;

} else {

echo Failure;

}

 


function checkLogin($e, $p) {

$ans = 0;

$emailcheck = $e;

$passwdcheck = $p;

$result = 0;

$query = SELECT * FROM maillist WHERE
email='$emailcheck' AND passwd='$passcheck'; 


$result = mysql_query($query);
  


Idon't think it's your problem, but you have two different 
variable--$passwdcheck and $passcheck.


After getting the results, you can check how many valid users are in the 
result, as follows:


$n = mysql_num_rows($result);
if($n  1)

etc.

Janet


if (!$result) {

echo h4UserName is FALSE name is:
$eh4;

echo h4Password is FALSE name is:
$ph4;

$ans = 0;

} else {

$row = mysql_fetch_assoc($result);

$em = $row['email'];

$pw = $row['passwd'];

echo pAccepted ;

echo User $em ;

echo Password $pw/p;

$ans = 1;

}

return($ans);

} //checkLogin

mysql_free_result($result);

mysql_close($db);

?

/body

/html

 



  


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



[PHP] Curl redirection problem.

2007-09-05 Thread Rahul Sitaram Johari

Ave,

I¹m using Curl to login to a website. I gather cookies from one page, carry
the cookiejar to another page, post data to login, and get the result. The
problem is, the final landing page displays on my php page as part of the
page and remains on my server, therefore the Links on that Landing page are
malformed as they are carrying my Server.

I want to redirect to the Landing page altogether. How do I do that?
Here¹s my code:

$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
curl_setopt($curl, CURLOPT_USERAGENT, Mozilla/4.0 (compatible; MSIE 5.01;
Windows NT 5.0));
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_COOKIEFILE,
/Library/WebServer/Documents/Misc/curl/garbage/wbCookieFile);
curl_setopt($curl, CURLOPT_COOKIEJAR,
/Library/WebServer/Documents/Misc/curl/garbage/wbCookieFile);
curl_setopt($curl, CURLOPT_POSTFIELDS, username=usrpassword=pwd);
curl_setopt($curl, CURLOPT_URL, http://www.website.org/login.php;);
$xxx = curl_exec($curl);
curl_setopt($curl, CURLOPT_URL, http://www.website.org/index.php;);
curl_setopt($curl, CURLOPT_POSTFIELDS, username=usrpassword=pwd);
$xxx = curl_exec($curl);
curl_close ($curl);

Basically I want to redirect to: http://www.website.org/index.php after
logging in using curl.

Thanks.

~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²



Re: [PHP] Opening a file

2007-09-05 Thread Dan Shirah
Ah, okay.

Would this also work if I wanted to apply this to multiple other pages
located within different areas of the site tree?


On 9/5/07, Stut [EMAIL PROTECTED] wrote:

 Dan Shirah wrote:
  So:
  fruits.txt is contained in the same folder as mypage.php.
  mypage.php tries to pull the data contained in fruits.txt to see if the
  data matches
  toppage.php has mypage.php inserted as an include and checks for the
  result of $a and processes accordingly.

 In that case your CWD in mypage.php is two levels above where mypage.php
 is. Change the line that reads the file to...

 $lines = file(dirname(__FILE__).'/users.txt');

 ...and it should work fine.

 -Stut

 --
 http://stut.net/



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Robert Cummings
On Wed, 2007-09-05 at 09:47 -0400, Dan Shirah wrote:
 I personally think it sounds like a pretty fun job with a lot of potential.
 Even if you don't get hired on as staff after the contract is up, you're
 still potentially walking away with:
 1 - Some excellent business contacts
 2 - First hand experience in developing their new applications
 3 - More marketability
 All of which can help you in getting the job you might really want.
 
 And, while this job may not be ideal for many programmers out there with
 that much experience under their belt, you know there is always that
 person who has lost their job and is trying hard to find something/anything
 to support their family.
 
 So, thank you Greg for posting this opportunity for people to look at.
 
 My only question is.is that $50,000 Canadian dollars or American? :)

I don't think the currency matters very much anymore... you get $1.05 on
the American dollar these days. It's not like 6 years ago where you got
around a $1.80 :)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Daniel Brown
On 9/5/07, Robert Cummings [EMAIL PROTECTED] wrote:
[snip]
 I don't think the currency matters very much anymore... you get $1.05 on
 the American dollar these days. It's not like 6 years ago where you got
 around a $1.80 :)

Until you think about the fact that the $0.05 difference on the
dollar adds up to $2,500 on a $50k salary.  Not a bank-breaker, but
still worth a mention.  I know I'd certainly like an additional
$2,500.

Actually, I'd like it right now.  Volunteers?  ;-P

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Robert Cummings
On Wed, 2007-09-05 at 14:03 -0400, Daniel Brown wrote:
 On 9/5/07, Robert Cummings [EMAIL PROTECTED] wrote:
 [snip]
  I don't think the currency matters very much anymore... you get $1.05 on
  the American dollar these days. It's not like 6 years ago where you got
  around a $1.80 :)
 
 Until you think about the fact that the $0.05 difference on the
 dollar adds up to $2,500 on a $50k salary.  Not a bank-breaker, but
 still worth a mention.  I know I'd certainly like an additional
 $2,500.
 
 Actually, I'd like it right now.  Volunteers?  ;-P

Well $2,500 is $2,500... no arguing that. But 6 years ago you'd have
gotten about $40,000 and that certainly made a BIG difference :) 

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Daniel Brown
On 9/5/07, Robert Cummings [EMAIL PROTECTED] wrote:
 Well $2,500 is $2,500... no arguing that. But 6 years ago you'd have
 gotten about $40,000 and that certainly made a BIG difference :)

Here, here.

Don't worry, though soon that $50k Canadian will transfer to
$84k+ American.  At which point, I'm going to get a tattoo of a maple
leaf on my face and move north.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Greg Maruszeczka
On Wed, 5 Sep 2007 14:35:10 -0400
Daniel Brown [EMAIL PROTECTED] wrote:

 On 9/5/07, Robert Cummings [EMAIL PROTECTED] wrote:
  Well $2,500 is $2,500... no arguing that. But 6 years ago you'd have
  gotten about $40,000 and that certainly made a BIG difference :)
 
 Here, here.
 
 Don't worry, though soon that $50k Canadian will transfer to
 $84k+ American.  At which point, I'm going to get a tattoo of a maple
 leaf on my face and move north.
 


You won't fit in very well with a mapleleaf on your face...er...except
maybe in Toronto :)


G

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Daniel Brown
On 9/5/07, Greg Maruszeczka [EMAIL PROTECTED] wrote:
 You won't fit in very well with a mapleleaf on your face...er...except
 maybe in Toronto :)

Fair enough, in this case.

On 8/31/07, Greg Gay [EMAIL PROTECTED] wrote:
 Title: Web Applications Developer

 Open August 30, 2007,

 Closing September 14, 2007

 Formal Education: University Degree in computer science/engineering or
 related discipline

 Employer: University of Toronto, Faculty of Information Studies,
 Adaptive Technology Resource Centre,


-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished

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



Re: [Fwd: Re: [PHP] PHP Developer Required]

2007-09-05 Thread Robert Cummings
On Wed, 2007-09-05 at 11:41 -0700, Greg Maruszeczka wrote:
 On Wed, 5 Sep 2007 14:35:10 -0400
 Daniel Brown [EMAIL PROTECTED] wrote:
 
  On 9/5/07, Robert Cummings [EMAIL PROTECTED] wrote:
   Well $2,500 is $2,500... no arguing that. But 6 years ago you'd have
   gotten about $40,000 and that certainly made a BIG difference :)
  
  Here, here.
  
  Don't worry, though soon that $50k Canadian will transfer to
  $84k+ American.  At which point, I'm going to get a tattoo of a maple
  leaf on my face and move north.
  
 
 
 You won't fit in very well with a mapleleaf on your face...er...except
 maybe in Toronto :)

Or if it's the 1st of July :D

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Command line socket server and SSL

2007-09-05 Thread Greg Donald
On Wed, 5 Sep 2007, Paul wrote:
 Below you have described a client. I'm talking about a server. That was clear
 in my original post.

Why on earth would you need to implement an SSL socket in PHP when we
have Apache and openssl?  That's pointless.  Anywhere PHP can run Apache
can run.. and with much better performance.


-- 
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/

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



Re: [PHP] Command line socket server and SSL

2007-09-05 Thread Paul

Greg Donald wrote:

On Wed, 5 Sep 2007, Paul wrote:

Below you have described a client. I'm talking about a server. That was clear
in my original post.


Why on earth would you need to implement an SSL socket in PHP when we
have Apache and openssl?  That's pointless.  Anywhere PHP can run Apache
can run.. and with much better performance.


Because the client is incapable of HTTPS or HTTP protocols.

Not that I really should need to answer this. Why on earth 
would you assume I don't have a good reason? In what way is 
this answer to my question even a little helpful?


Do you have anything to offer in answer to my question to 
the list that actually might help?


Paul W

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



Re: [PHP] Command line socket server and SSL

2007-09-05 Thread Per Jessen
Paul wrote:

 Why on earth would you need to implement an SSL socket in PHP when we
 have Apache and openssl?  That's pointless.  Anywhere PHP can run
 Apache can run.. and with much better performance.
 
 Because the client is incapable of HTTPS or HTTP protocols.
 
 Not that I really should need to answer this. Why on earth
 would you assume I don't have a good reason? In what way is
 this answer to my question even a little helpful?

I'm sorry, I can't offer any help for doing it in PHP, but why do you
have to?  Why not just do it in C, and use the openssl library. 
But if it has to be PHP, see if you can find some PHPopenssl bindings. 



/Per Jessen, Zürich

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



[PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread Matt Livingston
Hey List,

I want to know if it is possible to use PHP to find out if a visitor has
Java Runtime Environment installed on a computer.  Is there a way to use PHP
to find this similiar to how PHP can be used to find out browser info?
Thanks in advance for your help.

-- 
-Matt Livingston


Re: [PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread Jim Lucas

Matt Livingston wrote:

Hey List,

I want to know if it is possible to use PHP to find out if a visitor has
Java Runtime Environment installed on a computer.  Is there a way to use PHP
to find this similiar to how PHP can be used to find out browser info?
Thanks in advance for your help.


No, unless it said so in the user-agent

PHP - server side

client side - javascript, etc...

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Command line socket server and SSL

2007-09-05 Thread Kirk Friggstad
On 9/5/07, Paul [EMAIL PROTECTED] wrote:
 Greg Donald wrote:
  Why on earth would you need to implement an SSL socket in PHP when we
  have Apache and openssl?  That's pointless.  Anywhere PHP can run Apache
  can run.. and with much better performance.

 Because the client is incapable of HTTPS or HTTP protocols.

Disclaimer - I'm still something of a PHP newbie, so please do not
take this as definitive or authoritative advice, but hopefully you'll
still find it helpful.

My guess is that you won't find a way to create an SSL server socket
in PHP, as most PHP use is web-facing - all the SSL details on that
end would be handled by the web server (Apache, IIS, etc.) before the
PHP interpreter fires up. My best suggestion for you would be to use
stunnel (http://stunnel.org/) or something similar to handle the SSL
details of the server connection and pass the actual data on to your
server's socket - it's pretty straightforward to use.

Hope this helps.

Kirk

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



Re: [PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread tedd

At 3:17 PM -0600 9/5/07, Matt Livingston wrote:

Hey List,

I want to know if it is possible to use PHP to find out if a visitor has
Java Runtime Environment installed on a computer.  Is there a way to use PHP
to find this similiar to how PHP can be used to find out browser info?
Thanks in advance for your help.

--
-Matt Livingston


Matt:

But you can attempt to run a js script from php to see if javascript 
is enabled.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread David Powers

tedd wrote:

At 3:17 PM -0600 9/5/07, Matt Livingston wrote:


I want to know if it is possible to use PHP to find out if a visitor has
Java Runtime Environment installed on a computer.


But you can attempt to run a js script from php to see if javascript is 
enabled.


Java Runtime Environment == Java
JavaScript != Java

There is a PECL extension for Java, allows you to get the version of 
Java installed. I have never used it, but details are here:


http://www.php.net/manual/en/ref.java.php

--
David Powers

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



RE: [PHP] Security Issue

2007-09-05 Thread Instruct ICC
It was able to call up external includes using the below code which 
resulted

that the server was used to send out spam.
How can I protect the code?


Is ../inc/ in the web path?  $_SERVER['DOCUMENT_ROOT']

If so, then what do you mean by external includes?  You need to move inc/ 
to a path unreachable by a browser yet reachable by PHP.


_
Test your celebrity IQ.  Play Red Carpet Reveal and earn great prizes! 
http://club.live.com/red_carpet_reveal.aspx?icid=redcarpet_hotmailtextlink2


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



Re: [PHP] Curl redirection problem.

2007-09-05 Thread Chris



Basically I want to redirect to: http://www.website.org/index.php after
logging in using curl.


Curl won't redirect you, you have to do it.

header('Location: http://www.website.org');

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread Satyam
I would think that if you put an applet in the page with some public 
property or method which you could then query from JavaScript if it succeeds 
it means you do have Java, not only installed but available and enabled to 
the browser, then you could either send a AJAX message to the server or 
navigate to some other page.  The client might still have Java but not 
enabled for the browser though and this test would fail.  The Java applet 
itself might communicate to the server but then you wouldn't be able to do 
much with that page as I don't believe an applet has that much control over 
the page it resides in.



- Original Message - 
From: Matt Livingston [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Wednesday, September 05, 2007 11:17 PM
Subject: [PHP] Using PHP to determine if user has Java installed



Hey List,

I want to know if it is possible to use PHP to find out if a visitor has
Java Runtime Environment installed on a computer.  Is there a way to use 
PHP

to find this similiar to how PHP can be used to find out browser info?
Thanks in advance for your help.

--
-Matt Livingston







No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.485 / Virus Database: 269.13.5/990 - Release Date: 04/09/2007 
22:36


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



Re: [PHP] Command line socket server and SSL

2007-09-05 Thread Greg Donald
On Wed, 5 Sep 2007, Paul wrote:
 Because the client is incapable of HTTPS or HTTP protocols.

 Not that I really should need to answer this. Why on earth would you assume I
 don't have a good reason? In what way is this answer to my question even a
 little helpful?

It's not every day someone wants to use php with openssl but omit the web 
server component.

 Do you have anything to offer in answer to my question to the list that
 actually might help?

Have you tried using the openssl s_server directly?


-- 
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/

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



Re: [PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread tedd

At 11:18 PM +0100 9/5/07, David Powers wrote:

tedd wrote:

At 3:17 PM -0600 9/5/07, Matt Livingston wrote:


I want to know if it is possible to use PHP to find out if a visitor has
Java Runtime Environment installed on a computer.


But you can attempt to run a js script from php to see if 
javascript is enabled.


Java Runtime Environment == Java
JavaScript != Java

There is a PECL extension for Java, allows you to get the version of 
Java installed. I have never used it, but details are here:


http://www.php.net/manual/en/ref.java.php

--
David Powers



Duh!

And, I complain about others not reading post correctly.

Boy, I hate it when my words come back to bite me in the butt.

Sorry,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Command line socket server and SSL

2007-09-05 Thread Paul

Greg Donald wrote:

On Wed, 5 Sep 2007, Paul wrote:

Because the client is incapable of HTTPS or HTTP protocols.

Not that I really should need to answer this. Why on earth would you assume I
don't have a good reason? In what way is this answer to my question even a
little helpful?


It's not every day someone wants to use php with openssl but omit the web 
server component.


Do you have anything to offer in answer to my question to the list that
actually might help?


Have you tried using the openssl s_server directly?


Worth a look. Thanks.

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



Re: [PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread Paul Scott

On Wed, 2007-09-05 at 20:41 -0400, tedd wrote:
 Java Runtime Environment == Java
 JavaScript != Java
 

How about something like:

if ( navigator.javaEnabled() ) {
alert('JRE is installed!');
window.location=page_with_a_JAVA_applet;
}
else {
alert('JRE is not installed!');
window.location=error_page;
}


All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

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

Re: [PHP] Using PHP to determine if user has Java installed

2007-09-05 Thread Matt Livingston
Thanks,

http://www.php.net/manual/en/ref.java.php has the information I needed.  The
purpose of this script is on a website I will be managing we distribute
software written in Java, so when they go to download the software I thought
it would be a nice touch to alert them if they do not have JRE installed and
provide a link to the Java site where they can download it.

Thanks again all!

-Matt


On 9/5/07, David Powers [EMAIL PROTECTED] wrote:

 tedd wrote:
  At 3:17 PM -0600 9/5/07, Matt Livingston wrote:
 
  I want to know if it is possible to use PHP to find out if a visitor
 has
  Java Runtime Environment installed on a computer.
 
  But you can attempt to run a js script from php to see if javascript is
  enabled.

 Java Runtime Environment == Java
 JavaScript != Java

 There is a PECL extension for Java, allows you to get the version of
 Java installed. I have never used it, but details are here:

 http://www.php.net/manual/en/ref.java.php

 --
 David Powers

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




-- 
-Matt Livingston