OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
[suspicious - maybe spam] php-general Digest 12 Jan 2005 12:24:17 -0000 Issue 3223

php-general-digest-helplists.php.net
Date: Wed Jan 12 2005 - 06:24:17 CST


php-general Digest 12 Jan 2005 12:24:17 -0000 Issue 3223

Topics (messages 206129 through 206169):

stdClass to array
        206129 by: Cere Davis
        206130 by: Michael Sims

[suspicious - maybe spam] how to use a URL as a filename
        206131 by: shimuqiheb.abchina.com

Re: drag and drop CMS made with php
        206132 by: Andrew Kreps

Re: Apache 2.0 and Sessions
        206133 by: Stephen Craton
        206136 by: Jerry Kita
        206168 by: Jason Barnett

weird upload problem
        206134 by: Sebastian
        206137 by: Sebastian
        206138 by: Jason Wong
        206140 by: Sebastian
        206141 by: Santa
        206143 by: Jason Wong
        206163 by: Ford, Mike

Re: Get name of extending class with static method call
        206135 by: Rory Browne
        206152 by: Torsten Roehr
        206153 by: Torsten Roehr
        206154 by: Torsten Roehr

Re: Forms on PHP
        206139 by: PHPDiscuss - PHP Newsgroups and mailing lists

Re: Error loading extension dlls in WindosXP for PHP4.3.10
        206142 by: Ranjan K. Baisak
        206162 by: James Lobley

HTTP Proxy Script
        206144 by: John Camp
        206146 by: Manuel Lemos

Re: $_GET & $_POST simultaneously
        206145 by: Curt Zirzow

T1 Lib
        206147 by: PJ

Re: libphp4.so not created on upgrade
        206148 by: heath boutwell
        206150 by: Rasmus Lerdorf

URL-funtion - returnvalue into variable...?
        206149 by: Wiberg
        206151 by: Zouari Fourat

Offline working
        206155 by: Lester Caine

php dot net auto complete search engine
        206156 by: Zouari Fourat
        206158 by: Jochem Maas
        206160 by: Richard Davey
        206161 by: Zouari Fourat
        206164 by: Richard Davey
        206165 by: Jochem Maas
        206166 by: Jochem Maas

Data Enryption
        206157 by: Shaun
        206159 by: Dirk Kredler

array walk and class member functions
        206167 by: Tom

Generic question : migrating from java based RPC server to PHP
        206169 by: Ranjan K. Baisak

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hey folks,

Does anyone know of a painless way to convert a stdClass object to an
associative array in php?

Also, I wonder, is there a way to "flatten" associative arrays in php?
So say:
$b=new array(s=>"S")
$a=new array(a=>"A",b=>$b)

goes to:
 $z=flatten($a);
z turns to:
 (a=>"A", b=>$b, s=>"S");

Thanks,
Cere

attached mail follows:


Cere Davis wrote:
> Hey folks,
>
> Does anyone know of a painless way to convert a stdClass object to an
> associative array in php?

Just cast it:

$arr = (array) $stdClassInstance;

> Also, I wonder, is there a way to "flatten" associative arrays in php?
> So say:
> $b=new array(s=>"S")
> $a=new array(a=>"A",b=>$b)
>
> goes to:
> $z=flatten($a);
> z turns to:
> (a=>"A", b=>$b, s=>"S");

array_merge()

http://www.php.net/manual/en/function.array-merge.php

HTH

attached mail follows:


I want to get a file 'http://www.china.com/' , I can use
file_get_contents('http://www.china.com/');
But how can I get it via a Proxy.



                                     Shi MuQi
                         LangFang ABC (China) °гv°г
                         Tel:(86)-311-7876466 /(_)\
                E-mail:shimuqihebabchina.com ^ ^


attached mail follows:


On Tue, 11 Jan 2005 15:53:39 -0800, Graham Anderson <grahamasiren.cc> wrote:
> is there a php based CMS that exists that allows you to drag/drop and
> reorder tracks ?
> something akin to itunes or winamp playlist...
>

I'm not entirely sure you could make this work, if you're speaking of
a web app. On my Firefox browser running under Linux, I can select
and drag text and links from the page I'm on into the textbox I'm
using to reply to this message. But, in order to make it actually
work, you'd need some sort of form field on the page between each
track, which would auto-submit when it receives text (which you can do
via javascript). You'd also need code to decipher what's being sent
to figure out what in the database it relates too. I also think it
would be entirely browser dependent, which can't be a good thing. It
sounds like a lot of work to me, although you might have fun creating
it. :)

attached mail follows:


Not a production server, just a development server. It doesn't bail either,
it still displays the page correctly, but no sessions work, obviously.

Thanks,
Stephen Craton

-----Original Message-----
From: Bret Hughes [mailto:bhugheselevating.com]
Sent: Tuesday, January 11, 2005 7:24 PM
To: Stephen Craton
Subject: Re: [PHP] Apache 2.0 and Sessions

On Tue, 2005-01-11 at 16:02, Stephen Craton wrote:
> I just updated to Apache 2.0 and have gotten PHP all with it. However, I
> just loaded up a script that worked fine on my old Apache 1.3 install but
is
> now causing my errors. Here's the error:
>
>
>
> Warning: session_start():
> open(C:\WINDOWS\TEMP\\sess_8c53cb2382f75076c51ed4b3edece36b, O_RDWR)
failed:
> No such file or directory (2) in D:\htdocs\payments\index.php on line 8
<WAG>
sounds like the apache/php user does not have rights to write to
C:\WINDOWS\TEMP. is that possible?
</WAG>

