Re: [PHP] very large and long if statement

2004-04-08 Thread Andy B
i dont see any difference in the one you wrote and the one i wrote...they
seem to be exactly the same??

- Original Message - 
From: Tyler Replogle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, April 07, 2004 9:43 PM
Subject: RE: [PHP] very large and long if statement


 hey,
 i don't know how to make it smaller but should it be
 if
 (!empty($_SESSION['add']['type'])
  !empty($_SESSION['add']['start_date'])
  !empty($_SESSION['add']['end_date'])
  !empty($_SESSION['add']['name'])
  !empty($_SESSION['add']['county'])
  !empty($_SESSION['add']['discription'])
  !empty($_SESSION['add']['StartingDay'])
  !empty($_SESSION['add']['StartingMonth'])
  !empty($_SESSION['add']['StartingYear'])
  !empty($_SESSION['add']['EndingDay']})
  !empty($_SESSION['add']['EndingMonth'])
  !empty($_SESSION['add']['EndingYear']))
 {//run the insert query}
 else
 {//show error since one or more fields above are blank}

 ?
 From: Andy B [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] very large and long if statement
 Date: Wed, 7 Apr 2004 18:47:02 -0400
 
 I have this very large and long if statement:
 if
   (!empty($_SESSION['add']['type'])
!empty($_SESSION['add']['start_date']
!empty($_SESSION['add']['end_date'])
!empty($_SESSION['add']['name'])
!empty($_SESSION['add']['county'])
!empty($_SESSION['add']['discription'])
!empty($_SESSION['add']['StartingDay'])
!empty($_SESSION['add']['StartingMonth'])
!empty($_SESSION['add']['StartingYear'])
!empty($_SESSION['add']['EndingDay']})
!empty($_SESSION['add']['EndingMonth'])
!empty($_SESSION['add']['EndingYear']))
   {//run the insert query}
 else
   {//show error since one or more fields above are blank}
 was wondering if there was really any way to condense that down to
 something
 any better? all fields in the form that those came from are required...
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

 _
 Watch LIVE baseball games on your computer with MLB.TV, included with MSN
 Premium!

http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/direct/01/


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



[PHP] html forms class in php

2004-04-08 Thread Andy B
hi

yesterday i posted a msg about wanting to know if it was a good idea to
write a class that created/dealt with html forms and so on... somebody told
me to go look at html_quick_forms class and it looks good like everything i
would want to do but there is 1 problem: is there any classes for the same
thing out there anybody knows of that does the same thing but doesnt require
pear to be installed??

i dont have access to pear on the servers i deal with and the admin refuse
to install it...

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



Re: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread daniel
 If I understand right, PHP5 has an exception
 handling mechanism but it is only for manual using, i.e.
 a programmer can use try/catch but only for own code.
 PHP's built-in functions and functions from extensions still
 use old return value method. Yes?

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

I bloody hope not or what is the point ?

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



Re: [PHP] very large and long if statement

2004-04-08 Thread Tyler Replogle
yeah well they are really close but i add a ) on line 3





From: Andy B [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] very large and long if statement
Date: Thu, 8 Apr 2004 02:03:38 -0400
i dont see any difference in the one you wrote and the one i wrote...they
seem to be exactly the same??
- Original Message -
From: Tyler Replogle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, April 07, 2004 9:43 PM
Subject: RE: [PHP] very large and long if statement
 hey,
 i don't know how to make it smaller but should it be
 if
 (!empty($_SESSION['add']['type'])
  !empty($_SESSION['add']['start_date'])
  !empty($_SESSION['add']['end_date'])
  !empty($_SESSION['add']['name'])
  !empty($_SESSION['add']['county'])
  !empty($_SESSION['add']['discription'])
  !empty($_SESSION['add']['StartingDay'])
  !empty($_SESSION['add']['StartingMonth'])
  !empty($_SESSION['add']['StartingYear'])
  !empty($_SESSION['add']['EndingDay']})
  !empty($_SESSION['add']['EndingMonth'])
  !empty($_SESSION['add']['EndingYear']))
 {//run the insert query}
 else
 {//show error since one or more fields above are blank}

 ?
 From: Andy B [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] very large and long if statement
 Date: Wed, 7 Apr 2004 18:47:02 -0400
 
 I have this very large and long if statement:
 if
   (!empty($_SESSION['add']['type'])
!empty($_SESSION['add']['start_date']
!empty($_SESSION['add']['end_date'])
!empty($_SESSION['add']['name'])
!empty($_SESSION['add']['county'])
!empty($_SESSION['add']['discription'])
!empty($_SESSION['add']['StartingDay'])
!empty($_SESSION['add']['StartingMonth'])
!empty($_SESSION['add']['StartingYear'])
!empty($_SESSION['add']['EndingDay']})
!empty($_SESSION['add']['EndingMonth'])
!empty($_SESSION['add']['EndingYear']))
   {//run the insert query}
 else
   {//show error since one or more fields above are blank}
 was wondering if there was really any way to condense that down to
 something
 any better? all fields in the form that those came from are required...
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

 _
 Watch LIVE baseball games on your computer with MLB.TV, included with 
MSN
 Premium!

http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/direct/01/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Check out MSN PC Safety  Security to help ensure your PC is protected and 
safe. http://specials.msn.com/msn/security.asp

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


Re: [PHP] html forms class in php

2004-04-08 Thread Richard Harb
Then again you can just put the pear stuff into a subdirectory of your
project site / whatever.

for PHP 4 = 4.3.0 you could have a look at:
http://www.php.net/manual/en/function.set-include-path.php

for older versions you can use ini_set (@see same url)
I've seen it done - works just as well. The pear libraries are PHP
code anyway, so it doesn't really have to be installed like
ImageMagick or TurckCache or something ...

hth

Richard

Thursday, April 8, 2004, 8:09:09 AM, you wrote:

 hi

 yesterday i posted a msg about wanting to know if it was a good idea to
 write a class that created/dealt with html forms and so on... somebody told
 me to go look at html_quick_forms class and it looks good like everything i
 would want to do but there is 1 problem: is there any classes for the same
 thing out there anybody knows of that does the same thing but doesnt require
 pear to be installed??

 i dont have access to pear on the servers i deal with and the admin refuse
 to install it...

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



RE: [PHP] smarty

2004-04-08 Thread Vincent DUPONT

Does anyone have a 'good' tutorial about Smarty. The one available on smarty.php.net 
is really basic...


Vincent


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: jeudi 8 avril 2004 4:02
To: Kelly Hallman
Cc: PHP-General
Subject: Re: [PHP] smarty


On Wed, 2004-04-07 at 21:35, Kelly Hallman wrote:
 Apr 8 at 10:26am, Justin French wrote:
  PHP itself is a great templating language :)
  h1?=$title?/h1
  table
  ? foreach($staff as $person): ?tr
  td?=$person['firstname']? ?=$person['surname']?/td
  td?=$person['role']?/td
  td?=$person['phone']?/td
  tda href='mailto:?=$person['email']?'?=$person['email']?/td
  /tr? endforeach; ?/table
 
 Uhhh, yeah--that's not a templating, that's called spaghetti code :)
 
 You get the concept. Smarty, as you know, basically takes a Smarty
 template and writes PHP code similar to what you've done above, then
 writes out the .php file, and includes it when you render your template.
 So you'd get nearly the same effect by writing the PHP as a separate file
 and including it as your last step, and it acts as your display logic.
 
 That may be acceptable to you, as a PHP programmer. If you're the only one
 who ever needs to modify your templates then that's great, more power to
 you. I'm sure that you would have no problem having many levels of nesting
 all over the place and not screwing anything up. So be it. But that's you.
 
 I guarantee another person not as adept at PHP will screw that code up,
 and there is less potential for that with a Smarty template. If you know
 PHP as well as yourself, it should be plain to see how Smarty is just a
 wrapper over PHP that makes templates easier to build and maintain.
 For a designer or non-coder, Smarty will be easier to learn than PHP.
  
 Unless your needs never exceed the very basics like you have demonstrated
 above, you'll be hosed when another person needs to modify your template.  
 Which goes back to a templating truism never in dispute: if this is all
 you want templating for, it's six of one, half a dozen of the other.
 
 However, there are practical limitations on what you can easily accomplish
 with this approach, and Smarty addresses those issues. And you're worse
 off if you invest a lot into building your sites this way, and then
 realize you need some better templating strategies later.
 
  You can still separate your logic from your presentation, template 
  designers can still use quick, simple tags to include code, and the 
  upside is that people familiar with PHP don't need to learn ANOTHER 
  language (that's what Smarty is) -- they can dive straight in.
 
 You can consider it it's own language, but really it's more like PHP with
 different formatting. Which is why it's different than what you're doing
 above--it's designed to facilitate templating. Your method is just poking
 in variables and PHP into inline'd HTML. It works, but you're missing some
 of the power of Smarty if you think that's all it's good for.
 
  The question is, do you want to give your templater designers full 
  access to the power of PHP, or not.
 
 In other words: are your template designers already good PHP programmers?
 It's not just hype, it solves real problems, even if you don't have them.

Smarty is a bit of a hack too... why do I need to declare my templates
within the PHP code? If I'm an HTML designer I'd like to create a new
page, include templates, use some data that's been made available and
have it all in the template. I sure as heck wouldn't want to have joe
programmer edit the main page, add support for importing my template.
This is the thing that bugs me about Smarty, its still got that hanging
dependency. And it's still got to include all those templates within the
source code.

InterJinn is superior in this respect. You use XML tags to import other
templates, you use XML tags to load modules and components, and you use
XML tags to do almost any kind of expansion you want. Of course, you can
go ahead and use something else, InterJinn provides the ability to plug
in custom compilers. InterJinn compiles to PHP code, includes are
INCLUDED at compile time not at run time. So given this scheme anyone
working on the HTML is already familiar with the syntax... hard to go
wrong with:

jinn:template path=topnav.template/

Hell you can even overload HTML tags. Not only that but Interjinn allows
recursive includes of templates and source files, and these includes can
be relative to the outer nested template or source file. Furthermore,
there's nothing forcing the use of the InterJinn application layer so
InterJinn can be used entirely for it's templating features, in which
case it provides a faster resulting PHP page than using PHP include().

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework 

Re: [PHP] Re: php + lynx + grep

2004-04-08 Thread Burhan Khalid
[ snippity snip snip ]

Have you verified that lynx, grep, and head are in PHP's path? Check the
output of `which lynx` or phpinfo() to figure out what your path is, and
whether it includes lynx. Alternatively, use a full path to lynx to avoid
confusion.
Could be that the apache process has no rights to run these commands. 
Try su as apache and see if you can run it.

When you run php from the command line, it runs as the active user.

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


[PHP] Re: html forms class in php

2004-04-08 Thread Manuel Lemos
Hello,

On 04/08/2004 03:09 AM, Andy B wrote:
yesterday i posted a msg about wanting to know if it was a good idea to
write a class that created/dealt with html forms and so on... somebody told
me to go look at html_quick_forms class and it looks good like everything i
would want to do but there is 1 problem: is there any classes for the same
thing out there anybody knows of that does the same thing but doesnt require
pear to be installed??
i dont have access to pear on the servers i deal with and the admin refuse
to install it...
Sure, you may want to try this one that does even other things:

http://www.phpclasses.org/formsgeneration

--

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


[PHP] PHP vs. Outlook problem

2004-04-08 Thread
Dear all ,

I got a problem to send a confirmation mail from my Website to auto reply
every new registrator . Due to the ISP mail server resist any Web Mail
function but personal mailing permitted only through Outlook .

Since I used floating IP and asked another dynamic DNS server  to point to
my domain . Meanwhile , I'd like to have the Mail server of ISP for mailing
.

Hence , I'd like to have a PEAR module to call Outlook for mailing . Is it
possible ? What should I do ? Is there any resource which like as I
mentioned ?

Your any input will be highly appreciated and thanks in advance !

cchiang

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



Re: [PHP] Re: html forms class in php

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 04:09, Manuel Lemos wrote:
 Hello,
 
 On 04/08/2004 03:09 AM, Andy B wrote:
  yesterday i posted a msg about wanting to know if it was a good idea to
  write a class that created/dealt with html forms and so on... somebody told
  me to go look at html_quick_forms class and it looks good like everything i
  would want to do but there is 1 problem: is there any classes for the same
  thing out there anybody knows of that does the same thing but doesnt require
  pear to be installed??
  
  i dont have access to pear on the servers i deal with and the admin refuse
  to install it...
 
 Sure, you may want to try this one that does even other things:
 
 http://www.phpclasses.org/formsgeneration

Ooh, ooh, and FormJinn (part of InterJinn):

http://www.interjinn.com/documentation/formJinn.phtml

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

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



Re: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread Tumurbaatar S.

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  If I understand right, PHP5 has an exception
  handling mechanism but it is only for manual using, i.e.
  a programmer can use try/catch but only for own code.
  PHP's built-in functions and functions from extensions still
  use old return value method. Yes?
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

 I bloody hope not or what is the point ?

In the current version of PHP, many built-in functions (if not all?)
return FALSE on an error and some resource/handle on a success.
So, instead of coding like this:
...
$res = some_builtin_func(); // func does not raise exception on error
if (!$res)
throw new Exception();// so I throw it manually
...
I want to write:
...
$res = some_builtin_func(); // func raises exception on error
// so I don't need to write additional lines
...

So will PHP5 (or future versions) work as in my 2nd example?

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



[PHP] xmlhttp request

2004-04-08 Thread electroteque
This is filthy check this out

http://jibbering.com/2002/4/httprequest.html

i suppose its a mozilla and ie only thing and pc too but maybe handy for php
apps to post and get without changing the page

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



[PHP] Re: path to binary for php on linux

2004-04-08 Thread David Robley
[EMAIL PROTECTED] (Andy B) wrote in 
news:[EMAIL PROTECTED]:

 anybody know what the exact path for the php binary on linux is?

If all else fails, try locate php if your locate database is up to date, or 
check the logs or whatever of your install package tool.

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



[PHP] multiple constructor question

2004-04-08 Thread jdavis
Hello,
 I have looked around for information on using multiple constructors 
with OO PHP. I have found little, and from what I have seen I'm thinking
that  it's not supported. Is this true. I wrote the code below to try
to emulate multiple constructors.. is this what everyone else does to
try to get the same functionality?

thanks,  
-- 
[EMAIL PROTECTED]

Bad spellers of the world untie!


#!/usr/bin/php4
?php

$args = $_SERVER['argv'];

if($args[0]){
 $tc = new TestCon($args[1]);
}
else{
 $tc = new TestCon();
}


class TestCon{
 function TestCon($name = NULL){
  if($name){
   $this-doIt($name);
  }
  else{
   $this-doIt(User);
  }
 }  
 function doIt($string){
  echo Hello $string\n;
 }
}

?

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



[PHP] Re: Unsubscribe!!

2004-04-08 Thread David Robley
[EMAIL PROTECTED] (Ken Heath) wrote in
news:[EMAIL PROTECTED]: 

 Please remove me from the mailing list.  Many different efforts has
 failed. 
:-(
 
 I apology to everyone who receive this message.

This is the last place to send that to. Try looking in the headers of any 
mail you get from the list where you will see soem useful information.

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



[PHP] Re: Exceptions and builtin functions in PHP5

2004-04-08 Thread Catalin Trifu
Hi,

I think this question is better suited to the devel list.

Catalin

Tumurbaatar S. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 If I understand right, PHP5 has an exception
 handling mechanism but it is only for manual using, i.e.
 a programmer can use try/catch but only for own code.
 PHP's built-in functions and functions from extensions still
 use old return value method. Yes?

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



[PHP] Re: Adding a new entry using PHP

2004-04-08 Thread Catalin Trifu
Hi,

Check http://php.weblogs.com/adodb

Catalin


P.S.
Welcome to PHP :)


Alistair Hayward [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I am an ASP user, now learning PHP.

 When adding a record in ASP, I do this:

 Recordset.AddNew
 Field1 = whatever
 RecordSet.Update

 How is this done in PHP?

 I have built a recordset using a query, and have all the information
 needed to go into the different fields, but how do I 'Edit' or 'AddNew'
 and 'Update'?
 This is what I have:

 ?php

 unset($price);
 $price = $_GET['Price'];

 unset($id);
 $id = $_GET['id'];

 unset($partnumber);
 $partnumber = $_GET['PartNumber'];

 unset($disc);
 $disc = $_GET['Disc'];

 $link = mysql_connect('localhost', 'root', 'password');
 if (!$link) {
  echo Couldn't make a connection!;
  exit;
  }
 $db = mysql_select_db(order, $link);
 if (!$db) {
  echo Couldn't select database!;
  exit;
  }
 $sql= SELECT * FROM tborder WHERE sid='session.sessionid';
 $result = mysql_query($sql);

 $total_records = mysql_num_rows($result);


 ?

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



Re: [PHP] path to binary for php on linux

2004-04-08 Thread jdavis
On Wed, 2004-04-07 at 18:17, Andy B wrote:
 it was installed with get
 and which php doesnt do anything just returns to the prompt with no output
 
 - Original Message - 
 From: Curt Zirzow [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 07, 2004 8:11 PM
 Subject: Re: [PHP] path to binary for php on linux
 
 
  * Thus wrote Andy B ([EMAIL PROTECTED]):
   anybody know what the exact path for the php binary on linux is?
  

locate finds all files containing the search string ... this works..
but you can just find binaries and important conf-files with

[EMAIL PROTECTED] ~---whereis php4
php4: /usr/bin/php4 /etc/php4 /usr/lib/php4 /usr/include/php4 
/usr/share/man/man1/php4.1.gz
[EMAIL PROTECTED] ~---


also depending on what linux you are using ...
you can just ask the package manager...

redhat- rpm -qa | grep php4 
then rpm -qp --filebypkg php4_main.rpm // or whatever the above command tells you the 
name is

debian- dpkg -L php4

good luck,
jd

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



Re: [PHP] smarty

2004-04-08 Thread Richard Harb
Well, I can't say that it's a 'good' tutorial, it's a little messy,
but it's along the lines of how I am using it ... If you want to have
a look, I put together a page and some explanations and stuffed it
into an archive (162Kb) You can downlad it at
http://www.wegotit.at/sm_demo.zip

If you're going to look at it, drop me a line to let me know if it's
too confusing or if you could actually make something out of it :)

Richard

Thursday, April 8, 2004, 9:11:06 AM, you wrote:


 Does anyone have a 'good' tutorial about Smarty. The one
 available on smarty.php.net is really basic...


 Vincent


 -Original Message-
 From: Robert Cummings [mailto:[EMAIL PROTECTED]
 Sent: jeudi 8 avril 2004 4:02
 To: Kelly Hallman
 Cc: PHP-General
 Subject: Re: [PHP] smarty


 On Wed, 2004-04-07 at 21:35, Kelly Hallman wrote:
 Apr 8 at 10:26am, Justin French wrote:
  PHP itself is a great templating language :)
  h1?=$title?/h1
  table
  ? foreach($staff as $person): ?tr
  td?=$person['firstname']? ?=$person['surname']?/td
  td?=$person['role']?/td
  td?=$person['phone']?/td
  tda
 href='mailto:?=$person['email']?'?=$person['email']?/td
  /tr? endforeach; ?/table
 
 Uhhh, yeah--that's not a templating, that's called spaghetti code :)
 
 You get the concept. Smarty, as you know, basically takes a Smarty
 template and writes PHP code similar to what you've done above, then
 writes out the .php file, and includes it when you render your template.
 So you'd get nearly the same effect by writing the PHP as a separate file
 and including it as your last step, and it acts as your display logic.
 
 That may be acceptable to you, as a PHP programmer. If you're the only one
 who ever needs to modify your templates then that's great, more power to
 you. I'm sure that you would have no problem having many levels of nesting
 all over the place and not screwing anything up. So be it. But that's you.
 
 I guarantee another person not as adept at PHP will screw that code up,
 and there is less potential for that with a Smarty template. If you know
 PHP as well as yourself, it should be plain to see how Smarty is just a
 wrapper over PHP that makes templates easier to build and maintain.
 For a designer or non-coder, Smarty will be easier to learn than PHP.
  
 Unless your needs never exceed the very basics like you have demonstrated
 above, you'll be hosed when another person needs to modify your template.
 Which goes back to a templating truism never in dispute: if this is all
 you want templating for, it's six of one, half a dozen of the other.
 
 However, there are practical limitations on what you can easily accomplish
 with this approach, and Smarty addresses those issues. And you're worse
 off if you invest a lot into building your sites this way, and then
 realize you need some better templating strategies later.
 
  You can still separate your logic from your presentation, template
  designers can still use quick, simple tags to include code, and the
  upside is that people familiar with PHP don't need to learn ANOTHER
  language (that's what Smarty is) -- they can dive straight in.
 
 You can consider it it's own language, but really it's more like PHP with
 different formatting. Which is why it's different than what you're doing
 above--it's designed to facilitate templating. Your method is just poking
 in variables and PHP into inline'd HTML. It works, but you're missing some
 of the power of Smarty if you think that's all it's good for.
 
  The question is, do you want to give your templater designers full
  access to the power of PHP, or not.
 
 In other words: are your template designers already good PHP programmers?
 It's not just hype, it solves real problems, even if you don't have them.

 Smarty is a bit of a hack too... why do I need to declare my templates
 within the PHP code? If I'm an HTML designer I'd like to create a new
 page, include templates, use some data that's been made available and
 have it all in the template. I sure as heck wouldn't want to have joe
 programmer edit the main page, add support for importing my template.
 This is the thing that bugs me about Smarty, its still got that hanging
 dependency. And it's still got to include all those templates within the
 source code.

 InterJinn is superior in this respect. You use XML tags to import other
 templates, you use XML tags to load modules and components, and you use
 XML tags to do almost any kind of expansion you want. Of course, you can
 go ahead and use something else, InterJinn provides the ability to plug
 in custom compilers. InterJinn compiles to PHP code, includes are
 INCLUDED at compile time not at run time. So given this scheme anyone
 working on the HTML is already familiar with the syntax... hard to go
 wrong with:

 jinn:template path=topnav.template/

 Hell you can even overload HTML tags. Not only that but Interjinn allows
 recursive includes of templates and source files, and these includes can
 be relative to the outer 

Re: [PHP] PHP vs. Outlook problem

2004-04-08 Thread Jason Wong
On Thursday 08 April 2004 15:30,  wrote:

 I got a problem to send a confirmation mail from my Website to auto reply
 every new registrator . Due to the ISP mail server resist any Web Mail
 function but personal mailing permitted only through Outlook .

If the server on which your website is hosted has port 25 open then you can 
use the smtp mail class found at www.phpclasses.org.

NB you cannot get your website to send mail via Outlook, pursuing that path 
would be futile.

-- 
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
--
/*
There is a natural hootchy-kootchy to a goldfish.
-- Walt Disney
*/

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



[PHP] PHP-GTK mailing list

2004-04-08 Thread Cosmin
sorry for the off topic but i didn't knew where to ask this. 
does anyone know what's happening with the php-gtk mailing list. I
haven't received a message for more than a month now and any message
that i try to send comes back saying 

Hi. This is the qmail-send program at pb1.pair.com.
I'm afraid I wasn't able to deliver your message to the following
addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
[EMAIL PROTECTED]:
Unable to open .qmail-php-gtk-general: access denied. (#4.3.0)
I'm not going to try again; this message has been in the queue too
long.


sorry again for the off topic but I hope that one of the persons who's
in charge of the php-gtk mailing list will read this message and
hopefully fix this problem

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



[PHP] page design and possible conflict??

2004-04-08 Thread Andy B
hi..

this might be sort of ot and out of the range of the list but i had a site
design question: is it an absolute no no to put inset borders 3px wide
around EVERY table on the section of the site?? im trying to make an
attempt at making the site have some sort of layout standards and that
happen to be one of the new changes (my part) the site owner liked.. i didnt
think there was any huge rule for that as long as everybody could still use
the page...
possible conflict: the main person doing the site doesnt like it when there
are borders around any table at all and i was already told by him not to do
that or my stuff wont get added?? even though i was paid before i finished
the work *stress* dont know what to do...

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



[PHP] Can't get anything outside PHP

2004-04-08 Thread Nunners
Hi Folks,

Yes, that strange heading is exactly what it says

I'm trying to get a procedure working that takes a feed from an XML page,
and puts it into English... that should be common sense, but I can't seem to
get anything from my server

I've installed Apache on Win XP, with PHP, and tried installing PEAR, but
that doesn't want to work, even using a file that I know works from another
server; I've tried various ones from the web, but to no avail.

Whenever I run scripts that try and get anything, either Pea or otherwise,
it just comes up with a blank page, or anything that is not HTML.  I know
PHP is working because I've got other scripts running, and even added silly
things like an echo(Date()); on every other line ... but still nothing from
the XML side of things.

Have I missed something silly (:probably:)

Someone help!
Please

Nunners

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



RE: [PHP] smarty

2004-04-08 Thread Aaron Wolski


 -Original Message-
 From: Kelly Hallman [mailto:[EMAIL PROTECTED] 
 Sent: April 7, 2004 11:51 PM
 To: John W. Holmes
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] smarty
 
 
 Apr 7 at 10:22pm, John W. Holmes wrote:
   Uhhh, yeah--that's not templating, that's called spaghetti code :)
  
  +1 - Use of buzzword
 
 Right about here I could sense where this was going I 
 don't know, what would you call it? Is there a non-buzzword 
 term you'd be happier with?  
 That term predates PHP by a number of years, so I'm not sure 
 about buzz...
 
   For a designer or non-coder, Smarty will be easier to learn than 
   PHP.
  
  You must work with some real idiots.
 
 Sigh... you must work with some really lousy designers!
 
  You can teach them to write {$variable} but you can't teach them to 
  write ?=$variable? ?? Give your people some credit. If they can 
  learn {section name=foo loop=2 show=TRUE}{/section}, then 
 they can 
  learn for($x=0;$x2;$x++){ }, can't they??
 
 Sure, they could. However, take a look at all the newbie 
 questions on this list. Maybe you've got time for all that 
 hand holding.. but Smarty is a lot closer to HTML, which many 
 of them already know.
 
  I'm sorry, but if Smarty takes your template and turns it 
 into code
  like the example above, EXACTLY what limitations are you 
 going to run 
  into using the method above that Smarty solves?
 
 How about the limitation of lack of infinite time? Seriously 
 man, it's a tool. If you think that I was claiming Smarty 
 auto-magically did things you couldn't do with PHP, you need 
 to pay more attention...
 
  Fight it all you want, but PHP is a templating engine, too. That was
  it's original purpose. And again, what power of Smarty 
 are we missing 
  if Smarty just turns the template back into PHP code, anyhow?
 
 Fight what? If you call inline code and variables a 
 templating engine, I can see why you don't get it. PHP can 
 serve a templating purpose, but it doesn't greatly facilitate 
 that out of the box. It's not a strategy.
 
 I don't want to get into a tit-for-tat, but there are a lot 
 of things that Smarty makes much easier and more flexible 
 than coding straight PHP:
 
 The ease of developing and applying different types of 
 template plugins, the ability to dynamically attach arbitrary 
 functions as template plugins, extending the Smarty class to 
 encapsulate methods to control more complex 
 template functionalities.. the list goes on..
 
 Please read the next sentence twice. You can do it all with 
 plain PHP, but I can do it much faster with Smarty, which is 
 merely a TOOL.
 
   In other words: are your template designers already good PHP 
   programmers? It's not just hype, it solves real problems, even if 
   you don't have them.
  
  You can either teach your designers the Smarty language or you can 
  teach
  them PHP. Which one will set them up for success?
 
 Again, very much not the point.
 
  Now, all that being said, I am a fan of Smarty and use it in some 
  applications. But, there's no reason you can't use straight PHP and 
  achieve the same results by simply separating presentation 
 logic from 
  your code.
 
 It's clear you're just trying to be antagonistic, so I won't 
 beleaguer the point. I have a strong understanding of PHP, 
 and I myself find Smarty easier to work with from a template 
 design standpoint.
 
 Please feel free to call me a total idiot, question my 
 intelligence, belittle me or the people I work with, and 
 other side topics relating to the technical merits of Smarty 
 or the use of templating systems.
 
 I found it really educational and enriching.
 Thanks for your contribution.
 
 
 PS: I think this is tired at this point; thank you to Justin 
 for a thoughtful response that reassured me it was still a 
 discussion. I realize that many PHP 'experts' (let's call 
 them) may find different solutions that suit them 
 differently. People have different levels and different 
 needs. I personally like Smarty, and Smarty was the original 
 topic of the thread. I'm open to ideas, but going back to 
 mixing PHP and HTML is not a new idea nor a true templating 
 system, and there are valid reasons I sought out a more 
 comprehensive approaches after doing it that way for many 
 years. I found much benefit in Smarty, and hope others will too.

I don't think this thread is tired. As someone who is about to dive into
learning templating more than what I do now and with greater flexability
and success, I've enjoyed the banter between everyone about the merits
of Smarty and other templating engines.

I'll be frank with this next comment and say to you, Kelly, that it was
fine and dandy for you to be antagonistic and demeaning with your tone
towards Justin French when he commented that PHP, itself, IS a
templating engine, but when John turned the tables in regards to those
remarks made you get very defensive and ornery as illustrated in this
email.

I want to learn more about Smarty 

Re: [PHP] page design and possible conflict??

2004-04-08 Thread Andy B
dont know what his deal is but ok will close this idea now i guess..

- Original Message - 
From: Miles Thompson [EMAIL PROTECTED]
To: Andy B [EMAIL PROTECTED]
Sent: Thursday, April 08, 2004 7:41 AM
Subject: Re: [PHP] page design and possible conflict??


 You're right, ot  out of range.
 Seems to be an issue of taste and control.
 Could this be because the person in charge is confusing CSS borders with
 padding?
 MT
 At 07:19 AM 4/8/2004 -0400, you wrote:
 hi..
 
 this might be sort of ot and out of the range of the list but i had a
site
 design question: is it an absolute no no to put inset borders 3px wide
 around EVERY table on the section of the site?? im trying to make an
 attempt at making the site have some sort of layout standards and that
 happen to be one of the new changes (my part) the site owner liked.. i
didnt
 think there was any huge rule for that as long as everybody could still
use
 the page...
 possible conflict: the main person doing the site doesnt like it when
there
 are borders around any table at all and i was already told by him not to
do
 that or my stuff wont get added?? even though i was paid before i
finished
 the work *stress* dont know what to do...
 
 --
 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] start/stop deamon

2004-04-08 Thread CurlyBraces Technologies \( Pvt \) Ltd



can some body tell me how to start/stop a deamon ( 
eg: dhcpd ) from php ?
and also can v apply that same method to start/stop 
a some script by php ?

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

RE: [PHP] start/stop deamon

2004-04-08 Thread Jay Blanchard
[snip]


can some body tell me how to start/stop a deamon ( eg: dhcpd )
from php ?
and also can v apply that same method to start/stop a some
script by php ? 
 
[/snip]
 
http://www.php.net/exec 
 



RE: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread Hundiak, Arthur
Builtin functions in php5 will not throw exceptions.  The basic idea is that
exceptions are part of the OOP portion of PHP.  What you will need to do is
to wrap these functions into classes.  Fortunately, many existing class
libraries such as PEAR can be tweaked to throw exceptions with little or no
effort.

I want to write:
...
$res = some_builtin_func(); // func raises exception on error
...

So will PHP5 (or future versions) work as in my 2nd example?

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



Re: [PHP] page design and possible conflict??

2004-04-08 Thread Red Wingate
ok

Am Donnerstag, 8. April 2004 14:45 schrieb Andy B:
 dont know what his deal is but ok will close this idea now i guess..

 - Original Message -
 From: Miles Thompson [EMAIL PROTECTED]
 To: Andy B [EMAIL PROTECTED]
 Sent: Thursday, April 08, 2004 7:41 AM
 Subject: Re: [PHP] page design and possible conflict??

  You're right, ot  out of range.
  Seems to be an issue of taste and control.
  Could this be because the person in charge is confusing CSS borders with
  padding?
  MT
 
  At 07:19 AM 4/8/2004 -0400, you wrote:
  hi..
  
  this might be sort of ot and out of the range of the list but i had a

 site

  design question: is it an absolute no no to put inset borders 3px wide
  around EVERY table on the section of the site?? im trying to make an
  attempt at making the site have some sort of layout standards and that
  happen to be one of the new changes (my part) the site owner liked.. i

 didnt

  think there was any huge rule for that as long as everybody could still

 use

  the page...
  possible conflict: the main person doing the site doesnt like it when

 there

  are borders around any table at all and i was already told by him not to

 do

  that or my stuff wont get added?? even though i was paid before i

 finished

  the work *stress* dont know what to do...
  
  --
  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] smarty

2004-04-08 Thread Kelly Hallman
Apr 8 at 7:38am, Aaron Wolski wrote:
 I don't think this thread is tired. As someone who is about to dive into
 learning templating more than what I do now...

Tired in the sense that it had degenerated to a personal level that was 
uncalled for and off-topic. The merits of templating are never tired!

 I'll be frank with this next comment and say to you, Kelly, that it was
 fine and dandy for you to be antagonistic and demeaning with your tone
 towards Justin French when he commented that PHP, itself, IS a
 templating engine, but when John turned the tables in regards to those
 remarks made you get very defensive and ornery as illustrated in this

Here again, because I think it had been taken to a level that did not add
anything to the debate at hand, and was antagonistic for the sake of
antagonism. I was hardly trying to disrespect the point that Justin was
making, in fact I had no disagreement with the approach, other than that
it sold the concept of templating short by claiming that there is no
difference. If there was no difference, Smarty would not exist.

I think it is valid and important to understand that Smarty buys you
nothing you can't get with PHP. However, claiming that it's exactly the
same to use straight PHP, says to me that Smarty is either not being 
leveraged or it's true possibilities are not being realized.

There is a difference between a conscious choice by someone who is an
experienced PHP developer not to use Smarty, and someone who merely
doesn't see the leverage or purpose of the tool. Pedantic debates like
this surface regularly on topics such as OOP in PHP, to the detriment of
those looking for answers to problems they legitimately want to solve.

The reason this is frustrating is not because people should not have 
opinions or that there is nothing to be gained by expressing them. It's 
much different to say, for instance, I don't use Smarty because for my 
purposes it's the same difference to just use a straight PHP approach and 
to say PHP already does exactly this, and thus Smarty is pointless.

And thank you for your guidance in regards to my conduct. Apparently you
also read the same things INTO my message to Justin, and thus it was okay
for a third person to take it to a personal level that was out of line and
when I merely respond to that unprovoked attack, you give me the lecture.

If someone has an issue with my tone, fine. I think that's a perception or
communication issue that can be dealt with by offline clarification, or
any number of other approaches. Going off the handle is not an appropriate
response, and I think even in my defensive response I showed Mr. Holmes
a level of decorum that was completely absent in his abusive message.

I see a lot of extremely snide messages on here, and yet, I posted an
opinionated, on-topic message that did not disrespect anyone--yet managed
to raise the dander of a small group--it's then ok with you if some guy
lets go with personal invective. But not okay for me to respond. Get real.

 I want to learn more about Smarty and it's obvious we have some great
 sources here to do so. Let's get past the snide remarks and keep focused
 on educating and discussing the merits of Smarty (or another templating
 engine) so that we all benefit.

Yes, PLEASE! I regretted having to send that message, but I did so for the
same reason I responded to this one. It was personally addressing me.

Learn to discern the difference between a passionate debate and personal
attacks (not that yours was an attack, but it was unnecessary to come in
and try to call the shots on an off-topic issue that was already dead).

Please, let's get on with the relevant discussion!

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



RE: [PHP] page design and possible conflict??

2004-04-08 Thread Jason Sheets
Rather than doing something soley to comply with a standard you must sell
your client on the idea or not do it, they are the ones that ultimately must
live with the decision and be happy with it.  As a programmer it is your job
to make sure they have all the information and the pro's and cons of each
solution, after that point let your client hash it out, providing additional
information as needed. 

If you really like the way it looks provide a mockup of the front page with
the changes you are suggesting and one without the changes and explain the
benefits of your changes. 

At the end of the day after all information has been considered and a
decision has been made you are there to do what the client wants you to do,
not what you think or believe is best.

Who do you report to, the main site guy or the site owner?  If you report to
the site owner your responsibility is to him, likewise if you report to the
person doing the site it is to him.  A lot of times the maintenance person
feels like they should have got the programming job and are very resesntful
and hard to work with, if possible you should try to build a good working
relationship with him and stroke his ego a bit as the owner probably
selected him for some reason and he might have a say about future jobs and
at the least know other people in the business and positive advertising is
always good.

Jason

-Original Message-
From: Andy B [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 08, 2004 5:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] page design and possible conflict??

hi..

this might be sort of ot and out of the range of the list but i had a site
design question: is it an absolute no no to put inset borders 3px wide
around EVERY table on the section of the site?? im trying to make an
attempt at making the site have some sort of layout standards and that
happen to be one of the new changes (my part) the site owner liked.. i didnt
think there was any huge rule for that as long as everybody could still use
the page...
possible conflict: the main person doing the site doesnt like it when there
are borders around any table at all and i was already told by him not to do
that or my stuff wont get added?? even though i was paid before i finished
the work *stress* dont know what to do...

--
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] Using WinNT login

2004-04-08 Thread Alex Hogan
Hi All,

Is it possible to use the users WinNT network login for a php app?
If so can someone point me in the direction for a tutorial or directions.


Thanks,


alex hogan




** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Using WinNT login

2004-04-08 Thread Hawkes, Richard
Well, it's NTLM authentication you're after, but I'm not sure if there's a PHP
interface for it. Checked the web, and didn't get much response. It's
basically a link to the domain server.

Sorry, that wasn't much help was it?!

Richard

-Original Message-
From: Alex Hogan [mailto:[EMAIL PROTECTED]
Sent: 08 April 2004 14:38
To: PHP General list
Subject: [PHP] Using WinNT login


Hi All,

Is it possible to use the users WinNT network login for a php app?
If so can someone point me in the direction for a tutorial or directions.


Thanks,


alex hogan




** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 



==
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==

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



Re: [PHP] Using WinNT login

2004-04-08 Thread Red Wingate
Search the archive, we had this topic about a month ago and i pointed
out a quite good solution on this topic.

  -- red

 Hi All,

 Is it possible to use the users WinNT network login for a php app?
 If so can someone point me in the direction for a tutorial or directions.


 Thanks,


 alex hogan




 **
 The contents of this e-mail and any files transmitted with it are
 confidential and intended solely for the use of the individual or
 entity to whom it is addressed.  The views stated herein do not
 necessarily represent the view of the company.  If you are not the
 intended recipient of this e-mail you may not copy, forward,
 disclose, or otherwise use it or any part of it in any form
 whatsoever.  If you have received this e-mail in error please
 e-mail the sender.
 **

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



Re: [PHP] smarty

2004-04-08 Thread John W. Holmes
From: Kelly Hallman [EMAIL PROTECTED]

 Sure, they could. However, take a look at all the newbie questions on this
 list. Maybe you've got time for all that hand holding.. but Smarty is a
 lot closer to HTML, which many of them already know.

{$variable} is no more closer to HTML than ?=$variable?. Either way you
still have to teach them the templating engine langauge. That language can
either be Smarty or a specific subset of PHP functions/methods that serves
as your templating engine (like how Justin had to write the cycle()
function). If you can teach them how a {section} works, then you can teach
them how a foreach() works or write a section() function that works just the
same.

 If you call inline code and variables a templating engine, I
 can see why you don't get it. PHP can serve a templating purpose, but it
 doesn't greatly facilitate that out of the box. It's not a strategy.

Mixing PHP and HTML is not this big, bad, evil thing that should be avoided
at all cost like many people make it out to be. The key is to separate the
presentation / presentation logic and the business logic / backend code,
or whatever you want to call them. The presentation logic can either be
Smarty or PHP.

The problem is that if you use PHP, you must be very aware of what's going
on and ensuring you're keeping the two layers separate. It takes some
dedication. Smarty, however, FORCES you to keep the two layers separate and
I think that's why it's liked by many people. I personally think that Smarty
let you put _too much_ logic into the presentation layer, but everyone's
needs are different.

Smarty has two benefits to using a PHP templating solution (imo)

1. Smarty forces you to keep the presentation layer separate from your
code/business layer.
2. Caching

---John Holmes...

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



Re: [PHP] smarty

2004-04-08 Thread John Nichel
John W. Holmes wrote:
From: Kelly Hallman [EMAIL PROTECTED]

Sure, they could. However, take a look at all the newbie questions on this
list. Maybe you've got time for all that hand holding.. but Smarty is a
lot closer to HTML, which many of them already know.


{$variable} is no more closer to HTML than ?=$variable?. Either way you
still have to teach them the templating engine langauge. That language can
either be Smarty or a specific subset of PHP functions/methods that serves
as your templating engine (like how Justin had to write the cycle()
function). If you can teach them how a {section} works, then you can teach
them how a foreach() works or write a section() function that works just the
same.
This is the issue I have with things like Smarty.  No matter if I use 
PHP or Smarty, I have to 'teach' my designer how to 'code' in some 
aspect...and I've met quite a few designers who can't grasp JavaScript, 
much less Smarty or PHP.  Personally, I have the designers give me a 
HTML layout of the page to where I can cut up the HTML, and throw it 
into include files.

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using WinNT login

2004-04-08 Thread John W. Holmes
From: Alex Hogan [EMAIL PROTECTED]

 Is it possible to use the users WinNT network login for a php app?
 If so can someone point me in the direction for a tutorial or directions.

Assuming IIS, turn off anonymous access, which will force them to log in
as a user that has permission to reach the file they reqested. I believe you
can then use $_SERVER['LOGON_USER'] or something similar to find out their
username. (This also assumes an NTFS file system, but that should already be
in place).

It's the same as restricting access to any other file on Windows using the
security settings. You remove the Everyone user and give access to either
specific users or groups.

If this is confusing or I wasn't clear on something, feel free to ask more
questions.

---John Holmes...

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



RE: [PHP] Using WinNT login

2004-04-08 Thread Alex Hogan
Thanks guys...


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




[PHP] limit on ammount of generated jscript arrays

2004-04-08 Thread electroteque
Hi there i am building an app of insteading of building a list menu of
items, i am generating arrays of the data in javascript using a php class,
this is then autocompleted in a textbox. Is there a limit to how many i can
list in the page, like will it eventually slow the page down ?

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



RE: [PHP] smarty

2004-04-08 Thread Hundiak, Arthur

 From: John W. Holmes
Smarty has two benefits to using a PHP templating solution (imo)

1. Smarty forces you to keep the presentation layer separate from your
code/business layer.
2. Caching

IMHO, a critical reason for choosing a template language over PHP is
security.  Do you really want to give your template designers complete
access to your databases?  Especially if customers have the ability to
modify the templates themselves.

I personally feel Smarty is too powerful but fortunately there are dozens of
php template systems out there.

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



Re: [PHP] smarty

2004-04-08 Thread John W. Holmes
From: Hundiak, Arthur [EMAIL PROTECTED]

  From: John W. Holmes
 Smarty has two benefits to using a PHP templating solution (imo)

 1. Smarty forces you to keep the presentation layer separate from your
 code/business layer.
 2. Caching

 IMHO, a critical reason for choosing a template language over PHP is
 security.  Do you really want to give your template designers complete
 access to your databases?  Especially if customers have the ability to
 modify the templates themselves.

Very true. I had forgotten about that one. It can be seen as a feature or a
disadvantage, depending upon the person, though. Any templating engine,
that's not PHP itself, is going to restrict what the designer can do to some
extent.

---John Holmes...

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



Re: [PHP] smarty

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 10:45, John W. Holmes wrote:

 [--SNIP--]
 Any templating engine,
 that's not PHP itself, is going to restrict what the designer can do to some
 extent.

This is a pretty broad statement and is not true in general despite it's
applicability in many cases.

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

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



Re: [PHP] Exceptions and builtin functions in PHP5

2004-04-08 Thread Greg Beaver
The exception mechanism will not replace trigger_error() or function 
return values any time soon

Greg

Tumurbaatar S. wrote:
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
If I understand right, PHP5 has an exception
handling mechanism but it is only for manual using, i.e.
a programmer can use try/catch but only for own code.
PHP's built-in functions and functions from extensions still
use old return value method. Yes?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I bloody hope not or what is the point ?


In the current version of PHP, many built-in functions (if not all?)
return FALSE on an error and some resource/handle on a success.
So, instead of coding like this:
...
$res = some_builtin_func(); // func does not raise exception on error
if (!$res)
throw new Exception();// so I throw it manually
...
I want to write:
...
$res = some_builtin_func(); // func raises exception on error
// so I don't need to write additional lines
...
So will PHP5 (or future versions) work as in my 2nd example?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] limit on ammount of generated jscript arrays

2004-04-08 Thread Jay Blanchard
[snip]
Hi there i am building an app of insteading of building a list menu of
items, i am generating arrays of the data in javascript using a php
class,
this is then autocompleted in a textbox. Is there a limit to how many i
can
list in the page, like will it eventually slow the page down ?
[/snip]

Yes.

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



Re: [PHP] smarty

2004-04-08 Thread John W. Holmes
From: Robert Cummings [EMAIL PROTECTED]
 On Thu, 2004-04-08 at 10:45, John W. Holmes wrote:
 
  Any templating engine,
  that's not PHP itself, is going to restrict what the designer can do to
some
  extent.

 This is a pretty broad statement and is not true in general despite it's
 applicability in many cases.

Yeah, yeah... fine. I'm sure InterJinn doesn't limit you in any way, right?
;)

I should have known better than to use the word any and used most.

---John Holmes...

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



[PHP] header problems

2004-04-08 Thread Brent Clark
Hi All

I need to display a javascript window with some text displayed in to.
After the execution and displaying of this windows, I have two executable php script 
that perform some task for me.
After all this I need the page to direct to another page.

I keep getting this header error.

If someone know of a solution, that would be most appreciated

Here is my code:
if($read){
require_once('lib/functions.inc');
{execute the javascript window here}
exec(/var/www/html/ag.php);
exec(/var/www/html/convert_tif2pdf.php);
header(Location: capture.php);
exit;
}

Kind Regards and thank you
Brent Clark

RE: [PHP] header problems

2004-04-08 Thread Jay Blanchard
[snip]
I keep getting this header error.
[/snip]

Which header error? Like, the one where it says you can't do it again?
It is because you have caused some output somewhere prior to the
invocation of you header request to the new location. 

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



Re: [PHP] smarty

2004-04-08 Thread John Nichel
John W. Holmes wrote:
From: Robert Cummings [EMAIL PROTECTED]

On Thu, 2004-04-08 at 10:45, John W. Holmes wrote:

Any templating engine,
that's not PHP itself, is going to restrict what the designer can do to
some

extent.
This is a pretty broad statement and is not true in general despite it's
applicability in many cases.


Yeah, yeah... fine. I'm sure InterJinn doesn't limit you in any way, right?
;)
It will save you money on your car insurance.  ;)

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] smarty

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 10:59, John W. Holmes wrote:
 From: Robert Cummings [EMAIL PROTECTED]
  On Thu, 2004-04-08 at 10:45, John W. Holmes wrote:
  
   Any templating engine,
   that's not PHP itself, is going to restrict what the designer can do to
 some
   extent.
 
  This is a pretty broad statement and is not true in general despite it's
  applicability in many cases.
 
 Yeah, yeah... fine. I'm sure InterJinn doesn't limit you in any way, right?
 ;)

