Re: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Philip J. Newman
Again ... Now Now Kiddies your all way out of line.

- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: "Dan Rossi" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2003 7:55 PM
Subject: Re: [PHP] Re: Internet Explorer toolbar


> Correct, but he asked for a PHP solution. HE DID NOT ASK FOR A
> JAVASCRIPT SOLUTION, AND YOU SHOULD NOT DISCUSS CLIENT-SIDE MATTERS ON
> THE PHP LIST!
>
> Dan Rossi wrote:
>
> >??? who cares i gave a solution, there is no other #**#% way
> >
> >-Original Message-
> >From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
> >Sent: Friday, March 28, 2003 3:39 PM
> >To: daniel
> >Cc: Peter Houchin; Dan; php-general
> >Subject: Re: [PHP] Re: Internet Explorer toolbar
> >
> >
> >Yes, but that has nothing do to with PHP!  It's not doing it with PHP as
> >was asked, it's doing it with javascript.
> >
> >daniel wrote:
> >
> >
> >
> >>yes simply buffer the exact javascript code and then echo it
> >>
> >>ie
> >>
> >>$buffer .= '
>>onclick="window.open('something.php','something,'scrollbars=no,width=100,h
e
> >>
> >>
> >igh
> >
> >
> >>t=100'">';
> >>
> >>sorry i forget the no toolbar part from the top of my head.
> >>
> >>
> >>
> >>
> >>>= Original Message From Leif K-Brooks <[EMAIL PROTECTED]>
> >>>
> >>>
> >=
> >
> >
> >>>Correct, but he asked about doing it with PHP.
> >>>
> >>>Peter Houchin wrote:
> >>>
> >>>
> >>>
> >>>
> >>>
> yes there is java script
> 
> Dan wrote:
> 
> 
> 
> 
> 
> >On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED]
(Manuel
> >Ochoa) wrote:
> >
> >
> >Is there any way of using php to launch a new browser without the IE
> >toolbars?
> >
> >
> >
> >No. PHP is server side, not client side.
> >
> >
> >
> >
> >
> >
> 
> 
> >>>--
> >>>The above message is encrypted with double rot13 encoding.  Any
> >>>
> >>>
> >unauthorized
> >
> >
> >>>
> >>>
> >>attempt to decrypt it will be prosecuted to the full extent of the law.
> >>
> >>
> >>
> >>
> >>>--
> >>>PHP General Mailing List (http://www.php.net/)
> >>>To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >>
> >>
> >
> >--
> >The above message is encrypted with double rot13 encoding.  Any
unauthorized
> >attempt to decrypt it will be prosecuted to the full extent of the law.
> >
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>
>



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



Re: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Leif K-Brooks
Correct, but he asked for a PHP solution. HE DID NOT ASK FOR A 
JAVASCRIPT SOLUTION, AND YOU SHOULD NOT DISCUSS CLIENT-SIDE MATTERS ON 
THE PHP LIST!

Dan Rossi wrote:

??? who cares i gave a solution, there is no other #**#% way

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 3:39 PM
To: daniel
Cc: Peter Houchin; Dan; php-general
Subject: Re: [PHP] Re: Internet Explorer toolbar
Yes, but that has nothing do to with PHP!  It's not doing it with PHP as
was asked, it's doing it with javascript.
daniel wrote:

 

yes simply buffer the exact javascript code and then echo it

ie

$buffer .= '
onclick="window.open('something.php','something,'scrollbars=no,width=100,he
   

igh
 

t=100'">';

sorry i forget the no toolbar part from the top of my head.

   

= Original Message From Leif K-Brooks <[EMAIL PROTECTED]>
 

=
 

Correct, but he asked about doing it with PHP.

Peter Houchin wrote:



 

yes there is java script

Dan wrote:



   

On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
Ochoa) wrote:
Is there any way of using php to launch a new browser without the IE
toolbars?


No. PHP is server side, not client side.



 

   

--
The above message is encrypted with double rot13 encoding.  Any
 

unauthorized
 

 

attempt to decrypt it will be prosecuted to the full extent of the law.

   

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



   

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


 

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



Re: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Philip J. Newman
Now Now children.


- Original Message -
From: "Dan Rossi" <[EMAIL PROTECTED]>
To: "Leif K-Brooks" <[EMAIL PROTECTED]>
Cc: "Peter Houchin" <[EMAIL PROTECTED]>; "Dan" <[EMAIL PROTECTED]>;
"php-general" <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2003 6:47 PM
Subject: RE: [PHP] Re: Internet Explorer toolbar


> ??? who cares i gave a solution, there is no other #**#% way
>
> -Original Message-
> From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 28, 2003 3:39 PM
> To: daniel
> Cc: Peter Houchin; Dan; php-general
> Subject: Re: [PHP] Re: Internet Explorer toolbar
>
>
> Yes, but that has nothing do to with PHP!  It's not doing it with PHP as
> was asked, it's doing it with javascript.
>
> daniel wrote:
>
> >yes simply buffer the exact javascript code and then echo it
> >
> >ie
> >
> >$buffer .= '
>onclick="window.open('something.php','something,'scrollbars=no,width=100,he
> igh
> >t=100'">';
> >
> >sorry i forget the no toolbar part from the top of my head.
> >
> >
> >>= Original Message From Leif K-Brooks <[EMAIL PROTECTED]>
> =
> >>Correct, but he asked about doing it with PHP.
> >>
> >>Peter Houchin wrote:
> >>
> >>
> >>
> >>>yes there is java script
> >>>
> >>>Dan wrote:
> >>>
> >>>
> >>>
> On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
> Ochoa) wrote:
> 
> 
> Is there any way of using php to launch a new browser without the IE
> toolbars?
> 
> 
> 
> No. PHP is server side, not client side.
> 
> 
> 
> 
> >>>
> >>>
> >>--
> >>The above message is encrypted with double rot13 encoding.  Any
> unauthorized
> >>
> >>
> >attempt to decrypt it will be prosecuted to the full extent of the law.
> >
> >
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized
> attempt to decrypt it will be prosecuted to the full extent of the law.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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



RE: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Dan Rossi
??? who cares i gave a solution, there is no other #**#% way

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 3:39 PM
To: daniel
Cc: Peter Houchin; Dan; php-general
Subject: Re: [PHP] Re: Internet Explorer toolbar


Yes, but that has nothing do to with PHP!  It's not doing it with PHP as
was asked, it's doing it with javascript.

daniel wrote:

>yes simply buffer the exact javascript code and then echo it
>
>ie
>
>$buffer .= 'onclick="window.open('something.php','something,'scrollbars=no,width=100,he
igh
>t=100'">';
>
>sorry i forget the no toolbar part from the top of my head.
>
>
>>= Original Message From Leif K-Brooks <[EMAIL PROTECTED]>
=
>>Correct, but he asked about doing it with PHP.
>>
>>Peter Houchin wrote:
>>
>>
>>
>>>yes there is java script
>>>
>>>Dan wrote:
>>>
>>>
>>>
On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
Ochoa) wrote:


Is there any way of using php to launch a new browser without the IE
toolbars?



No. PHP is server side, not client side.




>>>
>>>
>>--
>>The above message is encrypted with double rot13 encoding.  Any
unauthorized
>>
>>
>attempt to decrypt it will be prosecuted to the full extent of the law.
>
>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
>
>

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




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



Re: [PHP] why this sript doesn't work

2003-03-27 Thread Hugh Danaher
JP,
Instead of::
global $nome;
global $email;
global $linguagem;
global $browser;
try:
$nome=$_POST['nome'];
$email=$_POST['email'];
$linguagem=$_POST['linguagem'];
$browser=$_POST['browser'];

Hugh

- Original Message -
From: "J. P." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 24, 2003 2:23 PM
Subject: [PHP] why this sript doesn't work


> Hello!
> I am using Apache 2.0.44 and WinXP. I have PHP 4.3.1.
> When i run the script the first page appears. But when i submit nothing
> appends. What's wrong?
>
>
>  function mostrar_formulario()
> {
> global $PHP_SELF;
> ?>
>
> 
> Nome: 
> Email: 
> 
> Qual a sua linguagem de programação preferida?
> PHP
> C++
> C
> PERL
> 
> Qual o seu browser web preferido?
> Netscape
> Navigator
> Internet
> Explorer
> 
> 
> 
>  }
> ?>
>
>  function processa_formulario() {
> global $nome;
> global $email;
> global $linguagem;
> global $browser;
>
> printf ("O utilizador %s cujo endereço de email é %s prefere a linguagem
de
> programação %s e utiliza, normalmente, o browser %s para navegar na www.",
> $nome, $email, $linguagem, $browser);
> }
> ?>
>  if (empty($nome)){
>mostrar_formulario();
>} else {
> processa_formulario();
> }
> ?>
>
> Thanks
>
>
>
> --
> 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] File Upload and ftp transfer problem

2003-03-27 Thread Hugh Danaher
Jason,
Thanks for your help.  The purpose of this script is to upload an image,
assign an image name based upon a record name received in a mysql query,
store the image name in the mysql table, and then ftp the file to a
directory on the server.
Thanks again,
Hugh

The following script is now working without error.
Input your digital photo.";

  print "";
  print "";
  print "Send this tree picture: ";
  print "";
  print "";
  print "";
  print "";
  print "";
  }
 if ($upload==1)
  {
  $photo2="L".(100*$asset_n).".jpg";
  if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
   {
   $fp=fopen($HTTP_POST_FILES['userfile']['tmp_name'],"rb");
   $file_stream=fread($fp,30);
   fclose($fp);

   $table="  ";
   $db="   ";
   $user="   ";
   $pass="  ";
   $link=mysql_connect("localhost","$user","$pass");
   if (! $link) die("Can't log in at this time");
   mysql_select_db($db,$link) or die ("Can't get database at this time");
   $query="update $table set photo2='".$photo2."' where
asset_n='".$asset_n."' ";
   $result=mysql_query($query);
   mysql_close($link);
   }
  call_user_func('ftp_transfer',$photo2,$file_stream);

  print "return to update
page";
  }
 }
 // set up basic ftp connection

function ftp_transfer($photo2,$file_stream)
 {
 $ftp_server="  ";
 $ftp_user_name="  ";
 $ftp_user_pass="  ";

 $conn_id = ftp_connect($ftp_server);

 // login with username and password
 $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

 // check connection
 if ((!$conn_id) || (!$login_result))
  {
  print "FTP connection has failed!";
  print "Attempted to connect to $ftp_server ";
  exit;
  }
 // upload the file

 $fp=tmpfile();
 fwrite($fp, $file_stream);
 rewind($fp);

 $destination_file="./directory/".$photo2;
 $upload = ftp_fput($conn_id, $destination_file, $fp, FTP_BINARY);
 // check upload status
 if (!$upload)
  {
  print "FTP upload has failed!";
  }
 // close the FTP stream
 //@ftp_close($conn_id);
 ftp_quit($conn_id);
 }
php?>
- Original Message -
From: "Hugh Danaher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 27, 2003 1:16 PM
Subject: Re: [PHP] File Upload and ftp transfer problem


> Thanks Jason, I'll try that, and let you know the results.  Hugh
> - Original Message -
> From: "Jason Wong" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 27, 2003 11:48 AM
> Subject: Re: [PHP] File Upload and ftp transfer problem
>
>
> > On Friday 28 March 2003 03:16, Hugh Danaher wrote:
> > > I'm trying to get the following script to ftp transfer an uploaded
image
> > > file so as to get around a file permission problem.  The upload
portion
> of
> > > this works without problem, the ftp portion doesn't spit out any
errors
> > > either, but the file transfered is just the name of the uploaded temp
> file
> > > and not the file itself. If I do a filesize() on $file_stream, I get
44K
> > > (the size of the image uploaded), I then transfer this var to the ftp
> > > function but what gets ftp and saved as a file is only 14 bytes.  The
> saved
> > > file has "/tmp/phpDcJSOq" as its entire contents. The upload scrip is
> > > below.
> >
> > It's doing exactly what you're telling it to do.
> >
> >   $file_stream=$HTTP_POST_FILES['userfile']['tmp_name'];
> >
> > This only contains the _name_ of the temporary file which contains the
> > contents of your uploaded file.
> >
> > What you need to do is send the _contents_ of the file pointed to by
> > $file_stream. Take a look at fread() and/or file().
> >
> > --
> > 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
> > --
> > /*
> > I do not find in orthodox Christianity one redeeming feature.
> > - Thomas Jefferson
> > */
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP] Connecting to a remote server

2003-03-27 Thread Jason Wong
On Friday 28 March 2003 05:00, Roberts, Mark \(Tulsa\) wrote:
> I am needing to move one of my apps to a remote secure server that I have.
> As I have never done this before what are the general things that I must do
> to make this happen.
>
> I changed my connect statement from "localhost" to the name of the server "
>   http://www.remoteservername.com"; and
> received an error that I could not connect, try again later.

Are you talking about the database connection? If so, then there is no need 
for the 'http://'. And if both the webserver and the DB server are on the 
same machine you can continue to use 'localhost'.

-- 
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
--
/*
Things are not as simple as they seems at first.
- Edward Thorp
*/


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



Re: [PHP] dynamic/multidimensional arrays in classes

2003-03-27 Thread Patrick Teague
I'm currently having a problem with another array in a class & I can't
figure it out -

class myClass
{
function myClass($arr = array( 'item1'=>array('a','b','c'),
'item2'=>array('a','b','c') ) )
{
print_r( $arr );
while( list($key,$val) = each($arr) )
{
print($key."=".$val);
}
}
}

