Re: [PHP] get value of array without key

2004-07-13 Thread Prasit Narkdee


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wednesday 14 July 2004 11:54, Prasit Narkdee wrote:
> > $tmp = unpack("d", substr($this->data, $spos + 6,
8));
> > // It machine machine dependent
> >
> > if ($this->isDate($spos)) {
> > list($string, $raw) =
$this->createDate($tmp['']);
> >  //   $this->addcell(DateRecord($r, 1));
> > }else{
> > $raw = $tmp[''];
> > if (isset($this->_columnsFormat[$column + 1])){
> > $this->curformat =
> > $this->_columnsFormat[$column + 1];
> > }
> >
> > $string = sprintf($this->curformat, $tmp[''] *
> > $this->multiplier);
> >
> >  //   $this->addcell(NumberRecord($r));
> > }
> >
> >
> > $raw = $tmp[''];
> > some server can get value of first element of array but some server $raw
is
> > empty
> > how can i  sole it?
> > What variable in php.ini must modify?
>
> First of all I have no idea what your code is trying to do. But if you're
> simply trying to get the first element from an array then use
array_shift()
> or array_slice().
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> The clash of ideas is the sound of freedom.
> */




i use class Spreadsheet_Excel_Reader  i  found in google
some server is no problem and get $tmp[''] value
but when i run this script in some server $tmp[''] is emptry


case Spreadsheet_Excel_Reader_Type_NUMBER:
$row= ord($this->data[$spos]) |
ord($this->data[$spos+1])<<8;
$column = ord($this->data[$spos+2]) |
ord($this->data[$spos+3])<<8;
$tmp = unpack("d", substr($this->data, $spos + 6, 8));
// It machine machine dependent

if ($this->isDate($spos)) {
list($string, $raw) = $this->createDate($tmp['']);
 //   $this->addcell(DateRecord($r, 1));
}else{
$raw = $tmp[''];
if (isset($this->_columnsFormat[$column + 1])){
$this->curformat =
$this->_columnsFormat[$column + 1];
}

$string = sprintf($this->curformat, $tmp[''] *
$this->multiplier);

 //   $this->addcell(NumberRecord($r));
}
$this->addcell($row, $column, $string, $raw);
//echo "Number $row $column $string\n";
break;

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



[PHP] Compile Php5: --with-mysql and --with-mysqli

2004-07-13 Thread Jacob Friis Larsen
How do I install Php5 with both --with-mysql and --with-mysqli?
MySQL is 4.1.3-beta and installed as official MySQL RPM.
This didn't work:
./configure --with-mysql=/usr/include/mysql --enable-embedded-mysqli
./configure --with-mysql=/usr/include/mysql
--with-mysql=/usr/bin/mysql_config
./configure --with-mysql=/usr/include/mysql
--with-mysqli=/usr/bin/mysql_config
The last gave me a lot of errors.
Thanks,
Jacob
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHPEdit almost as good as s*x (with a women in bikini)

2004-07-13 Thread EE
Sorry Guys,
I know that this is off-topic. In one of the sites,I saw the subject AD
{PHPEdit almost as good as s*x (with a women in bikini)}. This is really
irritating. What sex has to do with PHP. Does the PHPEdit folks think
that I will use their product if it is as good as s*x.
Sorry, really sorry.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] A question not directly related to PHP

2004-07-13 Thread Ed Lazor
How are you resolving hostnames?  Are relevant IPs/Hostnames in your hosts
file?  Does the local machine have mynotebook mapped to 127.0.0.1?


> -Original Message-
> A curious thing has been happening.  When I run the PHP script on my
> machine using localhost, the script executes perfectly.  However when I
> access the script from a remote machine (My machine is connected to a
> LAN and since I am running IIS, the script can be accessed at
> http://mynotebook/), the script does not execute.  Not only does the
> script not execute, the LAN connection on my notebook freezes.  After
> this, I am unable to access any network resources from my notebook
> including internet etc.  Once I reboot, I am able to access the net
> until I access the above script from a remote machine.

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



Re: [PHP] DAYLIGHT SAVINGS TIME OR NOT

2004-07-13 Thread Curt Zirzow
* Thus wrote Chirag Shukla:
> 
> This function can be used to know whether it is Daylight Savings time or 
> not for the given date. It may not be the most optimized program, but 
> may be helpful.
> 
> If there is a modified code, please let me know.

ok.


> 
>  
>   // here is the date. We wont worry about the time.
>   $processdate = "07/04/2004 14:45";

What about different formats like 07-04-2004 14:45:00

> 
>   // calling the function.
>   // 1 means the date is in a daylight savings time
>   // 0 means the date is not in a daylight savings time

 one thing to note, not all zones, even in the US honor the
 DST. this is a rather sepecific function.

>   echo daylight($processdate);
> 
>   // now the function
> 
> function daylight($mydate)
> {
>   // separating the date and time
>   $datetime = explode(" ",$mydate);
> 
>   // exploding the components of date
>   $dateexplode = explode("/",$datetime[0]);

 Instead of exploding stuff around, make your date argument compatible
 with the strtotime() function, it will return a unix timestamp or
 -1 if it fails to parse the date.


> 
>   // if the date is between Jan-Mar, NO DAYLIGHT
>   // if the date is between Nov-Dec, NO DAYLIGHT
>   if ($dateexplode[0]<4 or $dateexplode[0]>10)
>   {
>   return 0;
>   }
>   // if the date is not in the above zone, lets see
>   // if the date is between May-Sep, DAYLIGHT
>   elseif ($dateexplode[0]>4 and $dateexplode[0]<10)
>   {
>   return 1;
>   }

  Since you have a timestamp as I suggested above, you simply need
  to pull the month out, and then check the month value:

  $month = strftime('%m', $utimestamp);
  
  swtich ($month) {
case '01': case '02': ...
   return 0;
case '05': case '06': ...
   return 1;
   
  }


>   else
>   {
>   // we are going to pull out what date is a sunday
>   // then we compare our date's day-of-month with the 
>   day-that-is-sunday
>   
>   $interestday = 0;
>   
>   // lets see what happens in april - first sunday of the month
>   if ($dateexplode[0]==4)
>   {
>   // looping the first seven days to see what day is a 
>   sunday
>   for ($i=1; $i<=7; $i++)
>   {
>   $myday = 
>   
> date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2]));
>   if ($myday==0)
>   $interestday = $i;
>   }
>   
>   // now that we got what day is a sunday, lets see
>   // if our date's day-of-month is greater than this 
>   or not
>   // if it is greater, then DAYLIGHT
>   if ($dateexplode[1]>=$interestday)
>   return 1;
>   else
>   return 0;
>   }
> 
>   // lets see what happens in october - last sunday of the 
>   month
>   elseif ($dateexplode[0]==10)
>   {
>   // looping the first seven days to see what day is a 
>   sunday
>   for ($i=25; $i<=31; $i++)
>   {
>   $myday = 
>   
> date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2]));
>   if ($myday==0)
>   $interestday = $i;
>   }
>   
>   // now that we got what day is a sunday, lets see
>   // if our date's day-of-month is greater than this 
>   or not
>   // if it is less, then DAYLIGHT
>   if ($dateexplode[1]<=$interestday)
>   return 1;
>   else
>   return 0;
>   }
>   }
  
  now instead of doing all that mundane work, we simply have to
  find out if the  days are outabounds for the paticular months.

  // obtain the day of month 
  $dayofmonth = (int)strftime('%d', $utimestamp);

  // and the day of week
  $dayofweek =  strftime('%u', $utimestamp);

  if ($month == '04') {

// If its the first week of 04
if ($dayofmonth <= 7) {

  // and we havn't reached sunday, return 0
  return ($dayofweek < 7) ? 0: 1;

}
return 1; // otherwise we're passed it.
   
  } elseif ($month == '10') {

// look at the last week october
if ($dayofmonth >= 24) {
   
  // see if we're still in the zone.
  return ($dayofweek < 7) ? 1: 0;
}
return 1;

  }

  // something went w

Re: [PHP] get value of array without key

2004-07-13 Thread Jason Wong
On Wednesday 14 July 2004 11:54, Prasit Narkdee wrote:
> $tmp = unpack("d", substr($this->data, $spos + 6, 8));
> // It machine machine dependent
>
> if ($this->isDate($spos)) {
> list($string, $raw) = $this->createDate($tmp['']);
>  //   $this->addcell(DateRecord($r, 1));
> }else{
> $raw = $tmp[''];
> if (isset($this->_columnsFormat[$column + 1])){
> $this->curformat =
> $this->_columnsFormat[$column + 1];
> }
>
> $string = sprintf($this->curformat, $tmp[''] *
> $this->multiplier);
>
>  //   $this->addcell(NumberRecord($r));
> }
>
>
> $raw = $tmp[''];
> some server can get value of first element of array but some server $raw is
> empty
> how can i  sole it?
> What variable in php.ini must modify?

First of all I have no idea what your code is trying to do. But if you're 
simply trying to get the first element from an array then use array_shift() 
or array_slice().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The clash of ideas is the sound of freedom.
*/

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



[PHP] get value of array without key

2004-07-13 Thread Prasit Narkdee
$tmp = unpack("d", substr($this->data, $spos + 6, 8));
// It machine machine dependent

if ($this->isDate($spos)) {
list($string, $raw) = $this->createDate($tmp['']);
 //   $this->addcell(DateRecord($r, 1));
}else{
$raw = $tmp[''];
if (isset($this->_columnsFormat[$column + 1])){
$this->curformat =
$this->_columnsFormat[$column + 1];
}

$string = sprintf($this->curformat, $tmp[''] *
$this->multiplier);

 //   $this->addcell(NumberRecord($r));
}


$raw = $tmp[''];
some server can get value of first element of array but some server $raw is
empty
how can i  sole it?
What variable in php.ini must modify?

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



Re: [PHP] Opinion: PHP Sessions or Cookies

2004-07-13 Thread Jason Wong
On Wednesday 14 July 2004 12:45, Chris Shiflett wrote:

> The way I interpret your question is to ask whether it's better to store
> session data on the server (in $_SERVER) or on the client (in cookies).

So that people don't get confused: $_SERVER should be $_SESSION.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
...though his invention worked superbly -- his theory was a crock of sewage 
from
beginning to end. -- Vernor Vinge, "The Peace War"
*/

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Josh Close
That sounds about right. It pretty much described the behavior between
the two versions.

Thanks for the info.