Technically neither does Smarty since you can put PHP code in the
templates, but since InterJinn is backed by a framework which is
accessible by the render tags, accumulator tags, and various other
mechanisms, it can leverage all of the power of PHP while still
supporting business logic separation.

 I should have known better than to use the word any and used most.

Well it's not generally like you to make gross generalizations :)

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

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



Re: [PHP] header problems

2004-04-08 Thread John W. Holmes
From: Brent Clark [EMAIL PROTECTED]

 I need to display a javascript window with some text displayed in to.
 After the execution and displaying of this windows, I have two executable
php script that perform some task for me.
 After all this I need the page to direct to another page.

Use a Javascript redirect, since displaying your javascript window is output
to the browser and you can't use header() redirection after there's been
output.

Or rethink your logic.

---John Holmes...

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



[PHP] PHP5 xslt omit-xml-declaration

2004-04-08 Thread Vincent Jansen
Does this 'omit-xml-declaration' work? (my stylesheet looks with this)

?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xsl:output method=html version=4.0 encoding=UTF-8
indent=yes omit-xml-declaration=yes/

templates..

/xsl:stylesheet


All my transformation result in a document starting with 

?xml version=1.0 encoding=UTF-8 standalone=yes?

In a browser this is ok, but when trying to pass the document to Excel
2002 the first line seems to break the readingcapabillity of excel.

