Re: [PHP] emulate a browser

2002-01-24 Thread Frank Benady

Thanks for your help Michael, I'll try it out.

Frank


> At 01:45 AM 1/24/2002 +0100, Frank Benady wrote:
> >Hi All
> >
> >Can I emulate the first request of a browser when it tries to connect
to a
> >distant server using a domain name and parse the answer from the
remote
> >server to know if there is a website located there or if there is no
hosting
> >(or even some kind of forwarding) configured for this domain name ?
> >Is ther some http functions in PHP which permit to do this test ?
>
> You can use fsockopen() to open a socket connection to a remote host
via
> port 80 (HTTP).  If fsockopen() returns a valid file pointer then that
> means there is something listening on port 80 on the host (99% it will
be a
> web server).
>
> You could then use fputs() to send a request to the server, such as:
>
> "HEAD / HTTP/1.0\r\n\r\n"
>
> Normally browsers use GET instead of HEAD, but in your case you are
only
> interested in the servers response (the HTTP headers) and not the
actual
> file/page itself.
>
> You could then use fgets() to read the response sent back from the
server
> and parse it to get the information you wanted (for example, look for
a
> "Location: ..." line in the headers to see if the page is trying to
> redirect the browser).
>
> I have a function that checks to see if a particular file is available
via
> HTTP from a remote host.  It takes a full URL and returns true if the
> page/file exists, and false if it doesn't.  With some work you could
modify
> this script to achieve what you want.  I'm posting it below.  Ask if
you
> have any questions about it.
>
> Oh, BTW, I'm sure that I have (as usually) went totally overboard with
this
> function and someone will now probably point out that PHP has
something
> built in to do what I'm doing here...but I couldn't find it and I had
fun
> writing this function anyway. :-)
>
>  function http_file_exists ($url) {
>
>if (!preg_match("/^http:\/\/([^\/]+)\/.*$/i",$url,$matches)) {
>
>  return "Error - incorrect format";
>
>} else {
>
>  $host = $matches[1];
>  $fp = fsockopen ($host, 80, $errno, $errstr, 30);
>  if (!$fp) return "Error - couldn't connect to host";
>else {
>  fputs ($fp, "HEAD $url HTTP/1.0\r\n\r\n");
>  $response = fgets ($fp,128);
>  fclose ($fp);
>  return (eregi("^.+200 OK.+$",$response) ? true : false);
>}
>
>}
> }
> ?>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Creating a pdf document

2002-01-24 Thread val petruchek

http://www.php.net/manual/en/ref.com.php

Valentin Petruchek (aki Zliy Pes)
*** ??? ?? ***
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
- Original Message -
From: "Mihail Bota" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 9:52 AM
Subject: [PHP] Creating a pdf document


> Hello,
>
> I was wondering if I could save the result of a query in a pdf document. I
> looked for any functions that might help, but I got confused because I
> could not see how/where exactly to insert the necessary .dll's. I'd like
> to do this (saving the output of a query) by using mysql installed on a
> Irix machine, and PHP4.
> If this is not possible, could I create a pdf document or a word document
> from a query from either Access database or mysql on a win2k system,
> PHP4.1?
> Any references that might help?
> Thanks for your help!
>
> Mihai
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Creating a pdf document

2002-01-24 Thread Jason Wong

On Thursday 24 January 2002 15:52, Mihail Bota wrote:
> Hello,
>
> I was wondering if I could save the result of a query in a pdf document. I
> looked for any functions that might help, but I got confused because I
> could not see how/where exactly to insert the necessary .dll's. 

First read the chapter "PDF Functions". 

Then decide on, and install one of the supported PDF libraries.

> I'd like
> to do this (saving the output of a query) by using mysql installed on a
> Irix machine, and PHP4.

This is absolutely possible. If you decide on using the PDFlib library then I 
recommend pc4p (http://sourceforge.net/projects/pc4p/). Its a class which 
makes creating PDFs extremely easy.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
MOUNT TAPE U1439 ON B3, NO RING
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Whats the best way.

2002-01-24 Thread Philip J. Newman

Whats the best way that I can let users upload single .jpeg and gif files, renaming 
then with a time stamp?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012



Re: [PHP] Whats the best way.

2002-01-24 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Philip J. Newman blurted
> Whats the best way that I can let users upload single .jpeg and gif files, renaming 
>then with a time stamp?

RTFM
There's a *big* section on file uploads :=)
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8T8uWHpvrrTa6L5oRAmHLAJ9dFeAHlDSQ/GgNL1RjimxBroUP+ACgs1la
b5aMlxJGT02VtHr7c3XmEas=
=v0N1
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Whats the best way.

2002-01-24 Thread Philip J. Newman

Nice, how rude, but nice.

- Original Message -
From: "Nick Wilson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 9:53 PM
Subject: Re: [PHP] Whats the best way.


> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> * and then Philip J. Newman blurted
> > Whats the best way that I can let users upload single .jpeg and gif
files, renaming then with a time stamp?
>
> RTFM
> There's a *big* section on file uploads :=)
> - --
>
> Nick Wilson
>
> Tel: +45 3325 0688
> Fax: +45 3325 0677
> Web: www.explodingnet.com
>
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8T8uWHpvrrTa6L5oRAmHLAJ9dFeAHlDSQ/GgNL1RjimxBroUP+ACgs1la
> b5aMlxJGT02VtHr7c3XmEas=
> =v0N1
> -END PGP SIGNATURE-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Displaying array of elements problem

2002-01-24 Thread hugh danaher

first, set up the array something like:

$artist("Bon Jovi","N\'Sync","Boyzone","Britney Spears","Jethro Tull",
"Crosby\, Stills & Nash");  //  note escape slash before single quote and
comma I think they'll be needed, but maybe not.

then set up your checkbox array something like:

for ($i=0;$i<=count($artist)-1;$i++)
{
print "$artist[$i]"; // The escape slashes are important here
}
print 
print 
if (isset($submit))
{
for ($i=0;$i<=count($artist)-1;$i++)
{
if (isset($artist[$i])) print $artist[$i];
if (isset($artist[$i])) $number=$number+1;
}
print $number;
if ($number=="0") die ("go back and select something");  / / or do
something else here.
}



The above is untested especially the array set up, but the rest should give
you a hint on how to do what you want.
Hugh

- Original Message -
From: "Michael P. Carel" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 11:31 PM
Subject: [PHP] Displaying array of elements problem


> Hi there,
>
> I have another problem out here. Im using the for loop to display an array
> of element in the checkbox form.
> My problem is how could i set the this if to an error message if their are
a
> NULL selection. By default this will display blank for no selection which
i
> whant to be avoided. I dont know what particular variable should i declare
> if there are NULL selection so that i can incorporate that in an error
> script.
>
> Please help me.
>
>
> Sample script:
>
>  // check for $submit
> if (!$submit)
> {
> // and display form
> ?>
> 
for
> Bon Jovi
> N'Sync
> Boyzone
> Britney
Spears
> Jethro Tull
> Crosby, Stills & Nash
> 
> 
> 
>  }
> // or display the selected artists
> else
> {
>
> ?>
> And here are your selections:
> 
>  -error script line should be here--
>
>
> for($count = 0; $count < sizeof($artist); $count++)
>  {
>echo "$artist[$count]";
>  }
>
> }
> ?>
>
>
>
>
> Regards,
> Mike
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Whats the best way.

2002-01-24 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Philip J. Newman blurted
> Nice, how rude, but nice.

Didn't really mean to be rude hence the concessional smiley at the end. 

Regards
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8T86UHpvrrTa6L5oRAl+IAJ4iZLSWg15yBgCZA2Ohl2bj0iLlPgCgkC4y
zzo7R1x4GgRGrg2gKxP+/ZM=
=2+xd
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: seems easy...

2002-01-24 Thread liljim

Hi Justin,

$string = substr($string, 0, 5000) . " text too long.";

?

http://www.php.net/substr

James

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Really simple, but can't see which funtion to use in the manual.
>
> I want to take a user-inputted string $text, and IF it's length is more
> than $limit, trim it to the limited length, and then tack on some kind
> of "... text cut (too long)" thing on the end.
>
> I'm only missing one bit (line4):
>
> 1  $limit = "5000";
> 2  if(strlen($text) > $limit)
> 3{
> 4
> 5$text .= "...sorry, text was too long";
> 6}
>
>
> Or is it hard than that?
>
>
> Justin French



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] emulate a browser

2002-01-24 Thread Frank Benady

It works really nice, Michael, thanks again.

I have one more question, maybe you can answer me :
If the domain name has been redirected with hte permanent redirect, I
get the 301 Moved Permanently header response. But if the domain name
has been frame-forwarded, I have no header response. Is it normal ?
Do you know if there is some alternatives so I could check if the domain
name is used, even on a frame-forward type redirectection ?
Moreover, if the domain has been redirected, is it possible to get the
url it has been redirected to ?

Thanks again for your help

Frank

- Original Message -
From: "Michael Sims" <[EMAIL PROTECTED]>
To: "Frank Benady" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 2:28 AM
Subject: Re: [PHP] emulate a browser


> At 01:45 AM 1/24/2002 +0100, Frank Benady wrote:
> >Hi All
> >
> >Can I emulate the first request of a browser when it tries to connect
to a
> >distant server using a domain name and parse the answer from the
remote
> >server to know if there is a website located there or if there is no
hosting
> >(or even some kind of forwarding) configured for this domain name ?
> >Is ther some http functions in PHP which permit to do this test ?
>
> You can use fsockopen() to open a socket connection to a remote host
via
> port 80 (HTTP).  If fsockopen() returns a valid file pointer then that
> means there is something listening on port 80 on the host (99% it will
be a
> web server).
>
> You could then use fputs() to send a request to the server, such as:
>
> "HEAD / HTTP/1.0\r\n\r\n"
>
> Normally browsers use GET instead of HEAD, but in your case you are
only
> interested in the servers response (the HTTP headers) and not the
actual
> file/page itself.
>
> You could then use fgets() to read the response sent back from the
server
> and parse it to get the information you wanted (for example, look for
a
> "Location: ..." line in the headers to see if the page is trying to
> redirect the browser).
>
> I have a function that checks to see if a particular file is available
via
> HTTP from a remote host.  It takes a full URL and returns true if the
> page/file exists, and false if it doesn't.  With some work you could
modify
> this script to achieve what you want.  I'm posting it below.  Ask if
you
> have any questions about it.
>
> Oh, BTW, I'm sure that I have (as usually) went totally overboard with
this
> function and someone will now probably point out that PHP has
something
> built in to do what I'm doing here...but I couldn't find it and I had
fun
> writing this function anyway. :-)
>
>  function http_file_exists ($url) {
>
>if (!preg_match("/^http:\/\/([^\/]+)\/.*$/i",$url,$matches)) {
>
>  return "Error - incorrect format";
>
>} else {
>
>  $host = $matches[1];
>  $fp = fsockopen ($host, 80, $errno, $errstr, 30);
>  if (!$fp) return "Error - couldn't connect to host";
>else {
>  fputs ($fp, "HEAD $url HTTP/1.0\r\n\r\n");
>  $response = fgets ($fp,128);
>  fclose ($fp);
>  return (eregi("^.+200 OK.+$",$response) ? true : false);
>}
>
>}
> }
> ?>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need opinion On sessions - Cookies mandatory?

2002-01-24 Thread DL Neil

Entering the conversation late...

1 IP addresses
Remember these are not necessarily 'unique'. If two of us here log in, won't we appear 
(to you) have the same IP
address if we're 'hiding' behind a NAT (Network Address Translation) box? Also dial-up 
users share a pool of IP
addresses which are reallocated between customers as they disconnect/reconnect.

2 Cookies
I think someone has already made points against their use. Many corporates set 
up/require that browsers are
configured to reject all cookies (plays havoc with many shopping and banking sites). 
Obviously there is popular
advice that cookies are 'not good', because I've had a number of friends and clients 
tell me that they regularly
clear out their 'cookie jar' - and need help when they get over enthusiastic and clear 
more than they should...

There's a balance between easing life for those who are 'in', and turning off those 
trying to arrive. The trick
is finding it!
=dn


- Original Message -
From: "SpamSucks86" <[EMAIL PROTECTED]>
To: "'PHP-General'" <[EMAIL PROTECTED]>
Sent: 23 January 2002 23:46
Subject: RE: [PHP] Need opinion On sessions - Cookies mandatory?