now, if I say

$mine = myClass();

it only prints the print_r statement, but not the print($key."=".$val)
statment meaning it doesn't even bother entering the loop.  However if I say

$mine = myClass(array( 'item1'=>array('a','b','c'),
'item2'=>array('a','b','c') ) );

it prints both...  is there some reason why I need to repeat the default
value when creating the class?  I've also tried using a "" string on class
creation, but no luck there either.

Patrick



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



Re: [PHP] date math question

2003-03-27 Thread Charles Kline
Caught that :) Thanks for the tip... worked just perfect (after I fixed 
typo)

On Friday, March 28, 2003, at 12:57 AM, Foong wrote:

sorry
typo error should be:
date('Y')

Foong

"Foong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
hi,

$start = mktime ( 0, 0, 0, 1, 1, date['Y']);  // first day of this 
year
$end = mktime ( 0, 0, 0, 12, 31, date['Y']);  // last day of this year

then select all record where timestamp >= $start and timestamp <= $end

should do the job
Hope this helps
Foong



"Charles Kline" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Okay cool.

This leads me to another question. If I have stored the date as an
epoch then is there a way using PHP and MySQL to say find all the
records that have been added this YEAR (not last 365 days)?
Thanks
Charles
On Friday, March 28, 2003, at 12:31 AM, Leo Spalteholz wrote:

On March 27, 2003 09:15 pm, Charles Kline wrote:
I am storing my dates as unix timestamp (epoch). Am I right in
assuming that if I need to add or subtract days from this it is
done in seconds?
yes

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





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


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


Re: [PHP] Benchmark

2003-03-27 Thread Jason Wong
On Friday 28 March 2003 13:59, John Taylor-Johnston wrote:

> The first gives me the benchmark performance of Apache on the web. last I
> looked Apache was at 60% of all Internet servers used.

If you're talking about usage (as opposed to performance) then

  www.netcraft.com

> There was another URL (probably the same site) that would tell me
> everything I want to know about a particular server, for example mine:
> http://delete.compcanlit.ca/

  Probably the same.

-- 
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
--
/*
Remember, drive defensively! And of course, the best defense is a good 
offense!
*/


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



[PHP] Benchmark

2003-03-27 Thread John Taylor-Johnston
Hi,

I'm tired, it's late, I'm trying to remember two URLs, I should have bookmarked.

The first gives me the benchmark performance of Apache on the web. last I looked 
Apache was at 60% of all Internet servers used.

There was another URL (probably the same site) that would tell me everything I want to 
know about a particular server, for example mine: http://delete.compcanlit.ca/

Anyone awake out there in PHP land?  www.net.somethingcom?


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



Re: [PHP] date math question

2003-03-27 Thread Foong
sorry
typo error should be:

date('Y')

Foong

"Foong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi,
>
> $start = mktime ( 0, 0, 0, 1, 1, date['Y']);  // first day of this year
> $end = mktime ( 0, 0, 0, 12, 31, date['Y']);  // last day of this year
>
> then select all record where timestamp >= $start and timestamp <= $end
>
> should do the job
> Hope this helps
>
> Foong
>
>
>
>
> "Charles Kline" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Okay cool.
> >
> > This leads me to another question. If I have stored the date as an
> > epoch then is there a way using PHP and MySQL to say find all the
> > records that have been added this YEAR (not last 365 days)?
> >
> > Thanks
> > Charles
> >
> >
> > On Friday, March 28, 2003, at 12:31 AM, Leo Spalteholz wrote:
> >
> > > On March 27, 2003 09:15 pm, Charles Kline wrote:
> > >> I am storing my dates as unix timestamp (epoch). Am I right in
> > >> assuming that if I need to add or subtract days from this it is
> > >> done in seconds?
> > >
> > > yes
> > >
> > >
> > > --
> > > 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] date math question

2003-03-27 Thread Foong
hi,

$start = mktime ( 0, 0, 0, 1, 1, date['Y']);  // first day of this year
$end = mktime ( 0, 0, 0, 12, 31, date['Y']);  // last day of this year

then select all record where timestamp >= $start and timestamp <= $end

should do the job
Hope this helps

Foong




"Charles Kline" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Okay cool.
>
> This leads me to another question. If I have stored the date as an
> epoch then is there a way using PHP and MySQL to say find all the
> records that have been added this YEAR (not last 365 days)?
>
> Thanks
> Charles
>
>
> On Friday, March 28, 2003, at 12:31 AM, Leo Spalteholz wrote:
>
> > On March 27, 2003 09:15 pm, Charles Kline wrote:
> >> I am storing my dates as unix timestamp (epoch). Am I right in
> >> assuming that if I need to add or subtract days from this it is
> >> done in seconds?
> >
> > yes
> >
> >
> > --
> > 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] date math question

2003-03-27 Thread Charles Kline
Okay cool.

This leads me to another question. If I have stored the date as an 
epoch then is there a way using PHP and MySQL to say find all the 
records that have been added this YEAR (not last 365 days)?

Thanks
Charles
On Friday, March 28, 2003, at 12:31 AM, Leo Spalteholz wrote:

On March 27, 2003 09:15 pm, Charles Kline wrote:
I am storing my dates as unix timestamp (epoch). Am I right in
assuming that if I need to add or subtract days from this it is
done in seconds?
yes

--
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] date math question

2003-03-27 Thread Martin Towell
I think there's problems doing that when daylight savings starts/ends
Just something to keep in mind...

-Original Message-
From: Leo Spalteholz [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 4:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] date math question


On March 27, 2003 09:15 pm, Charles Kline wrote:
> I am storing my dates as unix timestamp (epoch). Am I right in
> assuming that if I need to add or subtract days from this it is
> done in seconds?

yes


-- 
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] date math question

2003-03-27 Thread Leo Spalteholz
On March 27, 2003 09:15 pm, Charles Kline wrote:
> I am storing my dates as unix timestamp (epoch). Am I right in
> assuming that if I need to add or subtract days from this it is
> done in seconds?

yes


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



[PHP] date math question

2003-03-27 Thread Charles Kline
I am storing my dates as unix timestamp (epoch). Am I right in assuming 
that if I need to add or subtract days from this it is done in seconds?

So for example if I have the timestamp 1041397200 and I wanted to 
subtract 24 hours from it I would do this:

$newtime = $orig_time - 86400;

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


Re: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Leif K-Brooks
Yes, but that has nothing do to with PHP!  It's not doing it with PHP as 
was asked, it's doing it with javascript.

daniel wrote:

yes simply buffer the exact javascript code and then echo it

ie

$buffer .= '';

sorry i forget the no toolbar part from the top of my head.
 

= Original Message From Leif K-Brooks <[EMAIL PROTECTED]> =
Correct, but he asked about doing it with PHP.
Peter Houchin wrote:

   

yes there is java script

Dan wrote:

 

On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
Ochoa) wrote:
Is there any way of using php to launch a new browser without the IE
toolbars?


No. PHP is server side, not client side.

   

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized 
   

attempt to decrypt it will be prosecuted to the full extent of the law.
 



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



 

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



RE: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread daniel
yes simply buffer the exact javascript code and then echo it

ie

$buffer .= '';

sorry i forget the no toolbar part from the top of my head.
>= Original Message From Leif K-Brooks <[EMAIL PROTECTED]> =
>Correct, but he asked about doing it with PHP.
>
>Peter Houchin wrote:
>
>> yes there is java script
>>
>> Dan wrote:
>>
>>> On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
>>> Ochoa) wrote:
>>>
>>>
>>> Is there any way of using php to launch a new browser without the IE
>>> toolbars?
>>>
>>>
>>>
>>> No. PHP is server side, not client side.
>>>
>>>
>>
>>
>
>--
>The above message is encrypted with double rot13 encoding.  Any unauthorized 
attempt to decrypt it will be prosecuted to the full extent of the law.
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



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



[PHP] Problem with readfile() and HTTP headers (vs. server-side include)

2003-03-27 Thread Kerry Shetline
I'm trying to figure out how to make readfile() or include() work more 
like a server-side #include, in terms of HTTP headers.

I'm taking some web pages that used server-side includes, that in turn 
invoked CGI scripts, and replacing these pages with PHP pages. For the 
most part, I don't need a lot of the old CGI code anymore, but I'd still 
like to be able to invoke a CGI from a PHP page with similar results as 
when I did the same thing with SSI.

The problem that I'm seeing is with HTTP headers. When I use the 
readfile() or include() functions in PHP, PHP seems to creating its own 
new headers, rather than passing along the headers from its own environment.

As an example of what I'm talking about, here's a CGI that displays, 
among other things, the HTTP headers that your web browser provides:

   http://www.shetline.com/cgi-bin/serverinfo.cgi

When I directly invoke the above from my browser, to no surprise at all 
I get this result:

   HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

When I try to use readfile() or include(), however, what I get back
is:
   HTTP_USER_AGENT: PHP/4.2.3