How (if) can I lose this first line?

Thanks
Vincent

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



[PHP] Compare Case Insensitive?

2004-04-08 Thread Jeff Oien
How can I compare a variable submitted by a form as case
insensitive? A promotional code will be entered into a form
and it's important that they can enter the code either way.
So if I have
if ($code == 'ABC123') {

I want that to match 'aBC123' 'abc123' or whatever. Thanks.
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Ncurses example @ zend

2004-04-08 Thread Brent Clark
Hi all

a while ago I posted a request for if someone knew anything or know of example etc 
about ncurses etc
I found this

http://www.zend.com/zend/tut/tut-degan.php


Kind Regards
Brent Clark

RE: [PHP] Compare Case Insensitive?

2004-04-08 Thread Dave Avent
if (strtolower($code) == 'abc123') {

or

if (strtoupper($code) == 'ABC123') {

-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]
Sent: 08 April 2004 4:21 PM
To: PHP
Subject: [PHP] Compare Case Insensitive?


How can I compare a variable submitted by a form as case
insensitive? A promotional code will be entered into a form
and it's important that they can enter the code either way.
So if I have

if ($code == 'ABC123') {

I want that to match 'aBC123' 'abc123' or whatever. Thanks.
Jeff

-- 
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] Compare Case Insensitive?

2004-04-08 Thread Richard Harb
let's see:
eregi()
preg_match()
strtolower()
... either one could help you
probably fastest is convert the user string to lower case and compare
... or upper case .. your choice.
Damn. so many options.

Thursday, April 8, 2004, 5:21:15 PM, you wrote:

 How can I compare a variable submitted by a form as case
 insensitive? A promotional code will be entered into a form
 and it's important that they can enter the code either way.
 So if I have

 if ($code == 'ABC123') {

 I want that to match 'aBC123' 'abc123' or whatever. Thanks.
 Jeff

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



Re: [PHP] Compare Case Insensitive?

2004-04-08 Thread Ryan Gibson
You could set your input string to upper case, then make all your
comparisons in upper case

http://www.php.net/manual/en/function.strtoupper.php

On 8/4/04 4:21 pm, Jeff Oien [EMAIL PROTECTED] wrote:

 How can I compare a variable submitted by a form as case
 insensitive? A promotional code will be entered into a form
 and it's important that they can enter the code either way.
 So if I have
 
 if ($code == 'ABC123') {
 
 I want that to match 'aBC123' 'abc123' or whatever. Thanks.
 Jeff

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



[PHP] Re: Newbie question about operators

2004-04-08 Thread Gabe
Thanks Ligaya


Ligaya Turmelle [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 it is refering to the associative array, specifically the $key = $value .
 Note here (http://www.php.net/manual/en/language.types.array.php).

 Respectfully,
 Ligaya Turmelle

 Gabe [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Looking at the code below, what exactly is happening with the
 $name=$value
  part?  I looked in the PHP online documentation and I can't find that
  operator.  What is it doing exactly and what is it called?
 
  foreach ($some_array as $name=$value)
  {
   ... some code ...
  }
 
  Thanks alot!

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



Re: [PHP] Compare Case Insensitive?

2004-04-08 Thread John W. Holmes
From: Jeff Oien [EMAIL PROTECTED]

 How can I compare a variable submitted by a form as case
 insensitive? A promotional code will be entered into a form
 and it's important that they can enter the code either way.

strcasecmp(): http://us2.php.net/strcasecmp

or 

strtoupper($string) == 'ABC123'

---John Holmes...

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



Re: [PHP] smarty

2004-04-08 Thread John Nichel
Robert Cummings wrote:
Yeah, yeah... fine. I'm sure InterJinn doesn't limit you in any way, right?
;)
It will save you money on your car insurance.  ;)


And people wonder why I feel the need once in while to give you a good
kick in the teeth for being a hypocrite and idiot. This is completely
off-topic and let me remind you of your past need to bring your better
than thou attitude to bear on other posters in the form of
chastisement. Also these snide remarks are typical of most trolls.
Understandably you are a troll, and well, not really worth engaging in
conversation.
What I find curious is what drives your need to target me so often? Are
you angry that I make references to InterJinn? Do you have a problem
when I use it as an example or a point in debate? Really, WHAT IS YOUR
PROBLEM? Please get over it!
Cheers,
your buddy,
Rob.
Actually 'buddy', I made a little joke to add some levity to a topic 
which seems to be teetering on the edge of personal discussion and 
personal attacks (maybe you missed the little wink ;) ).  Guess we see 
which side of the fence you seem to be on at the moment.  STFA 'buddy' 
and you'll see that I make these little jokes from time to time, and 
only once before had one of those jokes been directed towards InterJinn 
(remember, it would simonize your car...which you even joked with).  But 
no matter, I'll be your troll...you big bad Internet tough guy you. 
Have a good one, 'buddy'.

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] smarty

2004-04-08 Thread Richard Davey
Hello Robert,

Thursday, April 8, 2004, 4:19:10 PM, you wrote:

RC And people wonder why I feel the need once in while to give you a good
[snipo]
RC when I use it as an example or a point in debate? Really, WHAT IS YOUR
RC PROBLEM? Please get over it!

Whoa Robert, chill out a bit, please! He was only joking, the smiley
should have given it away. I can understand where you are coming from
(being the author 'n all), but I think you may have read into that a
wee bit too much.

Peace people, it's nearly the weekend (unless you live here, in which
case you have tomorrow off anyway :) ... smarty/InterJinn/native
PHP/whatever - pick the one that floats your boat and go sail in it.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] smarty

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 11:45, John Nichel wrote:
 Robert Cummings wrote:
 Yeah, yeah... fine. I'm sure InterJinn doesn't limit you in any way, right?
 ;)
 
 It will save you money on your car insurance.  ;)
  
  
  And people wonder why I feel the need once in while to give you a good
  kick in the teeth for being a hypocrite and idiot. This is completely
  off-topic and let me remind you of your past need to bring your better
  than thou attitude to bear on other posters in the form of
  chastisement. Also these snide remarks are typical of most trolls.
  Understandably you are a troll, and well, not really worth engaging in
  conversation.
  
  What I find curious is what drives your need to target me so often? Are
  you angry that I make references to InterJinn? Do you have a problem
  when I use it as an example or a point in debate? Really, WHAT IS YOUR
  PROBLEM? Please get over it!
  
  Cheers,
  your buddy,
  Rob.
 
 Actually 'buddy', I made a little joke to add some levity to a topic 
 which seems to be teetering on the edge of personal discussion and 
 personal attacks (maybe you missed the little wink ;) ).  Guess we see 
 which side of the fence you seem to be on at the moment.  STFA 'buddy' 
 and you'll see that I make these little jokes from time to time, and 
 only once before had one of those jokes been directed towards InterJinn 
 (remember, it would simonize your car...which you even joked with).  But 
 no matter, I'll be your troll...you big bad Internet tough guy you. 
 Have a good one, 'buddy'.

