php-general Digest 26 Nov 2005 09:31:22 -0000 Issue 3816

Topics (messages 226431 through 226464):

swaping numerical index for keys
        226431 by: Pooly
        226433 by: Matt Monaco

Re: array woes
        226432 by: Matt Monaco

$_GET and $_POST arrays not working
        226434 by: Unknown Unknown
        226436 by: Richard Davey
        226437 by: Unknown Unknown
        226438 by: Matt Monaco
        226440 by: Unknown Unknown
        226441 by: Richard Davey
        226443 by: Stephen Johnson
        226444 by: Unknown Unknown
        226446 by: Richard Davey
        226447 by: Unknown Unknown
        226448 by: Matt Monaco
        226450 by: adriano ghezzi
        226451 by: Unknown Unknown
        226453 by: John Nichel
        226454 by: Matt Monaco
        226455 by: Richard Davey
        226456 by: John Nichel
        226458 by: Matt Monaco
        226464 by: Andy Pieters

Re: Passing objects between pages
        226435 by: Unknown Unknown
        226439 by: Matt Monaco
        226442 by: Unknown Unknown
        226449 by: Matt Monaco
        226463 by: Andy Pieters

Re: Any performance experiences to offer?
        226445 by: Unknown Unknown
        226460 by: Oliver Grätz

Re: http protocols defining what gets sent between web server and browser
        226452 by: Tim Van Wassenhove

Re: mysqli unclonable object
        226457 by: Curt Zirzow
        226459 by: Matt Monaco

Ubiquitous quoted printable encode
        226461 by: Andy Pieters

Wanna Join me for an open source PHP Project?
        226462 by: bala chandar

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:
        php-general@lists.php.net


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

I've an array :
$ls_statfields=array(
        "rfile" =>0,
        "file" =>1,
        "dev" =>2,
        "ino" =>3,
        "mode" =>4,
        "nlink" =>5,
        "uid" =>6,
        "gid" =>7,
        "rdev" =>8,
        "size" =>9,
        "atime" =>10,
        "mtime" =>11,
        "ctime" =>12,
        "blksize" =>13,
        "blocks" =>14
        );

Which is the correspondance between the numerical and keys for stat
before PHP 4.0.6 :
http://uk.php.net/manual/en/function.stat.php

What would be the fastest solution to transform the result from stat
to the one with the keys (before 4.0.6 :-) ? (i.e. Exchanging
numerical indexing the for hash keys in the ls_statfields ?)

--
Pooly
Webzine Rock : http://www.w-fenec.org/

--- End Message ---
--- Begin Message ---
function addAssoc($ary_stat)
{
    $ls_statfields = array(.....);

    while ($assoc = each($ls_statfields)) {
        $ary_stat[$assoc['key']] = $ary_stat[$assoc['value']];
    }

    return $ary_stat;
}

This should do what you want.  I'm not sure if you want to remove the
numeric keys entirely, but after this function they still exist.


Matt



"Pooly" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,

I've an array :
$ls_statfields=array(
        "rfile" =>0,
        "file" =>1,
        "dev" =>2,
        "ino" =>3,
        "mode" =>4,
        "nlink" =>5,
        "uid" =>6,
        "gid" =>7,
        "rdev" =>8,
        "size" =>9,
        "atime" =>10,
        "mtime" =>11,
        "ctime" =>12,
        "blksize" =>13,
        "blocks" =>14
        );

Which is the correspondance between the numerical and keys for stat
before PHP 4.0.6 :
http://uk.php.net/manual/en/function.stat.php

What would be the fastest solution to transform the result from stat
to the one with the keys (before 4.0.6 :-) ? (i.e. Exchanging
numerical indexing the for hash keys in the ls_statfields ?)

--
Pooly
Webzine Rock : http://www.w-fenec.org/

--- End Message ---
--- Begin Message ---
Within grabQuotes(); if you do a var_dump($arg); (where $arg is $res[id]) is 
your vehicle name displayed?  If it is, and you're using it correctly, make 
sure you're returning the value you'd like correctly.  It might help to post 
your grabQuotes function as well as the code that displays $cars[].