PHP is supplying its own user agent, rather than the user agent that 
invoked the PHP page in the first place. Here's what the test page 
source looks like (from http://www.shetline.com/testphp.php):

   
   
   PHP Test
   
   
   
   <%
  readfile("http://www.shetline.com/cgi-bin/serverinfo.cgi";);
   %>
   
   
   
Below is an example of a page using SSI, that produces the desired
result:
   
   
   SSI Test
   
   
   
  
   
   
   
Is there any way, short of getting down to sockets and hard-coding the 
whole transaction, to get readfile(), include(), or something else 
that's relatively painless, to pass on the same HTTP environment that my 
PHP page operates within to a page that my PHP page invokes?

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


Re: [PHP] imagejpeg gives error

2003-03-27 Thread Reuben D. Budiardja
On Thursday 27 March 2003 10:51 pm, you wrote:
> Do you have libjpeg installed?  You might need to add --with-jpeg-dir=/usr
> assuming your libjpeg is in /usr/lib, for example.
>
> -Rasmus

I see. 

$ >  locate libjpeg
/usr/lib/libjpeg.so.62
/usr/lib/libjpeg.so.62.0.0
...

So I will try to re-compile then. Thanks a lot.

RDB


> On Thu, 27 Mar 2003, Reuben D. Budiardja wrote:
> > On Thursday 27 March 2003 10:42 pm, Rasmus Lerdorf wrote:
> > > Well, check the error.  Get rid of the header() call and just look at
> > > the output.
> >
> > uh.. didn't know I can do that, anyway, it gives:
> >
> > Fatal error: Call to undefined function: imagejpeg() in
> > /usr/local/apache/htdocs/astr162/wedgeplot.php on line 131
> >
> > So, this brings back the question if the jpeg support is there withe
> > bundled gd library, or do I need some special option with the configure?
> > Here is my configure line (from phpinfo()):
> >
> > './configure' '--with-ldap' '--enable-track-vars' '--with-pgsql'
> > '--with-mysql' '--disable-debug' '--prefix=/usr/local/apache/php'
> > '--with-config-file-path=/usr/local/apache/lib'
> > '--with-apxs=/usr/local/apache/bin/apxs' '--with-gd' '--with-zlib'
> >
> > Thanks.
> >
> > RDB
> >
> > > On Thu, 27 Mar 2003, Reuben D. Budiardja wrote:
> > > > Hello,
> > > > I have a script that creates image using the gd library that is
> > > > bundled with the latest php-4.0.3 on Redhat Linux / Apache as apache
> > > > mod. Everything works fine when I use png:
> > > >
> > > > header("Content-type: image/png");
> > > > $im = imagecreate(500,500);
> > > > ...[script]...
> > > > imagepng($im)
> > > >
> > > > Then when I try to display it as jpeg by changing the header and the
> > > > last line as follows:
> > > >
> > > > header("Content-type: image/jpeg");
> > > > $im = imagecreate(500,500);
> > > > ...[script]...
> > > > imagejpeg($im)
> > > >
> > > > It gives:
> > > >
> > > > The image "http://localhost/astr162/wedgeplot.php"; cannot be
> > > > displayed, because it contains errors.
> > > >
> > > > The question is, is the GD lib that is bundled with php has JPEG
> > > > support ? If yes, what might cause this error?
> > > >
> > > > Thanks a lot. Any help is appreciated.
> > > > RDB



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



Re: [PHP] imagejpeg gives error

2003-03-27 Thread Rasmus Lerdorf
Do you have libjpeg installed?  You might need to add --with-jpeg-dir=/usr
assuming your libjpeg is in /usr/lib, for example.

-Rasmus

On Thu, 27 Mar 2003, Reuben D. Budiardja wrote:

> On Thursday 27 March 2003 10:42 pm, Rasmus Lerdorf wrote:
> > Well, check the error.  Get rid of the header() call and just look at the
> > output.
> 
> uh.. didn't know I can do that, anyway, it gives:
> 
> Fatal error: Call to undefined function: imagejpeg() in 
> /usr/local/apache/htdocs/astr162/wedgeplot.php on line 131
> 
> So, this brings back the question if the jpeg support is there withe bundled 
> gd library, or do I need some special option with the configure? Here is my 
> configure line (from phpinfo()):
> 
> './configure' '--with-ldap' '--enable-track-vars' '--with-pgsql' 
> '--with-mysql' '--disable-debug' '--prefix=/usr/local/apache/php' 
> '--with-config-file-path=/usr/local/apache/lib' 
> '--with-apxs=/usr/local/apache/bin/apxs' '--with-gd' '--with-zlib'
> 
> Thanks.
> 
> RDB
> 
> 
> > On Thu, 27 Mar 2003, Reuben D. Budiardja wrote:
> > > Hello,
> > > I have a script that creates image using the gd library that is bundled
> > > with the latest php-4.0.3 on Redhat Linux / Apache as apache mod.
> > > Everything works fine when I use png:
> > >
> > > header("Content-type: image/png");
> > > $im = imagecreate(500,500);
> > > ...[script]...
> > > imagepng($im)
> > >
> > > Then when I try to display it as jpeg by changing the header and the last
> > > line as follows:
> > >
> > > header("Content-type: image/jpeg");
> > > $im = imagecreate(500,500);
> > > ...[script]...
> > > imagejpeg($im)
> > >
> > > It gives:
> > >
> > > The image "http://localhost/astr162/wedgeplot.php"; cannot be displayed,
> > > because it contains errors.
> > >
> > > The question is, is the GD lib that is bundled with php has JPEG support
> > > ? If yes, what might cause this error?
> > >
> > > Thanks a lot. Any help is appreciated.
> > > RDB
> 
> 


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



[PHP] Re: How do i valadate an email address?

2003-03-27 Thread Manuel Lemos
Hello,

On 03/27/2003 03:44 AM, Philip J. Newman wrote:
How would i check that an e-mail has the right parts in it. for example.

username @ domain . ext
You may want to try this class that provides different levels of e-mail 
address validation:

http://www.phpclasses.org/emailvalidation

--

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


[PHP] Re: Mail Header - id this PHP

2003-03-27 Thread Manuel Lemos
Hello,

On 03/26/2003 08:44 PM, John wrote:
I am trying to format the mail header that will be send by mail().

One thing that I noticed was it only accept for the first no. of lines or
charracters (???) See sample 1 & 2.
Is this a php problem (4.2.2) or has something to do the mailer ???

This script is working on (4.2.1) but is in different type of server.

FYI, on header sent it has some other default header included
That seems like one of the mail() function bugs. You may want to try 
this class that provides several workarounds from mail function bugs:

http://www.phpclasses.org/mimemessage

--

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


[PHP] Re: HTML mail being sent with mail() not working for some people

2003-03-27 Thread Manuel Lemos
Hello,

On 03/27/2003 02:14 PM, Jeff Lewis wrote:
We're sending out emails using mail() and sending it in HTML format and
while most people get it correctly a couple are not. They get the anti-abuse
headers and then the HTML code appears as just that - HTML code in the body
of the email.
Sending those same people an HTML email composed in Outlook comes across
just fine, perhaps it's the anti abuse headers causing the issue?
That seems like a bug in the mail() function that makes messages look 
they have some kind of virus, I was told.

You may want to try this class that provides workaround for many mail() 
function problems:

http://www.phpclasses.org/mimemessage

--

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


Re: [PHP] imagejpeg gives error

2003-03-27 Thread Reuben D. Budiardja
On Thursday 27 March 2003 10:42 pm, Rasmus Lerdorf wrote:
> Well, check the error.  Get rid of the header() call and just look at the
> output.

uh.. didn't know I can do that, anyway, it gives:

Fatal error: Call to undefined function: imagejpeg() in 
/usr/local/apache/htdocs/astr162/wedgeplot.php on line 131

So, this brings back the question if the jpeg support is there withe bundled 
gd library, or do I need some special option with the configure? Here is my 
configure line (from phpinfo()):

'./configure' '--with-ldap' '--enable-track-vars' '--with-pgsql' 
'--with-mysql' '--disable-debug' '--prefix=/usr/local/apache/php' 
'--with-config-file-path=/usr/local/apache/lib' 
'--with-apxs=/usr/local/apache/bin/apxs' '--with-gd' '--with-zlib'

Thanks.

RDB


> On Thu, 27 Mar 2003, Reuben D. Budiardja wrote:
> > Hello,
> > I have a script that creates image using the gd library that is bundled
> > with the latest php-4.0.3 on Redhat Linux / Apache as apache mod.
> > Everything works fine when I use png:
> >
> > header("Content-type: image/png");
> > $im = imagecreate(500,500);
> > ...[script]...
> > imagepng($im)
> >
> > Then when I try to display it as jpeg by changing the header and the last
> > line as follows:
> >
> > header("Content-type: image/jpeg");
> > $im = imagecreate(500,500);
> > ...[script]...
> > imagejpeg($im)
> >
> > It gives:
> >
> > The image "http://localhost/astr162/wedgeplot.php"; cannot be displayed,
> > because it contains errors.
> >
> > The question is, is the GD lib that is bundled with php has JPEG support
> > ? If yes, what might cause this error?
> >
> > Thanks a lot. Any help is appreciated.
> > RDB

-- 
-
/"\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-


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



Re: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Leif K-Brooks
Correct, but he asked about doing it with PHP.

Peter Houchin wrote:

yes there is java script

Dan wrote:

On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
Ochoa) wrote:

Is there any way of using php to launch a new browser without the IE 
toolbars?


No. PHP is server side, not client side.




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


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


Re: [PHP] imagejpeg gives error

2003-03-27 Thread Rasmus Lerdorf
Well, check the error.  Get rid of the header() call and just look at the 
output.

On Thu, 27 Mar 2003, Reuben D. Budiardja wrote:

> 
> Hello,
> I have a script that creates image using the gd library that is bundled with 
> the latest php-4.0.3 on Redhat Linux / Apache as apache mod. Everything works 
> fine when I use png:
> 
> header("Content-type: image/png");
> $im = imagecreate(500,500);
> ...[script]...
> imagepng($im)
> 
> Then when I try to display it as jpeg by changing the header and the last line 
> as follows:
> 
> header("Content-type: image/jpeg");
> $im = imagecreate(500,500);
> ...[script]...
> imagejpeg($im)
>  
> It gives:
> 
> The image "http://localhost/astr162/wedgeplot.php"; cannot be displayed, 
> because it contains errors.
> 
> The question is, is the GD lib that is bundled with php has JPEG support ?
> If yes, what might cause this error?
> 
> Thanks a lot. Any help is appreciated.
> RDB
> 
> 
> 


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



[PHP] imagejpeg gives error

2003-03-27 Thread Reuben D. Budiardja

Hello,
I have a script that creates image using the gd library that is bundled with 
the latest php-4.0.3 on Redhat Linux / Apache as apache mod. Everything works 
fine when I use png:

header("Content-type: image/png");
$im = imagecreate(500,500);
...[script]...
imagepng($im)

Then when I try to display it as jpeg by changing the header and the last line 
as follows:

header("Content-type: image/jpeg");
$im = imagecreate(500,500);
...[script]...
imagejpeg($im)
 
It gives:

The image "http://localhost/astr162/wedgeplot.php"; cannot be displayed, 
because it contains errors.

The question is, is the GD lib that is bundled with php has JPEG support ?
If yes, what might cause this error?

Thanks a lot. Any help is appreciated.
RDB


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



[PHP] shell_exec question....

2003-03-27 Thread Kalin Mintchev

hello list,

what has to happened so this actually works:

$mstrng = shell_exec("/usr/sbin/zip 0041_27032003223711.zip
0041_27032003223711");

if php is compiled as a module with apache is the apache owner the one
that has to have writing permissions? if so - it does..

any help appreciated...

thank you


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



Re: [PHP] last questions

2003-03-27 Thread Jason k Larson
Search the list archives, this question gets asked (and answered) a lot.

http://marc.theaimsgroup.com/?l=php-general

HTH,
Jason k Larson
Haseeb Iqbal wrote:
thanx to all those who replied to my previous question.
1 more question.i need help with reqular expressions.i want to check valid
(email)
usernanes for my mail server .i.e. Qmail. any help welcome.
thanx in advance
Haseeb


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


[PHP] test - please ignore

2003-03-27 Thread Kerry Shetline
My last post didn't appear -- just testing before I try to repost.

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


Re: [PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Peter Houchin
yes there is java script

Dan wrote:
On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
Ochoa) wrote:

Is there any way of using php to launch a new browser without the IE toolbars?


No. PHP is server side, not client side.




--

Peter Houchin
Sun Rentals STR Manager
Phone: 03 9869 6452
Fax:   03 9866 2511
Mobile:0438 789 220
[EMAIL PROTECTED]
http://www.sunrentals.com.au/


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


[PHP] Sending Digitally Signed E-mail with PHP

2003-03-27 Thread Bernardo de Barros Franco
Fellow PHP'ers,

Does anyone know how can I send an digitally signed e-mail using PHP? I need
to get a Verisign or Thawte e-mail certificate and use it to sign the
messages I send from PHP. I am not quite sure but I think those certificates
are x509. PGP or GPG aren't options and I need the certificate to work
correctly with at least Outlook and Outlook Express so that when someone
receives the message from my PHP script Outlook will show the digitally
signed stamp/medal.
Any ideas?

Thanks in advance,
Bernardo de Barros Franco



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



[PHP] Problem with readfile() and HTTP headers (vs. server-side include)

2003-03-27 Thread Kerry Shetline
I'm trying to figure out how to make readfile() or include() work more
like a server-side #include, in terms of HTTP headers.
I'm taking some web pages that used server-side includes, that in turn
invoked CGI scripts, and replacing these pages with PHP pages. For the
most part, I don't need a lot of the old CGI code anymore, but I'd
still like to be able to invoke a CGI from a PHP page with similar
results as when I did the same thing with SSI.
The problem that I'm seeing is with HTTP headers. When I use the
readfile() or include() functions in PHP, PHP seems to creating its
own new headers, rather than passing along the headers from its own
environment.
As an example of what I'm talking about, here's a CGI that displays,
among other things, the HTTP headers that your web browser provides:
   http://www.shetline.com/cgi-bin/serverinfo.cgi

When I directly invoke the above from my browser, to no surprise at
all I get this result:
   HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

When I try to use readfile() or include(), however, what I get back
is:
   HTTP_USER_AGENT: PHP/4.2.3

PHP is supplying its own user agent, rather than the user agent that
invoked the PHP page in the first place. Here's what the test page
source looks like (from http://www.shetline.com/testphp.php):
   
   
   PHP Test
   
   
   
   <%
  readfile("http://www.shetline.com/cgi-bin/serverinfo.cgi";);
   %>
   
   
   
Below is an example of a page using SSI, that produces the desired
result:
   
   
   SSI TEst
   
   
   
   
   
   
   
Is there any way, short of getting down to sockets and hard-coding the
whole transaction, to get readfile(), include(), or something else
that's relatively painless, to pass on the same HTTP environment that
my PHP page operates within to a page that my PHP page invokes?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Did I have to sign up for the mailing list to post here?

2003-03-27 Thread Kerry Shetline
If you're reading this now, then yes is probably the answer to my 
titular question. My last two attempts to post quietly disappeared into 
the ether with nary a warning, and I wasn't subscribed before.

I'd be happy simply using a news reader rather than getting regular 
e-mailings. Will I be able to unsubscribe from the mailing list without 
losing the ability to post here via news reader?

-Kerry

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


[PHP] Re: Problem with PHP

2003-03-27 Thread Foong
can i have a peek on you code

Foong



"Jan Navratil" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> > Hallo,
> >
> > i have problem with running PHP4.3.1 on Apache1.3.19 on W2K.
> >
> > I instaled everithng by install.txt. Is posible to load easy php pages
but
> > when i want to Recieve data from form it does not wrok.
> >
> > Please help me
> >
> > Best regards Honza Navratil



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



[PHP] why this sript doesn't work

2003-03-27 Thread J. P.
Hello!
I am using Apache 2.0.44 and WinXP. I have PHP 4.3.1.
When i run the script the first page appears. But when i submit nothing
appends. What's wrong?





Nome: 
Email: 

Qual a sua linguagem de programação preferida?
PHP
C++
C
PERL

Qual o seu browser web preferido?
Netscape
Navigator
Internet
Explorer








Thanks



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



RE: [PHP] sript doesn't work

2003-03-27 Thread Martin Towell
same question as before:
have you got register_globals turn on or off ?

-Original Message-
From: J. P. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 10:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] sript doesn't work


Hello!
I am using Apache 2.0.44 and WinXP. I have PHP 4.3.1.
When i run the script the first page appears. But when i submit nothing
appends. What's wrong?





Nome: 
Email: 

Qual a sua linguagem de programação preferida?
PHP
C++
C
PERL

Qual o seu browser web preferido?
Netscape
Navigator
Internet
Explorer








Thanks





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

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



[PHP] Re: Send Output to Printer?

2003-03-27 Thread Petter Aas
you should read this: http://www.php.net/manual/en/ref.printer.php

Nicole wrote:
anyone know of a good tutorial for using PHP to send output to a printer?

have a report that returns paged display (e.g., 20 rows max per page) ...
too many rows to show on one page. need a print button that will send all
the output directly to the printer and print all pages  not talking
about javascript print() either. I need something via PHP.
any tips?

thanks

--
Nicole
aeontrek.com



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


[PHP] Re: Internet Explorer toolbar

2003-03-27 Thread Dan
On Thu, 27 Mar 2003 12:32:06 -0800 (PST), [EMAIL PROTECTED] (Manuel
Ochoa) wrote:

>Is there any way of using php to launch a new browser without the IE toolbars?

No. PHP is server side, not client side.


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



[PHP] sript doesn't work

2003-03-27 Thread J. P.
Hello!
I am using Apache 2.0.44 and WinXP. I have PHP 4.3.1.
When i run the script the first page appears. But when i submit nothing
appends. What's wrong?





Nome: 
Email: 

Qual a sua linguagem de programação preferida?
PHP
C++
C
PERL

Qual o seu browser web preferido?
Netscape
Navigator
Internet
Explorer








Thanks





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



[PHP] _SERVER globals in fast CGI

2003-03-27 Thread Mike Long
I have installed php as fastcgi and I am now not getting 
all the _SERVER globals. Is there a config in the ini file 
to turn this on now or are they handled differently with 
fastcgi than in cgi?

Michael

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


Re: [PHP] logging ip address when submitting a form

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Not true- $_SERVER['REMOTE_ADDR'] doesn't rely on anything sent by the 
browser. Load up a phpinfo() on your server, then request it by hand...

echo -e "GET /phpinfo.php HTTP/1.0\r\n\r\n" | nc www.yourserver.com 80

You'll see it has your IP address even though you never supplied it. It's 
pointless to send IP protocol data over HTTP. $_SERVER['REMOTE_ADDR'] is 
always there, although you are right about not always being able to trust it.





On Thursday 27 March 2003 02:52 pm, Justin French wrote:
> $_SERVER['REMOTE_ADDR'] will contain the remote user's IP address IF it is
> set by the user agent (browser).
>
> It's also worth noting that this IP address could be faked, could be
> rotated by their ISP on a request-by-request basis (eg all AOL users),
> could be that of their firewall or network gateway, etc etc.
>
> It's fine to log it, but don't rely on it for future visits, or anything
> like that :)
>
>
> Justin
>
> on 28/03/03 5:04 AM, Joakim Larsson ([EMAIL PROTECTED]) wrote:
> > Hello,
> >
> > Is there a command in php that would logg the ip address of the user
> > viewing the php file.
> > I need someway of finding out who posted the form.
> >
> > thanx