Yes once is humour, and I met it with humour, but your consistency of
jabbing makes it more than humourous. It tends to make me think you have
some other agenda. And NO, a smiley face doesn't make me have to like
it, especially considering our past history where there is obviously no
love, which only strengthens the argument that you are being an ass. And
I have no need to STFA, I am quite aware of what you have said in the
past, my memory isn't currently failing me.

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

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



Re: Re[2]: [PHP] smarty

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 11:50, Richard Davey wrote:
 Hello Robert,
 
 Thursday, April 8, 2004, 4:19:10 PM, you wrote:
 
 RC And people wonder why I feel the need once in while to give you a good
 [snipo]
 RC when I use it as an example or a point in debate? Really, WHAT IS YOUR
 RC PROBLEM? Please get over it!
 
 Whoa Robert, chill out a bit, please! He was only joking, the smiley
 should have given it away. I can understand where you are coming from
 (being the author 'n all), but I think you may have read into that a
 wee bit too much.

In real life as well as in internet messages, a smiley isn't always a
smiley, and I doubt his was meant as a smiley as much as a snide smirk.

 Peace people, it's nearly the weekend (unless you live here, in which
 case you have tomorrow off anyway :) ... smarty/InterJinn/native
 PHP/whatever - pick the one that floats your boat and go sail in it.