On Tue, 13 Jul 2004 18:44:06 -0500, Michael Sims
<[EMAIL PROTECTED]> wrote:
> Curt Zirzow wrote:
> > * Thus wrote Josh Close:
> >> if($var)
> >>
> >> used to work for
> >>
> >> if($var != 0) or if($var != "0")
> >>
> >> but that doesn't seem to work since I upgrade. So I'm just going to
> >> do
> >>
> >> if((int)$var)
> >
> > I still think this is unnecessary
> >
> > if ("0") { echo '"0"'; }
> > if ("")  { echo '""'; }
> > if (0)   { echo 0; }
> >
> > As I pointed out earlier, are still all the same; this behaviour
> > hasn't changed.
> 
> I agree.  As I pointed out in my earlier message in this thread, based on
> the description that the OP gave (and the fact that he's using
> mssql_query()), I think he's getting bitten by the problems introduced by
> the fix for bug #25777:
> 
> http://bugs.php.net/bug.php?id=25777
> 
> Basically PHP used to trim trailing spaces from data being returned via the
> mssql and sybase extensions, and the fix for the above bug (in both
> extensions) was to stop this trimming.  In my case this introduced a new
> problem, because bit fields that contain simply '0' in the database come
> back with trailing spaces.  While this:
> 
> $ php -r 'if ("0") echo "Yes\n";'
> 
> produces no output (because "0" == false) this does:
> 
> $ php -r 'if ("0 ") echo "Yes\n";'
> 
> because "0 " != false.
> 
> I have a hunch that if the OP does a print_r() on their "$var", it will be a
> string that starts with zero and ends with one or more spaces.  Casting $var
> to int will restore the original behavior, but this is only because (int) "0
> " === 0 and 0 == false.  So basically the cast to int does fix the OP's
> problem but not for the reasons he believes.
> 
> Of course, that's a complete guess based off incomplete information.  I
> could be way off. :)
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
-Josh

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



Re: [PHP] Opinion: PHP Sessions or Cookies

2004-07-13 Thread Chris Shiflett
--- Ed Lazor <[EMAIL PROTECTED]> wrote:
> I'm using PHP sessions for user tracking.  My host provider's server is
> dropping session data.  He swears it's my scripts and says I should be
> using cookies for better security.  That goes completely opposite to my
> understanding, so I'd like to run it by you guys.  Which is more secure:
> PHP sessions or cookies?

First, I'd like to point out that sessions and cookies aren't opposite
ideas at all. In fact, PHP's default session mechanism uses cookies for
the session identifier (PHPSESSID).

The way I interpret your question is to ask whether it's better to store
session data on the server (in $_SERVER) or on the client (in cookies).
When stored on the client, you rely on the client to send all session data
to the server for every single request. These requests are sent across the
Internet. The Internet is a public network. Hopefully this makes it clear
that storing data on the server is more secure than having it sent across
a public network for every single HTTP transaction (multiple transactions
are typically required to render a single Web page).

I think your instinct ("That goes completely opposite to my
understanding") serves you well. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] FW: NO SUCH ADDRESS

2004-07-13 Thread Jason Wong
On Wednesday 14 July 2004 11:29, Curt Zirzow wrote:

> > I've already added that domain to my spam list and forgot lazy people
> > who does not unsubscribe from the list.
>
> I've mentioned this everytime this topic comes up, and every time
> it comes up, this solution is always given. And I'm going to say it
> again... That is not the way to deal with bounced mails.

As the list seems to run on ezmlm it would probably be a good idea to shorten 
bounce timeout to say 3-5 days and take good advantage of ezmlm's auto 
removal of "perpetually" bouncing addresses.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If you don't do it, you'll never know what would have happened if you
had done it.
*/

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



[PHP] A question not directly related to PHP

2004-07-13 Thread Feroze Arif
Hi,
I am using a notebook running Windows XP Professional  with IIS for my 
PHP development.  I am developing an application that generates RTF 
files on the fly and stores them in a directory. 

A curious thing has been happening.  When I run the PHP script on my 
machine using localhost, the script executes perfectly.  However when I 
access the script from a remote machine (My machine is connected to a 
LAN and since I am running IIS, the script can be accessed at 
http://mynotebook/), the script does not execute.  Not only does the 
script not execute, the LAN connection on my notebook freezes.  After 
this, I am unable to access any network resources from my notebook 
including internet etc.  Once I reboot, I am able to access the net 
until I access the above script from a remote machine.

I am also running Norton Anti-Virus and I tried turning it off but that 
doesn't seem to have any effect.  Norton has a Script Blocking feature 
which I turned off as well but that didn't have any effect either.

One more thing is that, in another environment, I connect through 
Wireless and in that environment this problem does not occur.  Having 
said that, i have to reconfirm if this problem occurs only when I 
connect using wires.

Has anyone come accross a similar problem?  I would appreciate it very 
much if some one could point me towards a solution.

Best Regards
Feroze
=
Jar Jar Binks will be Jedi!
=
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Josh Close
That sounds about right. It pretty much described the behavior between
the two versions.

Thanks for the info.


On Tue, 13 Jul 2004 18:44:06 -0500, Michael Sims
<[EMAIL PROTECTED]> wrote:
> Curt Zirzow wrote:
> > * Thus wrote Josh Close:
> >> if($var)
> >>
> >> used to work for
> >>
> >> if($var != 0) or if($var != "0")
> >>
> >> but that doesn't seem to work since I upgrade. So I'm just going to
> >> do
> >>
> >> if((int)$var)
> >
> > I still think this is unnecessary
> >
> > if ("0") { echo '"0"'; }
> > if ("")  { echo '""'; }
> > if (0)   { echo 0; }
> >
> > As I pointed out earlier, are still all the same; this behaviour
> > hasn't changed.
> 
> I agree.  As I pointed out in my earlier message in this thread, based on
> the description that the OP gave (and the fact that he's using
> mssql_query()), I think he's getting bitten by the problems introduced by
> the fix for bug #25777:
> 
> http://bugs.php.net/bug.php?id=25777
> 
> Basically PHP used to trim trailing spaces from data being returned via the
> mssql and sybase extensions, and the fix for the above bug (in both
> extensions) was to stop this trimming.  In my case this introduced a new
> problem, because bit fields that contain simply '0' in the database come
> back with trailing spaces.  While this:
> 
> $ php -r 'if ("0") echo "Yes\n";'
> 
> produces no output (because "0" == false) this does:
> 
> $ php -r 'if ("0 ") echo "Yes\n";'
> 
> because "0 " != false.
> 
> I have a hunch that if the OP does a print_r() on their "$var", it will be a
> string that starts with zero and ends with one or more spaces.  Casting $var
> to int will restore the original behavior, but this is only because (int) "0
> " === 0 and 0 == false.  So basically the cast to int does fix the OP's
> problem but not for the reasons he believes.
> 
> Of course, that's a complete guess based off incomplete information.  I
> could be way off. :)
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
-Josh

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



[PHP] DAYLIGHT SAVINGS TIME OR NOT

2004-07-13 Thread Chirag Shukla
This function can be used to know whether it is Daylight Savings time or 
not for the given date. It may not be the most optimized program, but 
may be helpful.

If there is a modified code, please let me know.
Thank you.
Sincerely,
Chirag Shukla.

// here is the date. We wont worry about the time.
$processdate = "07/04/2004 14:45";
// calling the function.
// 1 means the date is in a daylight savings time
// 0 means the date is not in a daylight savings time
echo daylight($processdate);
// now the function
function daylight($mydate)
{
// separating the date and time
$datetime = explode(" ",$mydate);
// exploding the components of date
$dateexplode = explode("/",$datetime[0]);
// if the date is between Jan-Mar, NO DAYLIGHT
// if the date is between Nov-Dec, NO DAYLIGHT
if ($dateexplode[0]<4 or $dateexplode[0]>10)
{
return 0;
}
// if the date is not in the above zone, lets see
// if the date is between May-Sep, DAYLIGHT
elseif ($dateexplode[0]>4 and $dateexplode[0]<10)
{
return 1;
}
else
{
// we are going to pull out what date is a sunday
// then we compare our date's day-of-month with the day-that-is-sunday

$interestday = 0;

// lets see what happens in april - first sunday of the month
if ($dateexplode[0]==4)
{
// looping the first seven days to see what day is a sunday
for ($i=1; $i<=7; $i++)
{
$myday = 
date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2]));
if ($myday==0)
$interestday = $i;
}

// now that we got what day is a sunday, lets see
// if our date's day-of-month is greater than this or not
// if it is greater, then DAYLIGHT
if ($dateexplode[1]>=$interestday)
return 1;
else
return 0;
}
// lets see what happens in october - last sunday of the month
elseif ($dateexplode[0]==10)
{
// looping the first seven days to see what day is a sunday
for ($i=25; $i<=31; $i++)
{
$myday = 
date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2]));
if ($myday==0)
$interestday = $i;
}

// now that we got what day is a sunday, lets see
// if our date's day-of-month is greater than this or not
// if it is less, then DAYLIGHT
if ($dateexplode[1]<=$interestday)
return 1;
else
return 0;
}
}
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] GMT to local time (CDT in this case)

2004-07-13 Thread Chirag Shukla


// I am using the convention (assumption) of "07/04/2004 14:45"
$processdate = "07/04/2004 14:45";
// gmttolocal is a function
// i am passing it 2 parameters:
// 1)the date in the above format and
// 2)time difference as a number; -5 in our case (GMT to CDT)
echo gmttolocal($processdate,-5);
function gmttolocal($mydate,$mydifference)  
{
// trying to seperate date and time
$datetime = explode(" ",$mydate);

// trying to seperate different elements in a date
$dateexplode = explode("/",$datetime[0]);

// trying to seperate different elements in time
$timeexplode = explode(":",$datetime[1]);
	// getting the unix datetime stamp
	$unixdatetime = 
mktime($timeexplode[0]+$mydifference,$timeexplode[1],0,$dateexplode[0],$dateexplode[1],$dateexplode[2]);

// return the local date
return date("m/d/Y H:i",$unixdatetime));
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] FW: NO SUCH ADDRESS

2004-07-13 Thread Curt Zirzow
* Thus wrote Jordi Canals:
> Ed Lazor wrote:
> 
> >Am I the only one getting these every time I post to the list?
> >
> Everyone is getting it. But we cannot know wich address is giving back 
> this message, as it is not reported. Just we know the domain it comes from.

I've put in a request to unsub this whole domain. The messages
should stop shortly.

> 
> I've already added that domain to my spam list and forgot lazy people 
> who does not unsubscribe from the list.

I've mentioned this everytime this topic comes up, and every time
it comes up, this solution is always given. And I'm going to say it
again... That is not the way to deal with bounced mails.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



[PHP] Grab a range of rows from a mysql result

2004-07-13 Thread [EMAIL PROTECTED]
I need to grab a range of rows from a mysql result resource.

The resource is made up of 1000+ records from a mysql table that I am
breaking up to make my PHP application run faster.  I have figured out how
to compute the range but I don¹t know how to pull out a group of rows within
a range from a mysql result resource.

Anyone have any insights into how I can do this in PHP?

VR/Tim