>
> Warning: session_start(): Cannot send session cache limiter - headers
> already sent (output started at D:\htdocs\payments\index.php:8) in
> D:\htdocs\payments\index.php on line 8
>

this is probably because your script does not bail if there is a problem
with establishing a session. Since php sent the error message the rest
could not happen.

It looks like your php is set to send error msgs. not a good idea on a
production server as was discussed in a thread the last day or so.

Bret

>
>
> I don't see why it's happening, especially since I went into php.ini (I'm
on
> Windows XP) and changed session.save_patch to this:
>
>
>
> session.save_path = "C:/PHP/sessiondata"
>
>
>
> Can anyone give me some input here? I think I see the problem, the whole
> double back slash in the file location, but I don't see how to fix that.
>
>
>
> Thanks,
>
> Stephen Craton
>

attached mail follows:


Stephen Craton wrote:
> Thanks for the reply, and I apologize for being a top poster, just a habit.
>
> I would do that, and it is a good idea, just not practical since I usually
> upload or publish the scripts I have on here to a server or to other people.

Steve .... My laptop is my development server but my production work is
on a public server. I apologize for not giving you a complete
description of what I do ... I set my "session.save_path" on the public
server by creating a TMP directory in my Public_html folder. I've
created an IF THEN ELSE that recognizes whether the code is being
executed on my laptop or at the public server. The entire include() file
is as follows:

<?php
if ($_SERVER['SERVER_NAME'] == "localhost")
{
  session_save_path('c:\Program Files\Apache Group\Apache2\htdocs\tmp');
 
       } else {
session_save_path('/...xxxxx..../public_html/tmp');
 
     }
?>

Works great ... and the old session files in the public_html/tmp
directory get cleaned out automatically.

Still might not be practical for you for other reasons but I thought I
should give you a more complete answer ...... Jerry

> What I have here will not work on their servers if I do this. I could just
> comment that line out, granted, but it doesn't seem practical for my
> situation. Thanks for the suggestion though!
>
> Thanks,
> Stephen Craton
>
> -----Original Message-----
> From: Jerry Kita [mailto:jskitaattglobal.net]
> Sent: Tuesday, January 11, 2005 7:03 PM
> To: php-generallists.php.net
> Subject: [PHP] Re: Apache 2.0 and Sessions
>
> Stephen Craton wrote:
>
>>I just updated to Apache 2.0 and have gotten PHP all with it. However, I
>>just loaded up a script that worked fine on my old Apache 1.3 install but
>
> is
>
>>now causing my errors. Here's the error:
>>
>>
>>
>>Warning: session_start():
>>open(C:\WINDOWS\TEMP\\sess_8c53cb2382f75076c51ed4b3edece36b, O_RDWR)
>
> failed:
>
>>No such file or directory (2) in D:\htdocs\payments\index.php on line 8
>>
>>Warning: session_start(): Cannot send session cache limiter - headers
>>already sent (output started at D:\htdocs\payments\index.php:8) in
>>D:\htdocs\payments\index.php on line 8
>>
>>
>>
>>I don't see why it's happening, especially since I went into php.ini (I'm
>
> on
>
>>Windows XP) and changed session.save_patch to this:
>>
>>
>>
>>session.save_path = "C:/PHP/sessiondata"
>>
>>
>>
>>Can anyone give me some input here? I think I see the problem, the whole
>>double back slash in the file location, but I don't see how to fix that.
>>
>>
>>
>>Thanks,
>>
>>Stephen Craton
>>
>>
>
> Stephen,
>
> Not sure I can see your error either but here's a thought that might be
> useful. I run Apache 2.0 on my laptop with PHP 4.3.4. Sessions work fine
> for me. For various reasons I chose to set my "session.save_path" at the
> beginning of every script and it works fine. Here's the line of code I use:
>
> session_save_path('c:\Program Files\Apache Group\Apache2\htdocs\tmp');
>
> Again .... it doesn't answer the question you're asking but it might be
> an approach that's easy for you to implement. I do it via an include().
>

--
Jerry Kita

http://www.salkehatchiehuntersville.com

email: jskitaattglobal.net

attached mail follows:


>>> Warning: session_start():
>>> open(C:\WINDOWS\TEMP\\sess_8c53cb2382f75076c51ed4b3edece36b, O_RDWR)

Search the archives... seriously... guaranteed you will find the answer
to this.

--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://www.php.net/manual/en/index.php
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

attached mail follows:


Hi,
im working on this mulitiple upload script to auto resize images. everything
works, except two problems.
1) for some odd reason if i attach all fields with an image it only submits
5. seems its skipping one.
2) if i attach an image to field 1, 3, 5 and skip the other fields only 1
file gets uploaded.. how do i make it so it doesnt matter which fields are
used? just submit whatever fields(s) are used.. i snipped a lot of the code
off the script so its easier to find the problem.. maybe i just overlooked
something.

<form action="/" enctype="multipart/form-data" method="post">
1: <input type="file" name="image[]"><br />
2: <input type="file" name="image[]"><br />
3: <input type="file" name="image[]"><br />
4: <input type="file" name="image[]"><br />
5: <input type="file" name="image[]"><br />
6: <input type="file" name="image[]"><br />
<input name="submit" type="submit" value="submit">
</form>

