php-general Digest 19 Feb 2008 16:05:46 -0000 Issue 5302

Topics (messages 269587 through 269628):

Re: mysql input
        269587 by: Robert Cummings
        269589 by: Bastien Koert
        269590 by: Shawn McKenzie
        269591 by: Robert Cummings
        269598 by: Richard Heyes
        269600 by: Nathan Rixham
        269601 by: Zoltán Németh
        269602 by: Nathan Rixham
        269603 by: Nathan Rixham
        269617 by: Bastien Koert
        269619 by: Bastien Koert
        269621 by: Nathan Rixham

Re: More than one values returned?
        269588 by: Bastien Koert
        269597 by: Nathan Rixham
        269608 by: tedd
        269613 by: Andrés Robinet

Call PHP script from MySQL
        269592 by: Mário Gamito
        269593 by: Zoltán Németh
        269594 by: Colin Guthrie
        269596 by: Nathan Rixham
        269604 by: Mário Gamito
        269620 by: Colin Guthrie
        269622 by: Sancar Saran

Re: www. not working
        269595 by: Christoph
        269599 by: Børge Holen
        269627 by: Philip Thompson

fopen never ends?
        269605 by: Paul van Brouwershaven
        269606 by: Nathan Rixham
        269610 by: Paul van Brouwershaven

System errno in PHP
        269607 by: Michal Maras
        269609 by: Stut
        269611 by: Michal Maras
        269612 by: Michal Maras

Hiding all browser toolbars - how?
        269614 by: Matty Sarro
        269615 by: Jay Blanchard
        269616 by: Thiago Pojda

Re: Question about cURL, and iFrames...
        269618 by: Jason Pruim
        269626 by: Daniel Brown

js to php help
        269623 by: tedd
        269624 by: Nathan Rixham
        269625 by: Nathan Rixham
        269628 by: tedd

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]


----------------------------------------------------------------------
--- Begin Message ---
On Mon, 2008-02-18 at 23:05 -0500, nihilism machine wrote:
> I have a user saving a VARCHAR(255) field in a mysql db which has  
> single quotes in the text, how can i replace them so that they dont  
> fuck up my mysql command?

mysql_real_escape_string()

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
mysql_real_escape_string()
addslashes()
htmlentities()
 