Matt


"blackwater dev" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Hello all,

I have some array code driving me nuts.

I am pulling from a db:

select id, vehicle, has_quotes from cars where active=1

I then loop through these and build an array that contains the id's and 
cars.

while($res){

$cars[$res[id]]=$res[vehicle];
//here is the problem, when has_quotes is 1, I call another function
to grab the quotes
   if ($res[has_quotes]>1){
    $cars[$res[id]]=grabQuotes($res[id]);
   }

}

The grabQuotes function returns an array and works fine.  THe problem
is when I go to display these, I cycle through the car array printing
id and vehicle name.  I do a check so if vehicle name is an array, I
print out the quotes from the inner array, problem is I have lost the
vehicle name!  How can I fix this? 

--- End Message ---
--- Begin Message ---
Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
$_POST arrays do not seem to be working, I am Sure I am spelling them right,
but i keep getting the errors:
**
*Notice*: Undefined index: Username in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*

*Notice*: Undefined index: Password in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*

*Notice*: Undefined index: EMail in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*

Is this a problem with configuration or is there a bug in PHP, thanks in
advance

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

Friday, November 25, 2005, 10:22:46 PM, you wrote:

> Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET
> and $_POST arrays do not seem to be working, I am Sure I am spelling
> them right, but i keep getting the errors:

> Is this a problem with configuration or is there a bug in PHP, thanks in
> advance

If it was a PHP bug I think a few more people may notice it ;)

Try dumping out the values of the arrays, see what they say:

print_r($_GET);
print_r($_POST);

etc

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

--- End Message ---
--- Begin Message ---
Well it returned all values with print_r(); but i can't access them...
this is what the page returns:


Array ( [Username] => SFF [Password] => dSF [EMail] => sfdf ) Array ( )
*Notice*: Undefined index: Username in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*

*Notice*: Undefined index: Password in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *6*

*Notice*: Undefined index: EMail in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *7*



On 11/25/05, Richard Davey <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Friday, November 25, 2005, 10:22:46 PM, you wrote:
>
> > Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET
> > and $_POST arrays do not seem to be working, I am Sure I am spelling
> > them right, but i keep getting the errors:
>
> > Is this a problem with configuration or is there a bug in PHP, thanks in
> > advance
>
> If it was a PHP bug I think a few more people may notice it ;)
>
> Try dumping out the values of the arrays, see what they say:
>
> print_r($_GET);
> print_r($_POST);
>
> etc
>
> Cheers,
>
> Rich
> --
> Zend Certified Engineer
> PHP Development Services
> http://www.corephp.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
In php.ini (most likely located in your windows directory) look for the 
globals section and turn register_globals = on

Matt


"Unknown Unknown" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
$_POST arrays do not seem to be working, I am Sure I am spelling them right,
but i keep getting the errors:
**
*Notice*: Undefined index: Username in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*

*Notice*: Undefined index: Password in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*

*Notice*: Undefined index: EMail in *
D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*

Is this a problem with configuration or is there a bug in PHP, thanks in
advance

--- End Message ---
--- Begin Message ---
Doesn't that cause security problems?

On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
>
> In php.ini (most likely located in your windows directory) look for the
> globals section and turn register_globals = on
>
> Matt
>
>
> "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
> $_POST arrays do not seem to be working, I am Sure I am spelling them
> right,
> but i keep getting the errors:
> **
> *Notice*: Undefined index: Username in *
> D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*
>
> *Notice*: Undefined index: Password in *
> D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*
>
> *Notice*: Undefined index: EMail in *
> D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*
>
> Is this a problem with configuration or is there a bug in PHP, thanks in
> advance
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Friday, November 25, 2005, 10:38:02 PM, you wrote:

> Well it returned all values with print_r(); but i can't access
> them... this is what the page returns:

Post your code, there's an error in it if the $_POST etc arrays are
populated, but you can't access them.

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