> The idea of building a website is largely to accommodate as large a
> portion of your visitors as possible. I'm not worried about people
> bookmarking sessionID's, but what if someone copy/pastes the URL to a
> friend and they use the section. My friend gave me an excellent idea,
> and that is to check their IP and store the IP in the session. If the IP
> doesn't match, then start a new session. This would be perfect, because
> there's a double check. If someone disconnects to the internet but never
> closes their browser, I don't think they should be allowed to continue
> their session anyway, they should be required to login again.
>
> -Original Message-
> From: Nick Wilson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 3:35 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Need opinion On sessions - Cookies mandatory?
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> * and then Jason G. blurted
> > If cookies do not work, then you must have a session_id appended to
> the
> > URL.  HTTP is a "stateless" protocol.  So every time you make a
> request via
> > HTTP, you must let PHP know what the session_id is either through
> cookies,
> > or url query strings (or possibly posted with a form).
>
> Yep, now I'm with you. The amount of times you'd see that kind of ugly
> URL would be fairly minimal in most situations as most users these days
> aren't even aware they *can* disable cookies.
>
>
> > >> disable cookies, but appending the session ID could be a security
> risk.
> > >> Consider this: Someone is viewing a page and says "oh cool, I want
> Joe
> > >> to see this". He then copy/pastes the URL, sessionID and all, to
> Joe,
> > >> who then loads up the page using his friend's SessionID. With
> cookies,
> > >> this would not happen.
> > >
> > >Not a problem. The session is *destroyed* as soon as a user closes
> the
> > >browser.
> >
> > A session will only be *destroyed* if it uses a cookie. PHP never
> knows
> > when you close the browser, but the browser will remove the cookie.
> Next
> > time you fire up the browser, it will not send the cookie, and a
> different
> > session will be started.
>
> Sure. But there is some kind of clean on the host machine right? You
> couldn't expect to continue a session a week later because you've
> bookmarked a URL containind a SID.
> I think this is controlled by something like a timeout var in the
> php.ini.
>
> > In my personal experience, using cookies only has not proven to be a
> > problem.  Your call.
>
> When you say using cookies only do you mean 'requiring' the user to have
> cookies enabled?
>
> - --
>
> Nick Wilson
>
> Tel: +45 3325 0688
> Fax: +45 3325 0677
> Web: www.explodingnet.com
>
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE8TnW3HpvrrTa6L5oRAthOAJ0WOpUWC5fFMokhYF2QsaQaQolp+wCfQWHL
> 03BrqRN2kLf+VWC/tzDSHho=
> =Gek0
> -END PGP SIGNATURE-
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Whats the best way.

2002-01-24 Thread Stefan Rusterholz

Read this through: http://www.php.net/manual/en/features.file-upload.php
Consider then: http://www.php.net/manual/en/function.is-uploaded-file.php
After that read:
http://www.php.net/manual/en/function.move-uploaded-file.php

and then do it like that:
-upload form
-check if user has uploaded a file (he could have sent an empty form)
-check what extension is needed (.jpg, .gif or whatever)
-move_uploaded_file($userfile, "Your/Directory/".time().$extension)

hope this helps
stefan rusterholz

- Original Message -
From: "Philip J. Newman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 9:47 AM
Subject: [PHP] Whats the best way.


Whats the best way that I can let users upload single .jpeg and gif files,
renaming then with a time stamp?

Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Error whith printer_list()

2002-01-24 Thread Mårten Andersson

var_dump(printer_list(PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED));

When I try to run this the following errormessage occurs:
Fatal error: Call to undefined function: infophp() in D:\Program 
Files\Apache Group\Apache\htdocs/index.php on line 61

Undefined function? What does that mean?
//M.


--
Mårten Andersson
Loddbygatan 2
60218 Norrköping

URL: http://www.vanvett.net/marten
email: [EMAIL PROTECTED]
ICQ: 86515830


_
Hämta MSN Explorer kostnadsfritt på http://explorer.msn.se/intl.asp


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Error whith printer_list()

2002-01-24 Thread Jason Wong

On Thursday 24 January 2002 17:57, Mårten Andersson wrote:
> var_dump(printer_list(PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED));
>
> When I try to run this the following errormessage occurs:
> Fatal error: Call to undefined function: infophp() in D:\Program
> Files\Apache Group\Apache\htdocs/index.php on line 61
>
> Undefined function? What does that mean?

It means PHP doesn't know about that function, ie its not a built-in function 
and you haven't defined it.

I don't know what you're trying to do but maybe you mean to use phpinfo() as 
opposed to infophp()?


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Computers are useless.  They can only give you answers.
-- Pablo Picasso
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Ftp issue - please help

2002-01-24 Thread Conrad Strydom

Please help.

i'm trying to access a remote ftp server , with my script.

it all works nicely , i can log in , i can list folders , make folders,
delete stuff,

but NOT COPY FILES!!

it gives this warning and no error.

Warning: ftp_put: "/capetown" is current directory. in
/home/www/cticc/incubator/applications/cm/compilecnfrm_edit.php on line 259

NOTE: i manually browse to the folder before operations

HELLPP!!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] db conversion advice needed

2002-01-24 Thread Wilbert Enserink

Hi all,


I have this huge db in FileMaker Pro format :-(

Now I need this db to make a db content based website. I know enough stuff
about MySQL to do this, but I don't know anything about converting db's.
Does anybody have any tips, or ideas how I can handle this db converting
thing best?



I am able to export the filemaker pro file to -tab based- files, which I
know M$ excel can import



many regards, and thx for all the ideas.


Wilbert Enserink

- 
Pas de Deux 
Van Mierisstraat 25 
2526 NM Den Haag 
tel 070 4450855 
fax 070 4450852 
http://www.pdd.nl 
[EMAIL PROTECTED] 
-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Using Mail Functions.

2002-01-24 Thread Sidney

Dear all,

I am a new user on php and I have read on the function of IMAP in the
php.net but they made me confuse. In ture i am not understand what is the
function and how to use them.

Have there got any resource for me to reference? I think that if there got
more example it can be more easy to understand.

In case, I want to design program which can receive mail and save to mysql
server.

I have spend so much time on this... :(

Can you give me some suggestion?
my e-mail: [EMAIL PROTECTED]

Best regards,
Sidney



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] XML / XSLT parsing using PHP

2002-01-24 Thread Lasse Laursen

Hi,

We are about to develop a CMS that uses XML and XSLT.

The XML files contains some static information (header, footers and common
non-dynamic information). We would like to have a XML file that would
contain a field like:


  <...>
  <...>
  <...>


Before the XML file is loaded into the PHP script that uses the xslt_process
routine to convert the XML/XSLT files into plain HTML we would like to
replace the  field with come dynamic content (eg. some other
variables, etc.)

What's the easiest way to do that? SAX or?

Furthermore the 'xslt_process' function requires the following parameters:

xslt_process (resource xh, string xml, string xsl [, string result [, array
arguments [, array parameters]]])

where the XML and XSLT variables are references to files. - The XML file is
in our example a variable (eg. $current_xml_file = "x";) and therefor we
cannot use the xslt_process function? Of cause we can store the XML var. in
a temporary location and then read the file, but that's an extreamly ugly
approach! :) Any ideas?


I'm looking forward to your replies :)


Yours
--
Lasse Laursen <[EMAIL PROTECTED]> - Systems Developer
NetGroup A/S, St. Kongensgade 40H, DK-1264 København K, Denmark
Phone: +45 3370 1526 - Fax: +45 3313 0066 - Web: www.netgroup.dk

"If it ain't broke, it doesn't have enough features yet." -- laursen
"I have not failed. I've just found 10,000 ways that won't work." --Thomas
Edison



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Using Mail Functions.

2002-01-24 Thread Ben-Nes Michael

Never done this before but its look rather simple:

first connect to the server|
probobly with imap_open

Read the messages into some Variable/ array what ever

Upload to the MySQL server.


Small Tip:
Drom MySQL and use Postgresql

--
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--


- Original Message -
From: "Sidney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 12:32 PM
Subject: [PHP] Using Mail Functions.


> Dear all,
>
> I am a new user on php and I have read on the function of IMAP in the
> php.net but they made me confuse. In ture i am not understand what is the
> function and how to use them.
>
> Have there got any resource for me to reference? I think that if there got
> more example it can be more easy to understand.
>
> In case, I want to design program which can receive mail and save to mysql
> server.
>
> I have spend so much time on this... :(
>
> Can you give me some suggestion?
> my e-mail: [EMAIL PROTECTED]
>
> Best regards,
> Sidney
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Clear form post data

2002-01-24 Thread Conrad Strydom

um , lets say a form calls its own page , does some db operations and then
returns to its former self ,

how do you get it to not perform said db operations on refresh?

i.e the data is reposted and thus  the submit variable still appears to be
set?

Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] db conversion advice needed

2002-01-24 Thread Stefan Rusterholz

- Original Message -
From: "Wilbert Enserink" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 4:34 PM
Subject: [PHP] db conversion advice needed


> Hi all,
>
>
> I have this huge db in FileMaker Pro format :-(
Which plattform? Mac, Win?

I had once to write an import script for mysql to import a tab-export from
FM Pro Mac. I did it this way:
-HTML-Fileupload
-Translate chars (e.g. german characters ä, ö, ü - or in HTML ä,
ö - furthermore I translated ASCII 13 to )
-Read in a loop line for line
-Split line by tab
-check if record is already in mysql database (only if you have to import
more than once)
-build mysql insert query
-done :)

If you have more questions or more detailed questions just ask
best regards
Stefan Rusterholz

> Now I need this db to make a db content based website. I know enough stuff
> about MySQL to do this, but I don't know anything about converting db's.
> Does anybody have any tips, or ideas how I can handle this db converting
> thing best?
>
>
>
> I am able to export the filemaker pro file to -tab based- files, which I
> know M$ excel can import
>
>
>
> many regards, and thx for all the ideas.
>
>
> Wilbert Enserink
>
> -
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: phpwiki save button

2002-01-24 Thread Tim Ward

What is it you actually want to do? Add the current date/time or a timestamp
entered on the submitting form? See date() for the former. Once you've got
your stamp in a format you want just add it to the front of the story before
saving. Give us a bit more detail about what it is that isn't working, or
the code that you want to modify.

(also) Tim
www.chessish.com  

--
From:  Tim Bogart [SMTP:[EMAIL PROTECTED]]
Sent:  23 January 2002 17:47
To:  [EMAIL PROTECTED]
Subject:  phpwiki save button

Hello everybody.  My name is Tim and I am new to this list.  I am
not a 
programmer and don't even play one on tv.  

I've recently installed and have started to attempt to customize
phpwiki.  I 
need to modify the way the "save" button works.  I not only need it
to do the 
save, but I would like it to append a date and time stamp to the
text being 
posted to the wiki.  My first choice would that the line of text
being typed 
would be prefixed with the stamp rather than slapping it on the end.
This I 
believe would be the most ergonomically convienient for those
reading that 
which has been posted.

Is there anybody out there willing to give me a hand.  

TIA,

Tim B.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] to evaluate ...

2002-01-24 Thread Thorsten Wandersmann

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 24 Jan 2002, Jason Wong wrote:

> Yes, you're missing something :) You can use arrays in forms, just use names
> like "width[0]", "width[1]" etc.

Thanks to Jason and Billy for this information, it makes my life a lot
easier.


And thanks to all the others given me hints how it would work. I think I
could need it in future.


thorsten

- -- 
Thorsten Wandersmann Phone:  +49-911-8172249
Bonhoefferstr. 79Mobile: +49-179-6670562
90473 Nuremberg  e-Mail: [EMAIL PROTECTED]
Germany  http://www.caipy.de

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Weitere Infos: siehe http://www.gnupg.org

iD8DBQE8T/CeQkW0pERqT24RApg2AJ41Y8dK26NeEynXEigKSxNaHYZ2MwCbB1k3
gDQve7Q9ppbJ0yg2F0whOdc=
=dxmm
-END PGP SIGNATURE-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: One Line text boxes vs. Multiline text boxes

2002-01-24 Thread Tim Ward

Sounds to like you're not putting the value in quotes.
i.e.  you can get away with  you can't.
's (what I assume you are referring to as multiline text boxes)
are different as the value goes between the tabs and seems to be treated as
prefdefined text (like between  tags)

Tim
www.chessish.com  

--
From:  Phil Schwarzmann [SMTP:[EMAIL PROTECTED]]
Sent:  23 January 2002 17:13
To:  [EMAIL PROTECTED]
Subject:  One Line text boxes vs. Multiline text boxes

For some reason, when a user enters information into a form field
that's
only one line, it might enter the database differently than if it
was a
multiline text box.
 
Anything characters after a blank space or a comma will get deleted
if
it is entered into a single-line text box.  But if I make it a
multiline
text box, it enters all the information correctly.
 
Why is this??

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] calling an URL

2002-01-24 Thread Eduardo Melo

How can i call as URL from a PHP code ?

thanks,

eduardo melo
computer programmer

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] calling an URL

2002-01-24 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Eduardo Melo blurted
> How can i call as URL from a PHP code ?

What do you mean by 'call'?
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8T/YiHpvrrTa6L5oRAtCOAKCHCmuEuyMh2Ze5rM9rWgdlECgRHQCfWf9S
3mqIsUvfHYFBTOX8ACPUIho=
=3R76
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] delete a file from the server

2002-01-24 Thread Tommy Straetemans

Hi,
I'm new in PHP and i have a question:

How can i delete a file from the server in PHP


Tommy Straetemans



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] calling an URL

2002-01-24 Thread Martin Cabrera Diaubalick


Header("Location:http://whatever.com";);

HTH
REgards

El Jue 24 Ene 2002 12:50, Eduardo Melo escribió:
>How can i call as URL from a PHP code ?
>
>thanks,
>
>eduardo melo
>computer programmer
>
>_
>Send and receive Hotmail on your mobile device: http://mobile.msn.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: delete a file from the server

