Re: [PHP] replacing Carriage Return

2001-12-11 Thread Paul Warner

\r\n is crlf

- Original Message -
From: Kevin Stone [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 11, 2001 3:53 PM
Subject: Re: [PHP] replacing Carriage Return


 Could be \r?  I'm not sure about this becuase I haven't tried it.  I
know
 that \r is used as the return character in other OSs.

 -Kevin Stone

 - Original Message -
 From: phantom [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, December 11, 2001 1:31 PM
 Subject: [PHP] replacing Carriage Return


  I solicit information from a text field and save the data in mysql to be
  pulled out later and displayed as text on a webpage.
 
  However, Carrage Returns in the text field do not appear in the webpage
  text.
 
  With ereg_replace() I can replace the Carriage Returns with  \n, so
  what is this the character I need to find in the text field to replace?
   chr(13) ???
 
  ereg_replace(chr(13), \n, $TextFieldData) 
 
  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 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] chown/chgrp not working

2001-11-30 Thread Paul Warner

I have a client that I made a image uploader/thumbnailer for
that insists on using FrontPage.  In order to make FP
happy, I need to set the owner to 'nobody' and the group
to 'site3' which are uid 99 and gid 117.  The uploaded file
is set as httpd/root and the thumbnail created by the script
comes out httpd/site3.

First I tried:

 chown($file_name, 99);
 chgrp($file_name, 117);

Next I tried:

 chown($file_name, '99');
 chgrp($file_name, '117');

This fails to get the uid or gid, so the first syntax appears
to be correct.

Finally I tried:

 chown($file_name, 'nobody');
 chgrp($file_name, 'site3');

Error message for first and third attempts is identical:

Warning: chown failed: Operation not permitted in
/home/sites/site3/web/dev/maintenance.php on line 191

Why is it 'not permitted' and how do I allow it?

-- Paul


-- 
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] PHP/Mysql

2001-11-30 Thread Paul Warner

  Hello,
  I've got cobalt raq4 with php(work) and mysql(work) but when I try to
  connect via mysql_connect() this error happens:
  Fatal error: Call to undefined function: mysql_connect()
  This is my php.ini:

SNIP

  I thing that it's all ok but it doesn't work.
  Any Ideas?
  Hi
 
  
 
  - Moreno Riccardi
 
  
 

Moreno-

If you just updated to PHP 4.0.6 on a Raq you need to add
'extension=mysql.so' to /etc/httpd/php.ini

-- P



-- 
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] chown/chgrp not working

2001-11-30 Thread Paul Warner

Ahh, it is not running with root priv., so this is the problem.  Sounds like
a good time to look
for another way to skin this cat...

Thanks!

-- Paul


- Original Message -
From: Darren Gamble [EMAIL PROTECTED]
To: 'Paul Warner' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, November 30, 2001 10:21 AM
Subject: RE: [PHP] chown/chgrp not working


 Good day,

 What user is the application running as?  Only the superuser can use these
 functions (this is documented with both of these functions).

 For security reasons, you may want to use an external sudo script to
 accomplish this.  Be very, very careful...

 
 Darren Gamble
 Planner, Regional Services
 Shaw Cablesystems GP
 630 - 3rd Avenue SW
 Calgary, Alberta, Canada
 T2P 4L4
 (403) 781-4948


 -Original Message-
 From: Paul Warner [mailto:[EMAIL PROTECTED]]
 Sent: Friday, November 30, 2001 8:24 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] chown/chgrp not working


 I have a client that I made a image uploader/thumbnailer for
 that insists on using FrontPage.  In order to make FP
 happy, I need to set the owner to 'nobody' and the group
 to 'site3' which are uid 99 and gid 117.  The uploaded file
 is set as httpd/root and the thumbnail created by the script
 comes out httpd/site3.

 First I tried:

  chown($file_name, 99);
  chgrp($file_name, 117);

 Next I tried:

  chown($file_name, '99');
  chgrp($file_name, '117');

 This fails to get the uid or gid, so the first syntax appears
 to be correct.

 Finally I tried:

  chown($file_name, 'nobody');
  chgrp($file_name, 'site3');

 Error message for first and third attempts is identical:

 Warning: chown failed: Operation not permitted in
 /home/sites/site3/web/dev/maintenance.php on line 191

 Why is it 'not permitted' and how do I allow it?

 -- Paul


 --
 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 the php.ini

2001-11-30 Thread Paul Warner

 Hi,
 How can PHP work without the php.ini file? I have tried to find the
php.ini
 file on a RAQ3, to no success. Looking at the php info and then looking at
 the system directories doesnt yield anything.
 The same goes with a server running the Plesk control panel.

 Any ideas on how this is done?