Re: [PHP] Grab a range of rows from a mysql result

2004-07-13 Thread Travis Low
select * from foo limit n, m
n == starting index, zero-based
m == maximum number of rows to return.
You probably shouldn't cross-post to different mailing lists.
cheers,
Travis
[EMAIL PROTECTED] wrote:
I need to grab a range of rows from a mysql result resource.
The resource is made up of 1000+ records from a mysql table that I am
breaking up to make my PHP application run faster.  I have figured out how
to compute the range but I don¹t know how to pull out a group of rows within
a range from a mysql result resource.
Anyone have any insights into how I can do this in PHP?
VR/Tim


--
Travis Low


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


[PHP] Compiling PHP 5.0.0 on Windows with IIS 5.1

2004-07-13 Thread Sean Vasey
Could anyone explain how to install PHP 5 on Windows running IIS 5.1? I following the 
supplied instructions but the extensions were not loading and I had them configured 
correctly in php.ini and when I would create a phpinfo page, there would be access 
errors and the PHP and Zend logos would not display for some reason. Any help would be 
greatly appreciated.

Thanks, Sean Vasey


Re: [PHP] Some weong when I start the apache and PHP

2004-07-13 Thread YY Liu
Yes!
I try to point the browser to http://localhost:8081 and it works!
 
Thank you all!


Michal Migurski <[EMAIL PROTECTED]> wrote:
> Hello everyone!
>
> I just have installed the apache and PHP. When I installed apache, I ran
> the command "./apachectl start" in its directory and there was an
> information showing that it has been running, but when I input
> "http://localhost/"; in browser I can't link to localhost.The error
> mesage is below:
>
> "The connection was refused when attepting to contact localhost."

Check your Apache config file -- it may be set to a port other than 80
(possibly 8080) by default. Change the port and restart Apache, or just
point your browser to http://localhost:8080

-
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html



-
Do You Yahoo!?
美女明星应有尽有,"一搜"搜遍美图、艳图和酷图
100兆邮箱够不够用?雅虎电邮自助扩容!

Re: [PHP] Some weong when I start the apache and PHP

2004-07-13 Thread Michal Migurski
> Hello everyone!
>
> I just have installed the apache and PHP. When I installed apache, I ran
> the command "./apachectl start" in its directory and there was an
> information showing that it has been running, but when I input
> "http://localhost/"; in browser I can't link to localhost.The error
> mesage is below:
>
> "The connection was refused when attepting to contact localhost."

Check your Apache config file -- it may be set to a port other than 80
(possibly 8080) by default. Change the port and restart Apache, or just
point your browser to http://localhost:8080

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



[PHP] Some weong when I start the apache and PHP

2004-07-13 Thread YY Liu

Hello everyone!

I just have installed the apache and PHP. When I installed apache, I ran the command 
"./apachectl start" in its directory and there was an information showing that it has 
been running, but when I input "http://localhost/"; in browser I can't link to 
localhost.The error mesage is below:

"The connection was refused when attepting to contact localhost."

 

Then I install PHP succesfully and start apache another time, there was no info to 
show it has been start or it has something wrong, and I can't link to localhost either.

I use apache2 and php-4.3.7 and installed both according to  
http://php.net/manual/install.apache2.php.

Anyone knows where the problem may be?

Thanks a lot!




-
Do You Yahoo!?
美女明星应有尽有,"一搜"搜遍美图、艳图和酷图
100兆邮箱够不够用?雅虎电邮自助扩容!

RE: [PHP] FW: NO SUCH ADDRESS

2004-07-13 Thread Ed Lazor
> -Original Message-
> Everyone is getting it. But we cannot know wich address is giving back
> this message, as it is not reported. Just we know the domain it comes
> from.

The guy lists [EMAIL PROTECTED] as his email address on the site.  I bet
that's the one bouncing.

-Ed

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



Re: [PHP] FW: NO SUCH ADDRESS

2004-07-13 Thread Jordi Canals
Ed Lazor wrote:
Am I the only one getting these every time I post to the list?
Everyone is getting it. But we cannot know wich address is giving back 
this message, as it is not reported. Just we know the domain it comes from.

I've already added that domain to my spam list and forgot lazy people 
who does not unsubscribe from the list.

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


Re: [PHP] PHP on MAC

2004-07-13 Thread Michael Collins
At 7:32 PM -0400 7/13/04, Larry E. Ullman wrote:
We've just bought a new Power Mac G5 Macintosh computer for the office and
I'll need to do some backend engineering work using it. I've never worked
with PHP on MAC, so I really have no experience with what happens on a
MAC... are there on issues regarding working with PHP on a MAC?
Not at all. OS X is essentially Unix and you've already got Apache 
built in. I believe it comes with PHP installed (but not enabled) 
but I would recommend using Marc's installer from www.entropy.ch. 
This will give you the most current version of PHP (normally). In 
short, PHP is great on a Mac.

Hope that helps,
Larry

PHP is already installed. If you want the latest 4.x series, use the 
entropy installer. If you want PHP 5 you will have to build it 
yourself from source. I have recently done that, I found this article 
useful in doing so:

http://www.phpmac.com/articles.php?view=177
--
Michael
__
||| Michael Collins
||| Kuwago Inc
||| Singapore and Seattle USA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] WAMP5 1.0 : now includes PHP 5.0.0

2004-07-13 Thread romain bourdon
It just comes out of the oven, WAMP5 1.0 now includes PHP 5.0.0 released a
few hours ago.

This new version installs PHP 5.0.0, apache 1.3.31, MySQL 4.0.18, a service
manager as a tray icon...and much more :

http://www.en.wampserver.com (english)
http://www.wampserver.com (français)


Thanks to the PHP GROUP for the wonderfull work they've done...;-)

Romain

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



RE: [PHP] PHP on MAC

2004-07-13 Thread PHP Junkie
Astrum Et Securis

AWESOME!! Needed to hear something like that.. 
Thanks a ton! And I will definitely get the Installer from the mentioned
location.

Thank you.

Dominor,
RSJ

-Original Message-
From: Larry E. Ullman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 13, 2004 7:32 PM
To: PHP Junkie
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP on MAC

> We've just bought a new Power Mac G5 Macintosh computer for the office 
> and
> I'll need to do some backend engineering work using it. I've never 
> worked
> with PHP on MAC, so I really have no experience with what happens on a
> MAC... are there on issues regarding working with PHP on a MAC?

Not at all. OS X is essentially Unix and you've already got Apache 
built in. I believe it comes with PHP installed (but not enabled) but I 
would recommend using Marc's installer from www.entropy.ch. This will 
give you the most current version of PHP (normally). In short, PHP is 
great on a Mac.

Hope that helps,
Larry

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



Re: [PHP] Templates Are Driving me Nuts

2004-07-13 Thread Paul Bissex
On Tue, 13 Jul 2004 10:48:34 -0400, John W. Holmes
<[EMAIL PROTECTED]> wrote:
[snip]
> Everyone has their own ideas on whether this is needed and what kind of
> templates to use. There are a ton of engines out there that you can use.
> Some are simple and some turn into programming languages of their own
> and just present another layer of failure/difficulty. Some people
> recommend just using PHP both in your business and presentation layer as
> this is what PHP was originally designed for.
> 
> Personal preference. :)

Personal preference indeed -- this is likely to be a long thread!

If you're new to this and finding template engines confising, I'd urge
you to start out by just doing "pure PHP" templating, i.e. what John
is describing in the last sentence of his first paragraph. You get the
structural benefits of templating (more readable program logic, more
readable HTML) without having to learn any new syntax.

In a nutshell, this means that you have a script that prepares data,
and another (mostly HTML), included by the first, that presents it. 
The first, let's call it page.php, will be something like this:

  

and page.tpl.php will be something like this:

  
  
  Current foo status: 
  Page created on 
  
  

This is a minimal example, but even without further refinements this
approach will create much more readable and maintainable code than the
big-ball-o-mud interwoven-PHP-and-HTML style of development.

The argument against template engines is well presented here:

  http://phppatterns.com/index.php/article/articleview/4/1/1/

Personally, I use Smarty for sites that need complex templating, and
pure PHP templating for everything else.

pb

-- 
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72°39'71"W 42°19'42"N

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



Re: [PHP] HTTP Session Recorder?

2004-07-13 Thread Justin Patrin
On Tue, 13 Jul 2004 19:42:19 -0400, John W. Holmes
<[EMAIL PROTECTED]> wrote:
> Does anyone know of a program that'll "record" the clicks and requests
> as I go through a site? Something that'll watch as I click on links,
> fill in forms, etc and then be able to perform the same requests
> (duplicating the forms, cookies, etc)?? Maybe a PHP script that can be
> dropped into an existing program and be turned on or off?
> 
> Any ideas? Anyone think this is possible to implement in PHP and then
> use Curl or a PEAR class to reproduce the sequence?
> 

Well, you can reproduct this with PEAR HTTP_Client. As for recording
it, I don't know of anything specific, but you could, for instance,
use the auto_prepend functionality of PHP to do something like this:

$vars = '$vars[] = array('uri' => "'.addslashes($_SERVER['REQUEST_URI']).'",
'get' => '.var_export($_GET, true).',
'post' => '.var_export($_POST, true).',
'cookie' => '.var_export($_COOKIE, true).');';

Then you could save $vars to a file and then include it from some
other script, loop through the contents, and send requests. :-)

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



[PHP] HTTP Session Recorder?

2004-07-13 Thread John W. Holmes
Does anyone know of a program that'll "record" the clicks and requests 
as I go through a site? Something that'll watch as I click on links, 
fill in forms, etc and then be able to perform the same requests 
(duplicating the forms, cookies, etc)?? Maybe a PHP script that can be 
dropped into an existing program and be turned on or off?

Any ideas? Anyone think this is possible to implement in PHP and then 
use Curl or a PEAR class to reproduce the sequence?

Thanks.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] php 4.3.7/5.0

2004-07-13 Thread Michael Sims
Curt Zirzow wrote:
> * Thus wrote Josh Close:
>> if($var)
>>
>> used to work for
>>
>> if($var != 0) or if($var != "0")
>>
>> but that doesn't seem to work since I upgrade. So I'm just going to
>> do
>>
>> if((int)$var)
>
> I still think this is unnecessary
>
> if ("0") { echo '"0"'; }
> if ("")  { echo '""'; }
> if (0)   { echo 0; }
>
> As I pointed out earlier, are still all the same; this behaviour
> hasn't changed.

I agree.  As I pointed out in my earlier message in this thread, based on
the description that the OP gave (and the fact that he's using
mssql_query()), I think he's getting bitten by the problems introduced by
the fix for bug #25777:

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

Basically PHP used to trim trailing spaces from data being returned via the
mssql and sybase extensions, and the fix for the above bug (in both
extensions) was to stop this trimming.  In my case this introduced a new
problem, because bit fields that contain simply '0' in the database come
back with trailing spaces.  While this:

$ php -r 'if ("0") echo "Yes\n";'

produces no output (because "0" == false) this does:

$ php -r 'if ("0 ") echo "Yes\n";'

because "0 " != false.

I have a hunch that if the OP does a print_r() on their "$var", it will be a
string that starts with zero and ends with one or more spaces.  Casting $var
to int will restore the original behavior, but this is only because (int) "0
" === 0 and 0 == false.  So basically the cast to int does fix the OP's
problem but not for the reasons he believes.

Of course, that's a complete guess based off incomplete information.  I
could be way off. :)

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



Re: [PHP] PHP on MAC

2004-07-13 Thread Larry E . Ullman
We've just bought a new Power Mac G5 Macintosh computer for the office 
and
I'll need to do some backend engineering work using it. I've never 
worked
with PHP on MAC, so I really have no experience with what happens on a
MAC... are there on issues regarding working with PHP on a MAC?
Not at all. OS X is essentially Unix and you've already got Apache 
built in. I believe it comes with PHP installed (but not enabled) but I 
would recommend using Marc's installer from www.entropy.ch. This will 
give you the most current version of PHP (normally). In short, PHP is 
great on a Mac.

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


[PHP] PHP on MAC

2004-07-13 Thread PHP Junkie

Astrum Et Securis

We've just bought a new Power Mac G5 Macintosh computer for the office and
I'll need to do some backend engineering work using it. I've never worked
with PHP on MAC, so I really have no experience with what happens on a
MAC... are there on issues regarding working with PHP on a MAC?

Thanks,
RSJ

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



[PHP] PHP 5.0.0 Released!

2004-07-13 Thread Andi Gutmans
The PHP development team is proud to announce the official release of PHP 5.
Some of the key features of PHP 5 include:
- The Zend Engine II with a new object model and dozens of new features.
- XML support has been completely redone in PHP 5, all extensions are now 
focused around the excellent libxml2 library (http://www.xmlsoft.org/).
- A new SimpleXML extension for easily accessing and manipulating XML as 
PHP objects. It can also interface with the DOM extension and vice-versa.
- A brand new built-in SOAP extension for interoperability with Web Services.
- A new MySQL extension named MySQLi for developers using MySQL 4.1 and 
later. This new extension includes an object-oriented interface in addition 
to a traditional interface; as well as support for many of MySQL's new 
features, such as prepared statements.
- SQLite has been bundled with PHP. For more information on SQLite, please 
visit their website (http://www.sqlite.org/).
- Streams have been greatly improved, including the ability to access 
low-level socket operations on streams.
- And lots more...

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


Re: [PHP] Yay!

2004-07-13 Thread rogerk
Quoting Matthew Sims <[EMAIL PROTECTED]>:

>
> PHP5 released today! (for those that don't know yet) ;)

Jeez, now my users will be demanding we run a .0.0 release of a language that's
incompatible with what they were running yesterday... :)

Seriously, congrats.

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



[PHP] Yay!

2004-07-13 Thread Matthew Sims

PHP5 released today! (for those that don't know yet) ;)

http://www.php.net/

--Matthew Sims
--

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jason Wong
On Wednesday 14 July 2004 05:07, Jamie wrote:
> > You want to specifically check for
> >
> >   $_SERVER["HTTPS"] == "on"
> >
> > because if you're not using HTTPS then $_SERVER["HTTPS"] does not exist.
>
> If this is the case why does it work ok on my windows box? 

Who cares what happens on a Windows box? I'm pointing out to you why it isn't 
working. Just look in $_SERVER and find something that will work under 
whatever systems you need it to work under. If need be have more than one 
test.

> Shouldnt it have same output accross all platforms?

Not necessarily, the info in $_SERVER is largely provided by the webserver and 
PHP has no control over that.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
All articles that coruscate with resplendence are not truly auriferous.
*/

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



Re: [PHP] Re: Anyone knows when PHP5 is released?

2004-07-13 Thread John W. Holmes
Ben Ramsey wrote:
Aidan Lister wrote:
"When it's ready"
Hopefully we'll see the stable release in the next 24 hours.

There was a post to the internals@ list yesterday.  Andi announced a 
test roll of 5.0.0 saying that he would release PHP 5 within the next 24 
hours "if all goes well."  Keep your fingers crossed.

Refer to: http://www.phpdeveloper.org/index/2279
www.php.net says PHP 5.0.0 is released now. I'm sure there'll be an 
annoucement soon...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Curt Zirzow
* Thus wrote Jamie:
> The code im using to test is:
> if ($_SERVER["HTTPS"] == "off")
> {
> print "We are not using HTTPS";
> }
> else
> {
> print "We are using HTTPS";
> }
> 
> 
> On my windows machine it works as expected with it displaying the correct
> message when using https and http. When i use my linux box it constantly
> displays "We are using HTTPS" what means the statement is evaluating as
> false. When it should be true (as im currently viewing the page off a HTTP
> connection)

The problem is that this HTTPS variable is not a standard variable
that has been defined. 

Apache's SSL module will only set *a* value to HTTPS if in https is
being used. The value it sets just so happens to be 'on'

Windows servers (versions unkown) will set 'on' or  'off.

Other servers will use either 'on' or 'ON', with or without
corresponding 'off' or 'OFF'.

So, as just described, your best bet would be:

if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')
  // https is on.
} else {
  // off.
}


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



[PHP] Re: PHP and Excel

2004-07-13 Thread Kim Steinhaug
I might be wrong, but if your client are using all the functions available
in Excel
Im pretty sure you wont get this to work. Ive tested a few of the Excel
converters for PHP and they all work nice with simple Excel spreadsheets,
but once you start doing it Excel style... Your on your own...

If youre on a Win32 platform you might solve this nicely, since this gives
you
alot of possibilities with exec and such. But I wouldt spend to much time on
this
if the system is to run on a *nix system.

I hope someone proove me wrong here, but theese are my findings.
Possible there are some nasty good proprietary Excel systems out there?
Anyone?

--
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-


"Arnold" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I want to use a large Excel sheet in a website. The Excel sheet exists of
> lots of functions and the developer of it is a financial person who is
used
> to programmning in Excel, not in other "programming languages". How can i:
> insert the data that's filled in in several forms on web pages (i guess
the
> "spreadsheet Excel Writer" package), let Excel do the work and produce the
> output information, in PHP? Or is there an easier way to use an Excel
sheet
> together with web pages?
>
> Arnold

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



[PHP] Re: Opinion: PHP Sessions or Cookies

2004-07-13 Thread Kim Steinhaug
Sessions are the best thing to use, cookies are nice as a supplement.
If you want your users to be able to "auto-login" cookies are just
the thing to use, but apart from this cookies are not my favourite.

Another thing is that many browsers nowaydays have turned cookies
all off.. I remember a friend of mine did a supportsystem where the
loggin system was pure cookies... Man - did their staff get a lot of
support from people who didnt manage to logg into the system...
As mentioned - this were users with cookies turned off

As the other users mentioned, the /tmp folder might be out of space,
however your provider might also have some custom setup on that
server which screws up the /tmp folder here and there. I know for
a fact one large provider here in Norway who has this problem on
one of their servers due to a heavy site which from time to time
sucks up resources resulting in the /tmp folder getting messed up.

If you still havnt solved your problem, get your provider to move you
to another of his servers (physically!), or change provider. You shouldnt
be having theese problems.

--

--
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-


"Ed Lazor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm using PHP sessions for user tracking.  My host provider's server is
> dropping session data.  He swears it's my scripts and says I should be
using
> cookies for better security.  That goes completely opposite to my
> understanding, so I'd like to run it by you guys.  Which is more secure:
> PHP sessions or cookies?
>
>
>
> In case you're curious, more details on the specifics of the problem I'm
> experiencing:
>
>
>
> I have a prepend file that executes start_session.  The script assumes the
> user is a guest if $_SESSION["UserID"] is not set.  All guests route to
the
> login screen.  Successful authentication sets $_SESSION["UserID"] and
sends
> you to the original requested page.
>
>
>
> It seems fairly straight forward to me.  People are able to login and
start
> using the site, but the login screen displays randomly after they've
already
> authenticated successfully.
>
>
>
> It sounds like PHP session data is being lost on the server.  I've also
seen
> error messages on web pages that report PHP / MySQL as having trouble
> reading from the temp directory.  Here's the extact message:  ERRORError
> writing file '/tmp/MYiYcf7q' (Errcode: 28).
>
>
>
> Anyway, those are the details.  I look forward to hearing what you think.
>
>
>
> -Ed
>
>
>
>

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



[PHP] Re: encryption needed?

2004-07-13 Thread Kim Steinhaug
if there is a system of your id's, like 1.. 2... 3... 4.. and such, you
should consider obfuscating the id's. Especially if you dont have
any form of login system that serve the client the id they want.

What you really should consider is having a login system that
after the user is logged in you serve the user the correct content,
and all from what is stored in the session. Meaning you dont need
client side javascript or hidden forms at all.

If the id's are unguessable however I wouldt care that much, on
the other hand - is the information in mention sensitive? If so you
are back to the login system again.

--
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-


"Klaus" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I am to set up a service where users can view news of companies.
> To identify the company selected an easy way is to use the company-id.
> The id is not displayed but stored in the client browser as JS-variable.
>
> Question:
> Is it ok to use the company-id or do I have to encrypt the id
> using mcrypt (takes some time)?
>
>
> Thanks in advance
> Klaus

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



RE: [PHP] encryption needed?

2004-07-13 Thread Ed Lazor
I wouldn't encrypt the ID, but I can't help wonder why you don't want people
knowing the company's ID.  They can get access to it if you're storing it
client-side.

This is like using a single script to view documents where you provide the
ID of the document to display.

http://localhost/view.php?ID=33

You end up needing a different way to reference which document should be
displayed, if you don't want people to know the ID.  In this case, I'd end
up specifying the name of the document to display.

http://localhost/view.php?Name=The%20Pizza%20Caper

As you can see, you end up having to deal with spaces and other special
characters in the name...  Basically, I'd just use the ID and not worry
about encrypting it, unless you have a good reason to do so.

-Ed

 

> -Original Message-
> Is it ok to use the company-id or do I have to encrypt the id
> using mcrypt (takes some time)?

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Curt Zirzow
* Thus wrote Josh Close:
> I'm positive that it will always be set, 'cause I set it. It's just
> going the comparison.
> 
> if($var)
> 
> used to work for 
> 
> if($var != 0) or if($var != "0")
> 
> but that doesn't seem to work since I upgrade. So I'm just going to do
> 
> if((int)$var)

I still think this is unnecessary

if ("0") { echo '"0"'; }
if ("")  { echo '""'; }
if (0)   { echo 0; }

As I pointed out earlier, are still all the same; this behaviour
hasn't changed.



Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] FW: NO SUCH ADDRESS