2002-01-24 Thread liljim

Hi Tommy,

use unlink()

$filename = "mypic.jpg";

unlink($filename)
or die("Something's barfed");

James

> How can i delete a file from the server in PHP




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] delete a file from the server

2002-01-24 Thread Jeff Van Campen


>How can i delete a file from the server in PHP

unlink("/file/path/filename.txt");
http://www.php.net/manual/en/function.unlink.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Viral Marketing PHP (was Re: [PHP] Computer Science and PHP)

2002-01-24 Thread DL Neil

Hello Manuel,

> > One other dimension, the institutions can only offer classes in the languages (and 
>techniques/technologies)
that
> > the trainers know and than they have the resources (hardware, 
>compilers/interpreters) to cover.
> >
> > Maybe therein lies an answer to the 'marketing' side too. The best way to 'market' 
>a new language, ie to
cause
> > it to spread virulently (?virus-like) is by offering classes in the schools! 
>Certainly when my customers ask
> > about 'which tool' my first question is always, "what skill sets do the staff 
>have?".
>
> One good point about what you said is that one budgetless what to
> promote PHP is to use 'viral marketing'. Viral marketing is a way to
> market something by using a technique that spreads by itself, ie, no
> additional effort or money needed to be spent by the originator to have
> the notice of what you want to market spread like crazy.
...
> sort what ideas can become viral. With that topic in the mind, if you
> ever figure a viral idea to promote PHP, just share it here to prove the
> concept as well! :-)


I had intended that the 'institutional approach' be seen as the seeds of a viral 
marketing campaign. If students
learn the tool, when they 'go out to work' they want to use it. Even if the student is 
a 'hobbyist' then it
still spreads the 'word' around...

Your point earlier, if statistics say x million dynamic web sites are held together by 
PHP, IT managers/decision
makers tend to feel they should take notice, eg Apache and the Netcraft surveys. The 
same will apply to PHP,
numbers need to build to some 'critical mass' for corporate credibility to follow (as 
wrong as that sounds).

How to get PHP into the institutions? You'd think it would be easy, wouldn't you - 
it's 'free', and that sounds
great! However you need competent/trained teachers/training staff. You need teaching 
materials and supporting
text books. You need sample exercises and databases. Look at what SuSE are doing with 
email servers (etc) and
RedHat with Linux distributions. Perhaps a distribution of LAMPS or the 'PHP Triad', 
especially configured for
an educational environment could be considered? Finally you need people to be 
convinced that there's a demand
for the teaching, and conversely students convinced that it is a valuable skill to 
acquire...

Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] db conversion advice needed

2002-01-24 Thread Miles Thompson

If you have access to the MySQL console (command line) ...

1. Read the MySQL doc's on LOAD DATA INFILE so that you know the various 
parameters, etc.
2. Export from FileMaker Pro using delimiters which will work with your 
data and are acceptable to MySQL
3. Create necessary database and tables
4. Execute LOAD DATA INFILE with appropriate switches. Don't be surprised 
if this takes some messing about; how the line is terminated often trips 
one up.

Here's one import line that worked ...
load data infile 'pwlist.txt' replace into table subscriber  fields 
terminated by '\t' optionally enclosed by ''" " "" lines terminated by '\r\n'

I can't quite remember how the "optionally enclosed" bit was conformer, I 
think it is tripe quote enclosing double quote.

It's difficult to be more specific, as so much depends on the data. I've 
only had to export from FM Pro once, and thatwas to transfer to MSFT Access 
for a client. The original consultant had specified FMP's "number" type for 
the telephone numbers. Many were of European origin, with embedded hyphens, 
etc.

First time around I tried using Access as the intermediate step, and it 
insisted on doing arithmetic on those fields, as did Access when I tried to 
import it directly. I ended up using FoxPro (old DOS version)  to create 
the table, then edited the header to change numeric field to character, 
deleted all the data and re-imported. Sheesh!

I hope you'll be spared these hoops.

Regards - Miles Thompson

At 04:34 PM 1/23/2002 +0100, Wilbert Enserink wrote:
>Hi all,
>
>
>I have this huge db in FileMaker Pro format :-(
>
>Now I need this db to make a db content based website. I know enough stuff
>about MySQL to do this, but I don't know anything about converting db's.
>Does anybody have any tips, or ideas how I can handle this db converting
>thing best?
>
>
>
>I am able to export the filemaker pro file to -tab based- files, which I
>know M$ excel can import
>
>
>
>many regards, and thx for all the ideas.
>
>
>Wilbert Enserink
>
>-
>Pas de Deux
>Van Mierisstraat 25
>2526 NM Den Haag
>tel 070 4450855
>fax 070 4450852
>http://www.pdd.nl
>[EMAIL PROTECTED]
>-
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Help is_dir command driving me crazy!

2002-01-24 Thread joakim . andersson

Try to add the following line above all code:

clearstatcache();

This clears the status from previous is_dir()'s.

Good luck,
Joakim


> -Original Message-
> From: Dean Dunn [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 22, 2002 6:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Help is_dir command driving me crazy!
> 
> 
> Can anyone tell me why this script doesn't work properly. 
> I've coded it
> several others ways including using is_dir pointing to the full path.
> Nothing works reliably, it works sometimes/sometimes not.
> 
> One interesting thing is that my PHP ecommerce app 
> (osCommrce) is run and
> then my script is run it always seems to work. This to me 
> points to some
> form of initialisation I'm missing.
> 
> Any advice would be gratefully received.
> 
> Regards,
> 
> Dean (a new PHP user)
> 
> Code Follows
> 
>  
> $dir_path = "\Inetpub\wwwroot\catalog\images";
> $dir = "abc";
> $complete_path = "$dir_path\\$dir";
> $dir_exists = "Directory already exists...can not create again";
> $dir_not_exist = "Directory does not exist...will try and create new
> directory";
> $dir_create_success = "Directory created";
> $dir_create_failure = "Could not create directory";
> 
> print ("Checking to see if subdirectory \"$dir_path\\$dir \"
> exists");
> 
> if (is_dir($complete_path) == true)
>  {
>  print $dir_exists;
>  }
> 
> else
>  {
>  print $dir_not_exist;
>  chdir ($dir_path);
>  if (mkdir ("abc",0700) == true) {
>  print $dir_create_success; }
>   else { print $dir_create_failure; }
>   }
> ?>
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Split files

2002-01-24 Thread DL Neil

> > > Making any sense?
> >
> > Year, so I have to do it manually (thought someone could preveting me from
> > reinvent the wheel... ;-)
> >
> > > What are you really trying to achieve?
> >
> > I'm trying to split a large binary file (>2 GB) into peaces of 700 MB to
> > burn it on a cd. It's a part of a backup-mechanism I'm wirting in PHP.
>
> Maybe you could find a program that will do the split for you then call that
> from within PHP.


=Hmm, I'm still come at it from the other way around (all due respect to Jason) - but 
then I don't recall OpSys
details, or know if there is a utility/tool for the job in your choice of OpSys.

=What it reminds me of, is what we used to do when archiving files/file sets larger 
than 1.44MB - zipping them
onto more than one diskette.

=Try using PHP to read the original file, and copy it out into a set of ~700MB 
copy/sub-files. Burn each of
these onto CDs. Get PHP to output a handy 'key' - report listing what came from where 
and how to reassemble it
all again (in six months' time when all is forgotten).

open original file
$FileCtr=0;

while not eof
{
create output sub-file nr $FileCtr
$MegCtr=1;

while $MegCtr<700 and not eof
{
read megabyte
write to sub-file
$MegCtr++;
} //end write loop

close sub-file
$FileCtr++;
} //end read

close original file
echo "Copied original into $FileCtr sub-files";


=Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Why while doesn't work?

2002-01-24 Thread Anthony Rodriguez

Although the table con_inf in db sbwresearch contains 3 records with 
username as the first column,  the following short script generates a blank 
page:



Why?  I've use the statement in other scripts and it works!

Thanks!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] emulate a browser

2002-01-24 Thread Michael Sims

At 10:33 AM 1/24/2002 +0100, Frank Benady wrote:
>It works really nice, Michael, thanks again.
>
>I have one more question, maybe you can answer me :
>If the domain name has been redirected with hte permanent redirect, I
>get the 301 Moved Permanently header response. But if the domain name
>has been frame-forwarded, I have no header response. Is it normal ?
>Do you know if there is some alternatives so I could check if the domain
>name is used, even on a frame-forward type redirectection ?
>Moreover, if the domain has been redirected, is it possible to get the
>url it has been redirected to ?

I'm not really sure what you mean by frame-forwarded.  The only methods of 
redirection that I'm really familiar with are:

1. An HTTP header redirect, such as "Location: http://somewhere";

2. A refresh meta tag in the actual body of the document, such as:

http://somewhere";>

3. A javascript redirect like so:

http://somewhere'">

I'm sure there are many other methods but those are the only three that I 
am personally familiar with.

Number 1 is easy to figure out by simply parsing the HTTP header that is 
returned to you from the remote server.  Numbers 2 and 3 are trickier, 
because you actually have to read the page in and parse it.  I'd probably 
do so using a regex to try and determine if these redirect methods exist 
and where they are going if so.  Number 3 is further complicated by the 
possibility of the redirect being wrapped up inside a JavaScript function 
so that makes it even harder to find using a regex.

Maybe someone else reading this can give you some more/better information...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Split files

2002-01-24 Thread Jason Wong

On Thursday 24 January 2002 20:46, DL Neil wrote:
> > > > Making any sense?
> > >
> > > Year, so I have to do it manually (thought someone could preveting me
> > > from reinvent the wheel... ;-)
> > >
> > > > What are you really trying to achieve?
> > >
> > > I'm trying to split a large binary file (>2 GB) into peaces of 700 MB
> > > to burn it on a cd. It's a part of a backup-mechanism I'm wirting in
> > > PHP.
> >
> > Maybe you could find a program that will do the split for you then call
> > that from within PHP.
>
> =Hmm, I'm still come at it from the other way around (all due respect to
> Jason) - but then I don't recall OpSys details, or know if there is a
> utility/tool for the job in your choice of OpSys.

Well unless it's a *really* obscure OS I'm sure there must be some readily 
available file splitter utility. No point doing more work than necessary by 
writing your own file splitting routine :)


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Bugs, pl. n.:
Small living things that small living boys throw on small living girls.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] eval on php embedded html

2002-01-24 Thread DigitalKoala

hi folks,

i'm having a problem using eval.

i have some html code interdispersed with php code (proper statement not
just variables) in a database.  when i fetch the code and display it using :

$reg_adv_html=addslashes($reg_adv_html);
eval("\$reg_adv_html = \"$reg_adv_html\";");
$reg_adv_html=stripslashes($reg_adv_html);

  print "$reg_adv_html";

the variables work (their values are substitued), but my condtional staments
don't work.

example from $reg_adv_html :

> 


can someone tell me if i have to remove the  tags from the html?

thanks very much!

dk



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Difference between i586 RPM and SRC.RPM?

2002-01-24 Thread Fredrik Wahlberg

src.rpm is the source code packaged in an rpm-file. If you install it as
rpm --rebuild it will compile a binary rpm for you. If you use Redhat you
can find the binary rpm in /usr/src/Redhat/RPMS

i586.rpm is a compiled binary for the i586-platform architecture

/Fredrik
--

Fredrik WahlbergW: +46-8-54 54 56 12
Fusage AB   C: +46-70-576 16 51
Kungstensgatan 38A  F: +46-8-54 54 56 10
113 59 Stockholm[EMAIL PROTECTED]
Sweden


"Gaukia 345" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Wanted to download PHP 4.1.1 RPM.
> What's the difference between i586 RPM and SRC.RPM?
> What sites provide non-FTP download for PHP4.1.1 RPM?
>
> Thanx ppl!
>
>
>
> _
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Todd Cary

When the surfer presses a button, I want a pre-determined file to be
downloaded by the surfer - the box to come up on the surfer's browser:
"Open or save...".

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] eval on php embedded html

2002-01-24 Thread Jon Haworth

>  value="reg1"  ?>> 

You either need to remove the opening {, or put a corresponding } at the end
of the if() statement.

So, either:



Or



HTH
Jon





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


_
This message has been checked for all known viruses by UUNET delivered 
through the MessageLabs Virus Control Centre. For further information visit
http://www.uk.uu.net/products/security/virus/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] multi-threading within php?

2002-01-24 Thread Mattias Andersson

Hello!
 
I was making a spider for a simple searchengine and all was well until I
started testing it on larger sites.
The problem isn't that it doesn't work, it does, but it is very very slow,
just handling one connection at the time.
Basically, it just downloads a page, extract all links from it, then
downloads those pages, extract their links, until all pages on a site has
been downloaded and archived.
Is there any way to do it in several threads so that it handles several
connections simultaneously?
If it would dynamically allocate threads that would be even better.
 
Regards,
Mattias Andersson
 
Software Developer, humany AB
Direct: 08-4540701
Mobile: 0704-526685
 