if (isset($_FILES['image']))
{
 $number = 0;
    for ($i = 0; $i < count($_FILES['image']); $i++)
    {
        $number++;
        $imageid = time();

        resize_img('image', $imageid.$number, $original_width,
$original_height));
        resize_img('image', 't'.$imageid.$number, $new_width, $new_height));

    }
}

attached mail follows:


well i found the problem to #1. i forgot an = on the for() loop.. so it
uploads all 6 instead of 5. still looking for a solution on #2

----- Original Message -----
From: "Sebastian" <sebastianbroadbandgaming.net>
To: <php-generallists.php.net>
Sent: Tuesday, January 11, 2005 8:59 PM
Subject: [PHP] weird upload problem

> Hi,
> im working on this mulitiple upload script to auto resize images.
everything
> works, except two problems.
> 1) for some odd reason if i attach all fields with an image it only
submits
> 5. seems its skipping one.
> 2) if i attach an image to field 1, 3, 5 and skip the other fields only 1
> file gets uploaded.. how do i make it so it doesnt matter which fields are
> used? just submit whatever fields(s) are used.. i snipped a lot of the
code
> off the script so its easier to find the problem.. maybe i just overlooked
> something.
>
> <form action="/" enctype="multipart/form-data" method="post">
> 1: <input type="file" name="image[]"><br />
> 2: <input type="file" name="image[]"><br />
> 3: <input type="file" name="image[]"><br />
> 4: <input type="file" name="image[]"><br />
> 5: <input type="file" name="image[]"><br />
> 6: <input type="file" name="image[]"><br />
> <input name="submit" type="submit" value="submit">
> </form>
>
>
> if (isset($_FILES['image']))
> {
> $number = 0;
> for ($i = 0; $i < count($_FILES['image']); $i++)
> {
> $number++;
> $imageid = time();
>
> resize_img('image', $imageid.$number, $original_width,
> $original_height));
> resize_img('image', 't'.$imageid.$number, $new_width,
$new_height));
>
> }
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


On Wednesday 12 January 2005 09:59, Sebastian wrote:

> 2) if i attach an image to field 1, 3, 5 and skip the other fields only 1
> file gets uploaded..

How did you ascertain this? What does print_r($_FILES) show? Unless you're
using a broken browser it *should* work.

--
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
------------------------------------------
New Year Resolution: Ignore top posted posts

attached mail follows:


Jason Wong wrote:

> How did you ascertain this? What does print_r($_FILES) show? Unless you're
> using a broken browser it *should* work.

i tried both IE6 and Firebox 1.0, both do the same.
does appear its being passed.. doesn't it? array:
Array
(
    [image] => Array
        (
            [name] => Array
                (
                    [0] => image1.jpg
                    [1] =>
                    [2] => image2.jpg
                    [3] =>
                    [4] =>
                    [5] => image3.jpg
                )

            [type] => Array
                (
                    [0] => image/pjpeg
                    [1] =>
                    [2] => image/pjpeg
                    [3] =>
                    [4] =>
                    [5] => image/pjpeg
                )

            [tmp_name] => Array
                (
                    [0] => /tmp/php6ubg5D
                    [1] =>
                    [2] => /tmp/phpYjSRr2
                    [3] =>
                    [4] =>
                    [5] => /tmp/phpuqTWXO
                )

            [error] => Array
                (
                    [0] => 0
                    [1] => 4
                    [2] => 0
                    [3] => 4
                    [4] => 4
                    [5] => 0
                )

            [size] => Array
                (
                    [0] => 83330
                    [1] => 0
                    [2] => 83330
                    [3] => 0
                    [4] => 0
                    [5] => 83330
                )

        )

)

attached mail follows:


So, in $_FILES all right.

may be use foreach instead for?
case count() show count of fulled cell of array, and in your case it show 3.
but 3 is not end of your array.

¬ сообщении от —реда 12 январь 2005 07:16 Sebastian написал(a):
> Jason Wong wrote:
> > How did you ascertain this? What does print_r($_FILES) show? Unless
> > you're using a broken browser it *should* work.
>
> i tried both IE6 and Firebox 1.0, both do the same.
> does appear its being passed.. doesn't it? array:
> Array
> (
> [image] => Array
> (
> [name] => Array
> (
> [0] => image1.jpg
> [1] =>
> [2] => image2.jpg
> [3] =>
> [4] =>
> [5] => image3.jpg
> )
>
> [type] => Array
> (
> [0] => image/pjpeg
> [1] =>
> [2] => image/pjpeg
> [3] =>
> [4] =>
> [5] => image/pjpeg
> )
>
> [tmp_name] => Array
> (
> [0] => /tmp/php6ubg5D
> [1] =>
> [2] => /tmp/phpYjSRr2
> [3] =>
> [4] =>
> [5] => /tmp/phpuqTWXO
> )
>
> [error] => Array
> (
> [0] => 0
> [1] => 4
> [2] => 0
> [3] => 4
> [4] => 4
> [5] => 0
> )
>
> [size] => Array
> (
> [0] => 83330
> [1] => 0
> [2] => 83330
> [3] => 0
> [4] => 0
> [5] => 83330
> )
>
> )
>
> )

attached mail follows:


On Wednesday 12 January 2005 12:16, Sebastian wrote:

> i tried both IE6 and Firebox 1.0, both do the same.
> does appear its being passed.. doesn't it? array:
> Array
> (
> [image] => Array
> (
> [name] => Array
> (
> [0] => image1.jpg
> [1] =>
> [2] => image2.jpg
> [3] =>
> [4] =>
> [5] => image3.jpg
> )

Certainly looks like they're uploaded OK.

--
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
------------------------------------------
New Year Resolution: Ignore top posted posts

attached mail follows:


To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

> -----Original Message-----
> From: Sebastian [mailto:sebastianbroadbandgaming.net]
> Sent: 12 January 2005 01:59
 

> <form action="/" enctype="multipart/form-data" method="post">
> 1: <input type="file" name="image[]"><br />
> 2: <input type="file" name="image[]"><br />
> 3: <input type="file" name="image[]"><br />
> 4: <input type="file" name="image[]"><br />
> 5: <input type="file" name="image[]"><br />
> 6: <input type="file" name="image[]"><br />
> <input name="submit" type="submit" value="submit">
> </form>
>
>
> if (isset($_FILES['image']))
> {
> $number = 0;
> for ($i = 0; $i < count($_FILES['image']); $i++)

      foreach ($FILES['image'] as $i=>$imagefile)

Solves both problems.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services, JG125, James
Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS,
LS6 3QS, United Kingdom
Email: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


I was kinda thinking about all that too, for a project I'm currently
doing, in that I wanted to be able to create a singleton, without
having to put the singleton code in each class. The only hack I could
think of was to use debug_backtrace() to get the line of source that
contained the call, and parse(reparse) it manually.

Bare in mind that this is EXTREMELY UGLY, and probably extremely slow,
and unprofessional, but as a wise man once said(Andrew Morton IIRC),
if there is no implemention there is nothing to improve on, but if you
provide a crappy solution, you can rally people to improve on it.

If you're new to PHP, or prone to picking up bad habits, stop reading now.

eg

<?pseudo_code

class Base {

function static_get_class_name(){
 list($file, $line, $method) =
get_calling_file_and_line_and_method_from_debug_backtrace();
 $codeline = file($file)[$line];
 preg_match("/([a-zA-Z_][a-zA-Z0-9_]*)::$method_name/", $codeline, $match);
 return $match[1];
}

}

On Tue, 11 Jan 2005 11:38:55 -0500, Jason Barnett
<jason.barnetttelesuite.com> wrote:
> M. Sokolewicz wrote:
> > try using __CLASS__
> >
> > Torsten Roehr wrote:
> >
>
> This is a good suggestion but I wonder... Torsten do you have a large
> heirarchy of parent classes or just one parent? E.g. Car -> Sports Car
> -> Porsche. More importantly will __CLASS__ resolve to the class name
> that you need...
>
> If __CLASS__ works for you then I would go with it. If not can you just
> send the appropriate class name as a parameter?
>
> --
> Teach a person to fish...
>
> Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
> PHP Manual: http://php.net/manual/
> php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


> I'm not sure if this will work, but hey, you could give it a try.
>
> class Car
> {
> public static $className = __CLASS__;
>
> public static function drive ()
> {
> return self::$className;
> }
> }
>
> class Porsche extends Car
> {
> public static $className = __CLASS__;
> }
>
> Porche::drive(); // Should return "Porche"

Hi Daniel,

thanks for the idea but it causes an error:
Fatal error: Cannot redeclare property static public Car::$className in
class Porsche

If I ommit the definition of $className in Car I get this error:
Fatal error: Access to undeclared static property: Car::$className

If I ommit the definition of $className in Porsche the return value is 'Car'
not 'Porsche'. Arrrgh!

Will keep on trying.

Best regards, Torsten

attached mail follows:


"Jason Barnett" <jason.barnetttelesuite.com> wrote in message
news:20050111192629.21621.qmailpb1.pair.com...
> The only other solution that comes to mind is a little messy but it lets
> you get away with no object. Instead of calling the method statically
> you can use call_user_func_array() with the child class name as a
> parameter. Then change the parent method to accept the child class name
> as a parameter.
>
> <?php
>
> function call_static_child() {
> $drive_args = func_get_args();
> /** assume that first parameter is child of class Car */
> return call_user_func_array(array($drive_args[0], 'drive'),
$drive_args);
> }
>
> ?>

Hi Jason,

thanks for taking a look but there *must* be a way to achieve this without
passing any parameters around. Otherwise I could just do:

Porsche::drive('Porsche');

Best regards, Torsten

attached mail follows:


> Torsten, I also found the following link to be helpful. Check out the
> user notes from michael at digitalgnosis dot removethis dot com (he did
> something similar to what I have already suggested, i.e. call_user_func)
>
> http://www.php.net/manual/en/language.oop5.static.php

Hi Jason,

thanks for the link. It helped me to find out that this does work:

class Car {
    function drive() {
        echo '<pre>';print_r(debug_backtrace());
    }
}

class Porsche extends Car {
    function drive() {
        parent::drive();
    }
}

By "tunnelling" the call through Porsche's own drive() method
debug_backtrace() will contain two traces, one of them with the correct
class name.

I tried using reflection but "reflecting" car by using __CLASS__ doesn't
give any information about the classes that extend it. So this doesn't work
either.

Rory's proposed way of reading in the file contents and preg_matching the
method name works, but it's very, very ugly, indeed! ;)

Isn't it somewhat ridiculous that there is no *easy* way in PHP5 to achieve
what I consider to be a pretty straightforward requirement?:

"Get name of the class that invoked a static call of an inherited method"

I would like to thank all of those that cared about my problem and tried to
find a solution by providing a wide variety of ideas. Thank you very much!!!

Do you think it would be wise to ask for help on php-dev?

Best regards, Torsten

attached mail follows:


Leon Poon wrote:

> Refer to the following line numbers:

> 01 > <?php
> 02 > // Start of PHP code - Extract values from form.
> 03 > /* Other values read */
> 04 > $n=$_POST['n'];
> 05 >
> 06 > // Pass the data from the form to lightcurve_csharp
> 07 > $command="./lightcurve_csharp $a $i $e $lomega $bomega $lambda $n";
> 08 > $result=`$command`;
> 09 >
> 10 > $form_submitted=$_POST['form_sumbitted'];
> 11 > if (isset($form_submitted)) {
> 12 > if ($form_submitted) {
> 13 > echo 'The form has been submitted<br>';
> 14 > unset($form_submitted);
> 15 > }
> 16 > } else
> 17 > echo 'The form has not been submitted<br>';

> When the user first load the page, no data was posted. So there was no
> $_POST['form_sumbitted'] available. Line 10 will cause $form_submitted to
> contain the NULL value (I think). $form_submitted will evaluate to FALSE at
> line 12. Thus it will not display any message.

> By the way, by doing line 10, $form_submitted would have been set regardless
> whether there is $_POST['form_sumbitted'], and line 11 will evaluate to TRUE
> always. Thus you will never ever see the 'form not been submitted' message.

> Anyway, when you posted for the first time, $_POST['form_sumbitted'] is
> available. The 'The form has been submitted<br>' message will be printed.
> After that, when you press Reload button on the browser, the post data will
> once again be sent from the user. (This is the behaviour of reloading a
> posted page. In Internet Explorer there should be a message dialog box
> asking the user whether to resend form data in order to refresh.) Reposting
> the data during the reload means that there will be
> $_POST['form_sumbitted'], thus once again the 'form hass been submitted'
> message.

> In order to prevent this from happening, you should do a header('Location:
> success-page.php') on a successful submit. This is so that at the redirected
> page, the user would not have resent data even if he press the Reload
> button.

> Hope this helps

> -Leon

Many thanks - at the top of the file I put in the code:

if ($_POST['submit'])
    header('Location: .../submitted.php');

where further down in the form I have name="submit" for the submit button.
 This goes to a new page submitted.php. The code is in fact now at
http://proteus.as.arizona.edu/~csharp/lightcurved.php .

No doubt there is still a way of writing back to the original page after
the submit button has been clicked, but I can't see an easy way, so this
will have to do for now. A work-around is to do it in frames, and write
to a frame at the bottom so that it appears to be in the same page.

Christopher Sharp

attached mail follows:


--- Richard Lynch <ceol-i-e.com> wrote:
>
> Some questions for you:
>
> Does it REALLY have an extra .dll on the end in the
> message?
> Perhaps somebody goofed up somewhere, but rip of the
> '.dll' in your
> php.ini and see what happens...
>
> Did the php_xmlrpc.dll you have COME WITH the EXACT
> SAME php distribution?
>
> If it's from some other version, do *NOT* try to
> mix-n-match it.
>
> Worse than having it not work at all, is having it
> work flawlessly until
> you try to use the function that changed in that DLL
> between 4.x.y and
> 4.x.z!
>
> Where the PHP DLLs are located *should* be set in
> php.ini, but one first
> has to be *sure* your php.ini file is being used.
>
> Take a step back and turn off all the extensions and
> change something
> innocuous in php.ini like the syntax highlighting
> colors (remember the old
> settings) and load up a <?php phpinfo();?> page.
>
> Did your settings take effect?
>
> If not, where is PHP looking for php.ini? (at the
> top of phpinfo output)
>
> That's where your php.ini file has to go.
>
> *THEN* you can change php.ini and put your PHP
> extensions where they
> belong, which is almost for sure not down in your
> Windows\System32
> directory (shudder).
>
Well Richard, I could able to solve it by copying all
dlls into Windows\System32 directory. But still not
sure why I need to copy all dlls into system32
directory though I have mentioned in php.ini file that
extension_directory=c:\PHP4\extensions.

regards,
Ranjan

                
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

attached mail follows:


> Well Richard, I could able to solve it by copying all
> dlls into Windows\System32 directory. But still not
> sure why I need to copy all dlls into system32
> directory though I have mentioned in php.ini file that
> extension_directory=c:\PHP4\extensions.
>
> regards,
> Ranjan
>
Hi Ranjan,

You might find this page useful:
http://uk.php.net/install.windows.extensions

I found I needed to add the path C:\PHP\dlls to the XP System variable
'Path' as a lot of extensions have dependencies on dlls found in this
directory.
(in XP: Control Panel / System / Advanced / Environment Variables)
Don't forget to seperate what you add in from the existing paths with a ;

Best Wishes,

James

attached mail follows:


I am looking for a script that uses GET data to retrieve a website and
display it to whoever requested it (a HTTP proxy). If it can translate
links to go through the proxy as well it would be even better. Thanks.

attached mail follows:


Hello,

on 01/12/2005 04:54 AM John Camp said the following:
> I am looking for a script that uses GET data to retrieve a website and
> display it to whoever requested it (a HTTP proxy). If it can translate
> links to go through the proxy as well it would be even better. Thanks.

You may want to try this HTTP client class that you can use to forward
any type of HTTP requests.

http://www.phpclasses.org/httpclient

As for link translation, I think you need to use some regular
expressions to translate the URLs of links, images, forms, etc...

--

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

attached mail follows:


* Thus wrote Bostjan Skufca domenca.com:
> Hello,
>
> If I create form like this
> <form name="form" action="##_URI_ROOT##/entity/edit.php?a=b" method="post">
> <input type="hidden" name="action" value="modify" />
> ...

> Now what I am interested in is if this is valid behaviour regarding HTTP
> specification and if other platforms support this interference of GET and
> POST variables in request?

Well the action should tell the browser to request:
  POST /root/entity/edit.php?a=b
 
And supply the appropiate data to be posted.

if the browser does do this then it is up to php to populate the
GET and POST varibles, and if memory server me right, this has been
done since early php3.

Now as to wether the client support's passing the full action URI's
to the server, i've only had issues with early version's of IE4.

Basically the only difference between a GET and POST is a POST has
extra data that is sent, besides some minor issues like what when
and how to cache post form.

HTH,

Curt
--
Quoth the Raven, "Nevermore."

attached mail follows:


Hello everybody!

I have some connection problems when I am searching topics in ThunderB.,
so I am sorry if my question is somewhere answered!

Does anybody know, where to download T1Lib for PHP4 - windows version?
After half hour googling I have feeling that it doesn't exist... :o(

So, I would be very very glad, if there is someone, who can help me by
posting link or dll via mail!

Thanks a lot!
Pavel

attached mail follows:


--- Rasmus Lerdorf <rasmuslerdorf.com> wrote:
> Well, what is created? Do you get a .libs/libphp4 file with no
> extension? If so, you can either just rename that to .libs/libphp4.so
> or run libtoolize --force and re-run ./configure
>
> -Rasmus
>

Still no libphp4.so created by make install.

Here is results from libtoolize --force
Using `AC_PROG_RANLIB' is rendered obsolete by `AM_PROG_LIBTOOL'
You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.

Here are the files created by make install:
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/bin/
Installing shared extensions: /usr/lib/php4/extensions/no-debug-non-zts-20020429/
Installing PEAR environment: /usr/lib/php4/php/
[PEAR] Archive_Tar - already installed: 1.2
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR - already installed: 1.3.2
Wrote PEAR system config file at: /usr/etc/pear.conf
You may want to add: /usr/lib/php4/php to your php.ini include_path
[PEAR] DB - already installed: 1.6.8
[PEAR] HTTP - already installed: 1.3.3
[PEAR] Mail - already installed: 1.1.4
[PEAR] Net_SMTP - already installed: 1.2.6
[PEAR] Net_Socket - already installed: 1.0.2
[PEAR] XML_Parser - already installed: 1.2.1
[PEAR] XML_RPC - already installed: 1.1.0
Installing build environment: /usr/lib/php/build/
Installing header files: /usr/include/php/
Installing helper programs: /usr/bin/
  program: phpize
  program: php-config
  program: phpextdist
  
  
I get no errors in the make/make test/make install stages. Why isn't libphp4.so created? It also
seems bizarre that I am the only person that has encountered this.

Thanks.

                
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

attached mail follows:


heath boutwell wrote:
> --- Rasmus Lerdorf <rasmuslerdorf.com> wrote:
>
>>Well, what is created? Do you get a .libs/libphp4 file with no
>>extension? If so, you can either just rename that to .libs/libphp4.so
>>or run libtoolize --force and re-run ./configure
>>
>>-Rasmus
>>
>
>
> Still no libphp4.so created by make install.
>
> Here is results from libtoolize --force
> Using `AC_PROG_RANLIB' is rendered obsolete by `AM_PROG_LIBTOOL'
> You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.
>
> Here are the files created by make install:
> Installing PHP SAPI module: cgi
> Installing PHP CGI into: /usr/bin/
> Installing shared extensions: /usr/lib/php4/extensions/no-debug-non-zts-20020429/
> Installing PEAR environment: /usr/lib/php4/php/
> [PEAR] Archive_Tar - already installed: 1.2
> [PEAR] Console_Getopt - already installed: 1.2
> [PEAR] PEAR - already installed: 1.3.2
> Wrote PEAR system config file at: /usr/etc/pear.conf
> You may want to add: /usr/lib/php4/php to your php.ini include_path
> [PEAR] DB - already installed: 1.6.8
> [PEAR] HTTP - already installed: 1.3.3
> [PEAR] Mail - already installed: 1.1.4
> [PEAR] Net_SMTP - already installed: 1.2.6
> [PEAR] Net_Socket - already installed: 1.0.2
> [PEAR] XML_Parser - already installed: 1.2.1
> [PEAR] XML_RPC - already installed: 1.1.0
> Installing build environment: /usr/lib/php/build/
> Installing header files: /usr/include/php/
> Installing helper programs: /usr/bin/
> program: phpize
> program: php-config
> program: phpextdist
>
>
> I get no errors in the make/make test/make install stages. Why isn't libphp4.so created? It also
> seems bizarre that I am the only person that has encountered this.

Because you built the CGI version as it says. You need to use the
--with-apxs configure switch to build the Apache SAPI.

-Rasmus

attached mail follows:


Hi there!

I'm a total newbie at connecting to diffrent servers, and b2b and such stuff
, so I guess this is a simple question for you guys...

Another company wants me to access their productinfo thorugh URL, something
like this:
https://www.anothercompany.com/returnValueOfProductID=1043

If I access this site, the value of product that has ID 1043 will be
returned.
How do I get this returnvalue into a variable?

/G
varupiraten.se

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 2005-01-10

attached mail follows:


u can try fopen

On Wed, 12 Jan 2005 09:40:26 +0100, Wiberg <gustavvarupiraten.se> wrote:
> Hi there!
>
> I'm a total newbie at connecting to diffrent servers, and b2b and such stuff
> , so I guess this is a simple question for you guys...
>
> Another company wants me to access their productinfo thorugh URL, something
> like this:
> https://www.anothercompany.com/returnValueOfProductID=1043
>
> If I access this site, the value of product that has ID 1043 will be
> returned.
> How do I get this returnvalue into a variable?
>
> /G
> varupiraten.se
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 2005-01-10
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Because of the problems working with the email version of the php lists,
I'm forced to use the newgroup interface.
Up until recently I could happily get up in the morning and 'Download
Now' in Mozilla so I can scan messages quickly locally.
Since xmas the 'Download Now' simply gets the first message and then
times out. It's working fine on Eclipse and Borland so it's not my end,
but now the only way to get the messages is one at a time.

Is this something that has been changed at www.php.net? Can anything be
done about it? Why should offline working be such a problem?

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

attached mail follows:


Hello
last days i've seen on php dot net site that the search engine has
impleted a new autocomplete option that was disabled soon.
anyone know why did they disable it ? is there any disadvantage with that ?
i'm interested in the autocomplete option with inputs, i used it with
pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
and what u can see on http://www.google.com/webhp?complete=1
anyone know how to do that ? wich technologie is used over it ?

attached mail follows:


Zouari Fourat wrote:
> Hello
> last days i've seen on php dot net site that the search engine has
> impleted a new autocomplete option that was disabled soon.
> anyone know why did they disable it ? is there any disadvantage with that ?

AFAIK it was a major resource hit.
The complete source of the php.net site is available; and you can view
the CVS history via a web iterface:

http://cvs.php.net/phpweb/

I would suggest searching that for the code.

> i'm interested in the autocomplete option with inputs, i used it with
> pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
> and what u can see on http://www.google.com/webhp?complete=1
> anyone know how to do that ? wich technologie is used over it ?
>

javascript.

attached mail follows:


Hello Jochem,

Wednesday, January 12, 2005, 10:22:26 AM, you wrote:

>> last days i've seen on php dot net site that the search engine has
>> impleted a new autocomplete option that was disabled soon.
>> anyone know why did they disable it ? is there any disadvantage with that ?

JM> AFAIK it was a major resource hit.

Yeah that and it redirected Firefox users to blank pages even if they
didn't use it (glad to see it removed for now).

Best regards,

Richard Davey
--
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

attached mail follows:


if it was js, where's the code ? i didnt find it in the source of
google.com and i havent notated any frame/iframe

On Wed, 12 Jan 2005 11:22:26 +0100, Jochem Maas <jochemiamjochem.com> wrote:
> Zouari Fourat wrote:
> > Hello
> > last days i've seen on php dot net site that the search engine has
> > impleted a new autocomplete option that was disabled soon.
> > anyone know why did they disable it ? is there any disadvantage with that ?
>
> AFAIK it was a major resource hit.
> The complete source of the php.net site is available; and you can view
> the CVS history via a web iterface:
>
> http://cvs.php.net/phpweb/
>
> I would suggest searching that for the code.
>
>
> > i'm interested in the autocomplete option with inputs, i used it with
> > pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
> > and what u can see on http://www.google.com/webhp?complete=1
> > anyone know how to do that ? wich technologie is used over it ?
> >
>
> javascript.
>
>

attached mail follows:


Hello Zouari,

Wednesday, January 12, 2005, 10:55:45 AM, you wrote:

ZF> if it was js, where's the code ? i didnt find it in the source of
ZF> google.com and i havent notated any frame/iframe

It's JS (what else could it be?!) - more info here:
http://uk2.php.net/search.php

For Google it's on their Suggest lab site:

http://www.google.com/webhp?complete=1&hl=en

Best regards,

Richard Davey
--
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

attached mail follows:


Zouari Fourat wrote:
> if it was js, where's the code ? i didnt find it in the source of
> google.com and i havent notated any frame/iframe
>

your not looking very hard:

first off you need to look in the source of the actual page which you
pointed the list to (thanks for that btw, I had not seen this new beta
widget of googles before!).

somewhere in the source is the following:

<SCRIPT src="/ac.js"></SCRIPT>
<SCRIPT>InstallAC(document.f,document.f.q,document.f.btnG,"search","en");</SCRIPT>

I haven't checked it - but I'm willing to bet that ac.js contains the
relevant magic....

AFAIKS they have 2 other scripts on that page, but they don't seem to be
directly involved:
<script>
<!--
function sf(){document.f.q.focus();}
// -->
</script>

and

<script><!--
function qs(el) {if (window.RegExp && window.encodeURIComponent) {var
qe=encodeURIComponent(document.f.q.value);if (el.href.indexOf("q=")!=-1)
{el.href=el.href.replace(new RegExp("q=[^&$]*"),"q="+qe);} else
{el.href+="&q="+qe;}}return 1;}
// -->
</script>

have fun working out exactly what they do :-)

>
> On Wed, 12 Jan 2005 11:22:26 +0100, Jochem Maas <jochemiamjochem.com> wrote:
>
>>Zouari Fourat wrote:
>>
>>>Hello
>>>last days i've seen on php dot net site that the search engine has
>>>impleted a new autocomplete option that was disabled soon.
>>>anyone know why did they disable it ? is there any disadvantage with that ?
>>
>>AFAIK it was a major resource hit.
>>The complete source of the php.net site is available; and you can view
>>the CVS history via a web iterface:
>>
>>http://cvs.php.net/phpweb/
>>
>>I would suggest searching that for the code.
>>
>>
>>
>>>i'm interested in the autocomplete option with inputs, i used it with
>>>pear : HTML_QuickForm but wasnt enough good like what i saw on php.net
>>>and what u can see on http://www.google.com/webhp?complete=1
>>>anyone know how to do that ? wich technologie is used over it ?
>>>
>>
>>javascript.
>>
>>
>
>

attached mail follows:


Richard Davey wrote:
...
> It's JS (what else could it be?!) - more info here:

what else? spontaneous self-realising tele-kinetic voodoo. :-D

attached mail follows:


Hi,

I have site that allows users to upload private information to our server.
We would like to encrypt the data for security reasons and only allow
certain users to be able to un-encrypt the data and view it. I have looked
at the PHP encryption functions and they appear to be one way algorithms - I
am guessing this is the whole point of encrption ;)

Does anyone have any suggestions regarding this?

Many thanks

attached mail follows:


Am Mittwoch, 12. Januar 2005 11:13 schrieb Shaun:
> Hi,
>
> I have site that allows users to upload private information to our server.
> We would like to encrypt the data for security reasons and only allow
> certain users to be able to un-encrypt the data and view it. I have looked
> at the PHP encryption functions and they appear to be one way algorithms -
> I am guessing this is the whole point of encrption ;)
>
> Does anyone have any suggestions regarding this?
>
> Many thanks

hey :)