2004-07-13 Thread Justin Patrin
Nope, I'm getting them too. This address should be removed from the
list...whatever it is.

On Tue, 13 Jul 2004 15:19:41 -0700, Ed Lazor <[EMAIL PROTECTED]> wrote:
> Am I the only one getting these every time I post to the list?
> 
> 
> 
> 
> > -Original Message-
> > From: GUNSMOKE MAIL DAEMON [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 13, 2004 3:13 PM
> > To: Ed Lazor
> > Subject: NO SUCH ADDRESS
> >
> > This is an automated message from the email daemon at Gunsmoke.com.
> >
> > DO NOT REPLY TO THIS MESSAGE!
> >
> > All replies to this address will be deleted.
> >
> > You have attempted to reach an address that is not a part of the
> > Gunsmoke.com domain.
> >
> > If you feel that this message has reached you in error, you may enquire at
> > help+at+gunsmoke.com (remove the "+" characters from the address before
> > using).
> >
> > Set the subject of your message to:
> > HELP WITH EMAIL
> >
> > Sorry to resort to such drastic measures, but the increasing volume of
> > SPAM messages leaves no choice. Thanks in advance for your understanding.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> !DSPAM:40f45dfc39501737413515!
> 
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



[PHP] FW: NO SUCH ADDRESS

2004-07-13 Thread Ed Lazor
Am I the only one getting these every time I post to the list?



> -Original Message-
> From: GUNSMOKE MAIL DAEMON [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 13, 2004 3:13 PM
> To: Ed Lazor
> Subject: NO SUCH ADDRESS
> 
> This is an automated message from the email daemon at Gunsmoke.com.
> 
> DO NOT REPLY TO THIS MESSAGE!
> 
> All replies to this address will be deleted.
> 
> You have attempted to reach an address that is not a part of the
> Gunsmoke.com domain.
> 
> If you feel that this message has reached you in error, you may enquire at
> help+at+gunsmoke.com (remove the "+" characters from the address before
> using).
> 
> Set the subject of your message to:
> HELP WITH EMAIL
> 
> Sorry to resort to such drastic measures, but the increasing volume of
> SPAM messages leaves no choice. Thanks in advance for your understanding.

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



[PHP] encryption needed?

2004-07-13 Thread klaus
Hi all,

I am to set up a service where users can view news of companies.
To identify the company selected an easy way is to use the company-id.
The id is not displayed but stored in the client browser as JS-variable.

Question:
Is it ok to use the company-id or do I have to encrypt the id
using mcrypt (takes some time)?


Thanks in advance
Klaus

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



RE: [PHP] Opinion: PHP Sessions or Cookies

2004-07-13 Thread Ed Lazor


> -Original Message-
> Looks like /tmp directory is out of space. Change the directory to your
> own, it's more secure anyway.

I keep watching and /tmp seems ok space-wise, but I like the idea of
overriding where session files are stored.  I just made that change and I'm
waiting for feedback from users to see if they're still getting login
prompts.

Thanks Marek =)

-Ed

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



Re: [PHP] Opinion: PHP Sessions or Cookies

2004-07-13 Thread Justin Patrin
Sounds like it could be a permissions issue to /tmp, but that's not
likely as some work and some don't. More likely, /tmp isn't big
enough. Ask the provider to check to see if it's being filled up (you
can also check yourself with the 'df' command on the command-line).

It could also be an old version of PHP or the timeout settings for
sessions. Check that stuff in phpinfo().

On Tue, 13 Jul 2004 14:47:16 -0700, Ed Lazor <[EMAIL PROTECTED]> wrote:
> I'm using PHP sessions for user tracking.  My host provider's server is
> dropping session data.  He swears it's my scripts and says I should be using
> cookies for better security.  That goes completely opposite to my
> understanding, so I'd like to run it by you guys.  Which is more secure:
> PHP sessions or cookies?
> 
> In case you're curious, more details on the specifics of the problem I'm
> experiencing:
> 
> I have a prepend file that executes start_session.  The script assumes the
> user is a guest if $_SESSION["UserID"] is not set.  All guests route to the
> login screen.  Successful authentication sets $_SESSION["UserID"] and sends
> you to the original requested page.
> 
> It seems fairly straight forward to me.  People are able to login and start
> using the site, but the login screen displays randomly after they've already
> authenticated successfully.
> 
> It sounds like PHP session data is being lost on the server.  I've also seen
> error messages on web pages that report PHP / MySQL as having trouble
> reading from the temp directory.  Here's the extact message:  ERRORError
> writing file '/tmp/MYiYcf7q' (Errcode: 28).
> 
> Anyway, those are the details.  I look forward to hearing what you think.
> 
> -Ed
> 
> !DSPAM:40f4566021229974011339!
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] Opinion: PHP Sessions or Cookies

2004-07-13 Thread Marek Kilimajer
Ed Lazor wrote:
I'm using PHP sessions for user tracking.  My host provider's server is
dropping session data.  He swears it's my scripts and says I should be using
cookies for better security.  That goes completely opposite to my
understanding, so I'd like to run it by you guys.  Which is more secure:
PHP sessions or cookies?
Session certainly.
It sounds like PHP session data is being lost on the server.  I've also seen
error messages on web pages that report PHP / MySQL as having trouble
reading from the temp directory.  Here's the extact message:  ERRORError
writing file '/tmp/MYiYcf7q' (Errcode: 28).
Looks like /tmp directory is out of space. Change the directory to your 
own, it's more secure anyway.

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


[PHP] Opinion: PHP Sessions or Cookies

2004-07-13 Thread Ed Lazor
I'm using PHP sessions for user tracking.  My host provider's server is
dropping session data.  He swears it's my scripts and says I should be using
cookies for better security.  That goes completely opposite to my
understanding, so I'd like to run it by you guys.  Which is more secure:
PHP sessions or cookies?

 

In case you're curious, more details on the specifics of the problem I'm
experiencing:

 

I have a prepend file that executes start_session.  The script assumes the
user is a guest if $_SESSION["UserID"] is not set.  All guests route to the
login screen.  Successful authentication sets $_SESSION["UserID"] and sends
you to the original requested page.

 

It seems fairly straight forward to me.  People are able to login and start
using the site, but the login screen displays randomly after they've already
authenticated successfully.  

 

It sounds like PHP session data is being lost on the server.  I've also seen
error messages on web pages that report PHP / MySQL as having trouble
reading from the temp directory.  Here's the extact message:  ERRORError
writing file '/tmp/MYiYcf7q' (Errcode: 28).

 

Anyway, those are the details.  I look forward to hearing what you think.

 

-Ed

 



[PHP] Re: How to make HTTP call to another address?

2004-07-13 Thread Manuel Lemos
Hello,
On 07/12/2004 02:24 PM, Matt Busche wrote:
I've recently set up some Tomcat/Java/Servlet stuff that provides some
high-level functions I wish to make available from PHP.  In other words,
from PHP, I want to make an HTTP call to an address like:
http://mycompany.com/myservlet?request=doSomething&arg1=meat&arg2=potatoes
and then use the returned stream of data to service the original PHP
request.  Clear?
I quickly found the PHP HTTP library (
http://www.php.net/manual/en/ref.http.php ), but my quick perusal makes me
think this is only useful for controlling the HTTP response sent back to the
browser making the original PHP request.
You may want to try this HTTP client class. If necessary it supports 
cookies and submitting forms with field values via POST if you want:

http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Sending email without an email server

2004-07-13 Thread Manuel Lemos
Hello,
On 07/13/2004 07:46 AM, Robert Mena wrote:
I have a small script hosted in a win32/apache/php4 enviroment where I
do not have a local email server.
I was wondering how could I send emails either connecting directly to
the mx or sending through a relay.
These classes together do exactly that. You do not need to relay the 
message in any intermediate server. Just use the direct delivery mode.

If you do not want to change your scripts, much you can use script named 
smtp_mail.php that wraps arround the classes to provide a function named 
smtp_mail() that works like the mail() function but provide this direct 
delivery mode and other features.

http://www.phpclasses.org/mimemessage
http://www.phpclasses.org/smtpclass
Since you are using Windows, your PHP function GetMXRR is probably not 
functional. In that case you will also need an emulation function 
provided by this class.

http://www.phpclasses.org/phpresolver
What you want is not conventional but it can be done thanks to all these 
classes. Just let me know if you need assistance to set them up.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Josh Close
I'm positive that it will always be set, 'cause I set it. It's just
going the comparison.

if($var)

used to work for 

if($var != 0) or if($var != "0")

but that doesn't seem to work since I upgrade. So I'm just going to do

if((int)$var)

from now on, 'cause that should always work. I'll typecast everything
that being compared to and int to make sure.



On Tue, 13 Jul 2004 14:01:47 -0700 (GMT-07:00),
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> http://marc.theaimsgroup.com/?l=php-general&m=108646344905178&w=2
> 
> 
> 
> 
> -Original Message-
> From: Matthew Sims <[EMAIL PROTECTED]>
> Sent: Jul 13, 2004 12:15 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] php 4.3.7/5.0
> 
> > I've noticed that in the last release of php 4.3.7 (or 5.0.0), that
> > when checking the value of a variable has changed.
> >
> > ex:
> >
> > if($var){ /* do something */ }
> >
> > doesn't work anymore. I've had to change code to
> >
> > if($var > 0)
> >
> > but the problem is, what if $var was converted to $var = "0" instead
> > of $var = 0 somewhere throughout the code that I didn't know about?
> >
> > Is there a way to be sure what's going on here?
> >
> > --
> > -Josh
> 
> What about the isset function? Or any of the following:
> 
> http://us3.php.net/manual/en/ref.var.php
> 
> --Matthew Sims
> --
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
-Josh

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie

> You want to specifically check for
>
>   $_SERVER["HTTPS"] == "on"
>
> because if you're not using HTTPS then $_SERVER["HTTPS"] does not exist.
>

If this is the case why does it work ok on my windows box? Shouldnt it have
same output accross all platforms?

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jason Wong
On Wednesday 14 July 2004 04:57, Jamie wrote:
> The code im using to test is:
> if ($_SERVER["HTTPS"] == "off")
> {
> print "We are not using HTTPS";
> }
> else
> {
> print "We are using HTTPS";
> }
>
>
> On my windows machine it works as expected with it displaying the correct
> message when using https and http. When i use my linux box it constantly
> displays "We are using HTTPS" what means the statement is evaluating as
> false. When it should be true (as im currently viewing the page off a HTTP
> connection)

You want to specifically check for 

  $_SERVER["HTTPS"] == "on"