Have a good holiday :)

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

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



[PHP] PHP XML

2004-04-08 Thread Chris Boget
Could someone point me in the right direction to learn how I can 
programatically validate a XML document against a XML schema?  
I've looked through the documentation but was unable to find any
thing of any relevance (or so my xml newbie mind thought).

thnx,
Chris

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



[PHP] http referrer

2004-04-08 Thread Chris Bruce
I apologize for my ignorance, but I am trying to find a way to grab the 
referring url. I can't seem to find the environment variable to do 
this. Does anyone know how to grab this?

Thanks.

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.


Re: [PHP] http referrer

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 12:22, Chris Bruce wrote:
 I apologize for my ignorance, but I am trying to find a way to grab the 
 referring url. I can't seem to find the environment variable to do 
 this. Does anyone know how to grab this?
 

HTTP_REFERER. Someone spelled it wrong a long time ago and it stuck :)

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

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



Re: [PHP] http referrer

2004-04-08 Thread John Nichel
Chris Bruce wrote:
I apologize for my ignorance, but I am trying to find a way to grab the 
referring url. I can't seem to find the environment variable to do this. 
Does anyone know how to grab this?

Thanks.
$_SERVER['HTTP_REFERER']

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] http referrer

2004-04-08 Thread Chris Bruce
Damn! It can't be that easy ;) But, yes, it works. Thanks a bunch.