Kunal-

/etc/httpd/php.ini and /etc/admserv/php.ini are on mine.
Try 'find / -name php.ini' from a telnet or ssh session.

-- P





-- 
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] PHP/Mysql

2001-11-30 Thread Paul Warner

  Hello,
  I've got cobalt raq4 with php(work) and mysql(work) but when I try to
  connect via mysql_connect() this error happens:
  Fatal error: Call to undefined function: mysql_connect()
  This is my php.ini:

SNIP

  I thing that it's all ok but it doesn't work.
  Any Ideas?
  Hi
 
  
 
  - Moreno Riccardi
 
  
 

Moreno-

If you just updated to PHP 4.0.6 on a Raq you need to add
'extension=mysql.so' to /etc/httpd/php.ini

-- P




-- 
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] Download textfile

2001-11-20 Thread Paul Warner

Arno [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 When I link a textfile, the textfile is opened in the browser. I want the
 SaveAs box to be shown. Is this possible and if so how to do that?

I apologize for not having a complete answer, but I do have an
explanation that may lead you on the correct path to solve this.
The headers sent at the start of the transfer include the
'Content-Type: text/html; charset = US-ASCII' and this is what
your browser associates with a text file, opening your default
text editor to view.  This is what allows Adobe Acrobat files to
spawn the Acrobat reader instead of getting saved to the users
filesystem.  I *think* that you need to alter the header to be
'unknown', but I am not sure of the specific syntax or method to
accomplish.  Maybe another lister can continue...?

-- Paul


-- 
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] Script returns an image?

2001-03-14 Thread Paul Warner

I am trying to make a call from one page (pure HTML) that would include a
tag as follows:

img src=http://mydomain.com/returnimage.php?var1=value1var2=value2
width="100" height="50" alt="Description"

My question is how to get the php script to return the proper headers as
well as the image to the client.  This will be used for tracking when
certain copyrighted images (actually blueprints) are accessed, and by whom
by making some db entries when called, then returning the image.  The image
is static and is not dynamically generated based on any of the values in the
uri.  So far all I get are broken images.  I'm guessing that it has to do
with the headers...

-- P


-- 
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] Script returns an image?

2001-03-14 Thread Paul Warner

I have been over that page, but did not know that it applied since I do not
want to modify an image, simply pass it on to the requestor.  Here;s my
relevant code:

?php

...database stuff...

Header("Content-type: image/jpg");
?
img src="image.jpg" width="100" height="50" alt="Description"

Do I need to use something more like:

?php

...database stuff...

Header("Content-type: image/jpg");
$im = imageCreateFromJpg("image.jpg");
ImageJpg($im);
ImageDestroy($im);
?

- Original Message -
From: "Yasuo Ohgaki" [EMAIL PROTECTED]
Subject: Re: [PHP] Script returns an image?


 Did you read this page?
 http://www.php.net/manual/en/features.images.php

 What is your php code looks like? if you read this page already.

 Yasuo Ohgaki

 - Original Message -
 From: "Paul Warner" [EMAIL PROTECTED]
 Subject: [PHP] Script returns an image?


  I am trying to make a call from one page (pure HTML) that would include
a
  tag as follows:
 
  img src=http://mydomain.com/returnimage.php?var1=value1var2=value2
  width="100" height="50" alt="Description"
 
  My question is how to get the php script to return the proper headers as
  well as the image to the client.  This will be used for tracking when
  certain copyrighted images (actually blueprints) are accessed, and by
whom
  by making some db entries when called, then returning the image.  The
image
  is static and is not dynamically generated based on any of the values in
the
  uri.  So far all I get are broken images.  I'm guessing that it has to
do
  with the headers...
 
  -- P


-- 
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] Anyone running their own Servers DNS versus renting space/services from an ISP or Hosting??

2001-03-14 Thread Paul Warner

Why not lease a dedicated machine in your favourite flavour.  That way you
have the reliability of a hosting company that monitors 24-hrs, provides
generators, UPS, etc. but will have full control over site, configuration,
etc.  There are many dedicated servers available in NT/2000/Linux/Cobalt
Raq/etc. that start at  $100 USD/mo.  Understand, though that you are
responsible for updates, etc. including security.

-- P

- Original Message -
From: "Andre Bajew" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 14, 2001 7:51 PM
Subject: [PHP] Anyone running their own Servers  DNS versus renting
space/services from an ISP or Hosting??


 Hi all,

 I'm contemplating moving one of my larger sites off of a hosting company
 over to my own PIII 1 Gigahertz. Thoughts right now are to use IIS 5.0 and
 either SQL Server or MySQL. I can currently get a fixed IP address DSL
 connection at 1.5 meg download and 512 Upload for fairly cheap. The reason