because if you're not using HTTPS then $_SERVER["HTTPS"] does not exist.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"If the code and the comments disagree, then both are probably wrong."
-- Norm Schryer
*/

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread deseavers
http://marc.theaimsgroup.com/?l=php-general&m=108646344905178&w=2


-Original Message-
From: Matthew Sims <[EMAIL PROTECTED]>
Sent: Jul 13, 2004 12:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php 4.3.7/5.0

> I've noticed that in the last release of php 4.3.7 (or 5.0.0), that
> when checking the value of a variable has changed.
>
> ex:
>
> if($var){ /* do something */ }
>
> doesn't work anymore. I've had to change code to
>
> if($var > 0)
>
> but the problem is, what if $var was converted to $var = "0" instead
> of $var = 0 somewhere throughout the code that I didn't know about?
>
> Is there a way to be sure what's going on here?
>
> --
> -Josh

What about the isset function? Or any of the following:

http://us3.php.net/manual/en/ref.var.php

--Matthew Sims
--

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

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
> Try $_ENV['HTTPS']

That prints nothing at all on windows and linux.

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
The code im using to test is:
if ($_SERVER["HTTPS"] == "off")
{
print "We are not using HTTPS";
}
else
{
print "We are using HTTPS";
}


On my windows machine it works as expected with it displaying the correct
message when using https and http. When i use my linux box it constantly
displays "We are using HTTPS" what means the statement is evaluating as
false. When it should be true (as im currently viewing the page off a HTTP
connection)

Any ideas?

Jamie

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Marek Kilimajer
More about your setup?
Try $_ENV['HTTPS'], or access phpinfo() page using https and see what 
you get.

Jamie wrote:
Hi,
That code I sent is running on a Cobalt Linux server.
-Dan Joseph

Why does it work for you then and not for me on a rhl 9 setup?

On phpinfo I have:
SCRIPT_URI
https://host.mydomain.com/phpinfo.php
_SERVER["SCRIPT_URI"]
https://host.mydomain.com/phpinfo.php
Michael.

According to my phpinfo there is not a SCRIPT_URI
This is weird and confusing... why does it only work on a few operating
systems :S
Jamie
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Dan Joseph
Hi,

Can you post your code so we can look at it?

-Dan Joseph 

> -Original Message-
> From: Jamie [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 13, 2004 4:48 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Detecting if browser is using a HTTP or 
> HTTPS connection to view the page
> 
> > Hi,
> >
> > That code I sent is running on a Cobalt Linux server.
> >
> > -Dan Joseph
> >
> 
> Why does it work for you then and not for me on a rhl 9 setup?
> 
> >On phpinfo I have:
> >
> >SCRIPT_URI
> > https://host.mydomain.com/phpinfo.php
> >_SERVER["SCRIPT_URI"]
> > https://host.mydomain.com/phpinfo.php
> >
> >Michael.
> 
> According to my phpinfo there is not a SCRIPT_URI
> 
> This is weird and confusing... why does it only work on a few 
> operating systems :S
> 
> Jamie
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
> Hi,
>
> That code I sent is running on a Cobalt Linux server.
>
> -Dan Joseph
>

Why does it work for you then and not for me on a rhl 9 setup?

>On phpinfo I have:
>
>SCRIPT_URI
> https://host.mydomain.com/phpinfo.php
>_SERVER["SCRIPT_URI"]
> https://host.mydomain.com/phpinfo.php
>
>Michael.

According to my phpinfo there is not a SCRIPT_URI

This is weird and confusing... why does it only work on a few operating
systems :S

Jamie

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



RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Dan Joseph
Hi,

That code I sent is running on a Cobalt Linux server.

-Dan Joseph 

> -Original Message-
> From: Jamie [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 13, 2004 3:37 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Detecting if browser is using a HTTP or 
> HTTPS connection to view the page
> 
> Thanks for your reply Dan,
> 
> I have tried the $_SERVER['HTTPS'] on windows and it works 
> fine. It replys off when HTTPS isnt working and on when it 
> is. But on linux it does nothing.
> Can someone please confirm if this works or it does not work 
> as i need a method that is cross platform compatitable.
> 
> Thanks
> Jamie
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Michael Gale
Hello,

What about the following variables:

On phpinfo I have:

SCRIPT_URI  https://host.mydomain.com/phpinfo.php
_SERVER["SCRIPT_URI"]   https://host.mydomain.com/phpinfo.php

Michael.


On Tue, 13 Jul 2004 20:37:07 +0100
"Jamie" <[EMAIL PROTECTED]> wrote:

> Thanks for your reply Dan,
> 
> I have tried the $_SERVER['HTTPS'] on windows and it works fine. It replys
> off when HTTPS isnt working and on when it is. But on linux it does nothing.
> Can someone please confirm if this works or it does not work as i need a
> method that is cross platform compatitable.
> 
> Thanks
> Jamie
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> 


-- 
Michael Gale
Network Administrator
Utilitran Corporation

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Josh Close
I think I'll just have to typecast everything, that should always work then.



On Tue, 13 Jul 2004 15:47:40 -0400, Adam Bregenzer <[EMAIL PROTECTED]> wrote:
> On Tue, 2004-07-13 at 15:35, Josh Close wrote:
> > The problem is, if 0 gets changed to "0" somewhere throughout. That's
> > why I've always used if($var) because it's usually not cared what the
> > type is, but it seems to now.
> 
> You can typecast values as well, this may be a good way to achieve what
> you are looking for:
> if ((int)$var != 0) {
>   // Do Something
> }
> 
> Also, if you are going to use this variable as an integer later you can
> do the following to explicitly convert $var into an integer:
> $var = (int)$var;
> 
> That should convert "0" into the integer value 0.  Also, note the
> following:
> 
> var_dump(0 == "0"); //bool(true)
> var_dump(0 === "0");//bool(false)
> 
> --
> Adam Bregenzer
> [EMAIL PROTECTED]
> http://adam.bregenzer.net/
> 
> 


-- 
-Josh

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Adam Bregenzer
On Tue, 2004-07-13 at 15:35, Josh Close wrote:
> The problem is, if 0 gets changed to "0" somewhere throughout. That's
> why I've always used if($var) because it's usually not cared what the
> type is, but it seems to now.

You can typecast values as well, this may be a good way to achieve what
you are looking for:
if ((int)$var != 0) {
  // Do Something
}

Also, if you are going to use this variable as an integer later you can
do the following to explicitly convert $var into an integer:
$var = (int)$var;

That should convert "0" into the integer value 0.  Also, note the
following:

var_dump(0 == "0"); //bool(true)
var_dump(0 === "0");//bool(false)

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



RE: [PHP] php 4.3.7/5.0

2004-07-13 Thread Michael Sims
Josh Close wrote:
> $result = mssql_query($sql);
> $row = mssql_fetch_array($result);
> $var = $row[0];
>
> So it should be an int. And if it's copied into a function it
> shouldn't be changed.
>
> But doing
>
> if($var)
>
> doesn't seem to work after I upgraded versions. Which is making me
> think that they changed how that works.
>
> And using is_string() or is_int() is pointless 'cause it doesn't
> matter. I just want to know if the value != 0.
>
> The problem is, if 0 gets changed to "0" somewhere throughout. That's
> why I've always used if($var) because it's usually not cared what the
> type is, but it seems to now.

This sounds an awful lot like the problem I experienced with PHP's Sybase extension
after upgrading to PHP 4.3.4.  Is your query retrieving data from a bit field ('0'
or '1')?  If so, you might want to read this:

http://marc.theaimsgroup.com/?l=php-dev&m=108377430919818&w=2

I never did get a response to it.  I've had it on my TODO list to open it as a bug
for the longest time, but I haven't had a chance to come up with minimal reproduce
code and I frankly haven't had the time to deal with it.  I managed to work around
the problem by maintaining a local patch to PHP to undo the change mentioned in my
post above.  Let me know if this is your issue and I can explain more and/or provide
my simple patch.

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Justin Patrin
On Tue, 13 Jul 2004 14:35:32 -0500, Josh Close <[EMAIL PROTECTED]> wrote:
> Well, the actual code is hard to tell. It's grabbed from a db so it
> should be an int. But it's also run through some functions. That's why
> I'd like a to tell what's going on better.
> 
> The variable is always set. Basically
> 
> $result = mssql_query($sql);
> $row = mssql_fetch_array($result);
> $var = $row[0];
> 
> So it should be an int. And if it's copied into a function it
> shouldn't be changed.
> 
> But doing
> 
> if($var)
> 
> doesn't seem to work after I upgraded versions. Which is making me
> think that they changed how that works.
> 
> And using is_string() or is_int() is pointless 'cause it doesn't
> matter. I just want to know if the value != 0.
> 
> The problem is, if 0 gets changed to "0" somewhere throughout. That's
> why I've always used if($var) because it's usually not cared what the
> type is, but it seems to now.
> 

AFAIK, PHP has for some time treated 0, '0', '', false, null, and
array() all the same. If you do if($var) when $var is any of those, it
results in false. If you want it to be non-zero, you should do !== 0.
If you also don't want '0', you can do if((int)$var !== 0).

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
Thanks for your reply Dan,

I have tried the $_SERVER['HTTPS'] on windows and it works fine. It replys
off when HTTPS isnt working and on when it is. But on linux it does nothing.
Can someone please confirm if this works or it does not work as i need a
method that is cross platform compatitable.

Thanks
Jamie

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Josh Close
Well, the actual code is hard to tell. It's grabbed from a db so it
should be an int. But it's also run through some functions. That's why
I'd like a to tell what's going on better.

The variable is always set. Basically

$result = mssql_query($sql);
$row = mssql_fetch_array($result);
$var = $row[0];

So it should be an int. And if it's copied into a function it
shouldn't be changed.

But doing

if($var)

doesn't seem to work after I upgraded versions. Which is making me
think that they changed how that works.

And using is_string() or is_int() is pointless 'cause it doesn't
matter. I just want to know if the value != 0.

The problem is, if 0 gets changed to "0" somewhere throughout. That's
why I've always used if($var) because it's usually not cared what the
type is, but it seems to now.



On Tue, 13 Jul 2004 19:39:09 +, Curt Zirzow
<[EMAIL PROTECTED]> wrote:
> * Thus wrote Josh Close:
> > I've noticed that in the last release of php 4.3.7 (or 5.0.0), that
> > when checking the value of a variable has changed.
> >
> > ex:
> >
> > if($var){ /* do something */ }
>  
> These values will all *not* do something:
> 
>   var_dump((bool) 0);
>   var_dump((bool) array());
>   var_dump((bool) "");
>   var_dump((bool) "0");
>   var_dump((bool) null);
>   var_dump((bool) false);
> 
> 
> > doesn't work anymore. I've had to change code to
> >
> > if($var > 0)
> 
> what is the actual value of $var?
> 
> Curt
> --
> First, let me assure you that this is not one of those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is the trapezoid!
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
-Josh

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Curt Zirzow
* Thus wrote Josh Close:
> I've noticed that in the last release of php 4.3.7 (or 5.0.0), that
> when checking the value of a variable has changed.
> 
> ex:
> 
> if($var){ /* do something */ }
 
These values will all *not* do something:

  var_dump((bool) 0);
  var_dump((bool) array());
  var_dump((bool) "");
  var_dump((bool) "0");
  var_dump((bool) null);
  var_dump((bool) false);


> doesn't work anymore. I've had to change code to
> 
> if($var > 0)

what is the actual value of $var?

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] php 4.3.7/5.0

2004-07-13 Thread Matthew Sims
> I've noticed that in the last release of php 4.3.7 (or 5.0.0), that
> when checking the value of a variable has changed.
>
> ex:
>
> if($var){ /* do something */ }
>
> doesn't work anymore. I've had to change code to
>
> if($var > 0)
>
> but the problem is, what if $var was converted to $var = "0" instead
> of $var = 0 somewhere throughout the code that I didn't know about?
>
> Is there a way to be sure what's going on here?
>
> --
> -Josh

What about the isset function? Or any of the following:

http://us3.php.net/manual/en/ref.var.php

--Matthew Sims
--

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



RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Dan Joseph
Hi,

if ($_SERVER["HTTPS"] != "on") {
$newurl = "https://"; . $_SERVER["SERVER_NAME"] .
$_SERVER["REQUEST_URI"];
header("location: $newurl");
die;
}

That's how I do it..

-Dan Joseph 

> Is there a way to detect if a browser is using a HTTPS or 
> HTTP. As i can get the scripts self and the host its running 
> off but i cannot seem to find a way to grab if the connection 
> is secure or not.

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



[PHP] php 4.3.7/5.0

2004-07-13 Thread Josh Close
I've noticed that in the last release of php 4.3.7 (or 5.0.0), that
when checking the value of a variable has changed.

ex:

if($var){ /* do something */ }

doesn't work anymore. I've had to change code to

if($var > 0)

but the problem is, what if $var was converted to $var = "0" instead
of $var = 0 somewhere throughout the code that I didn't know about?

Is there a way to be sure what's going on here?

-- 
-Josh

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



[PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page

2004-07-13 Thread Jamie
Is there a way to detect if a browser is using a HTTPS or HTTP. As i can get
the scripts self and the host its running off but i cannot seem to find a
way to grab if the connection is secure or not.

Thanks for any help in advance
Jamie

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



Re: [PHP] Session Variables ~ Best Practices

2004-07-13 Thread Justin Patrin
On Tue, 13 Jul 2004 17:52:44 +0100, Harlequin
<[EMAIL PROTECTED]> wrote:
> I'm right in the middle of developing some pages that will require session
> cookies. Now I have a few questions and hope I don't bore you too much...
> 
> I presume I am right in assuming that I can declare variables anywhere I
> like providing I have started a session on the page but I cannot actually
> use those variables until a post or some similar action has been performed
> by the user.
> 
> I am also wondering if I need to declare all my variables one after the
> other or can I simply declare variables that I will be using immediately
> upon submission.
> 

I'm not quite sure what your question is, but here's some info. You
have to call session_start() before using anything in the session.
This must be called before there is any output to the browser.

After the call to session_start() you can get/set/unset any session
value you want at any time in the script (all of this is stored on the
server). The best way to do all of this is through the $_SESSION
superglobal. Use it like a normal assicative array:

$_SESSION['var'] = 'value';

or:

$_SESSION['array'] = array(1, 2, 3, 4);

os:

$_SESSION['object'] = new Object();

Everything you put in there will be available from any function
without having to use the global keyword or the $GLOBALS superglobal.

Note that you can't store recources in the session (at least, they
can't be used as resources on subsequent requests.) This includes
things such as open file desriptors and database connections or
statement handles.

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] Session Variables ~ Best Practices

2004-07-13 Thread Michal Migurski
> I presume I am right in assuming that I can declare variables anywhere I
> like providing I have started a session on the page but I cannot
> actually use those variables until a post or some similar action has
> been performed by the user.

No, you can use them right away - they are stored server-side, so you
don't need to wait for a request/response loop before reading them:

session_start();
$_SESSION['foo'] = 'bar';
echo $_SESSION['foo']; // 'foo' is available immediately

No need to perform any special declarations. It's cookies that need to
wait for a subsequent request to be available via getcookie().

Careful with your session variable naming - you may want to implement a
primitive namespace, by using named arrays in $_SESSION, such as
$_SESSION['auth']['username'] or $_SESSION['prefs']['boxers_or_briefs'].

-mike.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



RE: [PHP] Session Variables ~ Best Practices

2004-07-13 Thread Jay Blanchard
[snip]
I am also wondering if I need to declare all my variables one after the
other or can I simply declare variables that I will be using immediately
upon submission.
[/snip]

Since PHP is not strongly typed (like C or C++) you need not declare any
variables. There are some caveats (see
http://www.php.net/error_reporting ). Is it good practice? Not really,
especially if you have a shop where more than one developer may be
touching the code. 

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



[PHP] Session Variables ~ Best Practices

2004-07-13 Thread Harlequin
I'm right in the middle of developing some pages that will require session
cookies. Now I have a few questions and hope I don't bore you too much...

I presume I am right in assuming that I can declare variables anywhere I
like providing I have started a session on the page but I cannot actually
use those variables until a post or some similar action has been performed
by the user.

I am also wondering if I need to declare all my variables one after the
other or can I simply declare variables that I will be using immediately
upon submission.

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-

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



Re: [PHP] Anyone knows when PHP5 is released?

2004-07-13 Thread Curt Zirzow
* Thus wrote Gabriel Medina:
> So is there a date set yet or is it just to wait?

No fixed date, but it will be very soon. Probably sometime this
week.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Email, Hotmail and PHP?

2004-07-13 Thread Tristan . Pretty
really? me..
I've not turned that on in over a year?
That's a worry... when was this...?

I'll tell our tech support group, perhaps there was a problem.. cheers for 
the heads up!





raditha dissanayake <[EMAIL PROTECTED]> 
13/07/2004 16:46
Please respond to
[EMAIL PROTECTED]


To
[EMAIL PROTECTED]
cc
[EMAIL PROTECTED]
Subject
Re: [PHP] Email, Hotmail and PHP?






[EMAIL PROTECTED] wrote:

>I get the distinct impression that this idea is not a favourable one?
>
>>> 
>>>
>>Let's hope what ever solution you come up with does not include an auto 
>>responder. :-)
>> 
>>
I was referring to the barrage we used to recieve from your auto 
responder.


-- 
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



Re: [PHP] Anyone knows when PHP5 is released?

2004-07-13 Thread Matthew Sims
> So is there a date set yet or is it just to wait?
>
> How is the progrese one the respons to RC3? Is it many bugs left?
>
> Dear Reagrds

I've been using RC3 for the past month and so far I haven't run into any
problems.

I want to get used to the new OO setup.

--Matthew Sims
--

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



[PHP] RE: using htmlentities with data in textarea

2004-07-13 Thread Dennis Gearon
When setting up a site, you should:
   A/ write a page with only the function 'phpinfo()' on it.
   B/ Call the page phpinfo.php, and put it in your document root.
   C/ Now tell us the location of your site so we can all view all your 
security information :-)

 do only A above and see if you have 'magic_quoutes_gpc' on, then 