- -- 
The greatest mistake is to imagine that the human being is an autonomous 
individual. The secret freedom which you can supposedly enjoy under a 
despotic government is nonsense, because your thoughts are never entirely 
your own. Philosophers, writers, artists, even scientists, not only need 
encouragement and an audience, they need constant stimulation from other 
people. It is almost impossible to think without talking. If Defoe had really 
lived on a desert island, he could not have written Robinson Crusoe, nor 
would he have wanted to. Take away freedom of speech, and the creative 
faculties dry up.

- -George Orwell
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g6wm/rncFku1MdIRArjPAJ46kEGkzIeZCSGiEMQEJ5d7SZd/RQCfaVgH
LfbocrxUHMpgbcLL4boIxI8=
=RG1G
-END PGP SIGNATURE-


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



Re: [PHP] Can anyone help me

2003-03-27 Thread Peter Houchin
Dude have a look on the web 1000's of examples/tutorials there and also 
in it's documentation. The PHP mailing list is NOT the place to be 
asking this as setting/learning how to use OpenSSL aint related to PHP.

Cheers
Peter
Suhas Pharkute wrote:
Can anyone give me a basic tutorial for 

Secure Site Programming (OpenSSL)

Also How to create certificate on server

Suhas

__
Suhas S Pharkute.
P O Box 8551,
Pocatello, ID 83209.
1.208.221.3896
http://myweb.cableone.net/psuhas/
__



--

Peter Houchin
Sun Rentals STR Manager
Phone: 03 9869 6452
Fax:   03 9866 2511
Mobile:0438 789 220
[EMAIL PROTECTED]
http://www.sunrentals.com.au/


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


[PHP] Working version of PHP4/Apache on a 64-bit platform?

2003-03-27 Thread mlm
Greetings...

Is anyone running PHP4 on a 64-bit platform?  I am attempting to run
squirrelmail on a Sun Ultra10 using NetBSD/sparc64.  I have
using gdb tracked the "bus error" messages down to PHP
source files.

I have seen chatter on the net about whether or not PHP4 is
64-bit safe...

I am hoping that a PHP developer will direct me to a version
of PHP4 source that I can compile on my system and get
past this road block...

Thank You,
Mike Marshall
[EMAIL PROTECTED]


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



RE: [PHP] need a reliable PHP host

2003-03-27 Thread Suhas Pharkute
Also checkout
http://bidforhost.com
Suhas


__
Suhas S Pharkute.
P O Box 8551,
Pocatello, ID 83209.
1.208.221.3896
http://myweb.cableone.net/psuhas/
__

-Original Message-
From: Jason Sheets [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 5:51 PM
To: Doug Parker
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] need a reliable PHP host


