php-general Digest 10 Sep 2005 12:39:42 -0000 Issue 3674

Topics (messages 222101 through 222110):

Books / tutorials on Object Oriented Programming with PHP
        222101 by: Vinayakam Murugan
        222102 by: Vizion
        222103 by: Jason Coffin

mixing $_POST and $_GET vars
        222104 by: bruce
        222105 by: Stephen Johnson
        222106 by: afan.afan.net

Re: access resources via a proxy
        222107 by: Vedanta Barooah

Re: Encrypt Files
        222108 by: Vedanta Barooah

Re: ASP (VBScript) to PHP Converters?
        222109 by: Rick Emery

Re: Breaking up search terms into an array intelligently
        222110 by: Robin Vickery

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


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

I am learning about Object Oriented Programming with PHP. Can you suggest 
any good books / tutorials?

-- 
Warm Regards
~~~~~~~~~~~~~~~
Vinayak
http://theregoesanotherday.blogspot.com/

--- End Message ---
--- Begin Message ---
On Friday 09 September 2005 16:25,  the author Vinayakam Murugan contributed 
to the dialogue on-
 [PHP] Books / tutorials on Object Oriented Programming with PHP: 

>Hi
>
>I am learning about Object Oriented Programming with PHP. Can you suggest
>any good books / tutorials?
PHP & MySQL web development by Luke Welling and Laura Thomson is good if you 
are web oriented in yr development objectives

david
-- 
40 yrs navigating and computing in blue waters.
English Owner & Captain of British Registered 60' bluewater Ketch S/V Taurus.
 Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after 
completing engineroom refit.

--- End Message ---
--- Begin Message ---
On 9/9/05, Vinayakam Murugan <[EMAIL PROTECTED]> wrote:
> I am learning about Object Oriented Programming with PHP. Can you suggest
> any good books / tutorials?

Greetings,