you should use the mcrypt_* functions. Look at the manual pages,
you will find there many examples.

Here are some functions i use for encryption of private data,
may they help you:

/**
  * mcrypt iv generieren
  */
  if(!isset($_SESSION['MCRYPT_IV'])) {
    
    $_SESSION['MCRYPT_IV']=
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC),
MCRYPT_DEV_URANDOM);
    
  }
  
  /**
   * Encryption
   *
   * param String input - unencrypted string
   * return String encrypted string
   */
  function encrypt($input) {
    
    $encrypted= mcrypt_encrypt(MCRYPT_BLOWFISH, SECRET, $input,
MCRYPT_MODE_CBC, $_SESSION['MCRYPT_IV']);
    $encoded= base64_encode($encrypted);
    
    return
      $encoded;
  }
  
  /**
   * Decryption
   *
   * param String input - encrypted string
   * return String - decrypted string
   */
  function decrypt($input) {
    
    $decoded= base64_decode($input);
    $decrypted= mcrypt_decrypt(MCRYPT_BLOWFISH, SECRET, $decoded,
MCRYPT_MODE_CBC, $_SESSION['MCRYPT_IV']);
    
    return
      rtrim($decrypted);
  }

attached mail follows:


Hi

I'm batting my head against a wall on this one...
I have a class that has a constructor which sets some initial
conditions, and then a public function that does some work. I want to be
able to call this function from an external array_walk call, but when I
try and reference it as $myClass->myFunction in the array_walk call, I
get an error back saying that this is an invalid function.