--

Chris Bruce
[EMAIL PROTECTED]
Idextrus
E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
On Apr 8, 2004, at 12:25 PM, Robert Cummings wrote:

On Thu, 2004-04-08 at 12:22, Chris Bruce wrote:
I apologize for my ignorance, but I am trying to find a way to grab 
the
referring url. I can't seem to find the environment variable to do
this. Does anyone know how to grab this?

HTTP_REFERER. Someone spelled it wrong a long time ago and it stuck :)

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


Re: [PHP] http referrer

2004-04-08 Thread John W. Holmes
From: Chris Bruce [EMAIL PROTECTED]

 I apologize for my ignorance, but I am trying to find a way to grab the 
 referring url. I can't seem to find the environment variable to do 
 this. Does anyone know how to grab this?

$_SERVER['HTTP_REFERER']

print_r($_SERVER) will tell you for sure.

---John Holmes...

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



Re: [PHP] (new question on this) http referer

2004-04-08 Thread Joe Szilagyi
Just a follow up on this one--I've seen where consistently that
$HTTP_REFERER will only show local referers, but not stuff from other
sites/hostnames. This is on mod_php... any workaround for that?

Regards,
Joe





- Original Message - 
From: John W. Holmes [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]; Chris Bruce [EMAIL PROTECTED]
Sent: Thursday, April 08, 2004 12:30 PM
Subject: Re: [PHP] http referrer


From: Chris Bruce [EMAIL PROTECTED]

 I apologize for my ignorance, but I am trying to find a way to grab the
 referring url. I can't seem to find the environment variable to do
 this. Does anyone know how to grab this?

$_SERVER['HTTP_REFERER']

print_r($_SERVER) will tell you for sure.

---John Holmes...

-- 
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] (new question on this) http referer

2004-04-08 Thread Duncan Hill
On Thursday 08 April 2004 17:31, Joe Szilagyi wrote:
 Just a follow up on this one--I've seen where consistently that
 $HTTP_REFERER will only show local referers, but not stuff from other
 sites/hostnames. This is on mod_php... any workaround for that?

Referrer is a function of the browser.  If it chooses to not give it to you, 
you don't get it.  Proxomitron, at one point, shipped with a setting that 
gave the browser as SpaceBison, and the referrer as the URL being visited.

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



Re: [PHP] (new question on this) http referer

2004-04-08 Thread Curt Zirzow
* Thus wrote Joe Szilagyi ([EMAIL PROTECTED]):
 Just a follow up on this one--I've seen where consistently that
 $HTTP_REFERER will only show local referers, but not stuff from other
 sites/hostnames. This is on mod_php... any workaround for that?

Its up to the web browser to decide if it is going to send the
referrer.  In most cases, any time a user clicks on a link or loads
a file within a page, the referrer is sent, even from other sites.


Curt.

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



Re: [PHP] (new question on this) http referer

2004-04-08 Thread John Nichel
Joe Szilagyi wrote:
Just a follow up on this one--I've seen where consistently that
$HTTP_REFERER will only show local referers, but not stuff from other
sites/hostnames. This is on mod_php... any workaround for that?
Regards,
Joe
The referrer is sent by the referring machine.  If that machine isn't 
setting it, you can't get it.  If memory serves, I think I remember 
someone claiming that this could also be blocked at a firewall...don't 
know if that's true or not though.

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Auto-acks on posting.

2004-04-08 Thread Duncan Hill
Anyone else getting auto-acks from [EMAIL PROTECTED] and 
[EMAIL PROTECTED], originating on host76.ipowerweb.com 
when they post here?

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



[PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Shaun
Hi,

I am trying to create a regular expression for a mobile phone number. The
number must be 12 digits long(0-9) and begin with 447 and have no spaces. So
far I have come up with this but it keeps telling me the number is invalid
even when its correct!

$regexp = /447[0-9]{9}/;
  if($_POST[mobile_number] != ''){
if(preg_match( $regexp, $_POST[mobile_number] )){
  $error = Invalid Mobile Number;
  header(Location:
edit_rep.php?error=$errorrep_id=.$_GET[rep_id].client_id=.$_GET[client_
id].rep_name=.$_GET[rep_name].client_name=.$_GET[client_name].);
 exit;
  }
}

I would be most grateful for any advice offered.

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



Re: [PHP] Auto-acks on posting.

2004-04-08 Thread Arthur Radulescu
Yes I get the same emails here

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



[PHP] Use PHP to copy MySQL tables

2004-04-08 Thread Robb Kerr
Is there an easy way to create an HTML page that uses PHP to copy selected
MySQL tables to backup copies on the same MySQL server? I want to create an
administration page for my client to be able to backup their database
whenever they see fit. But, I can't give them direct access to the MySQL
server and don't want them backing up to their hard drive. I prefer to
simply copy the tables to backup versions on the server so that if
problems arise, I can log into the server and simply copy the backups to
the originals.

Thanx in advance.
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] Auto-acks on posting.