take your pick
 
 
bastien
> From: [EMAIL PROTECTED]> To: [EMAIL PROTECTED]> Date: Mon, 18 Feb 2008 
> 23:05:10 -0500> Subject: [PHP] mysql input> > I have a user saving a 
> VARCHAR(255) field in a mysql db which has > single quotes in the text, how 
> can i replace them so that they dont > fuck up my mysql command?> > -e> > -- 
> > PHP General Mailing List (http://www.php.net/)> To unsubscribe, visit: 
> http://www.php.net/unsub.php> 
_________________________________________________________________


--- End Message ---
--- Begin Message ---
nihilism machine wrote:
> I have a user saving a VARCHAR(255) field in a mysql db which has single
> quotes in the text, how can i replace them so that they dont fuck up my
> mysql command?
> 
> -e


Have you tried:  dont_fuck_up_my_mysql_command()

--- End Message ---
--- Begin Message ---
On Mon, 2008-02-18 at 23:19 -0500, Bastien Koert wrote:
> mysql_real_escape_string()
> addslashes()
> htmlentities()
>  
> take your pick

That's a bad answer. If he's using MySQL then he SHOULD use
mysql_real_escape_string(). None of the other functions will fully
protect him from malicious input.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:
nihilism machine wrote:
I have a user saving a VARCHAR(255) field in a mysql db which has single
quotes in the text, how can i replace them so that they dont fuck up my
mysql command?

-e


Have you tried:  dont_fuck_up_my_mysql_command()

Hrmph, I can't seem to find that in the manual...

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software hosted for you - no
installation, no maintenance, new features automatic and free

--- End Message ---
--- Begin Message ---
Richard Heyes wrote:
Shawn McKenzie wrote:
nihilism machine wrote:
I have a user saving a VARCHAR(255) field in a mysql db which has single
quotes in the text, how can i replace them so that they dont fuck up my
mysql command?

-e


Have you tried:  dont_fuck_up_my_mysql_command()

Hrmph, I can't seem to find that in the manual...


it's been depricated I heard in favour of unfuck();

--- End Message ---
--- Begin Message ---
2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta:
> Richard Heyes wrote:
> > Shawn McKenzie wrote:
> >> nihilism machine wrote:
> >>> I have a user saving a VARCHAR(255) field in a mysql db which has single
> >>> quotes in the text, how can i replace them so that they dont fuck up my
> >>> mysql command?
> >>>
> >>> -e
> >>
> >>
> >> Have you tried:  dont_fuck_up_my_mysql_command()
> > 
> > Hrmph, I can't seem to find that in the manual...
> > 
> 
> it's been depricated I heard in favour of unfuck();
> 

as I remember its also in SPL.
$whatever = new MySqlCommandUnFucker($command);
$whatever->unFuck();

:D

greets
Zoltán Németh

--- End Message ---
--- Begin Message ---
Zoltán Németh wrote:
2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta:
Richard Heyes wrote:
Shawn McKenzie wrote:
nihilism machine wrote:
I have a user saving a VARCHAR(255) field in a mysql db which has single
quotes in the text, how can i replace them so that they dont fuck up my
mysql command?

-e

Have you tried:  dont_fuck_up_my_mysql_command()
Hrmph, I can't seem to find that in the manual...

it's been depricated I heard in favour of unfuck();


as I remember its also in SPL.
$whatever = new MySqlCommandUnFucker($command);
$whatever->unFuck();

:D

greets
Zoltán Németh

<?php

class MySqlCommandUnFucker {

 public function _unfucker($toUnFuck) {
  if(function_exists('get_magic_quotes_gpc')) {
   if (get_magic_quotes_gpc()) {
    $in = stripslashes($toUnFuck);
   }
  }
  return $in;
 }
        
 public function unFuck($fucked) {
  if(function_exists('mysql_real_escape_string')) {
   return mysql_real_escape_string($this->_unfucker($fucked));
  } else {
   return $fucked;
  }
 }
}
?>


usage:
$unfucker = new MySqlCommandUnFucker;
$sql = $unfucker ->unFuck($sql);

:)

--- End Message ---
--- Begin Message ---
Nathan Rixham wrote:
Zoltán Németh wrote:
2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta:
Richard Heyes wrote:
Shawn McKenzie wrote:
nihilism machine wrote:
I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my
mysql command?

-e

Have you tried:  dont_fuck_up_my_mysql_command()
Hrmph, I can't seem to find that in the manual...

it's been depricated I heard in favour of unfuck();


as I remember its also in SPL.
$whatever = new MySqlCommandUnFucker($command);
$whatever->unFuck();

:D

greets
Zoltán Németh

<?php

class MySqlCommandUnFucker {

 public function _unfucker($toUnFuck) {
  if(function_exists('get_magic_quotes_gpc')) {
   if (get_magic_quotes_gpc()) {
    $in = stripslashes($toUnFuck);
   }
  }
  return $in;
 }
public function unFuck($fucked) {
  if(function_exists('mysql_real_escape_string')) {
   return mysql_real_escape_string($this->_unfucker($fucked));
  } else {
   return $fucked;
  }
 }
}
?>


usage:
$unfucker = new MySqlCommandUnFucker;
$sql = $unfucker ->unFuck($sql);

:)

apologies! a slight correction for nihilism (the class does work..)

usage:
$unfucker = new MySqlCommandUnFucker;
$sql = "INSERT INTO tablename (varcol) VALUES ('";
$sql .= $unfucker->unFuck($myfuckedvariable);
$sql .= "')";

--- End Message ---
--- Begin Message ---
I agree, but they all provide some level of handling just might not be the 
'most correct' way of handling it
 