delete the page:

   http://us4.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc
or, you can just do a loop on your GET/POST/COOKIE variables after 
testing if magic quotes is on using:

   'get_magic_quotes_gpc()' to see if you need to strip them off.
if( get_magic_quotes_gpc() ){
   reset $_GET;
|  while (list($key, $value) = each ($_GET)) {
 $_GET[$key]= stripslashes($value);
 }
|reset $_POST;
|  while (list($key, $value) = each ($_POST)) {
 $_POST[$key]= stripslashes($value);
 }
|reset $_COOKIE;
|  while (list($key, $value) = each ($_COOKIE)) {
 $_COOKIE[$key]= stripslashes($value);
 }
||}|
Magic quotes is to prepare input for databases.
It **MAY** be possible to turn it off **BEFORE** the slashes get added 
in your '.htaccess' file using:

php_value magic_quotes_gpc 0
php_value magic_quotes_sybase 0
"Hull, Douglas D" <[EMAIL PROTECTED]> wrote:

As John H told me (which is true) I should  run my words through htmlentities.  I have 
a textarea in a form for individuals to type in a list of words.  From there I place 
these words in an array and then perform calculations and echo the words back out with 
the resulting calculations.  But if one enters:w'   my word ends upw\' I 
have tried using htmlentities in my array and other places (to take the slash out) but 
to no avail.  Here is what I tried when putting my words in my array:
$zchrpos = 0;
$tok = strtok($zwords, " \r");
while ($tok !== FALSE) {
$toks[] = htmlentities(trim($tok));
$tok = strtok(" \r");
$zchrpos++;
}
Any help would be appreciated,
Doug

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


Re: [PHP] RE:$_Request from 4.3 to v5.x

2004-07-13 Thread John W. Holmes
Dennis Gearon wrote:
Isn't $_REQUEST the same as the old GPC variables in global namespace? A 
way to get requested variables without paying attention to whether they 
came in via cookies, post, or get?

That's been my understanding so I've been using $_GET, $_POST, $_COOKIE 
instead, because that way I  don't have to worry about GPC order AND I 
can use GET and POST together at the same time.
Yes, you're correct. Personal preference as to what to use, though. I 
like using $_REQUEST since it doesn't matter what method my forms use 
and in the end, I really don't care how the user sends me the 
information since it's all validated anyhow. If you send me the form 
data through a cookie, who cares, as long as it's correct...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals â www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How to make HTTP call to another address?

2004-07-13 Thread Jay Blanchard
[snip]

I've recently set up some Tomcat/Java/Servlet stuff that provides some
high-level functions I wish to make available from PHP.  In other words,
from PHP, I want to make an HTTP call to an address like:


http://mycompany.com/myservlet?request=doSomething&arg1=meat&arg2=potato
es

and then use the returned stream of data to service the original PHP
request.  Clear?
[/snip]

There is always cURL http://www.php.net/curl

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



Re: [PHP] How to make HTTP call to another address?

2004-07-13 Thread raditha dissanayake
I sometimes wonder why we keep ignoring lowly old 
include("http://yoururlhere.com";);


--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Email, Hotmail and PHP?

2004-07-13 Thread raditha dissanayake
[EMAIL PROTECTED] wrote:
I get the distinct impression that this idea is not a favourable one?
 

Let's hope what ever solution you come up with does not include an auto 
responder. :-)
   

I was referring to the barrage we used to recieve from your auto responder.
--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE:$_Request from 4.3 to v5.x