[PHP] problems with system()

2002-01-24 Thread John Gurley



Hello,
  I am in a bit of a pickle and would greatly appreciate any help. I 
have code which writes inputs to a txt file. These inputs are used as inputs 
to a c program. What I am trying to do is use the redirect command < to run 
the code from php. The command is:
./a.outjunk");
it does write the first couple of lines of the code output to the file.

Can anyone see anything wrong? Any help would be great, thanks again
John


_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] multi-threading within php?

2002-01-24 Thread Stefan Rusterholz

Sorry, I don't have an answer on your question, but a question to you:
I'm currently building a class to browse a page and was interested in the
source of your script. Especially on that part extracting the links.
Would you mind providing the source or is it a commercial?

best regards
Stefan Rusterholz

- Original Message -
From: "Mattias Andersson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 2:52 PM
Subject: [PHP] multi-threading within php?


> Hello!
>
> I was making a spider for a simple searchengine and all was well until I
> started testing it on larger sites.
> The problem isn't that it doesn't work, it does, but it is very very slow,
> just handling one connection at the time.
> Basically, it just downloads a page, extract all links from it, then
> downloads those pages, extract their links, until all pages on a site has
> been downloaded and archived.
> Is there any way to do it in several threads so that it handles several
> connections simultaneously?
> If it would dynamically allocate threads that would be even better.
>
> Regards,
> Mattias Andersson
>
> Software Developer, humany AB
> Direct: 08-4540701
> Mobile: 0704-526685
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] multi-threading within php?

2002-01-24 Thread bvr


You may want to use 'wget' spider function, then parse the files with PHP if necessary.

http://wget.sunsite.dk/

bvr.


On Thu, 24 Jan 2002 14:52:54 +0100, Mattias Andersson wrote:

>Hello!
> 
>I was making a spider for a simple searchengine and all was well until I
>started testing it on larger sites.
>The problem isn't that it doesn't work, it does, but it is very very slow,
>just handling one connection at the time.
>Basically, it just downloads a page, extract all links from it, then
>downloads those pages, extract their links, until all pages on a site has
>been downloaded and archived.
>Is there any way to do it in several threads so that it handles several
>connections simultaneously?
>If it would dynamically allocate threads that would be even better.
> 
>Regards,
>Mattias Andersson
> 
>Software Developer, humany AB
>Direct: 08-4540701
>Mobile: 0704-526685
> 
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Why while doesn't work?

2002-01-24 Thread DL Neil

Anthony,