bastien> Subject: RE: [PHP] mysql input> From: [EMAIL PROTECTED]> To: [EMAIL 
PROTECTED]> CC: [EMAIL PROTECTED]; [EMAIL PROTECTED]> Date: Mon, 18 Feb 2008 
23:31:21 -0500> > > On Mon, 2008-02-18 at 23:19 -0500, Bastien Koert wrote:> > 
mysql_real_escape_string()> > addslashes()> > htmlentities()> > > > take your 
pick> > That's a bad answer. If he's using MySQL then he SHOULD use> 
mysql_real_escape_string(). None of the other functions will fully> protect him 
from malicious input.> > Cheers,> Rob.> -- > 
.------------------------------------------------------------.> | InterJinn 
Application Framework - http://www.interjinn.com |> 
:------------------------------------------------------------:> | An 
application and templating framework for PHP. Boasting |> | a powerful, 
scalable system for accessing system services |> | such as forms, properties, 
sessions, and caches. InterJinn |> | also provides an extremely flexible 
architecture for |> | creating re-usable components quickly and easily. |> 
`------------------------------------------------------------'> 
_________________________________________________________________


--- End Message ---
--- Begin Message ---
thats awesome
 
bastien> To: [EMAIL PROTECTED]> Date: Tue, 19 Feb 2008 11:21:02 +0000> From: 
[EMAIL PROTECTED]> Subject: Re: [PHP] Re: mysql input> > Zoltán Németh wrote:> 
> 2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta:> >> Richard 
Heyes wrote:> >>> Shawn McKenzie wrote:> >>>> nihilism machine wrote:> >>>>> I 
have a user saving a VARCHAR(255) field in a mysql db which has single> >>>>> 
quotes in the text, how can i replace them so that they dont fuck up my> >>>>> 
mysql command?> >>>>>> >>>>> -e> >>>>> >>>> Have you tried: 
dont_fuck_up_my_mysql_command()> >>> Hrmph, I can't seem to find that in the 
manual...> >>>> >> it's been depricated I heard in favour of unfuck();> >>> > > 
> as I remember its also in SPL.> > $whatever = new 
MySqlCommandUnFucker($command);> > $whatever->unFuck();> > > > :D> > > > 
greets> > Zoltán Németh> > <?php> > class MySqlCommandUnFucker {> > public 
function _unfucker($toUnFuck) {> if(function_exists('get_magic_quotes_gpc')) {> 
if (get_magic_quotes_gpc()) {> $in = stripslashes($toUnFuck);> }> }> return 
$in;> }> > public function unFuck($fucked) {> 
if(function_exists('mysql_real_escape_string')) {> return 
mysql_real_escape_string($this->_unfucker($fucked));> } else {> return 
$fucked;> }> }> }> ?>> > > usage:> $unfucker = new MySqlCommandUnFucker;> $sql 
= $unfucker ->unFuck($sql);> > :)> > -- > PHP General Mailing List 
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php> 
_________________________________________________________________


--- End Message ---
--- Begin Message ---
Bastien Koert wrote:
thats awesome
bastien> To: [EMAIL PROTECTED]> Date: Tue, 19 Feb 2008 11:21:02 +0000> From: [EMAIL PROTECTED]> Subject: Re: [PHP] Re: mysql input> > Zoltán Németh wrote:> > 2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta:> >> Richard Heyes wrote:> >>> Shawn McKenzie wrote:> >>>> nihilism machine wrote:> >>>>> I have a user saving a VARCHAR(255) field in a mysql db which has single> >>>>> quotes in the text, how can i replace them so that they dont fuck up my> >>>>> mysql command?> >>>>>> >>>>> -e> >>>>> >>>> Have you tried: dont_fuck_up_my_mysql_command()> >>> Hrmph, I can't seem to find that in the manual...> >>>> >> it's been depricated I heard in favour of unfuck();> >>> > > > as I remember its also in SPL.> > $whatever = new MySqlCommandUnFucker($command);> > $whatever->unFuck();> > > > :D> > > > greets> > Zoltán Németh> > <?php> > class MySqlCommandUnFucker {> > public function _unfucker($toUnFuck) {> if(function_exists('get_magic_quotes_gpc')) {> if (get_mag
ic_quotes_gpc()) {> $in = stripslashes($toUnFuck);> }> }> return $in;> }> > public function unFuck($fucked) {> if(function_exists('mysql_real_escape_string')) {> return mysql_real_escape_string($this->_unfucker($fucked));> } else {> return $fucked;> }> }> }> ?>> > > usage:> $unfucker = new MySqlCommandUnFucker;> $sql = $unfucker ->unFuck($sql);> > :)> > -- > PHP General Mailing List (http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php>
_________________________________________________________________




:)

although $in should be $toUnFuck; just can't be bothered chanign a mock class again!
--- End Message ---
--- Begin Message ---
return an array
 
bastien> From: [EMAIL PROTECTED]> To: [EMAIL PROTECTED]> Date: Tue, 19 Feb 2008 
10:31:02 +0900> Subject: [PHP] More than one values returned?> > Hi,> > > Is it 
possible to "return" more than one values in PHP?> > return $x;> return $y;> > 
They don't work for me.> > -T> > -- > PHP General Mailing List 
(http://www.php.net/)> To unsubscribe, visit: http://www.php.net/unsub.php> 
_________________________________________________________________


--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
On Monday 18 February 2008, Nick Stinemates wrote:

I have found, however, that if I ever need to return /multiple/ values,
it's usually because of bad design and/or the lack of proper
encapsulation.
You mean you've never had a function like getCoordinates()? Or
getUsers(), or any other of a zillion perfectly valid and reasonable
functions that return multiple values as an array? Wow, how odd!

Cheers,
Rob.
getCoordinates() would return a Point object
getUsers() would return a Group  object...

Not rocket science ;)
I wouldn't consider an array of user objects to be "multiple things". I consider it a single aggregate thing, and return arrays all the time. That's conceptually different from wanting two separate return values from a function, which is indeed conceptually icky.

Yes, an aggregate is comprised of multiple things usually. Hence when
decomposing the concept you are indeed returning multiple values-- both
points of view are valid. If you receive a parcel of 100 pens. I can
say, "has the parcel arrived yet" (one entity) or "have the pens arrived
yet" (multiple entities).

At any rate, the O.P. wanted to return multiple values called $x and $y.
It seems quite reasonable to assume he was returning something akin to
coordinates but didn't know how to do so by binding them in an
aggregating structure such as an array, or if you wish, an object.

Cheers,
Rob.

seriously, whats wrong with returning an array? half the standard php functions return array's, therefore at least half of php has been designed badly..?

ps: when working with co-ordinates / GIS data you should really be using wkb data instead, it's much faster. [unpack]
--- End Message ---
--- Begin Message ---
At 6:06 PM -0800 2/18/08, Nick Stinemates wrote:
Thats a good example, and a good reason for passing values by Reference
instead of by Value.

I have found, however, that if I ever need to return /multiple/ values,
it's usually because of bad design and/or the lack of proper encapsulation.

That really depends upon what your functions are doing. If they are calculating variables that are related but independent upon each other (like x, y, z coordinates) it makes perfect sense to return more than value.

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Nathan Rixham [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 19, 2008 5:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] More than one values returned?
> 
> Robert Cummings wrote:
> > On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote:
> >> On Monday 18 February 2008, Nick Stinemates wrote:
> >>
> >>>>> I have found, however, that if I ever need to return /multiple/
> values,
> >>>>> it's usually because of bad design and/or the lack of proper
> >>>>> encapsulation.
> >>>> You mean you've never had a function like getCoordinates()? Or
> >>>> getUsers(), or any other of a zillion perfectly valid and reasonable
> >>>> functions that return multiple values as an array? Wow, how odd!
> >>>>
> >>>> Cheers,
> >>>> Rob.
> >>> getCoordinates() would return a Point object
> >>> getUsers() would return a Group  object...
> >>>
> >>> Not rocket science ;)
> >> I wouldn't consider an array of user objects to be "multiple things".  I
> >> consider it a single aggregate thing, and return arrays all the time.
> That's
> >> conceptually different from wanting two separate return values from a
> >> function, which is indeed conceptually icky.
> >
> > Yes, an aggregate is comprised of multiple things usually. Hence when
> > decomposing the concept you are indeed returning multiple values-- both
> > points of view are valid. If you receive a parcel of 100 pens. I can
> > say, "has the parcel arrived yet" (one entity) or "have the pens arrived
> > yet" (multiple entities).
> >
> > At any rate, the O.P. wanted to return multiple values called $x and $y.
> > It seems quite reasonable to assume he was returning something akin to
> > coordinates but didn't know how to do so by binding them in an
> > aggregating structure such as an array, or if you wish, an object.
> >
> > Cheers,
> > Rob.
> 
> seriously, whats wrong with returning an array? half the standard php
> functions return array's, therefore at least half of php has been
> designed badly..?
> 
> ps: when working with co-ordinates / GIS data you should really be using
>   wkb data instead, it's much faster. [unpack]
> 

So returning multiple values is a bad thing? How about Matlab for which it is
such a common thing to use multiple return values, and they even have names?

function [x, y] = myvectorfun(A, t)
        x = A*cos(t);
        y = A*sin(t);
end

Regards,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE: bestplace |
Web: bestplace.biz  | Web: seo-diy.com

--- End Message ---
--- Begin Message ---
Hi,

Is it possible to call from within MySQL an external PHP script ?
I've read "MySQL Stored Procedure Programming" from O'Reilly but found nothing :(

How can I do this ?

Any help would be appreciated.

Warm Regards,
Mário Gamito

--- End Message ---
--- Begin Message ---
2008. 02. 19, kedd keltezéssel 21.08-kor Mário Gamito ezt írta:
> Hi,
> 
> Is it possible to call from within MySQL an external PHP script ?
> I've read "MySQL Stored Procedure Programming" from O'Reilly but found 
> nothing :(
> 
> How can I do this ?

I think from MySQL you can not call outside applications.

greets
Zoltán Németh

> 
> Any help would be appreciated.
> 
> Warm Regards,
> Mário Gamito
> 

--- End Message ---
--- Begin Message ---
Mário Gamito wrote:
> Hi,
> 
> Is it possible to call from within MySQL an external PHP script ?
> I've read "MySQL Stored Procedure Programming" from O'Reilly but found
> nothing :(
> 
> How can I do this ?
> 
> Any help would be appreciated.

Could be that a Trigger does what you want?
http://dev.mysql.com/doc/refman/5.0/en/triggers.html

But I'd suspect that you probably want to use a MySQL function to do this:

e.g. SELECT SYSTEM('/usr/bin/php /path/to/my/script');

I'm not 100% sure if such a function exists, but if not it's would be a
fairly trivial UDF to implement:
http://dev.mysql.com/doc/refman/5.0/en/adding-udf.html


I'd be very careful tho', as creating such a UDF opens up a potential
minefield for SQL injection attacks!! If it's only one script you want
to execute, then it would be better to create a specific function that
calls that and only that and doesn't accept arguments and doesn't have
any nasty side affects if it's run in an ad-hoc manner.

There may be better solutions and it may be that this could be
implemented in other way if you look at it differently.

Col

--- End Message ---
--- Begin Message ---
Mário Gamito wrote:
Hi,

Is it possible to call from within MySQL an external PHP script ?
I've read "MySQL Stored Procedure Programming" from O'Reilly but found nothing :(

How can I do this ?

Any help would be appreciated.

Warm Regards,
Mário Gamito

Mário,

I'd really like to see an example of why you need this functionality, if that'd be okay. Not to judge, just to learn :)

Many Regards

Nathan

--- End Message ---
--- Begin Message ---
Hi Nathan,


>> Is it possible to call from within MySQL an external PHP script ?
>> I've read "MySQL Stored Procedure Programming" from O'Reilly but
>> found nothing :(
> I'd really like to see an example of why you need this functionality,
> if that'd be okay. Not to judge, just to learn :)

I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page.
I need to insert the password field with the correct hash (vpopmail).

So, after the first insert leaving the password field blank, I need to invoke a PHP script that calculates the hash and then insert it.

Warm Regards,
Mário Gamito

--- End Message ---
--- Begin Message ---
Mário Gamito wrote:
> Hi Nathan,
> 
> 
>>> Is it possible to call from within MySQL an external PHP script ?
>>> I've read "MySQL Stored Procedure Programming" from O'Reilly but
>>> found nothing :(
>> I'd really like to see an example of why you need this functionality,
>> if that'd be okay. Not to judge, just to learn :)
> 
> I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page.
> I need to insert the password field with the correct hash (vpopmail).
> 
> So, after the first insert leaving the password field blank, I need to
> invoke a PHP script that calculates the hash and then insert it.

Assuming there is no way to calculate the hash in ASP.net/C# then you
could almost certainly create a pure C mysql UDF that can calculate it
in a function and leave PHP and double insert stuff out and allow any
MySQL client to claculate the hash....

See my earlier post for UDF details.

Col

--- End Message ---
--- Begin Message ---
Hello,

you may call external php script someting like that

$val = asp's_fopen(http://www.example.com/calculate.php?var=password_field);

<php // calculate.php
echo correct hash (vpopmail);
?>

Regards

Sancar

On Wednesday 20 February 2008 01:58:48 Mário Gamito wrote:
> Hi Nathan,
>
>  >> Is it possible to call from within MySQL an external PHP script ?
>  >> I've read "MySQL Stored Procedure Programming" from O'Reilly but
>  >> found nothing :(
>  >
>  > I'd really like to see an example of why you need this functionality,
>  > if that'd be okay. Not to judge, just to learn :)
>
> I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page.
> I need to insert the password field with the correct hash (vpopmail).
>
> So, after the first insert leaving the password field blank, I need to
> invoke a PHP script that calculates the hash and then insert it.
>
> Warm Regards,
> Mário Gamito

--- End Message ---
--- Begin Message ---
Don't do that.
Some sites may or may not use www. for whatever reason...
Usually screwed-up A-name records by incompetent sysadmins, but there
it is...

Really?  So

games.yahoo.com
blogreport.salon.com
mirror1.downloads.com

are examples of screwed up records by incompetent sysadmins?

thnx,
Chris

--- End Message ---
--- Begin Message ---
On Tuesday 19 February 2008 10:43:04 Christoph wrote:
> > Don't do that.
> > Some sites may or may not use www. for whatever reason...
> > Usually screwed-up A-name records by incompetent sysadmins, but there
> > it is...
>
> Really?  So
>
> games.yahoo.com
> blogreport.salon.com
> mirror1.downloads.com
>
> are examples of screwed up records by incompetent sysadmins?
>
> thnx,
> Chris


nah, just word from a non literate
-- 
---
Børge Holen
http://www.arivene.net

--- End Message ---
--- Begin Message ---
On Feb 19, 2008, at 3:43 AM, Christoph wrote:

Don't do that.
Some sites may or may not use www. for whatever reason...
Usually screwed-up A-name records by incompetent sysadmins, but there
it is...

Really?  So

games.yahoo.com
blogreport.salon.com
mirror1.downloads.com

are examples of screwed up records by incompetent sysadmins?

thnx,
Chris


I don't think he was referring to sub-domains. IMO, www.games.yahoo.com would be ridiculous. =D

~Philip

"Personally, most of my web applications do not have to factor 13.7 billion years of space drift in to the calculations, so PHP's rand function has been great for me..." ~S. Johnson
--- End Message ---
--- Begin Message ---
When you run the folling script, it will never ends?

I have seen this more then once, I know that there is no service running at the target host, but why is the script not printing the failed message?

It's only with a few ip-number I have this problem.

if ($fp = fopen('https://81.23.227.9', 'rb', false)) {
        echo "ok";
} else {
        echo "failed";
}

Best Regards,

Paul van Brouwershaven

--- End Message ---
--- Begin Message ---
Paul van Brouwershaven wrote:
When you run the folling script, it will never ends?

I have seen this more then once, I know that there is no service running at the target host, but why is the script not printing the failed message?

It's only with a few ip-number I have this problem.

if ($fp = fopen('https://81.23.227.9', 'rb', false)) {
        echo "ok";
} else {
        echo "failed";
}

Best Regards,

Paul van Brouwershaven

I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based "host" header in the request.

Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue.

Many Regard

Nathan

--- End Message ---
--- Begin Message ---
Nathan Rixham wrote:
I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based "host" header in the request.
I know that my browser is also waiting a long time, but strange that there is no timeout in fopen? My scripts are getting stuck and eventually they will hang my server. (when I start a new job every x minutes)

Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue.

fsockopen has no context and with stream_socket_client I have no timeout but stream_context_get_options is not returning the right data

$options = stream_context_get_options($fp);

--- End Message ---
--- Begin Message ---
Hello everybody

 Coud somebody tell me if it is possible to get integer value of variable
which name in C is errno end in perl $!.
 I am PHP beginner so I am sorry if question is 'stupid'.

By

--- End Message ---
--- Begin Message ---
Michal Maras wrote:
 Coud somebody tell me if it is possible to get integer value of variable
which name in C is errno end in perl $!.
 I am PHP beginner so I am sorry if question is 'stupid'.

What function are you calling where you expect to get a system error? Check the manual page for that function - it will tell you how to detect errors.

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
Hi

 I am asking about errno for Filesystems functions like
fopen, fread, fclose, ...

On 19/02/2008, Stut <[EMAIL PROTECTED]> wrote:
>
> Michal Maras wrote:
> >  Coud somebody tell me if it is possible to get integer value of
> variable
> > which name in C is errno end in perl $!.
> >  I am PHP beginner so I am sorry if question is 'stupid'.
>
> What function are you calling where you expect to get a system error?
> Check the manual page for that function - it will tell you how to detect
> errors.
>
> -Stut
>
> --
> http://stut.net/
>

--- End Message ---
--- Begin Message ---
I am now using filesystem functions fopen, fread, fclose, ...

On 19/02/2008, Stut <[EMAIL PROTECTED]> wrote:
>
> Michal Maras wrote:
> >  Coud somebody tell me if it is possible to get integer value of
> variable
> > which name in C is errno end in perl $!.
> >  I am PHP beginner so I am sorry if question is 'stupid'.
>
> What function are you calling where you expect to get a system error?
> Check the manual page for that function - it will tell you how to detect
> errors.
>
> -Stut
>
> --
> http://stut.net/
>

--- End Message ---
--- Begin Message ---
Greetings everyone! I am currently working on a web application (aren't we
all?). The main page which users will look at is simply a login prompt, and
upon logging in a new browser window will be launched. I would like that
window to have no browser bars, etc so all of the space taken up by the
window is dedicated to the app. I know this can be done in ASP (my company's
software does it) but I am curious if its possible or not with PHP? If not,
maybe javascript? Any advice at all would be wonderful, thanks!
-Matthew

--- End Message ---
--- Begin Message ---
[snip]
Greetings everyone! I am currently working on a web application (aren't
we
all?). The main page which users will look at is simply a login prompt,
and
upon logging in a new browser window will be launched. I would like that
window to have no browser bars, etc so all of the space taken up by the
window is dedicated to the app. I know this can be done in ASP (my
company's
software does it) but I am curious if its possible or not with PHP? If
not,
maybe javascript? Any advice at all would be wonderful, thanks![/snip]

It will either be JavaScript or starting the browser in a kiosk mode

--- End Message ---
--- Begin Message ---
<quote>
[snip]
Greetings everyone! I am currently working on a web application (aren't we
all?). The main page which users will look at is simply a login prompt, and
upon logging in a new browser window will be launched. I would like that
window to have no browser bars, etc so all of the space taken up by the
window is dedicated to the app. I know this can be done in ASP (my company's
software does it) but I am curious if its possible or not with PHP? If not,
maybe javascript? Any advice at all would be wonderful, thanks![/snip]

It will either be JavaScript or starting the browser in a kiosk mode
</quote>

As said, that's not up to php (server-side) but to HTML/JavaScript
(client-side).

But if you want to hide the address bar, remember that in Firefox3 and IE7
that's not possible (AFAIK).


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

--- End Message ---
--- Begin Message ---

On Feb 18, 2008, at 9:19 AM, Dan Joseph wrote:

On Feb 15, 2008 9:43 AM, Jason Pruim <[EMAIL PROTECTED]> wrote:

I am trying to think through something, I am writing a simple proxy
script for my own knowledge and to simplify my life :)

What I want to do is bring in multiple website by going to 1 webpage
(Think RSS for the entire website) have all the links work properly,
login to the pages etc. etc. etc. I think I can do this with cURL
which can pull the page in and display it properly, but I'm wondering
if I should be displaying in an iFrame to keep my navigation links at
the top to go around my site?


Well, I think the short answer to that is Yes, curl can do what you want. You could pull in the page with curl, then go thru it and populate form fields, then display it. You wouldn't need an iframe, you'd just pull it in
with curl, run thru and populate the fields, then display the finished
product on the screen. One thing you may also want to keep in mind is that I think you'd have to go through and fix the image links and url links if
they don't have the full url path in the html.


Hey Dan,

Thanks for the response. Do you think that there is a better way to pull in another webpage other then curl? I mean, could I simply include 'HTTP://www.mykillersite.com'; and have all the link work? I'll have to try that in a little bit when I get some development time and see how it works...


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
On Feb 19, 2008 9:44 AM, Jason Pruim <[EMAIL PROTECTED]> wrote:
> Hey Dan,
>
> Thanks for the response. Do you think that there is a better way to
> pull in another webpage other then curl? I mean, could I simply
> include 'HTTP://www.mykillersite.com'; and have all the link work?
> I'll have to try that in a little bit when I get some development time
> and see how it works...

    You could include, file_get_contents(), implode(), et cetera, but
the links will only work on your local site if a variety of conditions
are true.  Including:
        a.) Relative linking
        b.) Non-protected content
        c.) Static content or dynamic content that does not rely on a
private database
        d.) ....

    You can preg_replace() the '/href="(.*)"/Ui' tags, but then
matching conditions and writing out everything to expect (or not to
expect) may be going beyond the scope of what you're trying to do.  I
don't know.... I just read the end of the thread myself.

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

--- End Message ---
--- Begin Message ---
Hi gang:

I have a date picker in javascript working, but I need to take the date selections to php.

Here's the link and code:

http://www.webbytedd.com/a/calendar/index.php

How can I get what is selected in javascript to POST?

Thanks in advance for any suggestions.

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
tedd wrote:
Hi gang:

I have a date picker in javascript working, but I need to take the date selections to php.

Here's the link and code:

http://www.webbytedd.com/a/calendar/index.php

How can I get what is selected in javascript to POST?

Thanks in advance for any suggestions.

Cheers,

tedd


This is really a JS issue but.. check the snippet of your code below:

    Calendar.setup({
        inputField     :    "f_date_e",     // id of the input field
     });

<input type="hidden" value="f_trigger_e" name="show_e" >

looks to me like if your input should be

<input type="hidden" value="" id="date_e" name="date" />

Regards

Cool & the Gang

--- End Message ---
--- Begin Message ---
Nathan Rixham wrote:
tedd wrote:
Hi gang:

I have a date picker in javascript working, but I need to take the date selections to php.

Here's the link and code:

http://www.webbytedd.com/a/calendar/index.php

How can I get what is selected in javascript to POST?

Thanks in advance for any suggestions.

Cheers,

tedd


This is really a JS issue but.. check the snippet of your code below:

    Calendar.setup({
        inputField     :    "f_date_e",     // id of the input field
     });

<input type="hidden" value="f_trigger_e" name="show_e" >

looks to me like if your input should be

<input type="hidden" value="" id="date_e" name="date" />

Regards

Cool & the Gang

edit: (damn c+p)

..should be
<input type="hidden" value="" id="f_date_e" name="f_date_e" />

--- End Message ---
--- Begin Message ---
At 3:23 PM +0000 2/19/08, Nathan Rixham wrote:
Nathan Rixham wrote:
tedd wrote:
Hi gang:

I have a date picker in javascript working, but I need to take the date selections to php.

Here's the link and code:

http://www.webbytedd.com/a/calendar/index.php

How can I get what is selected in javascript to POST?

This is really a JS issue but.. check the snippet of your code below:

Getting variables from js to php is at least half a php issue.

looks to me like if your input should be

<input type="hidden" value="" id="f_date_e" name="f_date_e" />

Nathan:

Yeah, I was hoping for something like that as well. But, your suggestion doesn't work -- see here:

http://www.webbytedd.com/a/calendar1/index.php

I tried all sorts of different combinations, but couldn't get anything to work.

I believe that I'm close, but I thought someone here might have experience doing this.

I just don't want to start all over with DOM scripting and figure out how to do it that way.


Cheers,

tedd

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

--- End Message ---

Reply via email to