php-general Digest 12 Dec 2006 12:13:09 -0000 Issue 4510

Topics (messages 245723 through 245739):

Re: PHPDIG
        245723 by: Saqib Ali
        245725 by: Jiffy Slides Leonard Burton

Re: flash/php file uploader
        245724 by: Chris

Havn't been on the list in a while
        245726 by: Jim Lucas
        245739 by: clive

$POST Q
        245727 by: William Stokes
        245728 by: clive
        245735 by: Jochem Maas

Automating PHP email
        245729 by: clr
        245730 by: Stut
        245731 by: zoticaic

filedownload and output buffering
        245732 by: viraj

Re: Problems with Zip+IE6
        245733 by: Javier Ruiz

Re: file uploads Q?
        245734 by: Jochem Maas

PHP 4 on Apache 1.3
        245736 by: zoticaic
        245737 by: Edward Kay

Re: Need help with RegEx
        245738 by: Ford, Mike

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 ---
r u planning to use it for intranet site or a internet site?

if for a internet site: try http://www.google.com/coop instead of
phpDig or HTDig

saqib
http://www.full-disk-encryption.net

On 12/11/06, Leonard Burton <[EMAIL PROTECTED]> wrote:
HI Guys and Gals,

Has anyone used PHP Dig lately?

Is the new version any better than it used to be?

--
Leonard Burton, N9URK
[EMAIL PROTECTED]

"The prolonged evacuation would have dramatically affected the
survivability of the occupants."

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




--
Saqib Ali, CISSP, ISSAP
http://www.full-disk-encryption.net

--- End Message ---
--- Begin Message ---
Thanks for the Google Tip.

That is what I will use.  Much easier as I don't think we will have 5,000 sites.

Leonard

On 12/11/06, Saqib Ali <[EMAIL PROTECTED]> wrote:
r u planning to use it for intranet site or a internet site?

if for a internet site: try http://www.google.com/coop instead of
phpDig or HTDig

saqib
http://www.full-disk-encryption.net

On 12/11/06, Leonard Burton <[EMAIL PROTECTED]> wrote:
> HI Guys and Gals,
>
> Has anyone used PHP Dig lately?
>
> Is the new version any better than it used to be?
>
> --
> Leonard Burton, N9URK
> [EMAIL PROTECTED]
>
> "The prolonged evacuation would have dramatically affected the
> survivability of the occupants."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Saqib Ali, CISSP, ISSAP
http://www.full-disk-encryption.net



--
Leonard Burton, N9URK
[EMAIL PROTECTED]

"The prolonged evacuation would have dramatically affected the
survivability of the occupants."

--- End Message ---
--- Begin Message ---
Brad Fuller wrote:
-----Original Message-----

Hi

Sorry if this is considered off topic, but do you know of any code
examples/libs with a flash/php file uploader with progress bar?

I've googled for a while but the scripts I find won't work. I'm using
Firefox 2 and Flash player 9 on an intel Mac if that tells you anything?

Or should I ask somewhere else?

Thanks for your time.

Emil

The problem with having a "real" progress bar with PHP is that by default
PHP does not have a callback function so you won't know the status of the
uploaded file until it's complete.


PHP5.2.0 has this built in, see changelog:
http://www.php.net/ChangeLog-5.php#5.2.0

and an example Rasmus previously posted:

http://marc.theaimsgroup.com/?l=php-general&m=116265912901212&w=2

It's still ajax but the hooks are now built into php rather than an external unsupported patch.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Seems like this list has slowed down alot.

Anybody else notice this, or am I just missing something?

jl

--- End Message ---
--- Begin Message ---
Jim Lucas wrote:
Seems like this list has slowed down alot.

Anybody else notice this, or am I just missing something?

jl


well it is almost the end of the year perhaps some people are on holiday already?

clive

--- End Message ---
--- Begin Message ---
Hello,

Can someone tell me what wrong or to how to manage this?

//default
$limitorig = 10;

echo "<select name=\"USRlimitorig\">";
echo "<option selected value=>$limitorig</option>";
echo "<option>10</option>";
echo "<option>20</option>";
echo "<option>30</option>";
echo <input type=\"submit\" name=\"resetlimit\" value=\"GO\">";

When the form is first printed the selected default (10) value is shown OK 
and if something is selected everything is fine. If I just hit "GO" without 
changing the select menu the form fails because USRlimitorig will be empty. 
So how to post the $limitorig if user doesn't change it but hits "GO" 
anyway?

Thanks
-Will