eg)
<?php
    include "../includes/aClass.class";

    $myArray = array("item1"=>"firstItem", "item2"=>"secondItem");
    $myClass = new aClass;

    array_walk($myArray,'$myClass->aMemberFunction');
?>

As a workaround, I redifined the class so that there was a public
function which made the array_walk call with the worker function defined
internally as follows, but this throws another issue in that if I create
multiple instances of the class then I get an error to say that the
internal function is already defined ...

> *Fatal error*: Cannot redeclare aFunction() (previously declared in
> /usr/local/apache2/htdocs/includes/functions.php:23) in
> */usr/local/apache2/htdocs/includes/functions.php* on line *23*

class aClass
{
     some other stuff, constructor etc
    public function aPublicFunction($anArray)
    {
       global $aRetrunString;
      
       function aFunction($value, $key)
       {
            global $aReturnString;
            $aReturnString = $aReturnString.$value;
       }

       array_walk($anArray,'aFunction');
       return $aReturnString;
    }
}

   
Can anyone help me to get either solution to a working state?

By the way...
apache 2.0.49
php-5.0.2

Thanks very much

Tom

attached mail follows:


This might be a very generic question.
I am in a process of migrating my java based RPC
server to PHP. Luckily with the help of the list I
could able to make sure that all rpc and xml related
function are getting excuted in Apache server. I am
using Apache2 in WInXP.
But still not sure from where I should start my
changes.
Any link or tutorial or case study regarding PHP's
SOAP and RPC service would help a lot.

regards,
Ranjan

                
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com