--- End Message ---
--- Begin Message ---
You would access them by declaring them as regular variables and then using
the regular variables in your code.

<?php 

$username = $_POST['Username'];
$password = $_POST['Password'];
$email = $_POST['Email'];

?> 


As a side note - please do NOT turn global variables on in your php.ini
file.  There is a good reason for why it is shut off and "good" php does not
need to have it turned on.

Hope that helps .


<?php
/*

Stephen Johnson c | eh
The Lone Coder

http://www.ouradoptionblog.com
Join our journey of adoption

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

continuing the struggle against bad code

*/ 
?>


> From: Unknown Unknown <[EMAIL PROTECTED]>
> Date: Fri, 25 Nov 2005 17:38:02 -0500
> To: Richard Davey <[EMAIL PROTECTED]>
> Cc: <php-general@lists.php.net>
> Subject: Re: [PHP] $_GET and $_POST arrays not working
> 
> 

--- End Message ---
--- Begin Message ---
I refer to them as:
$Username=$_POST['Username'];
$Password=$_POST['Password'];
$EMail=$_POST['EMail'];
 and on the form i have method="post" so I don't know why this is not
working

On 11/25/05, Stephen Johnson <[EMAIL PROTECTED]> wrote:
>
> You would access them by declaring them as regular variables and then
> using
> the regular variables in your code.
>
> <?php
>
> $username = $_POST['Username'];
> $password = $_POST['Password'];
> $email = $_POST['Email'];
>
> ?>
>
>
> As a side note - please do NOT turn global variables on in your php.ini
> file.  There is a good reason for why it is shut off and "good" php does
> not
> need to have it turned on.
>
> Hope that helps .
>
>
> <?php
> /*
>
> Stephen Johnson c | eh
> The Lone Coder
>
> http://www.ouradoptionblog.com
> Join our journey of adoption
>
> http://www.thelonecoder.com
> [EMAIL PROTECTED]
>
> continuing the struggle against bad code
>
> */
> ?>
>
>
> > From: Unknown Unknown <[EMAIL PROTECTED]>
> > Date: Fri, 25 Nov 2005 17:38:02 -0500
> > To: Richard Davey <[EMAIL PROTECTED]>
> > Cc: <php-general@lists.php.net>
> > Subject: Re: [PHP] $_GET and $_POST arrays not working
> >
> >
>
>
>

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

Friday, November 25, 2005, 10:43:20 PM, you wrote:

> Doesn't that cause security problems?

Yes.

Post your *whole* code, not just snippets of it.

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

--- End Message ---
--- Begin Message ---
Wow somehow I fixed the error, I don't really know how... oh well

--- End Message ---
--- Begin Message ---
Somewhat, but its what you need to do for the post and get arrays to work. 
What you need to do is make sure check the values in the global variables 
before you use them.  For example if on one page you have a form for a user 
signup and <input type=text name='userName'> on the next page 
$_POST['userName'] should be checked for things like quotes and other 
characters that will alter your SQL statement before you actually INSERT 
that value into your table.


"Unknown Unknown" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Doesn't that cause security problems?

On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
>
> In php.ini (most likely located in your windows directory) look for the
> globals section and turn register_globals = on
>
> Matt
>
>
> "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
> $_POST arrays do not seem to be working, I am Sure I am spelling them
> right,
> but i keep getting the errors:
> **
> *Notice*: Undefined index: Username in *
> D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*
>
> *Notice*: Undefined index: Password in *
> D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*
>
> *Notice*: Undefined index: EMail in *
> D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*
>
> Is this a problem with configuration or is there a bug in PHP, thanks in
> advance
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
could you give us all source lines, just cut and paste ?
hy

ag.