2004-07-13 Thread Dennis Gearon
Isn't $_REQUEST the same as the old GPC variables in global namespace? A 
way to get requested variables without paying attention to whether they 
came in via cookies, post, or get?

That's been my understanding so I've been using $_GET, $_POST, $_COOKIE 
instead, because that way I  don't have to worry about GPC order AND I 
can use GET and POST together at the same time.

"Michael Purdy" <[EMAIL PROTECTED]> wrote
:
Folks
I am currently using 4.3.7.
I have a script which accepts three POSTed variables from a basic form.  Under 4.3.7 
the script
runs fine and the variables are successfully passed to the script.
I am testing 5.0 C3 and receive the following error 

PHP Notice: Undefined index: searchtype in c:\http\cgi\list7.php on line 13

Re: [PHP] using htmlentities with data in textarea

2004-07-13 Thread John W. Holmes
Hull, Douglas D wrote:
But if one enters: w' my word ends up w\'
Run stripslashes() on the entire string before you begin processing it.
If you eventually insert the data into the database, you'll need to run 
addslashes() on it though, to prevent errors/sql injection from the 
unescaped quotes.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] using htmlentities with data in textarea

2004-07-13 Thread Hull, Douglas D
As John H told me (which is true) I should  run my words through htmlentities.  I have 
a textarea in a form for individuals to type in a list of words.  From there I place 
these words in an array and then perform calculations and echo the words back out with 
the resulting calculations.  But if one enters:w'   my word ends upw\' I 
have tried using htmlentities in my array and other places (to take the slash out) but 
to no avail.  Here is what I tried when putting my words in my array:

$zchrpos = 0;
$tok = strtok($zwords, " \r");
while ($tok !== FALSE) {
$toks[] = htmlentities(trim($tok));
$tok = strtok(" \r");
$zchrpos++;
}
Any help would be appreciated,
Doug

Sorry about the return receipt turned on in previous emails!

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



Re: [PHP] Email, Hotmail and PHP?

2004-07-13 Thread Jordi Canals
[EMAIL PROTECTED] wrote:
Indeed... who doesn't enjoy a brief break to see what's happening in their 
world?
I ended up using 'hail' (http://www.hailware.com/)
As far as I can tell, it doesn't allow attatchments...

Spending lunch hour checking personal mails... who can honestly admit that 
it never happens?
Do it in some countries (like mine), and you probably will be fired. Put 
a network in a risk by using this kind of scripts and sure you will be 
fired... Do it in a network I manage, and sure you will be fired.

So ... be really carefull, administrators block sites for some reason. 
And don't forget to ask for the Terms of Use about your work computer.

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


Re: [PHP] $_Request from 4.3 to v5.x

2004-07-13 Thread Justin Patrin
If you turn off notices in your app, you won't get that.
error_reporting = E_ALL & ~E_NOTICE

Or, you could use isset to make sure that it was submitted (best option).

$searchtype = isset($_REQUEST['searchtype'] ? $_REQUEST['searchtype'] : false;

On Wed, 14 Jul 2004 00:18:22 +1000, Michael Purdy
<[EMAIL PROTECTED]> wrote:
> Folks
> 
> I am currently using 4.3.7.
> 
> I have a script which accepts three POSTed variables from a basic form.  Under 4.3.7 
> the script
> runs fine and the variables are successfully passed to the script.
> 
> I am testing 5.0 C3 and receive the following error
> 
> PHP Notice: Undefined index: searchtype in c:\http\cgi\list7.php on line 13
> 
> 

Re: [PHP] $_Request from 4.3 to v5.x

2004-07-13 Thread John W. Holmes
Michael Purdy wrote:
I have a script which accepts three POSTed variables from a basic form.  Under 4.3.7 
the script
runs fine and the variables are successfully passed to the script.
I am testing 5.0 C3 and receive the following error 

PHP Notice: Undefined index: searchtype in c:\http\cgi\list7.php on line 13

Re: [PHP] Templates Are Driving me Nuts

2004-07-13 Thread John W. Holmes
EE wrote:
Please help. This template thing is driving my nuts. I though maybe when
I read more articles things will clear up; however, things got even
worse. Every article writer has a different idea. Can anyone explain to
me what are Templates for? What are the advantages of using them? If I
use a third party template, will my site have a different look or is it
only a parser that will take my designed template and data and combine
them. I really don't know.
The whole idea behind templates is to separate your "business logic" 
from your "presentation logic". This means you have a script that does 
all of your processing and data retrieval, etc. This script is generally 
all PHP that performs your business logic. Then you have your template 
that only has code meant to control your presentation. This file is 
mostly HTML, generally, with some special template code or limited PHP 
thrown in to control presentation _only_. The idea is that changes to 
the presentation layer will not require changes to your business layer 
and vice-versa.

Everyone has their own ideas on whether this is needed and what kind of 
templates to use. There are a ton of engines out there that you can use. 
Some are simple and some turn into programming languages of their own 
and just present another layer of failure/difficulty. Some people 
recommend just using PHP both in your business and presentation layer as 
this is what PHP was originally designed for.

Personal preference. :)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Templates Are Driving me Nuts

2004-07-13 Thread Justin Patrin
A template system allows you to (in most cases) use a special
language, different than PHP, to write your HTML. At the simplest
level, template languages replace special markers with content from
PHP. More complicated types involve looping and other contro
structures (if, then, else, etc.).

Basically a template system allows you to seperate your display code
from the rest, allowing quick and easy updating of the look and feel
of the site without changing any (or much) of your PHP code. This is
assuming you've architected it well, of course. ;-)

On Tue, 13 Jul 2004 16:39:04 +0300, EE <[EMAIL PROTECTED]> wrote:
> Dears,
> 
> Please help. This template thing is driving my nuts. I though maybe when
> I read more articles things will clear up; however, things got even
> worse. Every article writer has a different idea. Can anyone explain to
> me what are Templates for? What are the advantages of using them? If I
> use a third party template, will my site have a different look or is it
> only a parser that will take my designed template and data and combine
> them. I really don't know.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> !DSPAM:40f3e49a72101927516234!
> 
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] How to make HTTP call to another address?

2004-07-13 Thread Justin Patrin
I would suggest using the PEAR HTTP_Request package for single-shot
requests and HTTP_Client for multiple requests to the same server
(like if you need your script to login first).

http://pear.php.net/packahe/HTTP_Request
http://pear.php.net/packahe/HTTP_Client

On Mon, 12 Jul 2004 11:24:19 -0600, Matt Busche <[EMAIL PROTECTED]> wrote:
> I've recently set up some Tomcat/Java/Servlet stuff that provides some
> high-level functions I wish to make available from PHP.  In other words,
> from PHP, I want to make an HTTP call to an address like:
> 
> http://mycompany.com/myservlet?request=doSomething&arg1=meat&arg2=potatoes
> 
> and then use the returned stream of data to service the original PHP
> request.  Clear?
> 
> I quickly found the PHP HTTP library (
> http://www.php.net/manual/en/ref.http.php ), but my quick perusal makes me
> think this is only useful for controlling the HTTP response sent back to the
> browser making the original PHP request.
> 
> Can someone help me?
> 
> FYI:  I'm a newbie.  Please forgive me if this is an old-hat question.
> 
> Matt
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> !DSPAM:40f3848311391443210090!
> 
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] Email, Hotmail and PHP?

2004-07-13 Thread Tristan . Pretty
I get the distinct impression that this idea is not a favourable one?
Just trying to earn brownie points with the misses... not trying to annoy 
'the man'.

Ho hum...
Back to surfing for porn at work ;-)



raditha dissanayake <[EMAIL PROTECTED]> wrote on 13/07/2004 14:56:38:

> [EMAIL PROTECTED] wrote:
> 
> >Hi there...
> >My misses has just started a new job, but has got loadsa websites 
blocked, 
> >including hotmail.
> > 
> >
> Let's hope what ever solution you come up with does not include an auto 
> responder. :-)
> 
> -- 
> Raditha Dissanayake.
> -
> http://www.raditha.com/megaupload/upload.php
> Sneak past the PHP file upload limits.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



[PHP] $_Request from 4.3 to v5.x

2004-07-13 Thread Michael Purdy
 
Folks

I am currently using 4.3.7.

I have a script which accepts three POSTed variables from a basic form.  Under 4.3.7 
the script
runs fine and the variables are successfully passed to the script.

I am testing 5.0 C3 and receive the following error 

PHP Notice: Undefined index: searchtype in c:\http\cgi\list7.php on line 13


[PHP] $_Request from 4.3 to v5.x

2004-07-13 Thread Michael Purdy
Folks

I am currently using 4.3.7.

I have a script which accepts three POSTed variables from a basic form.  Under 4.3.7 
the script
runs fine and the variables are successfully passed to the script.

I am testing 5.0 C3 and receive the following error 

PHP Notice: Undefined index: searchtype in c:\http\cgi\list7.php on line 13


RE: [PHP] Templates Are Driving me Nuts[Scanned]

2004-07-13 Thread Michael Egan
I looked at these briefly a couple of years ago but never really made great use of 
them. I also remember seeing an article in LinuxFormat about them which can be found 
at:

http://www.linuxformat.co.uk/archives/LXF35.tut_php.pdf

My understanding is that they are mainly intended for use in development areas where 
you get both programmers and designers working closely together. My limited experience 
of designers is that they get petrified at the sight of anything that looks like code 
nad personally I get horribly confused when I see some of those fiendishly complicated 
interfaces for graphic design applications.

In theory templates might offer a way of bridging this chasm - though I have my doubts.

Regards,

Michael Egan

-Original Message-
From: EE [mailto:[EMAIL PROTECTED]
Sent: 13 July 2004 14:39
To: php.net
Subject: [PHP] Templates Are Driving me Nuts[Scanned]


Dears,

Please help. This template thing is driving my nuts. I though maybe when
I read more articles things will clear up; however, things got even
worse. Every article writer has a different idea. Can anyone explain to
me what are Templates for? What are the advantages of using them? If I
use a third party template, will my site have a different look or is it
only a parser that will take my designed template and data and combine
them. I really don't know.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 
  
  
The information contained in this email (and in any attachments sent with it) is 
confidential. It is intended for the addressee only. Access to this email by anyone 
else is unintended and unauthorized.  
If you are not the original addressee, 3tc asks you to please maintain 
confidentiality. If you have received this email in error please notify 3tc 
immediately by replying to it, then destroy any copies and delete it from your 
computer system. 
  
Any use, dissemination, forwarding, printing or copying of this email by anyone except 
the addressee in the normal course of his/her business, is strictly prohibited. 3tc 
owns the copyright in this email and any document created by us and assert the right 
to be identified as the author of it. Copyright has not been transferred to the 
addressee. 
We protect our systems with Sophos Anti-virus -  
www.sophos.com 
 

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



  1   2   >