--- End Message ---
--- Begin Message ---
William Stokes wrote:
Hello,

Can someone tell me what wrong or to how to manage this?

//default
$limitorig = 10;

echo "<select name=\"USRlimitorig\">";
echo "<option selected value=>$limitorig</option>";
echo "<option>10</option>";
echo "<option>20</option>";
echo "<option>30</option>";
echo <input type=\"submit\" name=\"resetlimit\" value=\"GO\">";

firstly its better to use <option value='10'> 10 </option>

this might also solve your problem if I understand your question correctly.


When the form is first printed the selected default (10) value is shown OK and if something is selected everything is fine. If I just hit "GO" without changing the select menu the form fails because USRlimitorig will be empty. So how to post the $limitorig if user doesn't change it but hits "GO" anyway?

Thanks
-Will


--- End Message ---
--- Begin Message ---
William Stokes wrote:
> Hello,
> 
> Can someone tell me what wrong or to how to manage this?
> 
> //default
> $limitorig = 10;
> 
> echo "<select name=\"USRlimitorig\">";
> echo "<option selected value=>$limitorig</option>";

                              ^^ what do you think $_POST['USRlimitorig'] will 
be if you select the first option?

> echo "<option>10</option>";
> echo "<option>20</option>";
> echo "<option>30</option>";
> echo <input type=\"submit\" name=\"resetlimit\" value=\"GO\">";
> 
> When the form is first printed the selected default (10) value is shown OK 
> and if something is selected everything is fine. If I just hit "GO" without 
> changing the select menu the form fails because USRlimitorig will be empty. 
> So how to post the $limitorig if user doesn't change it but hits "GO" 
> anyway?
> 
> Thanks
> -Will
> 

--- End Message ---
--- Begin Message --- I am creating a PHP/mySQL site that enables members to set criteria for email notification As my site changes and clients criteria are met they need to be notified.
I can generate a list of email address and info quite simply using mySQL

My question is how to "trigger" or initiate this process as I am a bit weary of using cron

Can anyone suggest how I can automate this using PHP ?

Many thanks

Colin

--- End Message ---
--- Begin Message ---
clr wrote:
I am creating a PHP/mySQL site that enables members to set criteria for email notification
As my site changes and clients criteria are met they need to be notified.
I can generate a list of email address and info quite simply using mySQL

My question is how to "trigger" or initiate this process as I am a bit weary of using cron

Can anyone suggest how I can automate this using PHP ?

Face your fear.... use cron. You know it's the right thing to do.

-Stut

--- End Message ---
--- Begin Message ---
--
> My Seeding Blog | http://bytes.nullp0inter.com
> Hire me as Freelancer | http://www.getafreelancer.com/affiliates/shockx/

> -----Original Message-----
> From: clr [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 12, 2006 5:02 PM
> To: [email protected]
> Subject: [PHP] Automating PHP email
> 
> I am creating a PHP/mySQL site that enables members to set criteria for
> email notification
> As my site changes and clients criteria are met they need to be
> notified.
> I can generate a list of email address and info quite simply using mySQL
> 
> My question is how to "trigger" or initiate this process as I am a bit
> weary of using cron
> 
> Can anyone suggest how I can automate this using PHP ?
> 
> Many thanks
> 
> Colin

Colin,

First, you need to established when and what triggers this actions.

As for the solution I would usually go through these steps : 

- Create a shell PHP script to execute the emailing routine. Such script would
maintain a log of when it was last executed and some other status info, this can
be through a text file of MySQL database. This script can also be used with cron
if you desire or decide to switched back to a more reliable solution :)
- On another script (one that is always called whena user request a page on your
site i.e. global.php). On this script checks the status of the shell script from
its logs, it will determine if IT'S TIME TO RUN THE SCRIPT AGAIN.

This is my oldschool solution :D . I'd still love to hear other's.

Regards,
Jervin

--- End Message ---
--- Begin Message ---
hi all,
i have a small script which shows some information inside a html table
and then pushes a file to save on to users desktop.

but with the following code it download the file and stay without
outputting the html table to browser.