2005/11/26, Matt Monaco <[EMAIL PROTECTED]>:
> Somewhat, but its what you need to do for the post and get arrays to work.
> What you need to do is make sure check the values in the global variables
> before you use them.  For example if on one page you have a form for a user
> signup and <input type=text name='userName'> on the next page
> $_POST['userName'] should be checked for things like quotes and other
> characters that will alter your SQL statement before you actually INSERT
> that value into your table.
>
>
> "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Doesn't that cause security problems?
>
> On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
> >
> > In php.ini (most likely located in your windows directory) look for the
> > globals section and turn register_globals = on
> >
> > Matt
> >
> >
> > "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
> > $_POST arrays do not seem to be working, I am Sure I am spelling them
> > right,
> > but i keep getting the errors:
> > **
> > *Notice*: Undefined index: Username in *
> > D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*
> >
> > *Notice*: Undefined index: Password in *
> > D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*
> >
> > *Notice*: Undefined index: EMail in *
> > D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*
> >
> > Is this a problem with configuration or is there a bug in PHP, thanks in
> > advance
> >
> > --
> > 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
>
>

--- End Message ---
--- Begin Message ---
I used SQLyog and it's formated corectly
though when i release it i will do that
Also i have a login script, same same problem i'l see what will work

On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
>
> Somewhat, but its what you need to do for the post and get arrays to work.
> What you need to do is make sure check the values in the global variables
> before you use them.  For example if on one page you have a form for a
> user
> signup and <input type=text name='userName'> on the next page
> $_POST['userName'] should be checked for things like quotes and other
> characters that will alter your SQL statement before you actually INSERT
> that value into your table.
>
>
> "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Doesn't that cause security problems?
>
> On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
> >
> > In php.ini (most likely located in your windows directory) look for the
> > globals section and turn register_globals = on
> >
> > Matt
> >
> >
> > "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > Hello everyone, i am running PHP 5 on Windows XP Pro SP2, my $_GET and
> > $_POST arrays do not seem to be working, I am Sure I am spelling them
> > right,
> > but i keep getting the errors:
> > **
> > *Notice*: Undefined index: Username in *
> > D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *3*
> >
> > *Notice*: Undefined index: Password in *
> > D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *4*
> >
> > *Notice*: Undefined index: EMail in *
> > D:\Apache\Apache(re)\Apache2\htdocs\RegisterP.php* on line *5*
> >
> > Is this a problem with configuration or is there a bug in PHP, thanks in
> > advance
> >
> > --
> > 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
>
>

--- End Message ---
--- Begin Message ---
Matt Monaco wrote:
Somewhat, but its what you need to do for the post and get arrays to work.
<snip>

No. Things like $_POST and $_GET are global arrays and work regardless of the register_globals setting. The information you're handing out above is wrong and dangerous.

</snip>
What you need to do is make sure check the values in the global variables before you use them. For example if on one page you have a form for a user signup and <input type=text name='userName'> on the next page $_POST['userName'] should be checked for things like quotes and other characters that will alter your SQL statement before you actually INSERT that value into your table.

ie they should be sanitized. Things like mysql_real_escape_string() or adding slashes (depending on your magic_quotes setting) should be done prior to inserting any data. Also, you should check to ensure that it's the data you expect; if you only allow usernames to contain alpha-numeric characters, then you should check for that. Toss is out if it contains something else.

Best rule of thumb: Never trust user input, regardless of the register_globals setting.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
I apologize, but I've never been able to access $_POST and $_GET in any 
context whatsoever without first turning on the register globals.


"John Nichel" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Matt Monaco wrote:
>> Somewhat, but its what you need to do for the post and get arrays to 
>> work.
> <snip>
>
> No.  Things like $_POST and $_GET are global arrays and work regardless of 
> the register_globals setting.  The information you're handing out above is 
> wrong and dangerous.
>
> </snip>
>> What you need to do is make sure check the values in the global variables 
>> before you use them.  For example if on one page you have a form for a 
>> user signup and <input type=text name='userName'> on the next page 
>> $_POST['userName'] should be checked for things like quotes and other 
>> characters that will alter your SQL statement before you actually INSERT 
>> that value into your table.
>
> ie they should be sanitized.  Things like mysql_real_escape_string() or 
> adding slashes (depending on your magic_quotes setting) should be done 
> prior to inserting any data.  Also, you should check to ensure that it's 
> the data you expect; if you only allow usernames to contain alpha-numeric 
> characters, then you should check for that.  Toss is out if it contains 
> something else.
>
> Best rule of thumb:  Never trust user input, regardless of the 
> register_globals setting.
>
> -- 
> By-Tor.com
> ...it's all about the Rush
> http://www.by-tor.com 

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