> Although the table con_inf in db sbwresearch contains 3 records with
> username as the first column,  the following short script generates a blank
> page:
>
>  $connection=mysql_connect("localhost","wagner","xyz") or die ("No
> connection!");
> $db=mysql_select_db("sbwresearch",$connection) or die ("No database!");
> $qry_1="select * from con_inf";
> $result_1=mysql_query($qry_1,$connection) or die ("No query # 1!");
> while ($row_1=mysql_fetch_array($result_1,"mysql_assoc"))
> {
>$username=$row_1["username"];
>echo "$username";
> };
> mysql_free_result($result_1);
> mysql_close($connection);
> exit;
> ?>
>
> Why?  I've use the statement in other scripts and it works!


Please review http://www.php.net/manual/en/function.mysql-fetch-array.php. The second 
argument to
mysql_fetch_array is the name of a system-defined constant, not a string
(http://www.php.net/manual/en/language.constants.php).

Given the way you have coded this example, may I also suggest mysql_assoc() at
http://www.php.net/manual/en/function.mysql-fetch-assoc.php

Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: phpwiki save button

2002-01-24 Thread Tim Bogart

On Thursday 24 January 2002 06:36 am, Tim Ward wrote:
> What is it you actually want to do? Add the current date/time or a
> timestamp entered on the submitting form? 

yes.  That is exactly what I wish to do.

See date() for the former. Once
> you've got your stamp in a format you want just add it to the front of the
> story before saving. Give us a bit more detail about what it is that isn't
> working, or the code that you want to modify.

The following is the savepage.php script.  It (in as much as I can figure) is 
 what is executed when one pushes or clicks on the "save" button when phpwiki 
is serving up the"editpage.html" file to a user on his or her browser, and 
the individual is finished editing, and wishes to save their entry.  The 
"save" button is at the bottom of the edit page.  What I wish to have happen 
is, to have the save button do what it does now, save the changes, but in 
addition to that, if I had my perfect world, I would like this savepage.php 
script prefix the edited text with a date and time stamp on the left side of 
the page, appearing as a (redundancy here) prefix to the typed material.  
That way each entry would have a date and time stamp.  I hope I am describing 
this in a fashon you can understand.  Let me give you an example.  One types 
...

This is a good day.

Then the individual pushes the save button.  The save is executed, and the 
user is bounced back to the preview page (the preview page part happens as a 
result simply of how the thing just works).  When the preview page is 
displayed, the newly added text appears, but looks like this...

2002 01/24 09:33:45  This is a good day.

The format of the date and time are really fluff to me, as long as it appears.

I hope my description is understandable.  I eagerly await your response.

Tim B.

Here's the script...

-

s_id('$Id: savepage.php,v 1.17 2001/11/14 21:05:38 dairiki Exp $'); 
require_once('lib/Template.php'); 
require_once('lib/transform.php'); 
require_once('lib/ArchiveCleaner.php'); 
 
/* All page saving events take place here. All page info is also taken care 
of here. This is klugey. But it works. There's probably a slicker way of 
coding it. 
*/ 
 
// FIXME: some links so that it's easy to get back to someplace useful from 
these // error pages. 
 
function ConcurrentUpdates($pagename) { /* xgettext only knows about c/c++ 
line-continuation strings is does not know about php's dot operator. We want 
to translate this entire paragraph as one string, of course. 
*/ 
$html = ""; $html .= gettext ("PhpWiki is unable to save your changes, 
because another user edited and saved the page while you were editing the 
page too. If saving proceeded now changes from the previous author would be 
lost."); 
$html .= "\n"; $html .= gettext ("In order to recover from this 
situation follow these steps:"); 
$html .= "\n"; $html .= gettext ("Use your browser's Back 
button to go back to the edit page."); 
$html .= "\n"; $html .= gettext ("Copy your changes to the clipboard 
or to another temporary place (e.g. text editor)."); 
$html .= "\n"; $html .= gettext ("Reload the page. You should 
now see the most current version of the page. Your changes are no longer 
there."); 
$html .= "\n"; $html .= gettext ("Make changes to the file again. 
Paste your additions from the clipboard (or text editor)."); 
$html .= "\n"; $html .= gettext ("Press Save again."); 
$html .= "\n"; $html .= QElement('p', gettext ("Sorry for the 
inconvenience.")); 
 
echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while updating 
%s"), $pagename)); 
ExitWiki(); 
} 
 
function PageIsLocked($pagename) { 
$html = QElement('p', gettext("This page has been locked by the administrator 
and cannot be edited.")); 
$html .= QElement('p', gettext ("Sorry for the inconvenience.")); 
 
echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while editing 
%s"), $pagename)); 
ExitWiki (""); 
} 
 
function NoChangesMade($pagename) { $html = QElement('p', gettext ("You have 
not made any changes.")); $html .= QElement('p', gettext ("New version not 
saved.")); 
echo GeneratePage('MESSAGE', $html, sprintf(gettext("Edit aborted: %s"), 
$pagename)); 
ExitWiki (""); 
} 
 
function BadFormVars($pagename) { $html = QElement('p', gettext ("Bad form 
submission")); $html .= QElement('p', gettext ("Required form variables are 
missing.")); 
echo GeneratePage('MESSAGE', $html, sprintf(gettext("Edit aborted: %s"), 
$pagename)); 
ExitWiki (""); 
} 
 
function savePreview($dbi, $request) { $pagename = 
$request->getArg('pagename'); $version = $request->getArg('version'); 
 
$page = $dbi->getPage($pagename); $selected = $page->getRevision($version); 
 
// FIXME: sanity checking about posted variables // FIXME: check for 
simultaneous edits. foreach (array('minor_edit', 'convert') as $key) 
$formvars[$key] = $request->getArg($key) ? 'checked' : ''; foreach 
(array('content', 'editversion', 'summary', '

Re: [PHP] Split files

2002-01-24 Thread bvr


>> =Hmm, I'm still come at it from the other way around (all due respect to
>> Jason) - but then I don't recall OpSys details, or know if there is a
>> utility/tool for the job in your choice of OpSys.
>
>Well unless it's a *really* obscure OS I'm sure there must be some readily 
>available file splitter utility. No point doing more work than necessary by 
>writing your own file splitting routine :)


Think about a multi-volume archiver, like tar.
Also pkzip, rar and ace have an option to archive without using compression.

bvr.









-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Clear form post data

2002-01-24 Thread Atanas Vassilev

The general approach when a form has $PHP_SELF as the action value is to use
a switch construct and in one of the cases perform the mentioned db
operations, in all other cases (depends what variable you'd be switching)
simply do not perform them.

HTH,
Nasko

"Conrad Strydom" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> um , lets say a form calls its own page , does some db operations and then
> returns to its former self ,
>
> how do you get it to not perform said db operations on refresh?
>
> i.e the data is reposted and thus  the submit variable still appears to be
> set?
>
> Thanks
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Jason Wong

On Thursday 24 January 2002 21:33, Todd Cary wrote:
> When the surfer presses a button, I want a pre-determined file to be
> downloaded by the surfer - the box to come up on the surfer's browser:
> "Open or save...".

Many ways to do this, one of which could be:


  

  


Then in your file download.php, have a single statement using the header() 
function to redirect to the file that is to be downloaded.



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Bore, n.:
A person who talks when you wish him to listen.
-- Ambrose Bierce, "The Devil's Dictionary"
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problems writing the TM (™) symbol when generating XML file

2002-01-24 Thread Atanas Vassilev

I'm generating an XML file and because of the later purpose of this XML file
I need to write all occurrences of the TM symbol using "™" code
instead of "™". However, no matter how I write this symbol in the
input text fields, holding ALT and typing 0153 or just entering "™" in
the end I always get "™" in the generated XML file. I would appreciate
any clue for a workaround of this issue.

Thanks!
Nasko



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Why while doesn't work?

2002-01-24 Thread Matt Schroebel

If you only want the associative array, just use mysql_fetch_array($result).  If 
you're using the constant MYSQL_ASSOC, uppercase it, and don't quote it.

>Although the table con_inf in db sbwresearch contains 3 records with 
>username as the first column,  the following short script generates a blank 
>page:

>mysql_fetch_array($result_1,"mysql_assoc"))

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] delete a file from the server

2002-01-24 Thread bvr



That is indeed very tricky.

You may try this routine:

http://www.php.net/delete";);
?>

bvr.

On Thu, 24 Jan 2002 12:56:09 +0100, Tommy Straetemans wrote:

>Hi,
>I'm new in PHP and i have a question:
>
>How can i delete a file from the server in PHP
>
>
>Tommy Straetemans
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Clear form post data

2002-01-24 Thread Matt Schroebel

One would need to check the db to see if the operation had already been performed, so 
as not to do it again.

>um , lets say a form calls its own page , does some db operations and then returns to 
>its former self ,
>how do you get it to not perform said db operations on refresh?
>i.e the data is reposted and thus  the submit variable still appears to be set?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Sending a POST-message

2002-01-24 Thread Björne

Hi!

I wonder how I can send a POST-command to a server, via a PHP-script instead 
of a form.

Imagen that I have this form:

Name: 
E-mail: 



Now I want to send a command to the /request.php, and formate the returned 
data - via a PHP-script.

Should I use sockets or fopen? Or something else? This would be easy if I 
could use the GET-method, but unforntuatly I can't.

Best regards,

Björn Wikström
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: phpwiki save button

2002-01-24 Thread Tim Ward

I think you just need to add the timestamp to the start of the story before
you save it,
i.e.
$content = date("d/m/Y H:i:s - ") . $content;

or am I missing something?


Tim
www.chessish.com

> -Original Message-
> From: Tim Bogart [SMTP:[EMAIL PROTECTED]]
> Sent: 24 January 2002 15:01
> To:   Tim Ward; [EMAIL PROTECTED]
> Subject:  Re: phpwiki save button
> 
> On Thursday 24 January 2002 06:36 am, Tim Ward wrote:
> > What is it you actually want to do? Add the current date/time or a
> > timestamp entered on the submitting form? 
> 
> yes.  That is exactly what I wish to do.
> 
> See date() for the former. Once
> > you've got your stamp in a format you want just add it to the front of
> the
> > story before saving. Give us a bit more detail about what it is that
> isn't
> > working, or the code that you want to modify.
> 
> The following is the savepage.php script.  It (in as much as I can figure)
> is 
>  what is executed when one pushes or clicks on the "save" button when
> phpwiki 
> is serving up the"editpage.html" file to a user on his or her browser, and
> 
> the individual is finished editing, and wishes to save their entry.  The 
> "save" button is at the bottom of the edit page.  What I wish to have
> happen 
> is, to have the save button do what it does now, save the changes, but in 
> addition to that, if I had my perfect world, I would like this
> savepage.php 
> script prefix the edited text with a date and time stamp on the left side
> of 
> the page, appearing as a (redundancy here) prefix to the typed material.  
> That way each entry would have a date and time stamp.  I hope I am
> describing 
> this in a fashon you can understand.  Let me give you an example.  One
> types 
> ...
> 
> This is a good day.
> 
> Then the individual pushes the save button.  The save is executed, and the
> 
> user is bounced back to the preview page (the preview page part happens as
> a 
> result simply of how the thing just works).  When the preview page is 
> displayed, the newly added text appears, but looks like this...
> 
> 2002 01/24 09:33:45  This is a good day.
> 
> The format of the date and time are really fluff to me, as long as it
> appears.
> 
> I hope my description is understandable.  I eagerly await your response.
> 
> Tim B.
> 
> Here's the script...
> 
> -
> 
> s_id('$Id: savepage.php,v 1.17 2001/11/14 21:05:38 dairiki Exp $'); 
> require_once('lib/Template.php'); 
> require_once('lib/transform.php'); 
> require_once('lib/ArchiveCleaner.php'); 
>  
> /* All page saving events take place here. All page info is also taken
> care 
> of here. This is klugey. But it works. There's probably a slicker way of 
> coding it. 
> */ 
>  
> // FIXME: some links so that it's easy to get back to someplace useful
> from 
> these // error pages. 
>  
> function ConcurrentUpdates($pagename) { /* xgettext only knows about c/c++
> 
> line-continuation strings is does not know about php's dot operator. We
> want 
> to translate this entire paragraph as one string, of course. 
> */ 
> $html = ""; $html .= gettext ("PhpWiki is unable to save your changes, 
> because another user edited and saved the page while you were editing the 
> page too. If saving proceeded now changes from the previous author would
> be 
> lost."); 
> $html .= "\n"; $html .= gettext ("In order to recover from this 
> situation follow these steps:"); 
> $html .= "\n"; $html .= gettext ("Use your browser's Back 
> button to go back to the edit page."); 
> $html .= "\n"; $html .= gettext ("Copy your changes to the
> clipboard 
> or to another temporary place (e.g. text editor)."); 
> $html .= "\n"; $html .= gettext ("Reload the page. You
> should 
> now see the most current version of the page. Your changes are no longer 
> there."); 
> $html .= "\n"; $html .= gettext ("Make changes to the file again.
> 
> Paste your additions from the clipboard (or text editor)."); 
> $html .= "\n"; $html .= gettext ("Press Save again."); 
> $html .= "\n"; $html .= QElement('p', gettext ("Sorry for
> the 
> inconvenience.")); 
>  
> echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while
> updating 
> %s"), $pagename)); 
> ExitWiki(); 
> } 
>  
> function PageIsLocked($pagename) { 
> $html = QElement('p', gettext("This page has been locked by the
> administrator 
> and cannot be edited.")); 
> $html .= QElement('p', gettext ("Sorry for the inconvenience.")); 
>  
> echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while
> editing 
> %s"), $pagename)); 
> ExitWiki (""); 
> } 
>  
> function NoChangesMade($pagename) { $html = QElement('p', gettext ("You
> have 
> not made any changes.")); $html .= QElement('p', gettext ("New version not
> 
> saved.")); 
> echo GeneratePage('MESSAGE', $html, sprintf(gettext("Edit aborted: %s"), 
> $pagename)); 
> ExitWiki (""); 
> } 
>  
> function BadFormVars($pagename)
> { $html = QElement('p', gettext ("Bad form su

Re: [PHP] RE: phpwiki save button

2002-01-24 Thread Tim Bogart

No, you're not missing a thing.  I just need to know exactly where to put the 
line you sent me.  The word "content" is mentioned a few times in the script 
and I'm not a programmer, remember?  Could you please indicate exactly where 
you would put the line you sent me?  I'm sure you are taking for granted that 
I know more than I seem, but I don't.  I'm a newbie at this and have to have 
my nose put down into it before I understand.  Where should I put the line?

Thanks!

Tim

On Thursday 24 January 2002 10:07 am, Tim Ward wrote:
> I think you just need to add the timestamp to the start of the story before
> you save it,
> i.e.
> $content = date("d/m/Y H:i:s - ") . $content;
>
> or am I missing something?
>
>
>   Tim
>   www.chessish.com
>
> > -Original Message-
> > From:   Tim Bogart [SMTP:[EMAIL PROTECTED]]
> > Sent:   24 January 2002 15:01
> > To: Tim Ward; [EMAIL PROTECTED]
> > Subject:Re: phpwiki save button
> >
> > On Thursday 24 January 2002 06:36 am, Tim Ward wrote:
> > > What is it you actually want to do? Add the current date/time or a
> > > timestamp entered on the submitting form?
> >
> > yes.  That is exactly what I wish to do.
> >
> > See date() for the former. Once
> >
> > > you've got your stamp in a format you want just add it to the front of
> >
> > the
> >
> > > story before saving. Give us a bit more detail about what it is that
> >
> > isn't
> >
> > > working, or the code that you want to modify.
> >
> > The following is the savepage.php script.  It (in as much as I can
> > figure) is
> >  what is executed when one pushes or clicks on the "save" button when
> > phpwiki
> > is serving up the"editpage.html" file to a user on his or her browser,
> > and
> >
> > the individual is finished editing, and wishes to save their entry.  The
> > "save" button is at the bottom of the edit page.  What I wish to have
> > happen
> > is, to have the save button do what it does now, save the changes, but in
> > addition to that, if I had my perfect world, I would like this
> > savepage.php
> > script prefix the edited text with a date and time stamp on the left side
> > of
> > the page, appearing as a (redundancy here) prefix to the typed material.
> > That way each entry would have a date and time stamp.  I hope I am
> > describing
> > this in a fashon you can understand.  Let me give you an example.  One
> > types
> > ...
> >
> > This is a good day.
> >
> > Then the individual pushes the save button.  The save is executed, and
> > the
> >
> > user is bounced back to the preview page (the preview page part happens
> > as a
> > result simply of how the thing just works).  When the preview page is
> > displayed, the newly added text appears, but looks like this...
> >
> > 2002 01/24 09:33:45  This is a good day.
> >
> > The format of the date and time are really fluff to me, as long as it
> > appears.
> >
> > I hope my description is understandable.  I eagerly await your response.
> >
> > Tim B.
> >
> > Here's the script...
> >
> > -
> >
> > s_id('$Id: savepage.php,v 1.17 2001/11/14 21:05:38 dairiki Exp $');
> > require_once('lib/Template.php');
> > require_once('lib/transform.php');
> > require_once('lib/ArchiveCleaner.php');
> >
> > /* All page saving events take place here. All page info is also taken
> > care
> > of here. This is klugey. But it works. There's probably a slicker way of
> > coding it.
> > */
> >
> > // FIXME: some links so that it's easy to get back to someplace useful
> > from
> > these // error pages.
> >
> > function ConcurrentUpdates($pagename) { /* xgettext only knows about
> > c/c++
> >
> > line-continuation strings is does not know about php's dot operator. We
> > want
> > to translate this entire paragraph as one string, of course.
> > */
> > $html = ""; $html .= gettext ("PhpWiki is unable to save your changes,
> > because another user edited and saved the page while you were editing the
> > page too. If saving proceeded now changes from the previous author would
> > be
> > lost.");
> > $html .= "\n"; $html .= gettext ("In order to recover from this
> > situation follow these steps:");
> > $html .= "\n"; $html .= gettext ("Use your browser's Back
> > button to go back to the edit page.");
> > $html .= "\n"; $html .= gettext ("Copy your changes to the
> > clipboard
> > or to another temporary place (e.g. text editor).");
> > $html .= "\n"; $html .= gettext ("Reload the page. You
> > should
> > now see the most current version of the page. Your changes are no longer
> > there.");
> > $html .= "\n"; $html .= gettext ("Make changes to the file
> > again.
> >
> > Paste your additions from the clipboard (or text editor).");
> > $html .= "\n"; $html .= gettext ("Press Save again.");
> > $html .= "\n"; $html .= QElement('p', gettext ("Sorry for
> > the
> > inconvenience."));
> >
> > echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while
> > updating
> > %s"), $pagename));
> > ExitWiki()

[PHP] Change files of users?

2002-01-24 Thread Tobias Schweitzer

Hello

I just subscribed to the list, hoping that someone would be able to help
me with my question.
Well, I'm working on a script that can and will be used by different
users from the machine and I was wondering if there was any way to do
something like an su, changing the user the script is executed under to
the user currently logged in by the script.

Reason:
I'd like to give users the ability to save their options and preferences
for the script. I'd like to accomplish this with a file in the users
homedir, something like the usual .something config files, chowned to
the logged in user and set to his/ her permissions...

Hope someone will be able to help me.
Ciao
Tobias Schweitzer

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] Creating a pdf document

2002-01-24 Thread Daniel Ems

Mihai,

There is a php class that can generate pdf documents without the 
dll's/libraries required by other methods:

http://ros.co.nz/pdf/

You can definitely use the results of a database query to create a pdf!  
Enjoy!

Daniel Ems


On Wed, 23 Jan 2002, Mihail Bota wrote:

> Hello,
> 
> I was wondering if I could save the result of a query in a pdf document. I
> looked for any functions that might help, but I got confused because I
> could not see how/where exactly to insert the necessary .dll's. I'd like
> to do this (saving the output of a query) by using mysql installed on a
> Irix machine, and PHP4.
> If this is not possible, could I create a pdf document or a word document
> from a query from either Access database or mysql on a win2k system,
> PHP4.1?
> Any references that might help?
> Thanks for your help!
> 
> Mihai


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sending a POST-message

2002-01-24 Thread Matt Schroebel

I think this is what you're looking for.  It's a script written by Rasmus. 
http://www.php-faq.com/faq.php#39

>I wonder how I can send a POST-command to a server, via a PHP-script instead 
>of a form.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: phpwiki save button

2002-01-24 Thread Tim Ward

without the full source code of the classes you are using I'd be guessing,
but within savePreview() and savePage() $content is passed to an object
method that does the saving. You could just pass date("d/m/Y H:i:s - ") .
$content instead of $content. However it looks like this may be amended from
previous versions ... if so you'll need to strip the first x characters from
the front ... but this is getting messy.

the better way to do this is with a last_updated field in the database
holding a timestamp and handle including it at the top of the text when
displaying. I'd be surprised if the table doesn't already have a field like
that. 


Tim
www.chessish.com

> -Original Message-
> From: Tim Bogart [SMTP:[EMAIL PROTECTED]]
> Sent: 24 January 2002 15:43
> To:   Tim Ward; [EMAIL PROTECTED]
> Subject:  Re: [PHP] RE: phpwiki save button
> 
> No, you're not missing a thing.  I just need to know exactly where to put
> the 
> line you sent me.  The word "content" is mentioned a few times in the
> script 
> and I'm not a programmer, remember?  Could you please indicate exactly
> where 
> you would put the line you sent me?  I'm sure you are taking for granted
> that 
> I know more than I seem, but I don't.  I'm a newbie at this and have to
> have 
> my nose put down into it before I understand.  Where should I put the
> line?
> 
> Thanks!
> 
> Tim
> 
> On Thursday 24 January 2002 10:07 am, Tim Ward wrote:
> > I think you just need to add the timestamp to the start of the story
> before
> > you save it,
> > i.e.
> > $content = date("d/m/Y H:i:s - ") . $content;
> >
> > or am I missing something?
> >
> >
> > Tim
> > www.chessish.com
> >
> > > -Original Message-
> > > From: Tim Bogart [SMTP:[EMAIL PROTECTED]]
> > > Sent: 24 January 2002 15:01
> > > To:   Tim Ward; [EMAIL PROTECTED]
> > > Subject:  Re: phpwiki save button
> > >
> > > On Thursday 24 January 2002 06:36 am, Tim Ward wrote:
> > > > What is it you actually want to do? Add the current date/time or a
> > > > timestamp entered on the submitting form?
> > >
> > > yes.  That is exactly what I wish to do.
> > >
> > > See date() for the former. Once
> > >
> > > > you've got your stamp in a format you want just add it to the front
> of
> > >
> > > the
> > >
> > > > story before saving. Give us a bit more detail about what it is that
> > >
> > > isn't
> > >
> > > > working, or the code that you want to modify.
> > >
> > > The following is the savepage.php script.  It (in as much as I can
> > > figure) is
> > >  what is executed when one pushes or clicks on the "save" button when
> > > phpwiki
> > > is serving up the"editpage.html" file to a user on his or her browser,
> > > and
> > >
> > > the individual is finished editing, and wishes to save their entry.
> The
> > > "save" button is at the bottom of the edit page.  What I wish to have
> > > happen
> > > is, to have the save button do what it does now, save the changes, but
> in
> > > addition to that, if I had my perfect world, I would like this
> > > savepage.php
> > > script prefix the edited text with a date and time stamp on the left
> side
> > > of
> > > the page, appearing as a (redundancy here) prefix to the typed
> material.
> > > That way each entry would have a date and time stamp.  I hope I am
> > > describing
> > > this in a fashon you can understand.  Let me give you an example.  One
> > > types
> > > ...
> > >
> > > This is a good day.
> > >
> > > Then the individual pushes the save button.  The save is executed, and
> > > the
> > >
> > > user is bounced back to the preview page (the preview page part
> happens
> > > as a
> > > result simply of how the thing just works).  When the preview page is
> > > displayed, the newly added text appears, but looks like this...
> > >
> > > 2002 01/24 09:33:45  This is a good day.
> > >
> > > The format of the date and time are really fluff to me, as long as it
> > > appears.
> > >
> > > I hope my description is understandable.  I eagerly await your
> response.
> > >
> > > Tim B.
> > >
> > > Here's the script...
> > >
> > > -
> > >
> > > s_id('$Id: savepage.php,v 1.17 2001/11/14 21:05:38 dairiki Exp $');
> > > require_once('lib/Template.php');
> > > require_once('lib/transform.php');
> > > require_once('lib/ArchiveCleaner.php');
> > >
> > > /* All page saving events take place here. All page info is also taken
> > > care
> > > of here. This is klugey. But it works. There's probably a slicker way
> of
> > > coding it.
> > > */
> > >
> > > // FIXME: some links so that it's easy to get back to someplace useful
> > > from
> > > these // error pages.
> > >
> > > function ConcurrentUpdates($pagename) { /* xgettext only knows about
> > > c/c++
> > >
> > > line-continuation strings is does not know about php's dot operator.
> We
> > > want
> > > to translate this entire paragraph as one string, of course.
> > > */
> > > $html = ""; $html .= gett

[PHP] Warning: Failed opening '....' for inclusion (.....) in Unknown on line 0

2002-01-24 Thread Scott Fletcher

Hiya Everyone!

I'm a little baffled on what is happening.  I'm using Apache on the UNIX
machine.  When I built the website, everyone work okay.  Then I accidently
remove part of the web directory because I was in the wrong directory at
that time.  So, I had to restore the lost directory from the tape backup.
All of the deleted file had been restored.  Then that's when this problem
came up.  I kept getting the error message on some files with a "Warning:
Failed opening '...' for inclusion () in Unknown on line 0".  I did some
troubleshooting but with no luck.

Can someone tell me what the problem is?  Have I overlooked something?

Thanks,
 Scott



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Hey!

2002-01-24 Thread Scott Fletcher

Hi again!  I just did the crazy thing and it work!  What I did was to copy
the whole script in the file then delete the file.  Create a new file and
paste the script back into the file.  Guess what!   The webpage work!  No
nagging errors!  What give?

Scott



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Warning: Failed opening '....' for inclusion (.....) in Unknown on line 0

2002-01-24 Thread Ben Sinclair

Maybe there was a permissions problem?
--
Ben Sinclair
[EMAIL PROTECTED]


- Original Message -
From: "Scott Fletcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 9:34 AM
Subject: [PHP] Warning: Failed opening '' for inclusion (.) in Unknown
on line 0


> Hiya Everyone!
>
> I'm a little baffled on what is happening.  I'm using Apache on the UNIX
> machine.  When I built the website, everyone work okay.  Then I accidently
> remove part of the web directory because I was in the wrong directory at
> that time.  So, I had to restore the lost directory from the tape backup.
> All of the deleted file had been restored.  Then that's when this problem
> came up.  I kept getting the error message on some files with a "Warning:
> Failed opening '...' for inclusion () in Unknown on line 0".  I did some
> troubleshooting but with no luck.
>
> Can someone tell me what the problem is?  Have I overlooked something?
>
> Thanks,
>  Scott
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Warning: Failed opening '....' for inclusion (.....) in Unknown on line 0

2002-01-24 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Scott Fletcher blurted
> Hiya Everyone!
> came up.  I kept getting the error message on some files with a "Warning:
> Failed opening '...' for inclusion () in Unknown on line 0".  I did some
> troubleshooting but with no luck.

Is that warning coming from one of your 'restored' files of one of the
others? That's usually a *path* and or *file name* probem.
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8UCxlHpvrrTa6L5oRAig4AJ9jYZJdt13x/p+azCmhmqofR0ceaQCfel36
V2tOMwEb590YQvpdMv/qQDw=
=Mp19
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Warning: Failed opening '....' for inclusion (.....) in Unknown on line 0

2002-01-24 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Ben Sinclair blurted
> Maybe there was a permissions problem?

Good point :-)
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8UCyIHpvrrTa6L5oRAuchAKCML9BIpksH377SVqI/MFoy+Y3/KwCeIxsi
YHz+A5/k/Mhb3lWm83AgU1k=
=irN+
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Warning: Failed opening '....' for inclusion (.....) in Unknown on line 0

2002-01-24 Thread Negrea Mihai


> > Hiya Everyone!
> > came up.  I kept getting the error message on some files with a "Warning:
> > Failed opening '...' for inclusion () in Unknown on line 0".  I did
> > some troubleshooting but with no luck.

test to see if you don't have a prepend statement around!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Hey!

2002-01-24 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Scott Fletcher blurted
> Hi again!  I just did the crazy thing and it work!  What I did was to copy
> the whole script in the file then delete the file.  Create a new file and
> paste the script back into the file.  Guess what!   The webpage work!  No
> nagging errors!  What give?

Scott, this is a mailing list with hundreds of posts a day, the only
reason I know what your on about is that I just answered your last post.
Please keep the thread together, it makes life much easier :-)

Sounds like it was indeed a permissions thing.
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8UC0+HpvrrTa6L5oRAucgAKCKMkz5K042Pa7nT20CCcGbvlQndACfaIgM
xkHg6ZA2pvffe+OaQ7qOSWs=
=hwwf
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cut and Paste... Bah humbug.

2002-01-24 Thread Floyd Baker



Just found out it was the *quotes* that were pasted into my stuff from
a tutorial from a web site that were locking me up.  They looked good
but they weren't *official* quotes... :-/   Probably other characters
that will do that too..?  Duh!  

Well maybe someone besides myself didn't know that, eh?  

Floyd


--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Mail Attachments

2002-01-24 Thread Gordon Stewart

Dear List

I have just compleated a PHP web frontend to the standard mail function in
PHP.  I have got it to send and recieve email.

Can I take this programming task further and allow it to send and recieve
attachments. My script runs on a redhat 7 box.

Can anyone help?  How can i achieve this?

Gordon


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: phpwiki save button

2002-01-24 Thread Tim Bogart

So...I would create a new table in my postgresql database that's being used 
which would contain the timestamp.  I would populate that table when the 
savepage.php was executed, extract the data from that table and write it to 
the screen, then execute the save.  Does that sound right?

Tim

On Thursday 24 January 2002 10:07 am, Tim Ward wrote:
> I think you just need to add the timestamp to the start of the story before
> you save it,
> i.e.
> $content = date("d/m/Y H:i:s - ") . $content;
>
> or am I missing something?
>
>
>   Tim
>   www.chessish.com
>
> > -Original Message-
> > From:   Tim Bogart [SMTP:[EMAIL PROTECTED]]
> > Sent:   24 January 2002 15:01
> > To: Tim Ward; [EMAIL PROTECTED]
> > Subject:Re: phpwiki save button
> >
> > On Thursday 24 January 2002 06:36 am, Tim Ward wrote:
> > > What is it you actually want to do? Add the current date/time or a
> > > timestamp entered on the submitting form?
> >
> > yes.  That is exactly what I wish to do.
> >
> > See date() for the former. Once
> >
> > > you've got your stamp in a format you want just add it to the front of
> >
> > the
> >
> > > story before saving. Give us a bit more detail about what it is that
> >
> > isn't
> >
> > > working, or the code that you want to modify.
> >
> > The following is the savepage.php script.  It (in as much as I can
> > figure) is
> >  what is executed when one pushes or clicks on the "save" button when
> > phpwiki
> > is serving up the"editpage.html" file to a user on his or her browser,
> > and
> >
> > the individual is finished editing, and wishes to save their entry.  The
> > "save" button is at the bottom of the edit page.  What I wish to have
> > happen
> > is, to have the save button do what it does now, save the changes, but in
> > addition to that, if I had my perfect world, I would like this
> > savepage.php
> > script prefix the edited text with a date and time stamp on the left side
> > of
> > the page, appearing as a (redundancy here) prefix to the typed material.
> > That way each entry would have a date and time stamp.  I hope I am
> > describing
> > this in a fashon you can understand.  Let me give you an example.  One
> > types
> > ...
> >
> > This is a good day.
> >
> > Then the individual pushes the save button.  The save is executed, and
> > the
> >
> > user is bounced back to the preview page (the preview page part happens
> > as a
> > result simply of how the thing just works).  When the preview page is
> > displayed, the newly added text appears, but looks like this...
> >
> > 2002 01/24 09:33:45  This is a good day.
> >
> > The format of the date and time are really fluff to me, as long as it
> > appears.
> >
> > I hope my description is understandable.  I eagerly await your response.
> >
> > Tim B.
> >
> > Here's the script...
> >
> > -
> >
> > s_id('$Id: savepage.php,v 1.17 2001/11/14 21:05:38 dairiki Exp $');
> > require_once('lib/Template.php');
> > require_once('lib/transform.php');
> > require_once('lib/ArchiveCleaner.php');
> >
> > /* All page saving events take place here. All page info is also taken
> > care
> > of here. This is klugey. But it works. There's probably a slicker way of
> > coding it.
> > */
> >
> > // FIXME: some links so that it's easy to get back to someplace useful
> > from
> > these // error pages.
> >
> > function ConcurrentUpdates($pagename) { /* xgettext only knows about
> > c/c++
> >
> > line-continuation strings is does not know about php's dot operator. We
> > want
> > to translate this entire paragraph as one string, of course.
> > */
> > $html = ""; $html .= gettext ("PhpWiki is unable to save your changes,
> > because another user edited and saved the page while you were editing the
> > page too. If saving proceeded now changes from the previous author would
> > be
> > lost.");
> > $html .= "\n"; $html .= gettext ("In order to recover from this
> > situation follow these steps:");
> > $html .= "\n"; $html .= gettext ("Use your browser's Back
> > button to go back to the edit page.");
> > $html .= "\n"; $html .= gettext ("Copy your changes to the
> > clipboard
> > or to another temporary place (e.g. text editor).");
> > $html .= "\n"; $html .= gettext ("Reload the page. You
> > should
> > now see the most current version of the page. Your changes are no longer
> > there.");
> > $html .= "\n"; $html .= gettext ("Make changes to the file
> > again.
> >
> > Paste your additions from the clipboard (or text editor).");
> > $html .= "\n"; $html .= gettext ("Press Save again.");
> > $html .= "\n"; $html .= QElement('p', gettext ("Sorry for
> > the
> > inconvenience."));
> >
> > echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while
> > updating
> > %s"), $pagename));
> > ExitWiki();
> > }
> >
> > function PageIsLocked($pagename) {
> > $html = QElement('p', gettext("This page has been locked by the
> > administrator
> > and cannot be edited."));
> > $html .= QElement('

[PHP] One more time... Sessions questons?

2002-01-24 Thread Floyd Baker


Hi 

I have been reading but can't get sessions to even try working..  

The set up is win32/php4.1/apache. 

Reading the list I have done what was suggested where it I could
understand it.  Just went nuts creating /tmp dirs everywhere I could
think of to see if any of them worked...  Nada!  Also changed the ini
line to point to c:/tmp, etc. Still ng.

Here is one of the scrips that doesn't work.

session_start();
session_register('page_views');
$page_views++;

print " You have viewed this page ";
print $page_views;
print " times(s).";


The ini is the 'recommended' version with register_globals off and
whatever vanilla settings were in there.  Everything else seems to be
working...  I can pass vars using $_REQUEST just fine.  What's wrong?

TVMIA

Floyd
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] Creating a pdf document

2002-01-24 Thread Mihail Bota


Thanks a lot guys! This really helps a lot.

MySql is not installed on my machine, so it would take a while to install
all the necessary libraries. I'll stick with the material given by Daniel,
for the moment.

Mihai


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: Creating a pdf document

2002-01-24 Thread Andrew Chase

http://www.php.net/pdf

You'll need Thomas Mertz' PDFlib, which is free for personal/not-for-profit
use, but requires a license fee for commercial use:

http://www.pdflib.com/pdflib/index.html


-Andy

> -Original Message-
> From: Mihail Bota [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 11:53 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Creating a pdf document

> I was wondering if I could save the result of a query in a pdf document. I
> looked for any functions that might help, but I got confused because I
> could not see how/where exactly to insert the necessary .dll's. I'd like
> to do this (saving the output of a query) by using mysql installed on a
> Irix machine, and PHP4.
> If this is not possible, could I create a pdf document or a word document
> from a query from either Access database or mysql on a win2k system,
> PHP4.1?
> Any references that might help?
> Thanks for your help!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Warning: Failed opening '....' for inclusion (.....) in Unknown on line 0

2002-01-24 Thread Scott Fletcher

The file permission checked out fine.  It just baffled me!

I don't know how to keep the post together to one topic!  I use MS Outlook
and I clicked the "reply" button and it came out as a seperate post.

Scott

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hiya Everyone!
>
> I'm a little baffled on what is happening.  I'm using Apache on the
UNIX
> machine.  When I built the website, everyone work okay.  Then I accidently
> remove part of the web directory because I was in the wrong directory at
> that time.  So, I had to restore the lost directory from the tape backup.
> All of the deleted file had been restored.  Then that's when this problem
> came up.  I kept getting the error message on some files with a "Warning:
> Failed opening '...' for inclusion () in Unknown on line 0".  I did
some
> troubleshooting but with no luck.
>
> Can someone tell me what the problem is?  Have I overlooked something?
>
> Thanks,
>  Scott
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Warning: Failed opening '....' for inclusion (.....) in Unknown on line 0

2002-01-24 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Scott Fletcher blurted
> The file permission checked out fine.  It just baffled me!
> 
> I don't know how to keep the post together to one topic!  I use MS Outlook
> and I clicked the "reply" button and it came out as a seperate post.

Well, this ones okay :)
If your going to make a habbit of mailing lists I'm told 'TheBat' is a
*very* good mail client for 'doze.
- -- 

Nick Wilson

Tel:+45 3325 0688
Fax:+45 3325 0677
Web:www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8UDvYHpvrrTa6L5oRAow8AJ9rg2SnpGCRNgFK6BzzAHSkdz/x2gCcD7DA
s9SOnYEADHOonOU2DclEUCg=
=Fext
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Todd Cary

Jason -

<<<
Then in your file download.php, have a single statement using the
header()
function to redirect to the file that is to be downloaded.
>>>

What is the syntax for the header() function?

Many thanks...

Todd

--
Dr. Todd Cary
Ariste Software
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: The Euro symbol, default charset and htmlentities()

2002-01-24 Thread LaserJetter

can you not print the charset inside one of the HTML tags? ( it
might be in).

Also, if you dont want to keep typing out
htmlentities("¤",ENT_QUOTES,"iso-8859-15") to get a euro, just do:
$euro = htmlentities("¤",ENT_QUOTES,"iso-8859-15");


LJ

"Sönke Tesch" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi everybody!
>
>
> I'm a bit lost. The original problem was (and still is) to get the Euro
> symbol from a iso-8859-15 string into the HTML code output by a PHP-script
> (4.0.6 by the way).
>
> At first it worked fine using htmlentities("¤",ENT_QUOTES,"iso-8859-15").
> However, this is a bit long, I would have plenty of htmlentities() to fix,
> and since -15 should be the considered the current standard rather than
> the outdated -1 it replaced, I wanted to figure out how to tell PHP and
> its htmlentities() which character set to use as default.
>
> First question:
> Where's the configuration for that? mbstring.* ini php.ini doesn't seem
> to be the right place (and I didn't expect it anyway).
>
>
> So, after learning that mbstring.* doesn't work I removed these from
> php.ini and now the extended htmlentities() doesn't work anymore. The
> line
>
>   echo htmlentities("¤",ENT_QUOTES,"iso-8859-15");
>
> results in a "Wrong parameter count for htmlentities()"-warning. Oops?
>
> Second question:
> What's wrong now? I'm sure it worked earlier and I can't see that this
> line is wrong anyway. htmlentities() expects upto three arguments, there
> are three.
>
>
> And, not related to a problem, the third question:
> Did anybody yet consider setting iso-8859-15 as default charset throughout
> PHP instead of iso-8859-1?
>
>
> Regards,
>   soenk.e



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Jason Wong

On Friday 25 January 2002 01:00, Todd Cary wrote:
> Jason -
>
> <<<
> Then in your file download.php, have a single statement using the
> header()
> function to redirect to the file that is to be downloaded.
>
>
> What is the syntax for the header() function?

Manual? Lots of good info in there!


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Fats Loves Madelyn.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




SV: [PHP] multi-threading within php?

2002-01-24 Thread Mattias Andersson

Then I would have to write a parser when I have already written my own
spider. But the problem isn't the spider itself, but rather the lack of
multi-threading within PHP (which is needed in quite alot of sitatuations,
depending on what you're coding). I'm not sure if it really does lack
multi-threading though, it might just be me that doesn't know about it.
Is there any way to execute several functions simultaneously?

Mvh,
Mattias Andersson

Mjukvaruutvecklare, humany AB
Direkt: 08-4540701
Mobil: 0704-526685


-Ursprungligt meddelande-
Från: bvr [mailto:[EMAIL PROTECTED]] 
Skickat: den 24 januari 2002 15:33
Till: [EMAIL PROTECTED]; Mattias Andersson
Ämne: Re: [PHP] multi-threading within php?


You may want to use 'wget' spider function, then parse the files with PHP if
necessary.

http://wget.sunsite.dk/

bvr.


On Thu, 24 Jan 2002 14:52:54 +0100, Mattias Andersson wrote:

>Hello!
> 
>I was making a spider for a simple searchengine and all was well until I
>started testing it on larger sites.
>The problem isn't that it doesn't work, it does, but it is very very slow,
>just handling one connection at the time.
>Basically, it just downloads a page, extract all links from it, then
>downloads those pages, extract their links, until all pages on a site has
>been downloaded and archived.
>Is there any way to do it in several threads so that it handles several
>connections simultaneously?
>If it would dynamically allocate threads that would be even better.
> 
>Regards,
>Mattias Andersson
> 
>Software Developer, humany AB
>Direct: 08-4540701
>Mobile: 0704-526685
> 
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Mail Attachments

2002-01-24 Thread Neil Freeman

Take a look at the articles on:
 http://www.devshed.com/Server_Side/PHP

HTH

Neil

Gordon Stewart wrote:

> Dear List
>
> I have just compleated a PHP web frontend to the standard mail function in
> PHP.  I have got it to send and recieve email.
>
> Can I take this programming task further and allow it to send and recieve
> attachments. My script runs on a redhat 7 box.
>
> Can anyone help?  How can i achieve this?
>
> Gordon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***
>  This message was virus checked with: SAVI 3.52
>  last updated 8th January 2002
> ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP without browser

2002-01-24 Thread DrouetL

Hi everybody

I would like to pass parameters to a php script running as a bach job under
windows.

Is there any possibility to something like that ?

Laurent Drouet


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Image Upload

2002-01-24 Thread lists

Does anyone have a good script for uploading an image and storing it in a 
mySQL database.

Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] function scope question

2002-01-24 Thread Joel Boonstra

Hello,

I wrote a PHP class to display an HTML calendar, and then wrote a subclass
of it for a specific project I'm working on.  Here is the entirety of the
subclass:

// create our new sub-class of the calendar
class rantCal extends calendar {
  function get_link($day) {
$link = "";
if (valid_date($this->my_year, $this->my_month, $day)) {
  if (rant_exists($this->my_year, $this->my_month, $day)) {
$link = "index.php?date=$this->my_year-$this->my_month-$day";
  }
}
return $link;
  }
}

Basically, it's used to determine if a given date should be linked or not.
When I wrote it, I didn't expect it to work, since these two function:

valid_date()
rant_exists()

are defined completely outside of the class.  In fact, they're defined in
a functions file that I include (with include()) above where I define my
rantCal class.  Shouldn't their names not be recognized within this class?
I was assuming that a class was entirely self-contained, so it can't know
about functions defined outside its scope.  However, it works just fine
(that is, the functions get called), which is helpful, but it doesn't seem
like the way things should work.

Am I completely wrong?  I seem to recall that this sort of thing should
work in a more strict OO language, like C++.

I'm using PHP 4.0.6, if that's important.

-- 
[ joel boonstra | [EMAIL PROTECTED] ]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] eval on php embedded html

2002-01-24 Thread Atanas Vassilev

> So, either:
>
> 
>
> Or
>
> 

I found it very convenient for in-html coding to use the following
structure:

>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Todd Cary

Jason -

I had looked it up in the manual, but I am not sure of what to put into
the area /* ... output pdf file ... */

Any help is appreciated

Todd



If you want the user to be prompted to save the data you are sending,
such as a generated PDF file, you can use the Content-Disposition header
to supply a recommended filename and force the browser to display the
save dialog.

http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] function scope question

2002-01-24 Thread daniel

Joel-

> Basically, it's used to determine if a given date should be linked or not.
> When I wrote it, I didn't expect it to work, since these two function:
> 
> valid_date()
> rant_exists()
> 
> are defined completely outside of the class.  In fact, they're defined in
> a functions file that I include (with include()) above where I define my
> rantCal class.  Shouldn't their names not be recognized within this class?
> I was assuming that a class was entirely self-contained, so it can't know
> about functions defined outside its scope.  However, it works just fine
> (that is, the functions get called), which is helpful, but it doesn't seem
> like the way things should work.

When functions are defined, they are available everywhere: in other
functions, in classes, and in subclasses. As far as availability
goes, any function you define is just as available as any of the
built-in PHP functions (like addslashes() for instance).

Personally, though I am not a HEAVY OO programmer, I cannot see why
having those functions UNAVAILABLE in the class would be
advantageous in anyway.

If you want a function to exist ONLY within a particular class, then
it should be created in that class, otherwise, it should be created
outside of any class, and is therefore available globally.

I can't say whether it SHOULD be the way it is or not... but I can
tell you that the behaviour you are describing is accurate and
intended.

Daniel J. Lashua


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread daniel

Todd-

> I had looked it up in the manual, but I am not sure of what to put into
> the area /* ... output pdf file ... */
> 
> Any help is appreciated
> 
> Todd
> 
> 
> 
> If you want the user to be prompted to save the data you are sending,
> such as a generated PDF file, you can use the Content-Disposition header
> to supply a recommended filename and force the browser to display the
> save dialog.
> 
> header("Content-Disposition: attachment; filename=downloaded.pdf");
> 
>/* ... output pdf file ... */
> 
> 

This is where you put whatever chunk of code you use to create the
file that you wish the user to download. If this is a PDF file on
disk, you can do something as simple as readfile("filename.pdf")..
or if you are generating it yourself.. then, again, you'll probably
use readfile("whatever.pdf"), since (though I have never used them)
I am pretty sure the PDF libs don't have an output function, so you
have to write to disk.

Example 1 on this page (http://www.php.net/manual/en/ref.pdf.php)
shows EXACTLY what you are trying to do with one small change, make
the word "inline" read as "attachment" so it'll force the user to
download, as opposed to displaying in the browser.


Daniel J. Lashua


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] using a text file for variables in a form?

2002-01-24 Thread Alexis N. Mueller

I have some variables stored in plain text in a text file. Unfortunately I
am not going to be able to use SQL to solve this one, since that server is
not running it. Anyway.

The text file looks like this (everything between the *):
*
SAVINGS=type1
FILTER=disabled
SPOOL=category1
*
I use a form to edit this text file. SAVINGS and SPOOL are 'select' form
items with multiple options. FILTER is a 'radio' form item with two options.

I was wondering if anyone knew how to make the text file pass the variables
into the form that i use to edit the text file... confusing?
hmm...
let's say i was editing the text file that i gave as an example, I would
like like the SAVINGS 'select' field in the form to have type1 selected. the
FILTER 'radio' field
in the form should be checked on disabled. And the SPOOL 'select' field
should read category1

Anyone have any ideas on how to do that?
Help would be appreciated,
Thank you

Alex



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] emulate a browser

2002-01-24 Thread LaserJetter

If it is frame forwarded, you would get a 300 OK status becuase you have
accessed a web page and it has been server OK. The webpage (which contains
the  tags) then send a request to another server to get the page
to be redirected to.
The only way to check for this would be to see if the page you have sent the
request for contains the  tags (use GET instead of HEAD) but this
would be unreliable as a lot of websites start with a frame based page
anyway.

LJ

"Frank Benady" <[EMAIL PROTECTED]> wrote in message
004301c1a4ba$478a41c0$0101@phoenix">news:004301c1a4ba$478a41c0$0101@phoenix...
> It works really nice, Michael, thanks again.
>
> I have one more question, maybe you can answer me :
> If the domain name has been redirected with hte permanent redirect, I
> get the 301 Moved Permanently header response. But if the domain name
> has been frame-forwarded, I have no header response. Is it normal ?
> Do you know if there is some alternatives so I could check if the domain
> name is used, even on a frame-forward type redirectection ?
> Moreover, if the domain has been redirected, is it possible to get the
> url it has been redirected to ?
>
> Thanks again for your help
>
> Frank
>
> - Original Message -
> From: "Michael Sims" <[EMAIL PROTECTED]>
> To: "Frank Benady" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Thursday, January 24, 2002 2:28 AM
> Subject: Re: [PHP] emulate a browser
>
>
> > At 01:45 AM 1/24/2002 +0100, Frank Benady wrote:
> > >Hi All
> > >
> > >Can I emulate the first request of a browser when it tries to connect
> to a
> > >distant server using a domain name and parse the answer from the
> remote
> > >server to know if there is a website located there or if there is no
> hosting
> > >(or even some kind of forwarding) configured for this domain name ?
> > >Is ther some http functions in PHP which permit to do this test ?
> >
> > You can use fsockopen() to open a socket connection to a remote host
> via
> > port 80 (HTTP).  If fsockopen() returns a valid file pointer then that
> > means there is something listening on port 80 on the host (99% it will
> be a
> > web server).
> >
> > You could then use fputs() to send a request to the server, such as:
> >
> > "HEAD / HTTP/1.0\r\n\r\n"
> >
> > Normally browsers use GET instead of HEAD, but in your case you are
> only
> > interested in the servers response (the HTTP headers) and not the
> actual
> > file/page itself.
> >
> > You could then use fgets() to read the response sent back from the
> server
> > and parse it to get the information you wanted (for example, look for
> a
> > "Location: ..." line in the headers to see if the page is trying to
> > redirect the browser).
> >
> > I have a function that checks to see if a particular file is available
> via
> > HTTP from a remote host.  It takes a full URL and returns true if the
> > page/file exists, and false if it doesn't.  With some work you could
> modify
> > this script to achieve what you want.  I'm posting it below.  Ask if
> you
> > have any questions about it.
> >
> > Oh, BTW, I'm sure that I have (as usually) went totally overboard with
> this
> > function and someone will now probably point out that PHP has
> something
> > built in to do what I'm doing here...but I couldn't find it and I had
> fun
> > writing this function anyway. :-)
> >
> >  > function http_file_exists ($url) {
> >
> >if (!preg_match("/^http:\/\/([^\/]+)\/.*$/i",$url,$matches)) {
> >
> >  return "Error - incorrect format";
> >
> >} else {
> >
> >  $host = $matches[1];
> >  $fp = fsockopen ($host, 80, $errno, $errstr, 30);
> >  if (!$fp) return "Error - couldn't connect to host";
> >else {
> >  fputs ($fp, "HEAD $url HTTP/1.0\r\n\r\n");
> >  $response = fgets ($fp,128);
> >  fclose ($fp);
> >  return (eregi("^.+200 OK.+$",$response) ? true : false);
> >}
> >
> >}
> > }
> > ?>
> >
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Todd Cary

Daniel -

When I use the following code, I am not asked if I want to Save the file
or Open it.  Instead, the contents of the file are displayed in the
browser.  I am sure that I have missed something simple!!

Todd




--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] using a text file for variables in a form?

2002-01-24 Thread daniel

Alex-

This is very basic PHP.

> I have some variables stored in plain text in a text file. Unfortunately I
> am not going to be able to use SQL to solve this one, since that server is
> not running it. Anyway.
> 
> The text file looks like this (everything between the *):
> *
> SAVINGS=type1
> FILTER=disabled
> SPOOL=category1
> *
>
> I use a form to edit this text file. SAVINGS and SPOOL are 'select' form
> items with multiple options. FILTER is a 'radio' form item with two options.
> 
> I was wondering if anyone knew how to make the text file pass the variables
> into the form that i use to edit the text file... confusing?

First, you need to get the data from the file and make the items
useful:



Now your values are accessible as $data["SAVINGS"], etc.

So... when building the HTML...

";
?>



Daniel J. Lashua


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: XML / XSLT parsing using PHP

2002-01-24 Thread Peter Clarke

"Lasse Laursen" <[EMAIL PROTECTED]> wrote in message
02c301c1a4c4$42e03620$[EMAIL PROTECTED]">news:02c301c1a4c4$42e03620$[EMAIL PROTECTED]...
> Hi,
>
> We are about to develop a CMS that uses XML and XSLT.
>
> The XML files contains some static information (header, footers and common
> non-dynamic information). We would like to have a XML file that would
> contain a field like:
>
> 
>   <...>
>   <...>
>   <...>
> 
>
> Before the XML file is loaded into the PHP script that uses the
xslt_process
> routine to convert the XML/XSLT files into plain HTML we would like to
> replace the  field with come dynamic content (eg. some other
> variables, etc.)
>
> What's the easiest way to do that? SAX or?
>

Load the XML into a variable,
do whatever changes to it,
then process the variable with xslt_process.


> Furthermore the 'xslt_process' function requires the following parameters:
>
> xslt_process (resource xh, string xml, string xsl [, string result [,
array
> arguments [, array parameters]]])
>
> where the XML and XSLT variables are references to files. - The XML file
is
> in our example a variable (eg. $current_xml_file = "x";) and therefor
we
> cannot use the xslt_process function? Of cause we can store the XML var.
in
> a temporary location and then read the file, but that's an extreamly ugly
> approach! :) Any ideas?
>

Have a look at:
http://www.php.net/manual/en/function.xslt-process.php
Example 3 Using the xslt_process() to transform a variable containing XML
data and a variable containing XSL data into a variable containing the
resulting XML data



> I'm looking forward to your replies :)
>
>
> Yours
> --
> Lasse Laursen <[EMAIL PROTECTED]> - Systems Developer
> NetGroup A/S, St. Kongensgade 40H, DK-1264 København K, Denmark
> Phone: +45 3370 1526 - Fax: +45 3313 0066 - Web: www.netgroup.dk

Peter Clarke


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread daniel

Todd-

> When I use the following code, I am not asked if I want to Save the file
> or Open it.  Instead, the contents of the file are displayed in the
> browser.  I am sure that I have missed something simple!!
> 
> Todd
> 
>$len = filesize("test.pdf");
>   header("Content-type: application/pdf");
>   header("Content-Length: $len");
>   header("Content-Disposition: attachment; filename=test.pdf");
>   readfile("test.pdf");
> ?>

The code you are showing should work... therefore it may be
something to do with your browser. Try changing the Content-Type
to something that there is no way you could have ever registered in
your browser:

header("Content-Type: x-this-is-a-test/for-php");

And see if that changes the way it handles it. Of course,
application/pdf is the CORRECT MIME type, so if this NEW MIME type
does solve the problem, you should attempt to fix your browser, and
put the script back the way it was. If it doesn't fix anything, try
using a different browser, or better yet, a different machine.
Additionally, when working with this type of operation, the first
time you hit the page, it will be cached (in it's incorrect form) in
your browser. Therefore, after making these changes, you should dump
the Disk and Memory cache in your browser, and close and restart
your browser just to be safe.


Daniel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Jason Wong

On Friday 25 January 2002 01:35, Todd Cary wrote:
> Jason -
>
> I had looked it up in the manual, but I am not sure of what to put into
> the area /* ... output pdf file ... */
>
> Any help is appreciated

>
> Todd
>
> 
>
> If you want the user to be prompted to save the data you are sending,
> such as a generated PDF file, you can use the Content-Disposition header
> to supply a recommended filename and force the browser to display the
> save dialog.
>
> header("Content-Disposition: attachment; filename=downloaded.pdf");
>
>/* ... output pdf file ... */

1) What kind of file are you letting people download?
2) Is the file generated on-the-fly or is it already on disk?
3) What webserver are you using?



In general, if the file is on disk then simply using:

  header("Location: http://www.domain.com/downloads/myfile.exe";);

would work. Whether the user is asked to "Save or Open..." depends on the 
browser setting.

If you're using a webserver such as Apache then certain common file types are 
automatically recognised and the appropriate HTTP headers are sent to the 
browser.


If you want to force a download regardless of whether the file type will be 
recognised by the browser then you would have to send your own headers. 
Something like the following:

  header("HTTP/1.0 200 OK");
  header("Content-Type: application/octet-stream");
  header("Content-Disposition: attachment; filename=some_filename");
  header("Content-Location: $F");
  header("content-length: " . filesize("/path/to/file.ext"));
  header("Location:http://www.domain.com/some_filename";);


hth
-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
TRANSACTION CANCELLED - FARECARD RETURNED
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Jason Wong

On Friday 25 January 2002 02:23, Jason Wong wrote:


> In general, if the file is on disk then simply using:
>
>   header("Location: http://www.domain.com/downloads/myfile.exe";);
>
> would work. Whether the user is asked to "Save or Open..." depends on the
> browser setting.
>
> If you're using a webserver such as Apache then certain common file types
> are automatically recognised and the appropriate HTTP headers are sent to
> the browser.
>
>
> If you want to force a download regardless of whether the file type will be
> recognised by the browser then you would have to send your own headers.
> Something like the following:
>
>   header("HTTP/1.0 200 OK");
>   header("Content-Type: application/octet-stream");
>   header("Content-Disposition: attachment; filename=some_filename");
>   header("Content-Location: $F");
>   header("content-length: " . filesize("/path/to/file.ext"));
>   header("Location:http://www.domain.com/some_filename";);

**CORRECTION** (I was trying to adapt some old code to use for this example)

   header("HTTP/1.0 200 OK");
   header("Content-Type: application/octet-stream");
   header("Content-Disposition: attachment; filename=some_filename");
   header("Content-Location: some_filename");
   header("content-length: " . filesize("/path/to/file.ext"));
   readfile("/path/to/file.ext");


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Clear the laundromat!!  This whirl-o-matic just had a nuclear meltdown!!
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can the Surfer download

2002-01-24 Thread Jason Wong

On Friday 25 January 2002 02:16, daniel wrote:
> Todd-
>
> > When I use the following code, I am not asked if I want to Save the file
> > or Open it.  Instead, the contents of the file are displayed in the
> > browser.  I am sure that I have missed something simple!!
> >
> > Todd
> >
> >  >   $len = filesize("test.pdf");
> >   header("Content-type: application/pdf");
> >   header("Content-Length: $len");
> >   header("Content-Disposition: attachment; filename=test.pdf");
> >   readfile("test.pdf");
> > ?>
>
> The code you are showing should work... therefore it may be
> something to do with your browser. Try changing the Content-Type
> to something that there is no way you could have ever registered in
> your browser:
>
> header("Content-Type: x-this-is-a-test/for-php");
>
> And see if that changes the way it handles it. Of course,
> application/pdf is the CORRECT MIME type, so if this NEW MIME type
> does solve the problem, you should attempt to fix your browser, and
> put the script back the way it was. 

I just want to point out that some versions of IE are notoriously buggy 
(what's new ;-)) and would try to display any type of file regardless of what 
you have for the Content-Type. So if you have a buggy version of IE you need 
to upgrade it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Accident, n.:
A condition in which presence of mind is good, but absence of
body is better.
-- Foolish Dictionary
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Split files

2002-01-24 Thread DL Neil

> >> =Hmm, I'm still come at it from the other way around (all due respect to
> >> Jason) - but then I don't recall OpSys details, or know if there is a
> >> utility/tool for the job in your choice of OpSys.
> >
> >Well unless it's a *really* obscure OS I'm sure there must be some readily 
> >available file splitter utility. No point doing more work than necessary by 
> >writing your own file splitting routine :)
> 
> Think about a multi-volume archiver, like tar.
> Also pkzip, rar and ace have an option to archive without using compression.

=whilst they are running, will any of these burn a CD (for the original post-er)?
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] multi-threading within php?

2002-01-24 Thread DL Neil

If the links are placed in a db as they are found, then couldn't you run the same 
script in multiple instances
(browser windows, DOS boxes/command lines) against the same db. That way you would be 
fetching and parsing
multiple web pages concurrently. The only 'multi-threading' would be against the db. 
Your Internet link should
be able to cope.

=dn


- Original Message -
From: "Mattias Andersson" <[EMAIL PROTECTED]>
To: "'bvr'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 24 January 2002 17:14
Subject: SV: [PHP] multi-threading within php?


Then I would have to write a parser when I have already written my own
spider. But the problem isn't the spider itself, but rather the lack of
multi-threading within PHP (which is needed in quite alot of sitatuations,
depending on what you're coding). I'm not sure if it really does lack
multi-threading though, it might just be me that doesn't know about it.
Is there any way to execute several functions simultaneously?

Mvh,
Mattias Andersson

Mjukvaruutvecklare, humany AB
Direkt: 08-4540701
Mobil: 0704-526685


-Ursprungligt meddelande-
Från: bvr [mailto:[EMAIL PROTECTED]]
Skickat: den 24 januari 2002 15:33
Till: [EMAIL PROTECTED]; Mattias Andersson
Ämne: Re: [PHP] multi-threading within php?


You may want to use 'wget' spider function, then parse the files with PHP if
necessary.

http://wget.sunsite.dk/

bvr.


On Thu, 24 Jan 2002 14:52:54 +0100, Mattias Andersson wrote:

>Hello!
>
>I was making a spider for a simple searchengine and all was well until I
>started testing it on larger sites.
>The problem isn't that it doesn't work, it does, but it is very very slow,
>just handling one connection at the time.
>Basically, it just downloads a page, extract all links from it, then
>downloads those pages, extract their links, until all pages on a site has
>been downloaded and archived.
>Is there any way to do it in several threads so that it handles several
>connections simultaneously?
>If it would dynamically allocate threads that would be even better.
>
>Regards,
>Mattias Andersson
>
>Software Developer, humany AB
>Direct: 08-4540701
>Mobile: 0704-526685
>
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP without browser

2002-01-24 Thread DL Neil

Hi Laurent,

> I would like to pass parameters to a php script running as a bach job under
> windows.
> 
> Is there any possibility to something like that ?


Coverage of argv, argc and some good examples are in the manual at 
http://uk2.php.net/manual/en/commandline.php

Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   3   >