i tried with out put buffering functions, but still no luck (it seems
i'm not clear about those functions yet..). could somebody please help
me on this?

many thanks


~viraj



<?php

function my_callback($content) {
       header('Content-type: application/binary; charset=iso-8859-1');
       header("Expires: 0");
       header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
       header("Pragma: public");
        header("Content-Disposition: attachment; filename=\"Test.url\"");
                $content .= "[InternetShortcut]\r\n" .
                         "URL=http://192.168.1.71/\r\n"; .
                         "IDList=" .
                         "IconFile=http://192.168.1.71/favicon.ico\r\n"; .
                         "IconIndex=1\r\n" .
            "[{000214A0-0000-0000-C000-000000000046}]\r\n" .
            "Prop3=19,2\r\n";

       return $content;
}


ob_start('my_callback');
getBody();
ob_end_flush();

function getBody()
{
   ?>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
   <table cellspacing="0" cellpadding="0" width="780" align="center"
border="1">
       <tbody>
           <tr>
               <td class="outerBorder" valign="top" width="780">Some
information goes here..</td>
           </tr>
       </tbody>
   </table>
</body>
</html>
   <?php
}

?>

--- End Message ---
--- Begin Message ---
damn! that's a pretty good article, thanks a lot.

unfortunatelly, it's not mentioning about zip files concretely, I didn't
find a solution for my problem with them.
I tried playing a bit with the Content-type, but it seems that Internet
Explorer doesn't really care about "Content-type"... it uses the extention
of the file to determine the type (microsoft's way...) so it doesn't matter
if I use "application/octet-stream" or even "application/force-download" or
"application/makethisdownload-or-ikillyou" :-D as long as I name the file "
whatever.zip", IE6 shows the "open with" dialog and if I use "open" with an
application, it fails :(

thanks again Richard for the answer and for the article :)

anybody with a miracle for the ZIP+IE problem??



On 12/5/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

It's kinda long, but this will probably save you some grief:
http://richardlynch.blogspot.com

On Tue, December 5, 2006 2:07 am, Javier Ruiz wrote:
> Hi all!
>
> I have a problem with zip files and Internet Explorer 6. I try to send
> to
> the user a dinamically generated zip file writting the http headers
> and
> using file_put_contents for the zip content. It works fine when
> downloading
> the file with firefox, opera, etc... even it works well if I download
> the
> file with internet explorer and then open it with any zip tool. The
> problem
> comes when I try to directly open the file from the URL using IE6.
>
> I found this is a known bug of IE (several versions) in windows XP:
> http://support.microsoft.com/kb/308090
>
> Does anybody know any way to workaround this problem? I found a couple
> workarounds in forums over there and I tried them, but unfortunately
> they
> didn't work:
>    1 - To change the mimetype (when writting http headers) from
> "application/zip" that I used before to "application/x-zip-compressed"
>    2 - To not use MOD_DEFLATE in apache2 (I was not using it
> really...)
>
>
>
> Any idea??
>
> Thanks a lot!
>


--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?



--- End Message ---
--- Begin Message ---
Børge Holen wrote:
> On Monday 11 December 2006 20:48, Jochem Maas wrote:
>> Richard Lynch wrote:
>>> On Sat, December 9, 2006 12:18 pm, William Stokes wrote:
>>>> Is it possible to allow  user pick several images and upload them all
>>>> at
>>>> once? (I need to pass the images to a function for the resize). Or do
>>>> I need
>>>> to give several browse buttons to allow multiple file uploads?
>>> Yes, you would need to have several INPUT TYPE="FILE" browse buttons.
>>>
>>>> Also I have seen a application (written with MS tools) that allows
>>>> user to
>>>> upload a zip file containing images and the zip is automatically
>>>> uncompressed to a server disk. Can this be done with PHP also?
>>> Yes.
>>> http://php.net/zip
>> the zip extension is only available in php5.2 (or installable via
>> pecl).
>>
>> another option would to use the exec() function to make a call to
>> gunzip in order to unpack the contents of the zip file.
>>
>> a truely poorman's alternative would be to offer multiple FILE input
>> fields on the relevant page and check which one's are not empty when
>> the submission occurs.
> 
> there is no reason for checking each input.

is that crack your smoking?

> Take a look at my earlier questions with the subject "A general UL script" 
> and 
> the replies with various ppl here 'bout the use of $_FILES.
> This way it will check anything listed in the file(s) input of form(s).

er, whatever. whose next?

--- End Message ---
--- Begin Message ---
Hello,

 

I've been trying for a couple of times now but seems to not find the solution as
to why this error occurs.

 

I have Apache 1.3.37 installed on a Fresh CentOS 4.4 machine with this configure
line : ./configure -enable-module=so -enable-module=rewrite

 

I tried building PHP 4.4.4 using ./configure -with-mysql
-with-apxs=/usr/local/apache/bin/apxs but kept getting this error : 

 

Sorry, I cannot run apxs.  Possible reasons follow:

 

1. Perl is not installed

2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs

3. Apache was not built using --enable-so (the apxs usage page is displayed)

 

The output of apxs follows:

./configure: line 5656: apxs: command not found

configure: error: Aborting

 

--

1. I have verified that Perl is installed perl -v 

2. /usr/local/apache/bin/apxs does exists

3. I have configured apache to enable the so module.

 

Am I missing something?

 

TIA

Jervin

--
> Outsource Now | GetAFreelancer
<http://www.getafreelancer.com/affiliates/shockx/> 

 


--- End Message ---
--- Begin Message ---
A couple of suggestions:

* The options should start with a double minus, i.e. --with-mysql
not -with-mysql
* Are the permissions OK for axps and it's directory?

Edward


> Hello,
>
>
>
> I've been trying for a couple of times now but seems to not find
> the solution as
> to why this error occurs.
>
>
>
> I have Apache 1.3.37 installed on a Fresh CentOS 4.4 machine with
> this configure
> line : ./configure -enable-module=so -enable-module=rewrite
>
>
>
> I tried building PHP 4.4.4 using ./configure -with-mysql
> -with-apxs=/usr/local/apache/bin/apxs but kept getting this error :
>
>
>
> Sorry, I cannot run apxs.  Possible reasons follow:
>
>
>
> 1. Perl is not installed
>
> 2. apxs was not found. Try to pass the path using
> --with-apxs2=/path/to/apxs
>
> 3. Apache was not built using --enable-so (the apxs usage page is
> displayed)
>
>
>
> The output of apxs follows:
>
> ./configure: line 5656: apxs: command not found
>
> configure: error: Aborting
>
>
>
> --
>
> 1. I have verified that Perl is installed perl -v
>
> 2. /usr/local/apache/bin/apxs does exists
>
> 3. I have configured apache to enable the so module.
>
>
>
> Am I missing something?
>
>
>
> TIA
>
> Jervin
>
> --
> > Outsource Now | GetAFreelancer
> <http://www.getafreelancer.com/affiliates/shockx/>
>
>
>
>
>

--- End Message ---
--- Begin Message ---
On 11 December 2006 19:43, Michael wrote:

> At 08:29 AM 12/11/2006 , Brad Fuller wrote:
> > 
> > The example provided didn't work for me.  It gave me the same
> > string without anything modified.
> 
> You are absolutely correct, this is what I get for not
> testing it explicitly :( My most sincere apologies to the OP
> and the list, there is an error in my example (see below for
> correction) 
> 
> **** I have cut and pasted from further down in the quoted
> message, for convenience ****
> > > Using the tags you describe here, and assuming the source html is
> > > in the variable $source_html, try this:
> > > 
> > > $trans_text = preg_replace("/(.*?)(<div id=result_box
> > > dir=ltr>)(.*?)(<\/div>)(.*?)^/s","$3",$source_html);
> 
> The End of string symbol ^ should not be included.

That's because ^ is not the end-of-string symbol -- it's the START-of-string 
symbol.  $ is the END-of string symbol.  But the OP doesn't need either of 
these symbols as he's not trying to match at the start or end of the string, 
and nor does he need your suggested leading and trailing (.*?) for the same 
reason.  Unless anchored with ^ and/or $, preg is perfectly happy to match in 
the middle of the subject string.

@Anthony: your pattern is fine -- it's what you're doing with it that's wrong.

On 11 December 2006 08:03, Anthony Papillion wrote:

> $trans_text = preg_match("\/<div id=result_box
> dir=ltr>(.+?)<\/div>/");
> 
> The problem is that when I echo the value of $trans_text variable, I
> end up with the entire HTML of the page.

I don't see how this is possible, since preg_match returns an integer telling 
you how many times the pattern matched -- which will be 0 or 1, since 
preg_match doesn't do multiple matches!  You also clearly haven't given us your 
actual call, since you've only included the pattern and not the subject string.

What you're after is the third argument to preg_match, which returns an array 
of matched text; so for:

    preg_match("/<div id=result_box> dir=ltr>(.+?)<\\/div>/", $orig, $matches);

$matches[0]  will return the entire match (everything from "<div " to "</div>"
$matches[1]  will return the first parenthesized expression, which is what 
you're looking for.

Note also the doubled backslash, since you need to pass a single backslash 
through to escape the / for preg_match.  As an alternative, I would strongly 
advise using a different delimiter, so that no escaping is needed; for instance:

    preg_match("#<div id=result_box> dir=ltr>(.+?)</div>#", $orig, $matches);

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: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 


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

--- End Message ---

Reply via email to