Saturday, November 26, 2005, 12:42:16 AM, you wrote:

> I apologize, but I've never been able to access $_POST and $_GET in
> any context whatsoever without first turning on the register
> globals.

You have a seriously foobared installation of PHP then! :)

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

--- End Message ---
--- Begin Message ---
Matt Monaco wrote:
I apologize, but I've never been able to access $_POST and $_GET in any context whatsoever without first turning on the register globals.

If you have a form like this one one page...

<form action="page2.php" method="post">
<input type="hidden" name="foo" value="bar" />
<input type="submit" />
</form>

And this on page2.php...

<?php

echo ( $_POST['foo'] );

?>

And the output on page2.php is not 'bar' when you submit the form, something is very wrong with your install.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Well, I turned them off and it worked as it apparently should.  It was just 
a setting I read I had to make for globals to work the first time I install 
PHP.  I've made that change ever since.
I've always wondered why these variables - which I consider really 
important, need to be turned on.

Matt

"John Nichel" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Matt Monaco wrote:
>> I apologize, but I've never been able to access $_POST and $_GET in any 
>> context whatsoever without first turning on the register globals.
>
> If you have a form like this one one page...
>
> <form action="page2.php" method="post">
> <input type="hidden" name="foo" value="bar" />
> <input type="submit" />
> </form>
>
> And this on page2.php...
>
> <?php
>
> echo ( $_POST['foo'] );
>
> ?>
>
> And the output on page2.php is not 'bar' when you submit the form, 
> something is very wrong with your install.
>
> -- 
> By-Tor.com
> ...it's all about the Rush
> http://www.by-tor.com 

--- End Message ---
--- Begin Message ---
On Saturday 26 November 2005 02:45, John Nichel wrote:
> If you have a form like this one one page...
>
> <form action="page2.php" method="post">
> <input type="hidden" name="foo" value="bar" />
> <input type="submit" />
> </form>
>
[snip]

Dear John

Please go all the way when providing an example.  To prevent errors and 
unpredictable behaviour, ALWAYS add encoding to the form tag.

<form action="page2.php" method="post" enctype="multipart/form-data" 
name="form1">

Systematically adding names on all your forms may save you many hours of hair 
plucking as well ;)

With kind regards


Andy

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--

Attachment: pgpp5UKERpBad.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
Do you mean passing the class statement or the vars? couldn't you format the
vars into mysql and pull them?