I
 would do this is control, control, control.

 Is anyone out there running their own servers (not leased/rented form some
 service)? Is it as easy as registering a domain name server with Network
 Solutions and that's it? Also, how does one go about getting DNS updates
 from the outside world to stay current with other DNS's?

 Any input would be sincerely appreciated!
 Andre



 --
 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] REDIRECT_SCRIPT_URI What/How'd I do this?

2001-03-09 Thread Paul Warner

OK, seems I have created some unintended results in PHP.  A few weeks ago I
was trying to split some common code out into an include file.  I was
running into problems with an image when the calling file was not in the
root of the web directory and was experimenting with various ways to ensure
that the image was found no matter where the scripts were included from.
Since then, I have noted that I seem to be getting some strange error log
entries in Apache:

[Fri Feb 23 08:17:02 2001] [error] [client 10.11.30.13] File does not exist:
/home/sites/site3/web/bw-outline.gif

In an unrelated issue (actually verifying GD support in PHP) I ran
php_info() and noticed that in the environment section there are a bunch of
REDIRECT_* and SCRIPT_* variables that point to this image including the
same 'File does not exist...' message that has been appearing in my logs
(REDIRECT_ERROR_NOTES)!  Obviously in trying to specify an include
directory, I have messed with something that was GLOBAL and has 'stuck' even
through a reboot.

Additionally, it is affecting all v-sites on the box.  There is no ill
effect on the user, however a visit to any page on any v-site seems to
trigger a call to this 'script'.  I quote that because the 'script' is
actually the URI/URL to the above mentioned .GIF!

How do I get PHP to stop trying to pull this file?

Any help would be most greatly appreciated!

-- Paul




-- 
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] pop textarea field w/ text incl. quotes

2001-02-21 Thread Paul Warner

I seem to be stuck on a very simple (to me) issue.  I am trying to build a
database of links for a site.  A user inputs an HTML link into a text box
which is stored in a SQL db.  This works fine.  I need to display this data
on pages, and retrieving it into the page displays fine as well.  The
problem arises when I need to provide a means to edit this link.  Here's
what I've got:

Link as stored in db:  a href="http://winners-circle.com"Winners Circle
Design Group/a
variants I've tried to store: a href=\"http://winners-circle.com\"Winners
Circle Design Group/a
a
href=\\\"http://winners-circle.com\\\"Winners Circle Design Group/a
a
href='http://winners-circle.com'Winners Circle Design Group/a

All result in the textarea box in the form being populated with (basicly all
the output to the end of the page): Winners Circle Design
Group/a"/form/td\n/tr
tr
  th width = "40%" align = "right"Created:/th
  td width = "60%"20010221195310/td
/tr
tr
  th width = "40%" align = "right"Last Modified:/th
  td width = "60%"20010219104604/td
/tr
  /table
 /div
  /body
 /html

I'm sure that the answer is right in front of me, but my heads bleeding to
badly from hitting the wall so many times, I can't see it!

-- Paul


-- 
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] pop textarea field w/ text incl. quotes

2001-02-21 Thread Paul Warner

Simon-

Thanks for the tip...I trued using the htmlspecialchars() which allowed the
remainder of the form to display properly, but left no value in the
textarea.  Then I noticed a difference in the method I was using compared to
yours - I'm still learning the ways of PHP so it will take me a while to
determine the significance of the syntax differences:

Mine: td width = "60%"?php echo $linkurl . 'brtextarea
value="htmlspecialchars($linkurl)"/textarea/td\n' ?

Yours: ?php echo "textarea" . htmlspecialchars($link) . "/textarea" ?

I wanted a graphical representation of the present link displayed above the
textarea and then attempted to use php's substitution to build the text area
within the same string.  I updated my code to be more like yours and arrived
at:

?php echo $linkurl . 'brform'??php echo "textarea" .
htmlspecialchars($linkurl) . "/textarea\n"?

which seems to make the parser behave as I intended.

Anyway...thanks!

-- Paul

- Original Message -
From: "Simon Garner" [EMAIL PROTECTED]
To: "Paul Warner" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, February 21, 2001 8:19 PM
Subject: Re: [PHP] pop textarea field w/ text incl. quotes

 Don't worry about quotes - the problem is that you have HTML markup inside
 your textarea. You just need to convert  and  to lt; and gt;,
 respectively, in your link text. The functions htmlspecialchars() or
 strip_tags() can do this for you.

 i.e.:

 ? echo "textarea" . htmlspecialchars($link) . "/textarea" ?

 When the form is submitted (and when it's viewed), those entities will be
 converted back to their real characters automatically by the browser.



-- 
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]