2004-04-08 Thread John Nichel
Duncan Hill wrote:
Anyone else getting auto-acks from [EMAIL PROTECTED] and 
[EMAIL PROTECTED], originating on host76.ipowerweb.com 
when they post here?

Yeah.  An admin needs to remove those from the list.  For the time 
being, I just have anything coming from those addresses going to /dev/null

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ '  \ * 737 Main St. *
* |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150   *
*  |___/   * Buffalo, NY  *
* http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Auto-acks on posting.

2004-04-08 Thread Duncan Hill
On Thursday 08 April 2004 17:35, Arthur Radulescu wrote:
 Yes I get the same emails here

Ho hum, then into the bit bucket they go.

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



Re: [PHP] (new question on this) http referer

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 12:36, Duncan Hill wrote:
 On Thursday 08 April 2004 17:31, Joe Szilagyi wrote:
  Just a follow up on this one--I've seen where consistently that
  $HTTP_REFERER will only show local referers, but not stuff from other
  sites/hostnames. This is on mod_php... any workaround for that?
 
 Referrer is a function of the browser.  If it chooses to not give it to you, 
 you don't get it.  Proxomitron, at one point, shipped with a setting that 
 gave the browser as SpaceBison, and the referrer as the URL being visited.

Opera let's you choose whether to send the referrer or not. it also lets
you specify the browser to send so that you can trick some sites that
are poorly implemented (or restrictively) to think you are using IE.

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

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



Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Michal Migurski
I am trying to create a regular expression for a mobile phone number. The
number must be 12 digits long(0-9) and begin with 447 and have no spaces.
So far I have come up with this but it keeps telling me the number is
invalid even when its correct!

Try this:

$regexp = /447[0-9]{9}/;
  if($_POST[mobile_number] != ''){
if(!preg_match( $regexp, $_POST[mobile_number] )){
  $error = Invalid Mobile Number;
  
header(Location:edit_rep.php?error=$errorrep_id=.$_GET[rep_id].client_id=.$_GET[client_id].rep_name=.$_GET[rep_name].client_name=.$_GET[client_name].);
 exit;
  }
}

Also, your regexp is a little permissive; you can anchor it like so:

$regexp = /^447[0-9]{9}$/;

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

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



Re[2]: [PHP] (new question on this) http referer

2004-04-08 Thread Richard Davey
Hello Robert,

Thursday, April 8, 2004, 5:55:05 PM, you wrote:

RC Opera let's you choose whether to send the referrer or not. it also lets
RC you specify the browser to send so that you can trick some sites that
RC are poorly implemented (or restrictively) to think you are using IE.

and Norton Internet Security will block this information by default
(apparently it's a privacy thing).

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



RE: [PHP] (new question on this) http referer

2004-04-08 Thread Pablo Gosse
snip
The referrer is sent by the referring machine.  If that machine isn't 
setting it, you can't get it.  If memory serves, I think I remember 
someone claiming that this could also be blocked at a firewall...don't 
know if that's true or not though.
/snip

Yup, certain firewalls either mangle the HTTP_REFERER such that it
appears it was sent by Elmer Fudd, showing up as HTTP_WEFERER, and
others just eliminate it altogether.

At any rate, if you're relying on HTTP_REFERER to make sure a script is
being called from a certain location, I don't think it's very reliable.

Does anyone have any ideas as to a workaround for this?

Cheers,
Pablo

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



[PHP] Hiding email address from Robots ??

2004-04-08 Thread news
Looking for opinions before I start using this to hide the email address on
a page

$nx = username;
$sx = domain;
$mx = [EMAIL PROTECTED];

Then mailto:? echo $mx ?

Hopefully a Robot would read the address as the result of $mx, which is
totally useless - but it seems too easy.

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



Re: [PHP] PHP based Voice Chat Module

2004-04-08 Thread Pushpinder Singh
There are versions out there but they r for windoze only /// I was 
looking for Mac / Open Source implementations.

thanks



On Wednesday, April 7, 2004, at 07:15 PM, DvDmanDT wrote:

Hmm.. I'm pretty sure you can get Flash for Mac..

--
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
Pushpinder Singh [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
Thanks Raditha,

 Yes we are primarily looking at a PHP chat module which will 
allow
us conduct an audio conference. I know there are Flash Voice Chat
versions but they are all for Windoze... we are primarily a MAC
environment and our hosting company uses LINUX.

Please advise on the best course of action //  Thanks again

--Pushpinder



On Wednesday, April 7, 2004, at 12:06 PM, Raditha Dissanayake wrote:

Pushpinder Singh wrote:

Hello everyone,

 I was wondering if anyone has used any PHP/MySQL based voice chat
system. (for MAC OS X Platform)
What kind of voice chat are you talking about? are you refering to 
one
user saying something into the microphone that the other users hears?
If so php is not the best way to do it.




--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions
--
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] Hiding email address from Robots ??

2004-04-08 Thread Jason Giangrande
news wrote:
Looking for opinions before I start using this to hide the email address on
a page
$nx = username;
$sx = domain;
$mx = [EMAIL PROTECTED];
Then mailto:? echo $mx ?

Hopefully a Robot would read the address as the result of $mx, which is
totally useless - but it seems too easy.
Perhaps I'm missing something (and if I am, please let me know), but how 
would [EMAIL PROTECTED] be totally useless to email harvesting robots?  If 
$nx was 'user' and $sx was 'example.com'.  The mailto would be displayed 
as 'mailto:[EMAIL PROTECTED]' which any mail robot will clearly be able 
to use.  Any robots will not read the page until all PHP code has run 
and returned the page as complete html.

--
Jason Giangrande [EMAIL PROTECTED]
http://www.giangrande.org
http://www.dogsiview.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] (new question on this) http referer

2004-04-08 Thread Richard Davey
Hello Pablo,

Thursday, April 8, 2004, 6:32:06 PM, you wrote:

PG At any rate, if you're relying on HTTP_REFERER to make sure a script is
PG being called from a certain location, I don't think it's very reliable.

PG Does anyone have any ideas as to a workaround for this?

There are probably better, but I did come up with something
specifically for this a while ago:

Basically all form input went via a redirect script first.

Form 1 (in the users browser) submits everything to a PHP script that
does nothing but suck in all of the $_POST values and then itself
redirects this to the actual PHP processing script it was meant for.
It redirects using an HTTP header and POSTing all of the form values
it had received originally. When developing I used the Snoopy class to
handle this for me.

It works for 2 reasons (1) you ALWAYS know the IP address of the
script you are receiving the data from (because it's the same server*)
and (2) the redirect script can also add an extra POST variable that
identifies it is from a secure source (perhaps a private key, or md5
hash or similar). Or it could use your own HTTP headers or User Agent
for further checks.

* although it doesn't have to be

Downsides:

Your site is effectively processing all form data twice. Depending on
traffic/size of forms/etc this probably isn't desirable.

But, it does actually work and AFAIK cannot be easily spoofed.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: Hiding email address from Robots ??

2004-04-08 Thread Micheal Isaacson
Actually, a robot will read the html it generates, so this won't really
help.  However, if you store your adresses as character codes ( ie a space
is %20) and not just text, most robots have a hard time reading them.


News [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Looking for opinions before I start using this to hide the email address
on
 a page

 $nx = username;
 $sx = domain;
 $mx = [EMAIL PROTECTED];

 Then mailto:? echo $mx ?

 Hopefully a Robot would read the address as the result of $mx, which is
 totally useless - but it seems too easy.

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



[PHP] Pinging an IP without using exec or system

2004-04-08 Thread Micheal Isaacson
I am running scripts on a host that does not allow arbatrary commands to run
via exec() or system().  However, I need to be able to test and see if an IP
is active, basically ping it.  I have only been able to find example scripts
that use exec ot system to do the ping. Is there a way I can do a ping with
something like fsockopen?  I tried doing @fsockopen($ip, 7, $errno,
$errstr, 10); which connects to the echo port for TCP, however it fails on
many IPs I can ping successfully.  Any suggestions?

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



Re: Re[2]: [PHP] (new question on this) http referer

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 13:54, Richard Davey wrote:
 Hello Pablo,
 
 Thursday, April 8, 2004, 6:32:06 PM, you wrote:
 
 PG At any rate, if you're relying on HTTP_REFERER to make sure a script is
 PG being called from a certain location, I don't think it's very reliable.
 
 PG Does anyone have any ideas as to a workaround for this?
 
 There are probably better, but I did come up with something
 specifically for this a while ago:
 
 Basically all form input went via a redirect script first.
 
 Form 1 (in the users browser) submits everything to a PHP script that
 does nothing but suck in all of the $_POST values and then itself
 redirects this to the actual PHP processing script it was meant for.
 It redirects using an HTTP header and POSTing all of the form values
 it had received originally. When developing I used the Snoopy class to
 handle this for me.
 
 It works for 2 reasons (1) you ALWAYS know the IP address of the
 script you are receiving the data from (because it's the same server*)
 and (2) the redirect script can also add an extra POST variable that
 identifies it is from a secure source (perhaps a private key, or md5
 hash or similar). Or it could use your own HTTP headers or User Agent
 for further checks.
 
 * although it doesn't have to be
 
 Downsides:
 
 Your site is effectively processing all form data twice. Depending on
 traffic/size of forms/etc this probably isn't desirable.
 
 But, it does actually work and AFAIK cannot be easily spoofed.

I don't think this works in general. For instance some ISPs can have the
user's IP change between page requests (incuding redirects). AOL is an
example of such and ISP.

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

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



Re[4]: [PHP] (new question on this) http referer

2004-04-08 Thread Richard Davey
Hello Robert,

Thursday, April 8, 2004, 7:04:24 PM, you wrote:

RC I don't think this works in general. For instance some ISPs can have the
RC user's IP change between page requests (incuding redirects). AOL is an
RC example of such and ISP.

That doesn't make any difference in this instance.

scriptA receives the POST data
scriptA then in turns POSTs that to scriptB which outputs the result
back to a variable in scriptA
scriptA displays it, effectively - the proper page

At no point has the user been redirected anywhere.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Serializing objects and storing them is sessions

2004-04-08 Thread Jason Giangrande
I'm having a problem unserializing objects that are passed from page to 
page with sessions.  Registered globals is disabled so I am using the 
$_SESSION array to store session variable and am not using 
session_register().  Here's what I'm doing.

On first page:

$auth = new Class();
session_start();
$_SESSION['auth'] = serialize($auth);
Second page:

session_start();
var_dump($_SESSION);
$auth = unserialize($_SESSION['auth']);
var_dump($auth);
When I var_dump() $_SESSION it appears to be a string representation of 
the object.  However, when I try to unserialize() it and store it in 
$auth the value is bool(false) and not an object.

Can anyone tell me what I am doing wrong?

Thanks,
--
Jason Giangrande [EMAIL PROTECTED]
http://www.giangrande.org
http://www.dogsiview.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Re[4]: [PHP] (new question on this) http referer

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 14:07, Richard Davey wrote:
 Hello Robert,
 
 Thursday, April 8, 2004, 7:04:24 PM, you wrote:
 
 RC I don't think this works in general. For instance some ISPs can have the
 RC user's IP change between page requests (incuding redirects). AOL is an
 RC example of such and ISP.
 
 That doesn't make any difference in this instance.
 
 scriptA receives the POST data
 scriptA then in turns POSTs that to scriptB which outputs the result
 back to a variable in scriptA
 scriptA displays it, effectively - the proper page
 
 At no point has the user been redirected anywhere.

Aaah ok. That makes more sense to me :) Sorry was confused by the use of
the word redirect. Thought you were redirecting the user to an alternate
script with the reposted data. I'm not sure I understand how this is
more secure since isn't the data as valid as the first time it was
posted?

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

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



Re[6]: [PHP] (new question on this) http referer

2004-04-08 Thread Richard Davey
Hello Robert,

Thursday, April 8, 2004, 7:13:27 PM, you wrote:

RC Aaah ok. That makes more sense to me :) Sorry was confused by the use of
RC the word redirect. Thought you were redirecting the user to an alternate
RC script with the reposted data. I'm not sure I understand how this is
RC more secure since isn't the data as valid as the first time it was
RC posted?

It's not about the validity of data, that is handled by the receiving
script - it's about knowing for sure WHERE that form data came from in
the first place. For example it would stop something along the lines
of a user downloading your form, modifying some values and then
posting it from their local box. It could also stop another web-site
automatically posting data to your forms should they mask the referer
value.

Hope that makes more sense.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: Re[6]: [PHP] (new question on this) http referer

2004-04-08 Thread Robert Cummings
On Thu, 2004-04-08 at 14:19, Richard Davey wrote:
 Hello Robert,
 
 Thursday, April 8, 2004, 7:13:27 PM, you wrote:
 
 RC Aaah ok. That makes more sense to me :) Sorry was confused by the use of
 RC the word redirect. Thought you were redirecting the user to an alternate
 RC script with the reposted data. I'm not sure I understand how this is
 RC more secure since isn't the data as valid as the first time it was
 RC posted?
 
 It's not about the validity of data, that is handled by the receiving
 script - it's about knowing for sure WHERE that form data came from in
 the first place. For example it would stop something along the lines
 of a user downloading your form, modifying some values and then
 posting it from their local box. It could also stop another web-site
 automatically posting data to your forms should they mask the referer
 value.
 
 Hope that makes more sense.

Sorry, by validity of the data I meant validity of location. I'm not
sure though that you can validate location using your technique since
the first script retrieves all of the POSTed data and then forwards it
along to the second processing script. How does the second script gain
new information over the first? Doesn't it receive the same data? Agreed
the second server always knows the IP of the sender since the sender is
the first script which is on the same box, but I'm not sure how this
provides a benefit over just processing the data in the first script,
since the IP of the original sender is still at issue. Maybe I'm just
confused :)

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

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