On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
>
> What is the best way to pass an object between pages?  Currently I am
> first
> serializing, then doing a base64_encode, this doesn't seem entirely
> efficient.  (Especially the encode).
>
> I am however using the encode because I have the serialized object as the
> value of a hidden form element.  I can only have alphanumerics here.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I mean the object itself, not the class (the file containing the class 
definition is included on all necessary pages with 
require_once("file.inc.php");

I want to create an object on one page ($obj = new MyClass();) and have it 
on other pages, all members and functions intact.

Matt



"Unknown Unknown" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Do you mean passing the class statement or the vars? couldn't you format the
vars into mysql and pull them?

On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
>
> What is the best way to pass an object between pages?  Currently I am
> first
> serializing, then doing a base64_encode, this doesn't seem entirely
> efficient.  (Especially the encode).
>
> I am however using the encode because I have the serialized object as the
> value of a hidden form element.  I can only have alphanumerics here.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Well the functions won't need to be copied, but can't you put
the properties into a MySQL or other database? Then on a page that you need
the properties you pull them from the table?

On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
>
> I mean the object itself, not the class (the file containing the class
> definition is included on all necessary pages with
> require_once("file.inc.php");
>
> I want to create an object on one page ($obj = new MyClass();) and have it
> on other pages, all members and functions intact.
>
> Matt
>
>
>
> "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Do you mean passing the class statement or the vars? couldn't you format
> the
> vars into mysql and pull them?
>
> On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
> >
> > What is the best way to pass an object between pages?  Currently I am
> > first
> > serializing, then doing a base64_encode, this doesn't seem entirely
> > efficient.  (Especially the encode).
> >
> > I am however using the encode because I have the serialized object as
> the
> > value of a hidden form element.  I can only have alphanumerics here.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I know the functions don't need to be copied.  I would like to easily 
transport the objects (not the class) between pages using a form.  I'm 
pretty sure the serialize() function can't be avoided (otherwise all that 
will be passed is a string with a value like "Object ID: #55") but how can I 
get around the base64_encode() so the serialized object can be the value of 
a checkbox?

$obj = new MyClass();
$obj = serialize($obj);
$obj = base64_encode($obj); //I would like to eliminate this line

<input type=checkbox name='fieldName' value='$obj'>

So on the next page I have to decode and deserialize

$obj = $_POST['fieldName'];
$obj = base64_decode($obj);
$obj = unserialize($obj);

echo $obj->member;
$obj->function();




"Unknown Unknown" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Well the functions won't need to be copied, but can't you put
the properties into a MySQL or other database? Then on a page that you need
the properties you pull them from the table?

On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
>
> I mean the object itself, not the class (the file containing the class
> definition is included on all necessary pages with
> require_once("file.inc.php");
>
> I want to create an object on one page ($obj = new MyClass();) and have it
> on other pages, all members and functions intact.
>
> Matt
>
>
>
> "Unknown Unknown" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> Do you mean passing the class statement or the vars? couldn't you format
> the
> vars into mysql and pull them?
>
> On 11/25/05, Matt Monaco <[EMAIL PROTECTED]> wrote:
> >
> > What is the best way to pass an object between pages?  Currently I am
> > first
> > serializing, then doing a base64_encode, this doesn't seem entirely
> > efficient.  (Especially the encode).
> >
> > I am however using the encode because I have the serialized object as
> the
> > value of a hidden form element.  I can only have alphanumerics here.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Friday 25 November 2005 20:44, Matt Monaco wrote:
> What is the best way to pass an object between pages?  Currently I am
> first
> serializing, then doing a base64_encode, this doesn't seem entirely
> efficient.  (Especially the encode).
>
> I am however using the encode because I have the serialized object as the
> value of a hidden form element.  I can only have alphanumerics here.
You can instead of using a hidden form element, use sessions.

$_SESSION['obj_state']=serialize(objectinstance)

On other pages you can check if obj_state is set, and use it to reinitialize 
your class (object).

HTH

Andy

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--

Attachment: pgp9imq3RCs3j.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
PHP5 code is faster generally, and OOP is also accelerated a lot

On 11/25/05, Tim Meader <[EMAIL PROTECTED]> wrote:
>
> Are there any benchmarks that people are aware of comparing
> PHP4|PHP5|PHP5.1 as far as performance is concerned? I mean, it's easy
> to say that performance is improved... but what's the baseline?
>
> Was PHP5 faster than PHP4 for identical code? Thus making PHP5.1 even
> faster? Or was it a case of PHP5 being a bit more bulky than PHP4, thus
> PHP5.1 bringing it more inline with the old performance. I'm looking to
> upgrade of PHP 4.4.1 installs, but I'm holding off on PHP5.1 until
> eaccelerator (open source PHP accelerator) becomes compatible. As it is,
> PHP5.0.5 is the last supported version. But if 5.0.5 is slower than
> 4.4.1, I'll hold off.
>
> Thanks in advance.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Tim Meader schrieb:
> Was PHP5 faster than PHP4 for identical code? Thus making PHP5.1 even
> faster? Or was it a case of PHP5 being a bit more bulky than PHP4, thus
> PHP5.1 bringing it more inline with the old performance. I'm looking to
> upgrade of PHP 4.4.1 installs, but I'm holding off on PHP5.1 until
> eaccelerator (open source PHP accelerator) becomes compatible. As it is,
> PHP5.0.5 is the last supported version. But if 5.0.5 is slower than
> 4.4.1, I'll hold off.

That depends...
For typical PHP4 applications (little to no class stuff) I've heard of
benchmarks showing PHP5 to be slower than PHP4. These issues should be
fixed with the 5.1 release. If you intend to make use of OOP features
then PHP5 is not only faster but a lot of them simply aren't available
with PHP4.

OLLi

--- End Message ---
--- Begin Message ---
On 2005-11-24, "bruce" <[EMAIL PROTECTED]> wrote:
> I'm working on a project, and need to know if there's anyone who's a guru
> with Web Server/Client interactions. Basically, I'm trying to get a much
> better/deeper understanding of the HTTP protocols defining the information
> that is sent/transfered between the web server/client browser apps.

There is an article about HTTP on Wikipedia.org and from there you find
a link to RFC2616.

> So, if you have the skills/expertise in this area, and you're willing to
> talk to me for a few minutes, I'd appreciate it. As stated, the underlying
> reason for the questions is to get a better understanding of 'man in the
> middle attacks' as this applies to web server apps.

In that case you might want to look at tcp/ip and http over ssl too.

-- 
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>

--- End Message ---
--- Begin Message ---
On Wed, Nov 23, 2005 at 11:43:56PM -0500, Matt Monaco wrote:
> I get string(1) "", should that be taken just the same as 0?  In addition 
> phpinfo() indicates php 5.0.4 - does the upgrade to .5 involve remove .4 
> first?

I'm not sure how you are getting 'string(1) ""'  with php5.0.x you
should have either:

  string(1) "1"
  string(0) ""

The upgrade from .4 to .5 depends on how you installed it
originally, if you installed it from source then you can
re-configure .5 with the same options as you did with .4, you can
get your configure command with something like:

  php -i | grep 'Configure Command'

Curt.

> 
> 
> btw, as I'm new to the mailing list thing, why do some names appear in 
> quotes and others do not?

I'm not sure what you mean by this.

Curt.
-- 
cat .signature: No such file or directory

--- End Message ---
--- Begin Message ---
In outlook express by default the headers are displayed as some icons and 
then subject, from, sent, size.  For some people From is displayed in double 
quotes, and others not. 

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

I know of the imap_8bit function that *can* be compiled into php.  However I 
would like an encoder written in php that only uses standard extensions and 
functions and that therefore can work on all php 4+ installations.

Does anyone know of such a beast?

With kind regards

Andy

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--

Attachment: pgpEA2PRcdFaD.pgp
Description: PGP signature


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

I have just started a Open source Project in SourceForget.net using PHP.

Project Name: Weblook Express
URL : http://sourceforge.net/projects/weblookexpress

Idea came to me when i thought of porting the complete windows based
Desktop outlook express Application into a Portable, Web based
Application that runs on any Javascript supported webbrowser for any
POP3, or IMAP or HTTP Mail Service Providers.

I am just looking for people who can work along with me so that
complete porting occurs so that we can release the base version.

Technology to be used would be PHP, XML, XSLT, Javascript, HTML.

About Weblook Express
Weblook Express provides an integrated solution for managing and
organizing e-mail messages. It delivers innovations you can use to
manage your email communications, organize your mails - all from one
place similar like the desktop outlook express.

Project would involve complete porting of Desktop Outlook Express that
comes with Internet Explorer. The user should be able to configure
multiple Mail Service Providers. User experience is what we must see.
and i have more ideas in my mind. I also invite ideas, suggestions for
this project.

Looking for developers...
--
<name> balachandar muruganantham</name>
<Yahoo!> mbchandar</Yahoo!>
<Hotmail>  mbchandar</Hotmail>
<blog> http://chandar.blogspot.com</blog>
<web>http://www.balachandar.net</web>
<talk> http://www.expertstalk.org</talk>
<shop>http://www.chennaishopping.com</shop>

--- End Message ---

Reply via email to