I HIGHLY recommend "PHP 5 Objects, Patterns, and Practice" by Matt
Zandstra [http://www.apress.com/book/bookDisplay.html?bID=358]. This
was one of the best PHP books I have read and I suspect it is exactly
what you are looking for.

Yours,
Jason Coffin

--- End Message ---
--- Begin Message ---
hi..

quick question.. a basic link <a ref ="foo.php?a=1">blah</a> allows you to
process the vars in foo.php using $_GET, easy/basic enough. however, if i
have a form from cat.php that does a 'post' of the form information/input to
the foo.php, i'm then going to have to either change the form to do a 'get'
or else i'm going to have to do both a $_GET, and a $_POST within foo.php to
access the vars from the pages that are interfacing with foo.php.

is there an easier/cleaner/better approach??

or do i really need/wind up doing something like

if ($_GET['foo'])...

if ($_POST['apple'])...

and just have a mix of both methods within the code...

thanks

-bruce
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Is there any particular reason that you do not want to mix both type in
foo.php.

I have a few that mix $_SERVER , $_COOKIE, $_POST, and $_FILES.

I do not see a particular performance hit with mixing these since they are
available regardless of whether they are populated or not.




On 9/9/05 4:46 PM, "bruce" <[EMAIL PROTECTED]> wrote:

> hi..
> 
> quick question.. a basic link <a ref ="foo.php?a=1">blah</a> allows you to
> process the vars in foo.php using $_GET, easy/basic enough. however, if i
> have a form from cat.php that does a 'post' of the form information/input to
> the foo.php, i'm then going to have to either change the form to do a 'get'
> or else i'm going to have to do both a $_GET, and a $_POST within foo.php to
> access the vars from the pages that are interfacing with foo.php.
> 
> is there an easier/cleaner/better approach??
> 
> or do i really need/wind up doing something like
> 
> if ($_GET['foo'])...
> 
> if ($_POST['apple'])...
> 
> and just have a mix of both methods within the code...
> 
> thanks
> 
> -bruce
> [EMAIL PROTECTED]

-- 
Stephen Johnson
The Lone Coder

http://www.ouradoptionblog.com
*Join us on our adoption journey*

[EMAIL PROTECTED]
http://www.thelonecoder.com

*Continuing the struggle against bad code*
--

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

   Request variables: $_REQUEST

   *Note: * Introduced in 4.1.0. There is no equivalent array in
   earlier versions.

   *Note: * Prior to PHP 4.3.0, $_FILES information was also included
   in $_REQUEST.

An associative array consisting of the contents of $_GET, $_POST, and $_COOKIE.

This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script. You don't need to do a *global $_REQUEST;* to access it within functions or methods.

If the register_globals <http://us2.php.net/manual/en/ini.core.php#ini.register-globals> directive is set, then these variables will also be made available in the global scope of the script; i.e., separate from the $_REQUEST array. For related information, see the security chapter titled Using Register Globals <http://us2.php.net/manual/en/security.globals.php>. These individual globals are not autoglobals.

http://us2.php.net/reserved.variables


-afan


bruce wrote:

hi..

quick question.. a basic link <a ref ="foo.php?a=1">blah</a> allows you to
process the vars in foo.php using $_GET, easy/basic enough. however, if i
have a form from cat.php that does a 'post' of the form information/input to
the foo.php, i'm then going to have to either change the form to do a 'get'
or else i'm going to have to do both a $_GET, and a $_POST within foo.php to
access the vars from the pages that are interfacing with foo.php.

is there an easier/cleaner/better approach??

or do i really need/wind up doing something like

if ($_GET['foo'])...

if ($_POST['apple'])...

and just have a mix of both methods within the code...

thanks

-bruce
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
yeah! i gotta rewrite them... does anyone know of a rss-reader with
similar features..
thanks,


On 9/9/05, Raj Shekhar <[EMAIL PROTECTED]> wrote:
> in infinite wisdom Vedanta Barooah spoke thus  On 09/09/2005 10:46 AM:
> > what about existing apps... do i need to rewrite them :(
> >
> 
> if you want to ask if you will need to rewrite the scripts that fetch
> the data, then yes - I think you will need to rewrite them.  I am not
> sure how these scripts are retrieving data currently, hence I cannot
> give a definite answer.
> 
> You will not have to rewrite the scripts which are giving the data.
> --
> Raj Shekhar
> blog : http://rajshekhar.net/blog  home : http://rajshekhar.net
> Disclaimer : http://rajshekhar.net/disclaimer
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
define encrypt here...?

or in a SSL connection your file is anyway encrypted,

thanks,
vedanta

On 9/9/05, Shaun <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is it possible to encrypt files that are being uploaded via the
> move_uploaded_file() method?
> 
> Thanks for your advice
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
Quoting Jay Blanchard <[EMAIL PROTECTED]>:

Howdy!

I have started searching around for VBScript to PHP converters and was
hoping that the group might have some recommendations. My new position
places me squarely into the middle of a Windows shop and one of the reasons
that they wanted me here was to help them take the steps to the next levels.
The first steps that I want to take with them are moving away from ASP, .NET
and IIS to PHP, C++ and Apache. We have a pretty robust MS-SQL Server
replication system, but I will introduce them to MySQL & PostGres for
certain projects.

I know that ASP to PHP converters aren't perfect, and a lot of the existing
code was generated with Dreamweaver which has introduced some bloat. I feel
that if we can get part way there that the rest can be cleaned up reasonably
easily. I look forward to hearing suggestions.

TVMIA!

Take a look at asp2php http://asp2php.naken.cc/

I've never used it, but I have a friend who "played around" with it. He said it wasn't perfect, but he was very impressed with what it did.

HTH,
Rick
--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
with your eyes turned skyward, for there you have been, and there
you will always long to return"
                                             -- Leonardo Da Vinci

--- End Message ---
--- Begin Message ---
On 9/7/05, Paul Groves <[EMAIL PROTECTED]> wrote:
> I want to be able to break up a number of search terms typed into an input
> box into array, simple enough one would think, just use explode, e.g
> 
> 
> $array = explode(" ", $string);
> 
> 
> But what if I want to be able to cope with search terms seperated by > 1
> space (a common typing error)? This should work:
> 
> 
> function enhanced_explode($string) {
>  $array = preg_split ("/\s+/", $string);
>  return ($array);
> }
> 
> 
> But what if I want to allow "Google"-type search parameters, so that
> something like the following is split into 3 search terms?:
> firstsearchterm "second search term" thirdsearchterm
> The following code will do the trick, but is slow and doesn't allow for
> multiple spaces as the delimiter, nor the possibility of multiple delimiters
> (e.g. " ", "+", "," etc.)

<?php
$search ='first -second +third "fourth \"fifth\""    -"sixth seventh" 
    eighth';

$re = '/[+-]?("(?:[^"\\\\]|\\\\.)*"|[^\s]+)/';

preg_match_all($re, $search, $terms);

print_r($terms);
?>

Array
(
    [0] => Array
        (
            [0] => first
            [1] => -second
            [2] => +third
            [3] => "fourth \"fifth\""
            [4] => -"sixth seventh"
            [5] => eighth
        )

    [1] => Array
        (
            [0] => first
            [1] => second
            [2] => third
            [3] => "fourth \"fifth\""
            [4] => "sixth seventh"
            [5] => eighth
        )

)

--- End Message ---

Reply via email to