Re: [PHP] Regular Expression for a UK mobile phone number

2004-04-08 Thread Shaun

Michal Migurski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am trying to create a regular expression for a mobile phone number. The
 number must be 12 digits long(0-9) and begin with 447 and have no spaces.
 So far I have come up with this but it keeps telling me the number is
 invalid even when its correct!

 Try this:

 $regexp = /447[0-9]{9}/;
   if($_POST[mobile_number] != ''){
 if(!preg_match( $regexp, $_POST[mobile_number] )){
   $error = Invalid Mobile Number;

header(Location:edit_rep.php?error=$errorrep_id=.$_GET[rep_id].client_i
d=.$_GET[client_id].rep_name=.$_GET[rep_name].client_name=.$_GET[clie
nt_name].);
  exit;
   }
 }

 Also, your regexp is a little permissive; you can anchor it like so:

 $regexp = /^447[0-9]{9}$/;

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

Thanks for your reply Michal,

but the regular expression still seems to reject the number...

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



[PHP] ADOdb Operator question

2004-04-08 Thread Gabe
If you're using ADOdb, what is the name, purpose, and function of this
operator?

-

e.g. $conn-Connect(false, 'scott', 'tiger', $oraname);

I can follow some tutorials, but I'm just not sure when I need to use it and
when I don't.

Thanks

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



[PHP] ^%$! Download accelerators

2004-04-08 Thread Brian Dunning
I've been using the following code for some time to deliver electronic 
downloads of purchased software products -

  header('Content-Type: '.$file_row['content_type']);
  header('Content-Disposition: filename='.$file_row[filename].'');
  $size = filesize('../../store/files/'.$file_row['filename']);
  header('Content-Length: '.$size);
  header('Content-Transfer-Encoding: base64');
  readfile('../../store/files/'.$file_row['filename']);
But once in a blue moon, someone complains that they didn't get their 
file and they always seem to be using some download accelerator 
software. Does anyone have any experience with these? Anything I can do 
to make the above code more robust? Note that it's been working great 
for a long time.

- Brian

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


[PHP] Smarty Summary was Re: [PHP] smarty

2004-04-08 Thread Jochem Maas
I have been following this thread closely and thought I'd summarize a 
few points:

1. 'Template Engine' - you can justifyably call PHP a template engine, 
but I think calling Smarty a template engine confuses the issue - it 
would be clearer call it something like 'Presentation Component' which 
encapsulates output caching, output string transformation, markup 
generation, presentation logic security  seperation of (code  possibly 
human) tasks. viewing it as a component means viewing it as a tool, 
tools are used when appropriate and according to their capabilities and 
the scope of the job at hand. in principle a sizeable proportion of all 
the.

2. 'The Template Language' - basic PHP and Smarty 'languages' are 
roughly on par in terms of complexity (MMV - were all unique!), 
personally I feel that Smarty markup looks tidier alongside (X|(X)?HT)ML.

3. 'Lock In' - the lock-in argument is academic. in reality projects you 
 build using Smarty will be decommissioned or rewritten (at which point 
you can choose to use something else) long before lock-in becomes an 
issue. Besides being locked-in to Free  Open code doesn't sound too bad 
- if you don't use somebody elses 'template engine' then you will 
probably end up writing something similar to perform the related tasks - 
 using somebody elses frees you from dev, maintainance, doc-writing etc

4. 'Limited Interface' -

5. 'Limitations' - when you find Smarty limits you, but you are 
otherwise convinced its a good tool for the job, subclass it and make it 
do things your way (or write BadAss(tm) plugins - for which you can 
achieve fame and glory if you make them available on the Smarty Wiki 
;-). any real limitations of Smarty are not of a level which would 
trouble novice users of PHP, they are simply not yet at the level where 
they are stretching the capabilities of PHP or components they use. 
Smarty is limited in 2 ways:
	1. because PHPs syntax is very broad and flexible (the fact that
	it is typeless is probably no help in this respect), this makes
	it extremely difficult to support it all with in the Smarty 		
	constructs -it not only has to work, but it has to work
	As Expected(tm).
	2. on purpose in order to allow the develop to determine what 	
	interface (functional markup*) designers. Limiting the interface
	(and by definition defining an interface) is a Good Thing(tm)
	thats why PHP5 supports interfaces for classes - consider them,
	like steel-toe-capped boots in the fight against spaghetti code.
Limitations are often purely percieved rather than actual, possibly 
stemming from the fact that somebody else decided on how (i.e. not 
_what_) to do something, small price to pay if for a free, well 
supported component really. And when you look at it you might see that 
this is a bit like developing in a team, sometimes somebody (has to) 
make(s) a decision and your stuck with it regardless of whether you 
think it is correct.

6. 'Designers  Templates' - I use really heavy smarty markup (70% or 
more is not HTML) for the presentation logic... why because my templates 
are very generic - they expect php objects of a certain types and the 
create markup based on the structures within. I don't want any 
non-programmer anywhere near my templates - styling belongs in CSS, that 
is what designers should using to change the look and feel of the site - 
from a deisgners point of view CSS type markup is the future is layout - 
it almost completely removes the styling from the structural markup 
(Murphy's Law dictates that some of the designers wishes will mean 
having to tweak the functional markup templates - but that does not 
happen constantly.). Are your designers often styling/layout online 
articles are the like? maybe it time to try a webbased (X)HTML editor - 
for a couple of $, or even for free, you have an editor to create 
content with which you can store in files or a DB, even change history 
if you want and then extract this content and display it in one of your 
structural templates.

7. 'Why the fuck do we do this?' - for the kick of writing cool code for 
one, but there are always many tasks in writing an application which are 
mundane (to say the least) - for me Smarty takes care of a few of these 
and that makes coding more fun.

8. 'Why use Smarty?' - what a non-question or rather you have to answer 
it yourself. first determine what it is you need to do now (and 
possibily in the future) then go and look what best fits the need (read 
the code and the documentation, make an effort to actually run examples) 
- if nothing fits write something. if your going judge Smarty do it 
based on the quality of the code, level of support and the 
usuability/flexibility of its API.

9. 'php.net' - it possibly says something of Smarty that it is hosted 
under the PHP banner. Smarty is certainly not the only way, probably not 
the best way and possibly not the most flexible way. But it provides a 
free, stable, widely used  well supported framework 

Re: [PHP] ADOdb Operator question

2004-04-08 Thread Matt Matijevich
[snip]
e.g. $conn-Connect(false, 'scott', 'tiger', $oraname);
[/snip]

http://www.php.net/oop will give you some help.

I am not even sure if I can explain it correctly.

I believe you would say use - to call object methods and - to get/set
the class variables.  I am sure someone can give a better explanation
than that, or correct me if I am wrong.

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



[PHP] parsing question ('010.000.080.001' == `10.0.80.1`) how to be 'true'?

2004-04-08 Thread Galkov Vladimir
Two tables have diferent standarts to hold IP adresses:

first:
045.012.001.002
003.000.123.231
123.230.101.080

second:
45.12.1.2
3.0.123.231
123.230.101.80

I have to compare the data and stack there .. my fantasy can't help me write
regular expresion to parse first format into second or second into first.

 Please help me!... or there can be enother way to compare the data .. don't
know... some function wich can translate both formats into binary format ..
so any ideas very nessary :-)

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



  1   2   >