I recommend pair (http://www.pair.net) they have excellent staff, 
excellent accounts, an excellent backbone and they have been profitable 
since their second month in business they will let you host more than 
one domain on your account (with a setup fee).  They also host a lot of 
open source mirrors, etc.

Another choice  I recommend is fidelityhosting 
(http://www.fidelityhosting.com) they will allow you to host multiple 
domains on one account, saving the account holder money if they have 
more than one account.

Doug Parker wrote:

> Hi everyone - I need suggestions for a reliable PHP/mySQL host that
> has cURL support WITH https capability.  The site is e-commerce, but 
> is mainly a statistics site that relies on frequent mysql requests, 
> rather than numerous transactions.  The only transaction is the site 
> subscription fee.  I could also use suggestions for a reliable Credit 
> Card processor.  If anyone has experience with this and can point me 
> in the right direction, I would REALLY appreciate it.  I'm having alot

> of trouble with shoddy hosting and a terrible cc processor right now, 
> I really need to know which direction to take.
>
> Thanks - Doug
>
>


-- 
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] need a reliable PHP host

2003-03-27 Thread Jason Sheets
I recommend pair (http://www.pair.net) they have excellent staff, 
excellent accounts, an excellent backbone and they have been profitable 
since their second month in business they will let you host more than 
one domain on your account (with a setup fee).  They also host a lot of 
open source mirrors, etc.

Another choice  I recommend is fidelityhosting 
(http://www.fidelityhosting.com) they will allow you to host multiple 
domains on one account, saving the account holder money if they have 
more than one account.

Doug Parker wrote:

Hi everyone - I need suggestions for a reliable PHP/mySQL host that 
has cURL support WITH https capability.  The site is e-commerce, but 
is mainly a statistics site that relies on frequent mysql requests, 
rather than numerous transactions.  The only transaction is the site 
subscription fee.  I could also use suggestions for a reliable Credit 
Card processor.  If anyone has experience with this and can point me 
in the right direction, I would REALLY appreciate it.  I'm having alot 
of trouble with shoddy hosting and a terrible cc processor right now, 
I really need to know which direction to take.

Thanks - Doug




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


RE: [PHP] split

2003-03-27 Thread John W. Holmes
> I want to make a loop.Like $a = "123"; //$a is One two threw not
> hundred...
> and i want to make for each $a then $b = $a + 2
> 
> The output will be.
> 3 (1+2)
> 4 (2+2)
> 5 (3+2)
> 
> Any example?

$a = "123";
$c = '';

$b = strlen($a);
for($x=0;$x<$b;$x++)
{ $c .= $a{$x} +2; }

echo $c;

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Can anyone help me

2003-03-27 Thread Suhas Pharkute
Can anyone give me a basic tutorial for 

Secure Site Programming (OpenSSL)

Also How to create certificate on server

Suhas

__
Suhas S Pharkute.
P O Box 8551,
Pocatello, ID 83209.
1.208.221.3896
http://myweb.cableone.net/psuhas/
__


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



Re: [PHP] Why this script doesn't work?

2003-03-27 Thread Leif K-Brooks
http://www.php.net/manual/en/security.registerglobals.php

J. P. wrote:

I'm using Apache 2.0.44 with Win XP and PHP version 4.3.1!

 

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


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


RE: [PHP] Why this script doesn't work?

2003-03-27 Thread Martin Towell
have you got register_globals turn on or off ?

-Original Message-
From: J. P. [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 5:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Why this script doesn't work?


I'm using Apache 2.0.44 with Win XP and PHP version 4.3.1!




-- 
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] Form Validation: Surnames with Apostrophe

2003-03-27 Thread Andre Dubuc
Hi,

I made a little function that will allow allow "alphabetical character with 
apostrophe then more alphabetical characters then hyphen then more 
alphabetical characters (D'Agostino-Wong)". The downside is that it will 
automatically cap "von Hollander-Smith"

function ucase_words($txt){

if(ereg("['-]", $txt)){

$txt = strtolower($txt);

$boom = explode("'", $txt);
foreach($boom as $key => $txt){
$boom[$key] = ucfirst($txt);
}
$booms = implode("'", $boom);


$boomer = explode("-", $booms);

foreach($boomer as $key => $booms){
$boomer[$key] = ucfirst($booms);
}
$boomers = implode("-", $boomer);

return($boomers);
}
else {

$txt = strtolower($txt);
$txt = ucwords($txt);
return($txt);
}
}


I suppose you could add an if-then test for the odd lowercase. It seems to 
work well and covers most of the scenarios you listed. [Btw, it was my 
'very-first-function' so go easy on me! :>]

Just my $0.01 worth,
Andre



On Thursday 27 March 2003 06:49 pm, [EMAIL PROTECTED] wrote:
> Thank you.  Strip_slashes was the key.  The following Regular
> Expression:
>
> (preg_match("/^[[:alpha:]]{2,}[-]?[[:alpha:]]+$|^[[:alpha:]]{2,}[[:space:]]
>?[[:alpha:]]+$|^[[:alpha:]]{1,1}[']?[[:alpha:]]+$/", $Last_Name)
>
> allows only alphabetical characters (e.g., Smith), alphabetical characters
> with whitespace then more alphabetical characters (e.g., Au Yong),
> alphabetical character with apostrophe then more alphabetical characters
> (e.g., O'Neal), or alphabetical characters with hyphen then more
> alphabetical characters (e.g., Zeta-Jones).  It does not, however, allow
> alphabetical character with apostrophe then more alphabetical characters
> then hyphen then more alphabetical characters (D'Agostino-Wong),
> alphabetical characters with whitespace then more alphabetical characters
> then hyphen then more alphabetical characters (e.g., von Hollander-Smith),
> or alphabetical characters with whitespace then more alphabetical
> characters then hyphen then alphabetical character then apostrophe then
> more alphabetical characters (e.g, Van Horn-O'Reilly) or anything else
> anyone may type in or not type in.
>
> On Thu, 27 Mar 2003, Jennifer Goodie wrote:
> > This is what I use
> > $LastName = stripslashes($_POST['LastName']);
> > preg_match("/^\w+[\s\-\'\.\w]*$/i", $LastName)
> >
> > This is less strict than yours as I'm allowing whitespace, periods,
> > underscores, hyphens, apostrophes, and numbers because I don't so much
> > care if someone tacks on " Jr." or something like that to the end of
> > their name.
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 27, 2003 3:05 PM
> > To: Jennifer Goodie
> > Cc: John W. Holmes; 'John Nichel'; [EMAIL PROTECTED]
> > Subject: RE: [PHP] Form Validation: Surnames with Apostrophe
> >
> >
> >
> > When I do that:
> >
> > (preg_match("/^[a-z](\\')?[a-z-]+$/i",$_POST[Last_Name])
> >
> > it won't allow O'Reilly
> > and seems to not allow anything at all
> >
> > On Thu, 27 Mar 2003, Jennifer Goodie wrote:
> > > That is because it is not saying that is all that can be in the string.
> >
> > The
> >
> > > 'Re' matches that pattern.  Put a ^ at the beginning to signify it must
> > > start with the pattern and a $ at the end to signify it must end there.
> > >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, March 27, 2003 1:19 PM
> > > To: John W. Holmes
> > > Cc: 'John Nichel'; [EMAIL PROTECTED]
> > > Subject: RE: [PHP] Form Validation: Surnames with Apostrophe
> > >
> > >
> > >
> > > I just tried your regexp:
> > >
> > > (preg_match("/[a-z](\\')?[a-z-]+/i",$_POST[Last_Name])
> > >
> > > and it allows the following:
> > >
> > > O' [EMAIL PROTECTED]
> > >
> > > It seems to allow any number of characters and spaces between the O'
> > > and Re
> > >
> > > On Wed, 12 Mar 2003, John W. Holmes wrote:
> > > > > > preg_match ( "/[A-Za-z-']+/", $_POST['Last_Name'] );
> > > > > >
> > > > > > [EMAIL PROTECTED] wrote:
> > > > > > > I have been trying to validate a form field Last_Name and have
> > > >
> > > > been
> > > >
> > > > > unable
> > > > >
> > > > > > > to find a regexp to account for the apostrophe (e.g.,
> > > > > > > O'Reilly).
> > > >
> > > > The
> > > >
> > > > > > > following statement:
> > > > > > >
> > > > > > > preg_match('/^[[:alpha:]]+[-]?[[:alpha:]]+$/',
> > > > > > > $_POST[Last_Name])
> > > > > > >
> > > > > > > accepts hyphenated surnames and I have tried escaping the
> > > >
> > > > apostrophe:
> > > > > > > [\\'] and [\\\'] to no avail. Any idea what I am doing wrong?
> > > > >
> > > > > that could work but the user may now submit one or more apostrophes
> > > > > as the Last

[PHP] Why this script doesn't work?

2003-03-27 Thread J. P.
I'm using Apache 2.0.44 with Win XP and PHP version 4.3.1!


begin 666 c07p115.php
M/"%$3T-465!%([EMAIL PROTECTED]"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,"!4
M3X-"@T*/#]P:' -"F9U;F-T:6]N(&UOPT*9VQO8F%L("1N;VUE.PT*9VQO8F%L("1E
M;6%I;#L-"F=L;V)A;" D;&EN9W5A9V5M.PT*9VQO8F%L("1BF%D;W(@)7,@8W5J;R!E;F1Ehttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Form Validation: Surnames with Apostrophe

2003-03-27 Thread tpc

Thank you.  Strip_slashes was the key.  The following Regular
Expression:

(preg_match("/^[[:alpha:]]{2,}[-]?[[:alpha:]]+$|^[[:alpha:]]{2,}[[:space:]]?[[:alpha:]]+$|^[[:alpha:]]{1,1}[']?[[:alpha:]]+$/",
$Last_Name)

allows only alphabetical characters (e.g., Smith), alphabetical characters
with whitespace then more alphabetical characters (e.g., Au Yong),
alphabetical character with apostrophe then more alphabetical characters
(e.g., O'Neal), or alphabetical characters with hyphen then more
alphabetical characters (e.g., Zeta-Jones).  It does not, however, allow
alphabetical character with apostrophe then more alphabetical characters
then hyphen then more alphabetical characters (D'Agostino-Wong),
alphabetical characters with whitespace then more alphabetical characters
then hyphen then more alphabetical characters (e.g., von Hollander-Smith),
or alphabetical characters with whitespace then more alphabetical
characters then hyphen then alphabetical character then apostrophe then more
alphabetical characters (e.g, Van Horn-O'Reilly) or anything else anyone
may type in or not type in.

On Thu, 27 Mar 2003, Jennifer Goodie wrote:

> This is what I use
> $LastName = stripslashes($_POST['LastName']);
> preg_match("/^\w+[\s\-\'\.\w]*$/i", $LastName)
>
> This is less strict than yours as I'm allowing whitespace, periods,
> underscores, hyphens, apostrophes, and numbers because I don't so much care
> if someone tacks on " Jr." or something like that to the end of their name.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 27, 2003 3:05 PM
> To: Jennifer Goodie
> Cc: John W. Holmes; 'John Nichel'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Form Validation: Surnames with Apostrophe
>
>
>
> When I do that:
>
> (preg_match("/^[a-z](\\')?[a-z-]+$/i",$_POST[Last_Name])
>
> it won't allow O'Reilly
> and seems to not allow anything at all
>
> On Thu, 27 Mar 2003, Jennifer Goodie wrote:
>
> > That is because it is not saying that is all that can be in the string.
> The
> > 'Re' matches that pattern.  Put a ^ at the beginning to signify it must
> > start with the pattern and a $ at the end to signify it must end there.
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 27, 2003 1:19 PM
> > To: John W. Holmes
> > Cc: 'John Nichel'; [EMAIL PROTECTED]
> > Subject: RE: [PHP] Form Validation: Surnames with Apostrophe
> >
> >
> >
> > I just tried your regexp:
> >
> > (preg_match("/[a-z](\\')?[a-z-]+/i",$_POST[Last_Name])
> >
> > and it allows the following:
> >
> > O' [EMAIL PROTECTED]
> >
> > It seems to allow any number of characters and spaces between the O' and
> > Re
> >
> > On Wed, 12 Mar 2003, John W. Holmes wrote:
> >
> > > > > preg_match ( "/[A-Za-z-']+/", $_POST['Last_Name'] );
> > > > >
> > > > > [EMAIL PROTECTED] wrote:
> > > > > > I have been trying to validate a form field Last_Name and have
> > > been
> > > > unable
> > > > > > to find a regexp to account for the apostrophe (e.g., O'Reilly).
> > > The
> > > > > > following statement:
> > > > > >
> > > > > > preg_match('/^[[:alpha:]]+[-]?[[:alpha:]]+$/', $_POST[Last_Name])
> > > > > >
> > > > > > accepts hyphenated surnames and I have tried escaping the
> > > apostrophe:
> > > > > > [\\'] and [\\\'] to no avail. Any idea what I am doing wrong?
> > > > that could work but the user may now submit one or more apostrophes
> > > > as the Last Name.
> > >
> > > Watch out for magic_quotes. If "O'Reilly" is submitted, unless you
> > > stripslash() it, you're validating against "O\'Relly".
> > >
> > > preg_match("/[a-z](\\')?[a-z-]+/i",$_POST['Last_Name'])
> > >
> > > ---John W. Holmes...
> > >
> > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> > > today. http://www.phparch.com/
> > >
> > >
> > >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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



RE: [PHP] logging ip address when submitting a form

2003-03-27 Thread Chris Shiflett
--- daniel <[EMAIL PROTECTED]> wrote:
> this is a major problem , $_SERVER['HTTP_X_FORWARDED_FOR'] should get the ip 
> being the isp proxy , but some proxies including the stupid windoze one we 
> have at work will hide the ips behind it, so its rendered useless

Your Windows proxy is not misbehaving. The presence of
$_SERVER['HTTP_X_FORWARDED_FOR'] requires that the HTTP request include a
header by the name of X-Forwarded-For, an optional header.

Also, in many cases, the point of an HTTP proxy is to protect the clients it
serves. Exposing the origin IP might not be desirable.

With Web development, unless you have complete control over the network between
your users and your Web server(s), it is best to rely on the HTTP layer only
rather than rely on information obtained from the TCP/IP layer.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



RE: [PHP] Form Validation: Surnames with Apostrophe

2003-03-27 Thread Jennifer Goodie
This is what I use
$LastName = stripslashes($_POST['LastName']);
preg_match("/^\w+[\s\-\'\.\w]*$/i", $LastName)

This is less strict than yours as I'm allowing whitespace, periods,
underscores, hyphens, apostrophes, and numbers because I don't so much care
if someone tacks on " Jr." or something like that to the end of their name.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 3:05 PM
To: Jennifer Goodie
Cc: John W. Holmes; 'John Nichel'; [EMAIL PROTECTED]
Subject: RE: [PHP] Form Validation: Surnames with Apostrophe



When I do that:

(preg_match("/^[a-z](\\')?[a-z-]+$/i",$_POST[Last_Name])

it won't allow O'Reilly
and seems to not allow anything at all

On Thu, 27 Mar 2003, Jennifer Goodie wrote:

> That is because it is not saying that is all that can be in the string.
The
> 'Re' matches that pattern.  Put a ^ at the beginning to signify it must
> start with the pattern and a $ at the end to signify it must end there.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 27, 2003 1:19 PM
> To: John W. Holmes
> Cc: 'John Nichel'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Form Validation: Surnames with Apostrophe
>
>
>
> I just tried your regexp:
>
> (preg_match("/[a-z](\\')?[a-z-]+/i",$_POST[Last_Name])
>
> and it allows the following:
>
> O' [EMAIL PROTECTED]
>
> It seems to allow any number of characters and spaces between the O' and
> Re
>
> On Wed, 12 Mar 2003, John W. Holmes wrote:
>
> > > > preg_match ( "/[A-Za-z-']+/", $_POST['Last_Name'] );
> > > >
> > > > [EMAIL PROTECTED] wrote:
> > > > > I have been trying to validate a form field Last_Name and have
> > been
> > > unable
> > > > > to find a regexp to account for the apostrophe (e.g., O'Reilly).
> > The
> > > > > following statement:
> > > > >
> > > > > preg_match('/^[[:alpha:]]+[-]?[[:alpha:]]+$/', $_POST[Last_Name])
> > > > >
> > > > > accepts hyphenated surnames and I have tried escaping the
> > apostrophe:
> > > > > [\\'] and [\\\'] to no avail. Any idea what I am doing wrong?
> > > that could work but the user may now submit one or more apostrophes
> > > as the Last Name.
> >
> > Watch out for magic_quotes. If "O'Reilly" is submitted, unless you
> > stripslash() it, you're validating against "O\'Relly".
> >
> > preg_match("/[a-z](\\')?[a-z-]+/i",$_POST['Last_Name'])
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> > today. http://www.phparch.com/
> >
> >
> >
>
>


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


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



RE: [PHP] logging ip address when submitting a form

2003-03-27 Thread daniel
this is a major problem , $_SERVER['HTTP_X_FORWARDED_FOR'] should get the ip 
being the isp proxy , but some proxies including the stupid windoze one we 
have at work will hide the ips behind it, so its rendered useless

>= Original Message From Justin French <[EMAIL PROTECTED]> =
>$_SERVER['REMOTE_ADDR'] will contain the remote user's IP address IF it is
>set by the user agent (browser).
>
>It's also worth noting that this IP address could be faked, could be rotated
>by their ISP on a request-by-request basis (eg all AOL users), could be that
>of their firewall or network gateway, etc etc.
>
>It's fine to log it, but don't rely on it for future visits, or anything
>like that :)
>
>
>Justin
>
>
>on 28/03/03 5:04 AM, Joakim Larsson ([EMAIL PROTECTED]) wrote:
>
>> Hello,
>>
>> Is there a command in php that would logg the ip address of the user 
viewing
>> the php file.
>> I need someway of finding out who posted the form.
>>
>> thanx
>>
>>
>
>
>--
>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] Form Validation: Surnames with Apostrophe

2003-03-27 Thread tpc

When I do that:

(preg_match("/^[a-z](\\')?[a-z-]+$/i",$_POST[Last_Name])

it won't allow O'Reilly
and seems to not allow anything at all

On Thu, 27 Mar 2003, Jennifer Goodie wrote:

> That is because it is not saying that is all that can be in the string.  The
> 'Re' matches that pattern.  Put a ^ at the beginning to signify it must
> start with the pattern and a $ at the end to signify it must end there.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 27, 2003 1:19 PM
> To: John W. Holmes
> Cc: 'John Nichel'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Form Validation: Surnames with Apostrophe
>
>
>
> I just tried your regexp:
>
> (preg_match("/[a-z](\\')?[a-z-]+/i",$_POST[Last_Name])
>
> and it allows the following:
>
> O' [EMAIL PROTECTED]
>
> It seems to allow any number of characters and spaces between the O' and
> Re
>
> On Wed, 12 Mar 2003, John W. Holmes wrote:
>
> > > > preg_match ( "/[A-Za-z-']+/", $_POST['Last_Name'] );
> > > >
> > > > [EMAIL PROTECTED] wrote:
> > > > > I have been trying to validate a form field Last_Name and have
> > been
> > > unable
> > > > > to find a regexp to account for the apostrophe (e.g., O'Reilly).
> > The
> > > > > following statement:
> > > > >
> > > > > preg_match('/^[[:alpha:]]+[-]?[[:alpha:]]+$/', $_POST[Last_Name])
> > > > >
> > > > > accepts hyphenated surnames and I have tried escaping the
> > apostrophe:
> > > > > [\\'] and [\\\'] to no avail. Any idea what I am doing wrong?
> > > that could work but the user may now submit one or more apostrophes
> > > as the Last Name.
> >
> > Watch out for magic_quotes. If "O'Reilly" is submitted, unless you
> > stripslash() it, you're validating against "O\'Relly".
> >
> > preg_match("/[a-z](\\')?[a-z-]+/i",$_POST['Last_Name'])
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> > today. http://www.phparch.com/
> >
> >
> >
>
>


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



RE: [PHP] Passing data between the web to an Intranet

2003-03-27 Thread Ernest E Vogelsinger
At 13:53 27.03.2003, Steve Jackson said:
[snip]
>That would've been ideal.
>However I asked our webhost and they want 2100+ Danish Marks (Dotserv -
>tight "#"#"#!" - needless to say it isn't going to happen) to configure
>cURL within their PHP, can't do cron jobs either. 
[snip]

May I suggest switching ISP's - I'm offering you my server farm for half
this price ;-)

[snip]
>They suggest I use wget to do the same thing, however the only way I can
>think of to do that is display the submissions on a page and and somehow
>parse that into SQL to insert it. Any ideas on how I can go about that?
[snip]

I have another idea - you could simply go the other way round, the intranet
box polls the external one by executing a "special" PHP script. This script
on the external server checks the IP (only your intranet host, rsp. the
gateway is allowed), and maybe some secret token passed to it. It then
responds by transmitting any content that needs to go into the intranet DB,
formatted in a way easy to parse by an intranet script (e.g. ini style, or
xml, whatever). On the intranet box have a cronjob running that polls once
per minute.


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



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



Re: [PHP] Stupid question perhaps?

2003-03-27 Thread Justin French
PHP and Apache 2 don't boogie.

A lot has changed in PHP over those versions... did you read the
relase/upgrade notes across those versions??  I assume quite a lot of your
issues are in relation to the register_globals directive in php.ini, which
now defaults to off, not on.  If you switch it back, and downgrade Apache, I
dounbt you'll have many further problems.

You should compare other settings between your old php.ini and the new one
too, for little things like magic quotes, etc.


Justin


on 28/03/03 5:57 AM, Tom Tsongas ([EMAIL PROTECTED]) wrote:

> I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been
> previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled
> PHP website that I had been developing on for some time.
> After I upgraded, the entire website is virtually non-functional. I keep
> receiving 'Page cannot Display' or 'Document contains no data' errors.
> 
> I am not sure if this is a configuration issue on Apache or PHP. phpinfo
> seems to work fine and I don't encounter issues accessing pure HTML
> pages directly. Just the PHP ones?
> 
> Any ideas folks?
> 
> - Tom
> 


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



Re: [PHP] logging ip address when submitting a form

2003-03-27 Thread Justin French
$_SERVER['REMOTE_ADDR'] will contain the remote user's IP address IF it is
set by the user agent (browser).

It's also worth noting that this IP address could be faked, could be rotated
by their ISP on a request-by-request basis (eg all AOL users), could be that
of their firewall or network gateway, etc etc.

It's fine to log it, but don't rely on it for future visits, or anything
like that :)


Justin


on 28/03/03 5:04 AM, Joakim Larsson ([EMAIL PROTECTED]) wrote:

> Hello,
> 
> Is there a command in php that would logg the ip address of the user viewing
> the php file.
> I need someway of finding out who posted the form.
> 
> thanx
> 
> 


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



RE: [PHP] Include Question

2003-03-27 Thread Jennifer Goodie
If your include is located somewhere on the site you should refer to it as
$_SERVER[DOCUMENT_ROOT]/pathtofile/filename.php so that your paths don't get
messed up from chaning the includes etc.

-Original Message-
From: Beauford.2002 [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 2:28 PM
To: James E Hicks III
Cc: PHP General
Subject: Re: [PHP] Include Question


Just a typo, but now I have other problems as well which I think have to do
with paths and includes.  If I am in the root directory on page main.html
and click on a link that is in /other - because this is a restricted page I
include main.html with an error (which right now doesn't display) - but now
the paths are all screwed up. If I click on the same link again I get file
not found. Hope I am explaining this right as this is really getting on my
nerves.

TIA

- Original Message -
From: "James E Hicks III" <[EMAIL PROTECTED]>
To: "Beauford.2002" <[EMAIL PROTECTED]>
Sent: Thursday, March 27, 2003 4:15 PM
Subject: RE: [PHP] Include Question


> If checklogin.php is only below, you shouldnn't get those errors. Anyway,
> is password just a typo below or does your code omit the $ too?
>
>
> if (!$name || !password) {
>  $message = $enter_info;
>  include ("login.php");
>  exit;
> }
>
> -Original Message-
> From: Beauford.2002 [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 27, 2003 4:07 PM
> To: James E Hicks III
> Subject: Re: [PHP] Include Question
>
>
> Because I would get the error - headers already sent etc.
>
> - Original Message -
> From: "James E Hicks III" <[EMAIL PROTECTED]>
> To: "Beauford.2002" <[EMAIL PROTECTED]>
> Sent: Thursday, March 27, 2003 3:53 PM
> Subject: RE: [PHP] Include Question
>
>
> > Why not try header("login.php") instead of include?
> >
> > James Hicks
> >
> >
> > -Original Message-
> > From: Beauford.2002 [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 27, 2003 3:47 PM
> > To: PHP General
> > Subject: [PHP] Include Question
> >
> >
> > Hi,
> >
> > First, I fixed my other problem of the stack overflow by moving the
files
> > back to the root directory (although I would rather have them in a login
> > directory). Anyway, I have a question regarding the include function. I
> have
> > a login script in a file called login.php - in this file it includes
> > checklogin.php and loginerrors.php. If the user inputs an incorrect
login
> I
> > assign $messages the appropriate error from loginerrors, then I
re-include
> > login.php where I want to show the error message, but no matter what I
do
> > the error message will not show up.
> >
> > Example.
> >
> > Login.php 
> >
> > Enter your Name:
> > Enter Your Password:
> > if ($message) { echo $message; }
> >
> > Checklogin.php
> >
> > if (!$name || !password) {
> > $message = $enter_info;
> > include ("login.php");
> > exit;
> > }
> >
> > Any help is appreciated.



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



Re: [PHP] split

2003-03-27 Thread Philip Olson

This:

$word = 'test';
$len  = strlen($word);

for ($a = 0; $a < $len; $a++) {
print $word{$a} . "\n";
}

Will print:

t
e
s
t

Regards,
Philip

On Thu, 27 Mar 2003, Oden Odenius wrote:

> I have $word = "test";
> And i want to split it like
> t
> e
> s
> t
> 
> I want to make a loop.Like $a = "123"; //$a is One two threw not hundred...
> and i want to make for each $a then $b = $a + 2
> 
> The output will be.
> 3 (1+2)
> 4 (2+2)
> 5 (3+2)
> 
> Any example?
> 
> Btw sorry for my english
> 
> 
> 
> --
> Programmers are tools for convert coffeine into code... (c) Oden
> 
> 
> 
> 
> _
> MSN 8 with e-mail virus protection service: 2 months FREE* 
> http://join.msn.com/?page=features/virus
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] Re: GD - dynamic PNG generation

2003-03-27 Thread Petter Aas
Conor McTernan wrote:
Coding wise, I currently read the text in from a file, then put the text
into an array, each line being a seperate entry in the array. I then
create a PNG image approx 490*1848(i change the image size depending on
the amount of text). I dont do anything really strange in my image
function, apart from performing a wordwrap on the text before i start
displaying it, just to make the image readable. 

I'm trying to do allmost exactly the same, but I can't get the wordwrap 
to work in the png creation, (wordwrap part of the code works on 
ordinary html creation)the code i wrote is:

header ("Content-type: image/png");
$fp = fopen('randquote.txt', r);
while (++$i and $line = fgets($fp, 4096)) {
if ((mt_rand() / mt_getrandmax() * $i) < 1) { $it = $line; }
}
fclose($fp);
$txt = wordwrap($it, 20, "\r\n", 1);

$im = @imagecreate (468, 100)
or die ("Cannot Initialize new GD image stream");
$bg = ImageColorAllocate($im,255,255,255);
$tx = ImageColorAllocate($im,0,0,0);
ImageFilledRectangle($im,0,0,200,200,$bg);
$trans=imagecolortransparent($im,$bg);
ImageString($im,3,10,10,"$txt\r\n",$tx);
// send the image
ImagePng($im);
to see the output of the script: 
http://magikern.sytes.net/code/php/gd_png_dynamic/image_rand_quote.html

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


Re: [PHP] Include Question

2003-03-27 Thread Beauford.2002
Just a typo, but now I have other problems as well which I think have to do
with paths and includes.  If I am in the root directory on page main.html
and click on a link that is in /other - because this is a restricted page I
include main.html with an error (which right now doesn't display) - but now
the paths are all screwed up. If I click on the same link again I get file
not found. Hope I am explaining this right as this is really getting on my
nerves.

TIA

- Original Message -
From: "James E Hicks III" <[EMAIL PROTECTED]>
To: "Beauford.2002" <[EMAIL PROTECTED]>
Sent: Thursday, March 27, 2003 4:15 PM
Subject: RE: [PHP] Include Question


> If checklogin.php is only below, you shouldnn't get those errors. Anyway,
> is password just a typo below or does your code omit the $ too?
>
>
> if (!$name || !password) {
>  $message = $enter_info;
>  include ("login.php");
>  exit;
> }
>
> -Original Message-
> From: Beauford.2002 [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 27, 2003 4:07 PM
> To: James E Hicks III
> Subject: Re: [PHP] Include Question
>
>
> Because I would get the error - headers already sent etc.
>
> - Original Message -
> From: "James E Hicks III" <[EMAIL PROTECTED]>
> To: "Beauford.2002" <[EMAIL PROTECTED]>
> Sent: Thursday, March 27, 2003 3:53 PM
> Subject: RE: [PHP] Include Question
>
>
> > Why not try header("login.php") instead of include?
> >
> > James Hicks
> >
> >
> > -Original Message-
> > From: Beauford.2002 [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 27, 2003 3:47 PM
> > To: PHP General
> > Subject: [PHP] Include Question
> >
> >
> > Hi,
> >
> > First, I fixed my other problem of the stack overflow by moving the
files
> > back to the root directory (although I would rather have them in a login
> > directory). Anyway, I have a question regarding the include function. I
> have
> > a login script in a file called login.php - in this file it includes
> > checklogin.php and loginerrors.php. If the user inputs an incorrect
login
> I
> > assign $messages the appropriate error from loginerrors, then I
re-include
> > login.php where I want to show the error message, but no matter what I
do
> > the error message will not show up.
> >
> > Example.
> >
> > Login.php 
> >
> > Enter your Name:
> > Enter Your Password:
> > if ($message) { echo $message; }
> >
> > Checklogin.php
> >
> > if (!$name || !password) {
> > $message = $enter_info;
> > include ("login.php");
> > exit;
> > }
> >
> > Any help is appreciated.
> >
> >
> >
> > --
> > 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] Form Validation: Surnames with Apostrophe

2003-03-27 Thread Jennifer Goodie
That is because it is not saying that is all that can be in the string.  The
'Re' matches that pattern.  Put a ^ at the beginning to signify it must
start with the pattern and a $ at the end to signify it must end there.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 1:19 PM
To: John W. Holmes
Cc: 'John Nichel'; [EMAIL PROTECTED]
Subject: RE: [PHP] Form Validation: Surnames with Apostrophe



I just tried your regexp:

(preg_match("/[a-z](\\')?[a-z-]+/i",$_POST[Last_Name])

and it allows the following:

O' [EMAIL PROTECTED]

It seems to allow any number of characters and spaces between the O' and
Re

On Wed, 12 Mar 2003, John W. Holmes wrote:

> > > preg_match ( "/[A-Za-z-']+/", $_POST['Last_Name'] );
> > >
> > > [EMAIL PROTECTED] wrote:
> > > > I have been trying to validate a form field Last_Name and have
> been
> > unable
> > > > to find a regexp to account for the apostrophe (e.g., O'Reilly).
> The
> > > > following statement:
> > > >
> > > > preg_match('/^[[:alpha:]]+[-]?[[:alpha:]]+$/', $_POST[Last_Name])
> > > >
> > > > accepts hyphenated surnames and I have tried escaping the
> apostrophe:
> > > > [\\'] and [\\\'] to no avail. Any idea what I am doing wrong?
> > that could work but the user may now submit one or more apostrophes
> > as the Last Name.
>
> Watch out for magic_quotes. If "O'Reilly" is submitted, unless you
> stripslash() it, you're validating against "O\'Relly".
>
> preg_match("/[a-z](\\')?[a-z-]+/i",$_POST['Last_Name'])
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
>


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



RE: [PHP] redirect using header

2003-03-27 Thread Chris Shiflett
--- David Banning <[EMAIL PROTECTED]> wrote:
> I have been trying to do a redirect with header;
...
> I keep getting the error;
> 
> Warning: Cannot modify header information - headers already sent by
> (output started at /usr/hosting/optex/goterm/temp.html:8) in
> /usr/hosting/optex/goterm/temp.html on line

--- Jeremy Russell <[EMAIL PROTECTED]> wrote:
> Use ---> header("Location:http://newwebpage.com";);

Technically, the syntax for the header is (notice the space after the colon and
the proper URL):

header('Location: http://newwebpage.com/');

Also, while his syntax is a problem, it is not the problem at hand. David, you
cannot have output prior to using the header() function. You need to call
header() prior to outputting your HTML.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



RE: [PHP] need a reliable PHP host

2003-03-27 Thread Clint Tredway
I currently use www.imhosted.com and have been happy with their service.

Clint

-Original Message-
From: Doug Parker [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 3:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] need a reliable PHP host


Hi everyone - I need suggestions for a reliable PHP/mySQL host that has 
cURL support WITH https capability.  The site is e-commerce, but is 
mainly a statistics site that relies on frequent mysql requests, rather 
than numerous transactions.  The only transaction is the site 
subscription fee.  I could also use suggestions for a reliable Credit 
Card processor.  If anyone has experience with this and can point me in 
the right direction, I would REALLY appreciate it.  I'm having alot of 
trouble with shoddy hosting and a terrible cc processor right now, I 
really need to know which direction to take.

Thanks - Doug


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

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



[PHP] need a reliable PHP host

2003-03-27 Thread Doug Parker
Hi everyone - I need suggestions for a reliable PHP/mySQL host that has 
cURL support WITH https capability.  The site is e-commerce, but is 
mainly a statistics site that relies on frequent mysql requests, rather 
than numerous transactions.  The only transaction is the site 
subscription fee.  I could also use suggestions for a reliable Credit 
Card processor.  If anyone has experience with this and can point me in 
the right direction, I would REALLY appreciate it.  I'm having alot of 
trouble with shoddy hosting and a terrible cc processor right now, I 
really need to know which direction to take.

Thanks - Doug

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


RE: [PHP] split

2003-03-27 Thread Don Read

On 27-Mar-2003 Oden Odenius wrote:
> I have $word = "test";
> And i want to split it like
> t
> e
> s
> t
> 
> I want to make a loop.Like $a = "123"; //$a is One two threw not
> hundred...
> and i want to make for each $a then $b = $a + 2
> 
> The output will be.
> 3 (1+2)
> 4 (2+2)
> 5 (3+2)
> 
> Any example?
> 

$str='test';
$ary=preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
echo implode("\n", $ary), '';

$ary=preg_split('//', '123', -1, PREG_SPLIT_NO_EMPTY);
foreach($ary as $a) {
$b= $a + 2;
echo "", $b, "  ($a + 2)";
}



> Btw sorry for my english
> 
> 
> 
> --
> Programmers are tools for convert coffeine into code... (c) Oden
> 
> 
> 
> 
> _
> MSN 8 with e-mail virus protection service: 2 months FREE* 
> http://join.msn.com/?page=features/virus
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)


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



RE: [PHP] Form Validation: Surnames with Apostrophe

2003-03-27 Thread tpc

I just tried your regexp:

(preg_match("/[a-z](\\')?[a-z-]+/i",$_POST[Last_Name])

and it allows the following:

O' [EMAIL PROTECTED]

It seems to allow any number of characters and spaces between the O' and
Re

On Wed, 12 Mar 2003, John W. Holmes wrote:

> > > preg_match ( "/[A-Za-z-']+/", $_POST['Last_Name'] );
> > >
> > > [EMAIL PROTECTED] wrote:
> > > > I have been trying to validate a form field Last_Name and have
> been
> > unable
> > > > to find a regexp to account for the apostrophe (e.g., O'Reilly).
> The
> > > > following statement:
> > > >
> > > > preg_match('/^[[:alpha:]]+[-]?[[:alpha:]]+$/', $_POST[Last_Name])
> > > >
> > > > accepts hyphenated surnames and I have tried escaping the
> apostrophe:
> > > > [\\'] and [\\\'] to no avail. Any idea what I am doing wrong?
> > that could work but the user may now submit one or more apostrophes
> > as the Last Name.
>
> Watch out for magic_quotes. If "O'Reilly" is submitted, unless you
> stripslash() it, you're validating against "O\'Relly".
>
> preg_match("/[a-z](\\')?[a-z-]+/i",$_POST['Last_Name'])
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
>


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



Re: [PHP] File Upload and ftp transfer problem

2003-03-27 Thread Hugh Danaher
Thanks Jason, I'll try that, and let you know the results.  Hugh
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 27, 2003 11:48 AM
Subject: Re: [PHP] File Upload and ftp transfer problem


> On Friday 28 March 2003 03:16, Hugh Danaher wrote:
> > I'm trying to get the following script to ftp transfer an uploaded image
> > file so as to get around a file permission problem.  The upload portion
of
> > this works without problem, the ftp portion doesn't spit out any errors
> > either, but the file transfered is just the name of the uploaded temp
file
> > and not the file itself. If I do a filesize() on $file_stream, I get 44K
> > (the size of the image uploaded), I then transfer this var to the ftp
> > function but what gets ftp and saved as a file is only 14 bytes.  The
saved
> > file has "/tmp/phpDcJSOq" as its entire contents. The upload scrip is
> > below.
>
> It's doing exactly what you're telling it to do.
>
>   $file_stream=$HTTP_POST_FILES['userfile']['tmp_name'];
>
> This only contains the _name_ of the temporary file which contains the
> contents of your uploaded file.
>
> What you need to do is send the _contents_ of the file pointed to by
> $file_stream. Take a look at fread() and/or file().
>
> --
> 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
> --
> /*
> I do not find in orthodox Christianity one redeeming feature.
> - Thomas Jefferson
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



[PHP] Connecting to a remote server

2003-03-27 Thread Roberts, Mark \(Tulsa\)
I am needing to move one of my apps to a remote secure server that I have. As I have 
never done this before what are the general things that I must do to make this happen.
 
I changed my connect statement from "localhost" to the name of the server "  
 http://www.remoteservername.com"; and received an 
error that I could not connect, try again later.
 
Is there something else that I must do from an mysql or php standpoint to allow this 
to happen?
 
Thanks

Mark Roberts 
Sr. Systems Analyst 




Re: [PHP] Internet Explorer toolbar

2003-03-27 Thread Ray Hunter
This is why it is imperative that the user first research the topic
(problem) via on-line references (search engines, docs, howtos,etc) then
post to the mailing list when all these resources have been exhausted.

--
Ray


On Fri, 2003-03-28 at 02:43, Haseeb Iqbal wrote:
> hello,
> just want to suggest something to the list manager. there should be a way to
> email every newly subscribed user about what php can do and what php can't
> this will help solve many problems.i have been subscribed to this list for
> 10 days or so and i have recieved more then 50% of the mails about php doing
> client side stuff.and everytime the nice people explain to them what php can
> do.
> 
> i think all new users should get an email explaining what php is and what
> can it do.
> 
> just a suggestion no hard feelings.
> 
> Haseeb


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



[PHP] split

2003-03-27 Thread Oden Odenius
I have $word = "test";
And i want to split it like
t
e
s
t
I want to make a loop.Like $a = "123"; //$a is One two threw not hundred...
and i want to make for each $a then $b = $a + 2
The output will be.
3 (1+2)
4 (2+2)
5 (3+2)
Any example?

Btw sorry for my english



--
Programmers are tools for convert coffeine into code... (c) Oden


_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

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


[PHP] Include Question

2003-03-27 Thread Beauford.2002
Hi,

First, I fixed my other problem of the stack overflow by moving the files
back to the root directory (although I would rather have them in a login
directory). Anyway, I have a question regarding the include function. I have
a login script in a file called login.php - in this file it includes
checklogin.php and loginerrors.php. If the user inputs an incorrect login I
assign $messages the appropriate error from loginerrors, then I re-include
login.php where I want to show the error message, but no matter what I do
the error message will not show up.

Example.

Login.php 

Enter your Name:
Enter Your Password:
if ($message) { echo $message; }

Checklogin.php

if (!$name || !password) {
$message = $enter_info;
include ("login.php");
exit;
}

Any help is appreciated.



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



[PHP] Password authentication failed with pg_connect (apache2 / win32 / php4.3.1)

2003-03-27 Thread Richard Hollis
Im running apache2, php4.3.1 on win32 and everything is dandy apart from the
fact that pg_connect won't connect to a server which requires encrypted
passwords.

I get:

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL
server: FATAL 1: Password authentication failed for user "account_dev" . in
C:\www\common\db.inc on line 49

I am using the same script which works on my linux box running different
versions of apache and php, but I know it works with the username/password
etc.

Can pg_connect handle encrypted passwords on win32?  Do I need apache 1.3.x
or is this a bug perhaps?

Cheers
Richard



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



Re: [PHP] Internet Explorer toolbar

2003-03-27 Thread Leif K-Brooks
PHP is server-side.  It runs on the server, NOT the client.  It has no 
way to do anything to the client.  Try javascript.

Manuel Ochoa wrote:

Is there any way of using php to launch a new browser without the IE toolbars?
 

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


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


RE: [PHP] Internet Explorer toolbar

2003-03-27 Thread Jeremy Russell
Use javascript --> window.open("url","toolbar=no");

-Original Message-
From: Manuel Ochoa [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 2:32 PM
To: PHP General
Subject: [PHP] Internet Explorer toolbar


Is there any way of using php to launch a new browser without the IE
toolbars?

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



RE: [PHP] redirect using header

2003-03-27 Thread Jeremy Russell
Use ---> header("Location:http://newwebpage.com";);

-Original Message-
From: David Banning [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 1:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] redirect using header


I have been trying to do a redirect with header;



   Optex Staging and Services Inc. 


http://newwebpage.com');
?>

Stand By For Terminal...




I keep getting the error;

Warning: Cannot modify header information - headers already sent by
(output started at /usr/hosting/optex/goterm/temp.html:8) in
/usr/hosting/optex/goterm/temp.html on line 

I have tried the header statement in different postions, and also tried
eliminating the existing  section with no difference. What am
doing wrong here?

-- 
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] Internet Explorer toolbar

2003-03-27 Thread Haseeb Iqbal
hello,
just want to suggest something to the list manager. there should be a way to
email every newly subscribed user about what php can do and what php can't
this will help solve many problems.i have been subscribed to this list for
10 days or so and i have recieved more then 50% of the mails about php doing
client side stuff.and everytime the nice people explain to them what php can
do.

i think all new users should get an email explaining what php is and what
can it do.

just a suggestion no hard feelings.

Haseeb

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



[PHP] Internet Explorer toolbar

2003-03-27 Thread Manuel Ochoa
Is there any way of using php to launch a new browser without the IE toolbars?

Re: [PHP] File Upload and ftp transfer problem

2003-03-27 Thread Jason Wong
On Friday 28 March 2003 03:16, Hugh Danaher wrote:
> I'm trying to get the following script to ftp transfer an uploaded image
> file so as to get around a file permission problem.  The upload portion of
> this works without problem, the ftp portion doesn't spit out any errors
> either, but the file transfered is just the name of the uploaded temp file
> and not the file itself. If I do a filesize() on $file_stream, I get 44K
> (the size of the image uploaded), I then transfer this var to the ftp
> function but what gets ftp and saved as a file is only 14 bytes.  The saved
> file has "/tmp/phpDcJSOq" as its entire contents. The upload scrip is
> below.

It's doing exactly what you're telling it to do. 

  $file_stream=$HTTP_POST_FILES['userfile']['tmp_name'];

This only contains the _name_ of the temporary file which contains the 
contents of your uploaded file.

What you need to do is send the _contents_ of the file pointed to by 
$file_stream. Take a look at fread() and/or file().

-- 
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
--
/*
I do not find in orthodox Christianity one redeeming feature.
- Thomas Jefferson
*/


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



RE: [PHP] Return Character in a Text File?

2003-03-27 Thread Don Read

On 27-Mar-2003 Jay Paulson wrote:
> I have a slight problem.  Is there anyway to make a text file with a
> return character that doesn't show up in windows notepad as a gibberish
> character and actually puts a return in it?  Right now I'm using the "\n"
> for the return but it doesn't get read in notepad as a return so the
> string data is one long line instead of multiple lines.  Is there any
> other way of doing this?
> 
> Code I am using:
> $data = "";
> //loop
> $data .= "$firstName, $lastName, $email, $gender, $bday, $phone,
> $zip,\n";
> //end of loop
> 

notepad wants '\r\n' for an end of line. 

IIRC wordpad (or whatever they calling it this week) will grok
bare linefeeds.

> Thanks!

Regards,

-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)


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



Re: [PHP] PHP Send Mail Main headers.

2003-03-27 Thread Jason Wong
On Friday 28 March 2003 03:24, Don Read wrote:

We're getting way off-topic here.

> Not entirely accurate. It has to do with how you connect to the MTA.
>
> RFC822 only applies to SMTP 'on the wire' and internal delivery formats are
> outside the scope.
>
> There are alot of UUCP class 1 sites out there, and X.400, and JNT, and ...
> None of which follows RFC822 unless they gateway to SMTP.

AFAIK PHP's mail() command doesn't do any of the above except 'internet mail' 
(SMTP).

> Since MS-Windows doesn't have a native command-line mailer --PHP has to
> handle the connection to the gateway host and thus falls under 822.
>
> The 'must have ' rule is the lowest common denominator needed to
> support a mis-functional (albeit very popular) platform: MS-Windows.

Hmm, RFC 822 was conceived some time in the early 1980's. Which genius 
anticipated the 'popularity' of Windows back then?

-- 
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
--
/*
Youth is a blunder, manhood a struggle, old age a regret.
-- Benjamin Disraeli, "Coningsby"
*/


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



RE: [PHP] HTML mail being sent with mail() not working for some people

2003-03-27 Thread Don Read

On 27-Mar-2003 Jeff Lewis wrote:
> We're sending out emails using mail() and sending it in HTML format and
> while most people get it correctly a couple are not. They get the
> anti-abuse
> headers and then the HTML code appears as just that - HTML code in the
> body
> of the email.
> 
> Sending those same people an HTML email composed in Outlook comes across
> just fine, perhaps it's the anti abuse headers causing the issue?
> 
> Has anyone heard or had experience with this?
> 

google 'mime multipart alternative HTML'

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)


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



RE: [PHP] redirect using header

2003-03-27 Thread Matt Schroebel


> -Original Message-
> From: David Banning [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 27, 2003 2:15 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] redirect using header
> 
> 
> I have been trying to do a redirect with header;
> 
> 
> 
>Optex Staging and Services Inc. 
> 
> 
>  header('http://newwebpage.com');
> ?>
> 
> Stand By For Terminal...
> 
> 
> 

If you want to send output before the re-direct you need to use
javascript.

http://mywebdomain.com/index.html',100
00");">
This will execute right after the page is completely loaded and move to
the next page after 10 seconds. If javascript is disabled this will not
work, so provide a link in that case to be clicked on.

You can also use the meta tag:




Hello there

Since  starts counting when page is first accessed (as opposed to
when the page is comepletly loaded), people with slow connection might
not see the message -- depending on how big things are.

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



RE: [PHP] Stupid question perhaps?

2003-03-27 Thread Bryan Lipscy
Anything in the apache error_log?

-Original Message-
From: Tom Tsongas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 27, 2003 10:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Stupid question perhaps?


I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been 
previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled 
PHP website that I had been developing on for some time.
After I upgraded, the entire website is virtually non-functional. I keep

receiving 'Page cannot Display' or 'Document contains no data' errors.

I am not sure if this is a configuration issue on Apache or PHP. phpinfo

seems to work fine and I don't encounter issues accessing pure HTML 
pages directly. Just the PHP ones?

Any ideas folks?

- Tom


-- 
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] PHP Send Mail Main headers.

2003-03-27 Thread Don Read

On 27-Mar-2003 Jason Wong wrote:
> On Wednesday 26 March 2003 23:01, -{ Rene Brehmer }- wrote:
> 
>> > is not an overkill. That is the specs. Some MTAs (sendmail in
>> >particular) will treat a single LF (\n) as a line termination as thus
>> >you
>> > can get away with it.
>>
>> On unix machines you can do with just a linefeed, on CPM/DOS-based
>> systems
>> (that is, DOS & Windows), you need CRLF...
> 
> This has nothing to do with the OS. It is to do with the specs (RFC-822).
> 

Not entirely accurate. It has to do with how you connect to the MTA.

RFC822 only applies to SMTP 'on the wire' and internal delivery formats are
outside the scope. 

There are alot of UUCP class 1 sites out there, and X.400, and JNT, and ...
None of which follows RFC822 unless they gateway to SMTP.

Since MS-Windows doesn't have a native command-line mailer --PHP has to
handle the connection to the gateway host and thus falls under 822.

The 'must have ' rule is the lowest common denominator needed to
support a mis-functional (albeit very popular) platform: MS-Windows.

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

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)


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



RE: [PHP] redirect using header

2003-03-27 Thread Jennifer Goodie
Read the manual section on headers.  A header must be sent before any other
output, including whitespace, so putting it in the middle of an HTML page is
totally not going to work.  http://www.php.net/manual/en/function.header.php



-Original Message-
From: David Banning [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 11:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] redirect using header


I have been trying to do a redirect with header;



   Optex Staging and Services Inc. 


http://newwebpage.com');
?>

Stand By For Terminal...




I keep getting the error;

Warning: Cannot modify header information - headers already sent by (output
started at /usr/hosting/optex/goterm/temp.html:8) in
/usr/hosting/optex/goterm/temp.html on line

I have tried the header statement in different postions, and also
tried eliminating the existing  section with no difference.
What am doing wrong here?



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



Re: [PHP] PHP Session in Windows - Please help...

2003-03-27 Thread Tiago Simões
YEES!!

I've used:

#page1.php
".$sessionID."";
?>
Next Page

and

#page2.php




and on page2.php finally appears in all its glory:

bar



that reminds me. beer time!


thanks a lot!!
T.S.



"Mike" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It's much easier and works better to use:
>
>  session_start();
> $_SESSION['sess_var'] = "Hello World!";
> //then you can echo
> echo "The content of \$_SESSION['sess_var'] is " . $_SESSION['sess_var']
> . "";
> ?>
> Next Page
> ?>
>
> That will set everything and echo correctly... this also makes it more
> obvious for later where your variables are coming from.
>
> On Thu, 2003-03-27 at 08:03, Tiago Simões wrote:
> > Hi,
> >
> > I am using PHP version 4.3.0, Apache 2.0.44 on Windows XP. I am new to
> > Sessions and need your help with the problem below...
> >
> > I've done this simple session test:
> >
> > on session1.php:
> >
> >  > session_start();
> > session_register("sess_var");
> >
> > $sess_var = "Hello World!";
> >
> > echo "The content of \$sess_var is $sess_var";
> >
> > ?>
> > Next Page
> >
> > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
> > . . . . . . . . . . . . . . . .
> >
> > on session2.php:
> >
> >  > session_start();
> > echo "The content of \$sess_var is $sess_var";
> >
> > ?>
> >
> > When i test this, on the session2.php file, i get this error:
> >
> > Notice: Undefined variable: sess_var in C:\Program Files\Apache
> > Group\Apache2\htdocs\sites\activa\homepage\session2.php on line 3
> >
> > It's strange, because it writes a session file to my temporary folder
> > (session.save_path = c:/tmp).I've tried everything (even enabling
> > session.use_trans_sid)...
> >
> > Any thoughts?
> > Thank you in advance...
> >
> > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
> > . . . . . . . . . . . . . . . .
> >
> >
> > This is my configuration in PHP.ini (global variables off)
> >
> > session.save_handler = files
> > session.save_path = c:/tmp
> > session.use_cookies = 1
> > session.name = PHPSESSID
> > session.auto_start = 0
> > session.cookie_lifetime = 0
> > session.cookie_path = /
> > session.cookie_domain =
> > session.serialize_handler = php
> > session.gc_probability = 1
> > session.gc_maxlifetime = 1440
> > session.referer_check =
> > session.entropy_length = 0
> > session.entropy_file =
> > session.cache_limiter = nocache
> > session.cache_expire = 180
> > session.use_trans_sid = 0
>
>



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



Re: [PHP] Stupid question perhaps?

2003-03-27 Thread Tom Tsongas
Thx for the feedback everyone.

Based on what most have told me, I think I will defer to an older Apache 
version (1.3.x) and use that with the latest PHP. Not enough time to 
experiment with getting newer Apache to work with newest PHP.

- Tom

Evan Nemerson wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
register globals is of in newer versions of php. you can re-enable it in the 
php.ini.. See 
http://www.php.net/manual/en/configuration.directives.php#ini.register-globals

On Thursday 27 March 2003 10:57 am, Tom Tsongas wrote:
 

I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been
previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled
PHP website that I had been developing on for some time.
After I upgraded, the entire website is virtually non-functional. I keep
receiving 'Page cannot Display' or 'Document contains no data' errors.
I am not sure if this is a configuration issue on Apache or PHP. phpinfo
seems to work fine and I don't encounter issues accessing pure HTML
pages directly. Just the PHP ones?
Any ideas folks?

- Tom
   

- -- 
Businesses may come and go, but religion will last forever, for in no other 
endeavor does the consumer blame himself for product failure.

- -Harvard Lamphoon
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+g0xM/rncFku1MdIRArx/AJ9HYhHbEQRTWwz3+qqFibKKubOmZACgp9yh
KqCV12CJR4Td92mAITOn6vw=
=F145
-END PGP SIGNATURE-
 




[PHP] redirect using header

2003-03-27 Thread David Banning
I have been trying to do a redirect with header;



   Optex Staging and Services Inc. 


http://newwebpage.com');
?>

Stand By For Terminal...




I keep getting the error;

Warning: Cannot modify header information - headers already sent by (output started at 
/usr/hosting/optex/goterm/temp.html:8) in /usr/hosting/optex/goterm/temp.html on line 

I have tried the header statement in different postions, and also
tried eliminating the existing  section with no difference.
What am doing wrong here?

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



[PHP] PHP has encountered a Stack overflow

2003-03-27 Thread Beauford.2002
Where can I find information on this (all my searches come up in
non-English). This script was working fine until I changed the directory it
was in - since I moved it I get this error.

TIA



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



[PHP] File Upload and ftp transfer problem

2003-03-27 Thread Hugh Danaher
I'm trying to get the following script to ftp transfer an uploaded image file so as to 
get around a file permission problem.  The upload portion of this works without 
problem, the ftp portion doesn't spit out any errors either, but the file transfered 
is just the name of the uploaded temp file and not the file itself.  
If I do a filesize() on $file_stream, I get 44K (the size of the image uploaded), I 
then transfer this var to the ftp function but what gets ftp and saved as a file is 
only 14 bytes.  The saved file has "/tmp/phpDcJSOq" as its entire contents. 
The upload scrip is below.
Thanks for any help to resolve this problem.
Hugh
 
Input your digital photo of the specimen.";

  print "";
  print "";
  print "Send this tree picture: ";
  print "";
  print "";
  print "";
  print "";
  }
 if ($upload==1)
  {
  $photo2="L".(100*$asset_n).".jpg";
  // move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], 
"./directory/".$photo2.""); // doesn't work because of file permissions.
  $file_stream=$HTTP_POST_FILES['userfile']['tmp_name'];
   
  if ($upload==1)
   {
   call_user_func('ftp_transfer',$photo2, $file_stream);
   header("location: update.php?asset_n=$asset_n&edit=1");
  }
 }

 // functions
 // set up basic ftp connection
function ftp_transfer($photo2,$file_stream)
 {
 $ftp_server="   ";
 $ftp_user_name="   ";
 $ftp_user_pass="   ";
  
 $conn_id = ftp_connect($ftp_server); 

 // login with username and password
 $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); 

 // check connection
 if ((!$conn_id) || (!$login_result)) 
  { 
  print "FTP connection has failed!";
  print "Attempted to connect to $ftp_server "; 
  exit; 
  } 
 // upload the file
 $fp = tmpfile(); 
 fwrite($fp, $file_stream); 
 rewind($fp); 

 $destination_file="./directory/".$photo2;
 $upload = ftp_fput($conn_id, $destination_file, $fp, FTP_BINARY); 
 // check upload status
 if (!$upload) 
  { 
  print "FTP upload has failed!";
  } 
 // close the FTP stream 
 ftp_quit($conn_id);
 }
php?>


Re: [PHP] Stupid question perhaps?

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

register globals is of in newer versions of php. you can re-enable it in the 
php.ini.. See 
http://www.php.net/manual/en/configuration.directives.php#ini.register-globals


On Thursday 27 March 2003 10:57 am, Tom Tsongas wrote:
> I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been
> previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled
> PHP website that I had been developing on for some time.
> After I upgraded, the entire website is virtually non-functional. I keep
> receiving 'Page cannot Display' or 'Document contains no data' errors.
>
> I am not sure if this is a configuration issue on Apache or PHP. phpinfo
> seems to work fine and I don't encounter issues accessing pure HTML
> pages directly. Just the PHP ones?
>
> Any ideas folks?
>
> - Tom

- -- 
Businesses may come and go, but religion will last forever, for in no other 
endeavor does the consumer blame himself for product failure.

- -Harvard Lamphoon
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g0xM/rncFku1MdIRArx/AJ9HYhHbEQRTWwz3+qqFibKKubOmZACgp9yh
KqCV12CJR4Td92mAITOn6vw=
=F145
-END PGP SIGNATURE-


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



Re: [PHP] Stupid question perhaps?

2003-03-27 Thread Andrew Powell
Tom:

The install.txt file that came with PHP 4.3.1 states:

   At this time, support for Apache 2 is experimental.  It's
   highly recommended you use PHP with Apache 1.3.x and not
   Apache 2.
aap

Tom Tsongas wrote:

> I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been
> previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled
> PHP website that I had been developing on for some time.
> After I upgraded, the entire website is virtually non-functional. I
> keep receiving 'Page cannot Display' or 'Document contains no data'
> errors.
>
> I am not sure if this is a configuration issue on Apache or PHP.
> phpinfo seems to work fine and I don't encounter issues accessing pure
> HTML pages directly. Just the PHP ones?
>
> Any ideas folks?
>
> - Tom
>
>


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


Re: [PHP] character set problem

2003-03-27 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

rawurlencode was originally intended for URLs, but all it does is encode 
certian characters- it can be used for anything, and if the percentage of 
characters is low enough, the returned string is smaller than that which is 
returned by base64_encode, bin2hex, etc.

That said, it sounds like the problem is not in php itself, but maybe your 
php_mssql.dll or freetds. Make sure you have the latest version of both. See 
what versions were working for you- maybe something got broken in a newer 
release of one of those.



On Thursday 27 March 2003 10:45 am, Filip De Graeve wrote:
> the problem is, there is already an application running
> (written in VB) using that ms sql server ; so i must find a way
> to enter the characters in the db in a proper way...
>
> isn't rawurlencode supposed to be used for urls?
> i'm just talking about a plain text string...
>
> is there anybody else who got any idea ?
> thank you for your quick response...
>
> regards,
>
> Filip
>
> "Evan Nemerson" <[EMAIL PROTECTED]> schreef in bericht
> news:[EMAIL PROTECTED]
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > can you do a rawurlencode() on the data before you put it in the DB, and
> > a rawurldecode when you suck it out? It's a hack, but it would prolly
> > work fine.
> >
> > On Thursday 27 March 2003 09:46 am, Filip De Graeve wrote:
> > > Hello,
> > >
> > > Using PHP 4.3.1 on a Windows 2k/Apache,
> > > i am trying to insert some text  like"Test é à ë" into a
> > > MS SQL database.
> > >
> > > The result I get using the query analyzer :
> > > Test Ú Þ Ù
> > >
> > > is not the same as you can see for yourself.
> > > However; ms sql supports those characters when
> > > i insert them directly into the query analyzer.
> > >
> > > My locales support those characters (.be locals),
> > > and i configured the php.ini to support the iso-8859-1 charset
> > > (and use the mssql dll extension).
> > >
> > > What's also weird, is that the function   htmlspecialchars has
> > > no effect on the result, whilst htmlentities does have one; but then
> > > the textfield looks like " Test é è ë "
> > > which wasn't exactly the point.
> > >
> > > I used an older version of php once;
> > > ( i believe it was 4.1.1 or something) and there wasn't any bug
> > > regarding charsets etc (on a ms sql database).
> > >
> > > Can anybody give me any clue where to look
> > > or what to do?
> > >
> > > thank you,
> > > regards
> > >
> > > Filip
> > > [EMAIL PROTECTED]
> >
> > - --
> > Prisons are built with stones of Law, Brothels with bricks of Religion.
> >
> > - -William Blake
> > -BEGIN PGP SIGNATURE-
> > Version: GnuPG v1.0.7 (GNU/Linux)
> >
> > iD8DBQE+g0SB/rncFku1MdIRAofUAJ0TbYKVYZ+tPski2l8QNT6dkDkh8wCdEjux
> > 8jW37HvPuBZg5aZbZywOF+0=
> > =qVVT
> > -END PGP SIGNATURE-

- -- 
To achieve adjustment and sanity and the conditions that follow from them, we 
must study the structural characteristics of this world first and, then only, 
build languages of similar structure, instead of habitually ascribing to the 
world the primitive structure of our language.

- -Alfred Korzybski
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+g0s0/rncFku1MdIRAqVYAJ9Xxavy/cCPCuvKPNXfURrTv4r7NQCcDwtO
VqQFVBtmNtSWenoUTNgUv7U=
=Xrm1
-END PGP SIGNATURE-


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



[PHP] Stupid question perhaps?

2003-03-27 Thread Tom Tsongas
I just recently upgraded to PHP 4.3.1 and Apache 2.0.44. I had been 
previously running PHP 4.0.4 and Apache 1.3.20. I had a fully enabled 
PHP website that I had been developing on for some time.
After I upgraded, the entire website is virtually non-functional. I keep 
receiving 'Page cannot Display' or 'Document contains no data' errors.

I am not sure if this is a configuration issue on Apache or PHP. phpinfo 
seems to work fine and I don't encounter issues accessing pure HTML 
pages directly. Just the PHP ones?

Any ideas folks?

- Tom

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


  1   2   3   >