Re: [PHP] creating a folder in php

2004-10-12 Thread PHP Junkie

>> I want an IDE that will let me speak code into it. Anyone else want
>> anything?

Oh.. I'd like a flat-screen monitor that would interpret the program that I
have in my mind, generate the code for it on screen, save it and run the
program everytime I say "KaBoom".

I'd like a side-order of that IDE that will let me speak code into it as
well.. 

And a bag of Spicier Doritos!! Can't get enough of those.

Thanks,
Junkie



On 10/12/04 2:48 PM, "Greg Donald" <[EMAIL PROTECTED]> wrote:

> On Tue, 12 Oct 2004 13:35:13 -0500, Jay Blanchard
> <[EMAIL PROTECTED]> wrote:
>> I want an IDE that will let me speak code into it. Anyone else want
>> anything?
> 
> I'd like a clone of myself to do my 9-5 x 5 for me.
> 
> Oh yeah, and a bag of cheetos.   Thanks.
> 

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



Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-06 Thread PHP Junkie
Ave,

One more thing I'd like to point out, which I just discovered. The php code
I was using earlier, prior to using Manuel's mail class... Was not able to
send any kind of attachment except .txt files. Niether images nor pdf nor
anything would go through without being corrupted.

However, using Manuel's class, the images are going through attached
properly, without being corrupted. The PDF files still give the error that
the file size & read size isn't the same, but text and image attachments are
going through.

Junkie

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



Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-06 Thread PHP Junkie
Ave,

Manuel...

I saved the new email_message.php class that you sent me replacing the old
one. I used the test_attachment_message.php to test the new class. This time
it didn't send the email with the corrupted attachments, instead, gave me an
error on the screen... This is the error that I received:

³Error: the length of the file that was read does not match the size of the
part file CarsContract-Generic.pdf due to possible data corruption²

I understand now that garbage characters are being inserted by PHP in the
attachment files. Which is why also the other day when I tried your little
php code, it gave Size 35823 but Read 36704 with the additional garbage
characters added. Unfortunately, I think with the new class too, the same is
happening, as per the error. Only this time it is actually giving the error
instead of sending the corrupted file.

Please advice what I can do next... I¹m looking into the Mac compatibility
issue everywhere but I don¹t see anywhere anyone else complaining about such
a thing.

Thanks again,
Junkie



On 10/5/04 10:22 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/05/2004 04:57 PM, PHP Junkie wrote:
>> I replaced the code and added my PDF file in the required place, and this is
>> what it displays now:
>> 
>> Size 35823 Read 36704
>> 
>> I'll put in your address and send out the mail your way with the PDF
>> attachment using the class script.
> 
> It seems that the problem has to due with garbage characters inserted by
> PHP during the read of the file because some PHP options set in your
> environment.
> 
> I have added a few workarounds to the class and it should avoid the
> problem now. I am sending you the new class version attached to this
> message. Please try it now and let me know if you still have problems.



Re: [PHP] Upload problems

2004-10-05 Thread PHP Junkie
Ave,

What's the upload_max_filesize  set to in your php.ini ? Under "File
Uploads" in the php.ini, you will find this value.

Junkie


On 10/5/04 4:33 PM, "Pablo Gosse" <[EMAIL PROTECTED]> wrote:

> Hi, folks.  I'm running into a strange upload problem and am not sure if
> it's a php or apache issue.
> 
> I can't seem to upload any files bigger than 511k.  511k will upload
> fine, but 512k returns a "Document contains no data" error.
> 
> I've tried this with a text file, adding and removing lines until it
> uploaded and wouldn't upload.
> 
> I've also tried multiple file formats, and it's the same for all.
> 
> Has anyone run into this before?  I thought it might be a problem with
> the LimitRequestBody directive in the apache config file, but that
> directive is not used anywhere in the file.
> 
> Any ideas?
> 
> Cheers and TIA,
> 
> Pablo
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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



Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-05 Thread PHP Junkie
Ave,

I replaced the code and added my PDF file in the required place, and this is
what it displays now:

Size 35823 Read 36704

I'll put in your address and send out the mail your way with the PDF
attachment using the class script.

Thanks a lot,

Junkie


On 10/5/04 3:51 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/05/2004 04:40 PM, PHP Junkie wrote:
>> Really appreciate your help.
> 
> No problem. Sending mail with PHP is a saga to many users, not just
> Macs. If there is something that can be done to workaround PHP problems
> to avoid your problem, I will integrate it in that class.
> 
> 
>> I created a new empty php file and put your given code in it. Upon running
>> the test.php in my browser, it prints exactly this in my browser:
>> 
>> could not open file
> 
> Sorry, change it this way and replace your PDF file name where it says
> your-PDF-file-name-here.pdf .
> 
> 
>  $filename="your-PDF-file-name-here.pdf";
> $size=filesize($filename);
> if(!($file=fopen($filename,"rb")))
>die("could not open file ".$file_name);
> $data=fread($file,$size);
> echo "Size ",$size," Read ",strlen($data);
> fclose($file);
> ?>
> 
> 
>> I have a PowerMac G5 Machine, with MacOS X. I have PHP 5 installed from
>> entropy.ch and have the in-built Apache Web Server. Also, the MacOS X ships
>> with Postfix Mail Server and I used the Postfix Enabler to configure it. So
>> I use the Postfix Mail Server.
> 
> Hummm... there should be no problem. Can you try using the class script
> again and change it to send the message with the PDF attachment to:
> [EMAIL PROTECTED] ?

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



Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-05 Thread PHP Junkie
Manuel,

Really appreciate your help.

I created a new empty php file and put your given code in it. Upon running
the test.php in my browser, it prints exactly this in my browser:

could not open file

I have a PowerMac G5 Machine, with MacOS X. I have PHP 5 installed from
entropy.ch and have the in-built Apache Web Server. Also, the MacOS X ships
with Postfix Mail Server and I used the Postfix Enabler to configure it. So
I use the Postfix Mail Server.

Junkie



On 10/5/04 3:36 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

>  $filename=$argv[1];
> $size=filesize($filename);
> if(!($file=fopen($filename,"rb")))
> die("could not open file ".$file_name);
> $data=fread($file,$size);
> echo "Size ",$size," Read ",strlen($data);
> fclose($file);
> ?>

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



Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-05 Thread PHP Junkie
Ave,

On a hunch.. I uploaded my original php script AND the php mime class to a
normal linux server with Apache web server... And all the scripts are
running fine! The PDF attachments go through fine.

So I finally found out.. It's a MAC issue! Using my scripts on the MAC
server is causing the problem. My problem however is, I have to use the MAC
and not a linux or windows or whatever. So what do I do now? How do I make
these scripts work fine on a MAC ??

Thanks,
Junkie



On 10/5/04 12:43 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/04/2004 10:24 AM, Php Junkie wrote:
>> I created a form which can accept 2 file attachments and send an HTML
>> Email... Everything works great... The files even get attached and sent, the
>> ONLY problem is... The PDF file I'm sending attached open up empty! They are
>> all blank.. Like everything has been wiped off from them!!
> 
> It sounds like it is arriving corrupted.
> 
> You may want to try this other class you can used for the same purpose
> and AFAIK does not corrupt attachments:
> 
> http://www.phpclasses.org/mimemessage
> 

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



Re: [PHP] Re: PHP Attachement Problems

2004-10-05 Thread PHP Junkie
Ave,

I just tried your php mime class. I tried the test_attachment_message file.
It did the same to the pdf attachment.

Initially, it tested with a text and an image. The text attachment opened
without a problem but the image was giving an error in opening. I left the
text file attachment as is and attached my pdf file .. And it gave the same
error in opening.

At this point I'm inclined to believe that any kind of php attachment script
is sending through any Text Attachment but not any other kind of attachment.

I'm running an Apache Web Server on a Mac... Would that make a difference?

Junkie.


On 10/5/04 12:43 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/04/2004 10:24 AM, Php Junkie wrote:
>> I created a form which can accept 2 file attachments and send an HTML
>> Email... Everything works great... The files even get attached and sent, the
>> ONLY problem is... The PDF file I'm sending attached open up empty! They are
>> all blank.. Like everything has been wiped off from them!!
> 
> It sounds like it is arriving corrupted.
> 
> You may want to try this other class you can used for the same purpose
> and AFAIK does not corrupt attachments:
> 
> http://www.phpclasses.org/mimemessage
> 

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



Re: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread PHP Junkie
Ave,

The text file went through fine! Absolutely perfect... I attached a normal
text file with just one sentence. I sent it and it arrived in my mailbox
without any problems.. It opened and it had the sentence.. And no warnings
or errors.

Using my code, I'm able to send the HTML mail with 2 attachments. Everything
is fine except that the pdf attachments are just blank and corrupted. One
thing I would like to point out is that I'm only trying to send PDF files.
The purpose of my code is to send PDF files only, not any other type.


Here's my code.. 

This is the form to gather data:

 method=post
ENCTYPE="multipart/form-data" name="f1" id="f1" >

  
From
(Name):

  
  
From
(Email):

  
  
To
(First,Last):


  
  
To
(Email):

  
  
Subject:

  
  
Attachment
1 

  
  
Attachment
2 

  



  


And this is the PHP Code that handles the mail & attachment:

Test";
 $message_html = stripslashes($message_html);
 $message_text = "Informed Sources Inc.";
 $m = new CMIMEMail("$to_nameF $to_nameL <$to>","$from_name
<$from>",$subject);
 $m->mailbody($message_text, $message_html);
 if( $file1) {
 $m->attachFile_raw($file1,$file1_name,$file1_type);
 };
 if( $file2) {
 $m->attachFile_raw($file2,$file2_name,$file2_type);
 };
 $m->send();
?>

mailbody("This is simply text","This is HTML
text");
* $m->attach("example.html","text/html",$filebody);
* $m->attachFile("resume.gif","image/gif");
* $m->send();
*/

class CMIMEMail {
 var $to;
 var $boundary;
 var $smtp_headers;
 var $filename_real;
 var $body_plain;
 var $body_html;
 var $atcmnt;
 var $atcmnt_type;
 
 function CMIMEMail($to,$from,$subject,$priority=3) {
   $this->to=$to; $this->from=$from;
   $this->subject=$subject; $this->priority=$priority;
   $this->boundary="=_NextPart_".time()."_".md5(time())."_";
 }
 function  mailbody( $plain, $html="" ) {
   $this->body_plain=$plain;
   $this->body_html=$html;
 }
 function  attach( $name, $content_type, $data ) {
 }
 function  attachfile_raw( $fname, $mailFileName, $content_type ) {
   if([EMAIL PROTECTED]($fname,"r")) {
$this->atcmnt[$mailFileName]=fread($f,filesize($fname));
$this->atcmnt_type[$mailFileName]=$content_type;
fclose($f);
  } 
 }
 function  attachfile( $fname, $content_type ) {
attachfile_raw($fname,$fname,$content_type);
 }

 function  clear() {
   unset( $atcmnt );
   unset( $atcmnt_type );
 }
 
 function  makeheader() {
   $out ="From: ".$this->from."\n";
   $out.="Reply-To: ".$this->from."\n";
   $out.="MIME-Version: 1.0\n".
"Content-Type: multipart/mixed;\n\t boundary=\"".$this->boundary."\"\n".
"X-Priority: ".$this->priority."\n".
"X-Mailer: phpMimeMail ( http://www.informed-sources.com/ )\n";
   return $out;
 }
 function  makebody() {
   $boundary2= "=_NextAttachedPart_".time()."_".md5(time()+101)."_";
   $out="";
   if( " ".$this->body_html!=" " ) {
 $out="\nThis is a multi-part message in MIME format.\n\n";
 $out.="--".$this->boundary."\nContent-Type:
multipart/alternative;\n\tboundary=\"$boundary2\"\n";
 $out.="$body_plan\n".
   "--$boundary2\nContent-Type: text/plain\n".
#   "Content-Disposition: inline\n".
   "Content-Transfer-Encoding: quoted-printable\n\n".
   $this->body_plain.
   "\n\n--$boundary2\n".
   "Content-Type: text/html\n".
#   "Content-Disposition: attachment;\n\tfilename=\"message.html\"\n".
   "Conent-Transfer-Encoding: quoted-printable\n".
   "\n$this->body_html\n\n".
   "--$boundary2--\n";
   } else {
 $out="\n\n".$this->body_plain."\n\n";
 $out.="--".$this->boundary."\n".
"Content-Type: text/plain\n".
"Content-Transfer-Encoding: quoted-printable\n\n".
$this->body_plain.
"\n\n--".$this->

Re: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread PHP Junkie
Ave,

Exactly, that's the problem. I can very well see the binary information in
the attached PDF in a text editor ... But when I open it in Adobe... The
file does open, it's just that it's all blank. White pages. All wiped off.
All information erased!!


On 10/5/04 12:21 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> I didn't find any php warnings... Instead there was a whole bunch of
> coding
> much of which seemed like junk. I ran a search but no php warnings
> anywhere.. When I open the pdf in a text editor.
> [/snip]
> 
> So, you saw the binary information in the text editor? Can you open the
> file with Adobe?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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



Re: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread PHP Junkie
Ave,

I didn't find any php warnings... Instead there was a whole bunch of coding
much of which seemed like junk. I ran a search but no php warnings
anywhere.. When I open the pdf in a text editor.

What else can be wrong?

Thanks,
Junkie


On 10/4/04 4:46 PM, "Marek Kilimajer" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Ave,
>> 
>> I'm trying to send Attachments via a mail script... The only problem is, my
>> attached files go corrupted or damaged, and I don't understand why! Can
>> anyone help me? I've already made 2 posts earlier with my code and all and
>> no one responded. Really need some help here.
> 
> View the attachment in a text editor, you might see php warnings in it.
> 
> 

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



[PHP] Can anyone help me with Attachments?

2004-10-04 Thread PHP Junkie
Ave,

I'm trying to send Attachments via a mail script... The only problem is, my
attached files go corrupted or damaged, and I don't understand why! Can
anyone help me? I've already made 2 posts earlier with my code and all and
no one responded. Really need some help here.

Thanks,
Junkie

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



[PHP] [PHP Attachement Problems

2004-10-04 Thread PHP Junkie
Ave,

I created a form which can accept 2 file attachments and send an HTML
Email... Everything works great... The files even get attached and sent, the
ONLY problem is... The PDF file I'm sending attached open up empty! They are
all blank.. Like everything has been wiped off from them!!

Here's my code.. 

 method=post
ENCTYPE="multipart/form-data" name="f1" id="f1" >

  
From
(Name):

  
  
From
(Email):

  
  
To
(First,Last):


  
  
To
(Email):

  
  
Subject:

  
  
Message:

Test Message

  
  
Attachment
1 

  
  
Attachment
2 

  


  

","$from_name
<$from>",$subject);
 $m->mailbody($message_html, $message_html);
 if( $file1) {
$m->attachFile_raw($file1,$file1_name,$file1_type);
 };
 if( $file2)
{$m->attachFile_raw($file2,$file2_name,$file2_type);};
 $m->send();
?>

mailbody("This is simply text","This is HTML
text");
* $m->attach("example.html","text/html",$filebody);
* $m->attachFile("resume.gif","image/gif");
* $m->send();
*/

class CMIMEMail {
 var $to;
 var $boundary;
 var $smtp_headers;
 var $filename_real;
 var $body_plain;
 var $body_html;
 var $atcmnt;
 var $atcmnt_type;
 
 function CMIMEMail($to,$from,$subject,$priority=3) {
   $this->to=$to; $this->from=$from;
   $this->subject=$subject; $this->priority=$priority;
   $this->boundary="=_NextPart_".time()."_".md5(time())."_";
 }
 function  mailbody( $plain, $html="" ) {
   $this->body_plain=$plain;
   $this->body_html=$html;
 }
 function  attach( $name, $content_type, $data ) {
 }
 function  attachfile_raw( $fname, $mailFileName, $content_type ) {
   if([EMAIL PROTECTED]($fname,"r")) {
$this->atcmnt[$mailFileName]=fread($f,filesize($fname));
$this->atcmnt_type[$mailFileName]=$content_type;
fclose($f);
  } 
 }
 function  attachfile( $fname, $content_type ) {
attachfile_raw($fname,$fname,$content_type);
 }
 function  clear() {
   unset( $atcmnt );
   unset( $atcmnt_type );
 }
 function  makeheader() {
   $out ="From: ".$this->from."\n";
   $out.="Reply-To: ".$this->from."\n";
   $out.="MIME-Version: 1.0\n".
"Content-Type: multipart/mixed;\n\t boundary=\"".$this->boundary."\"\n".
"X-Priority: ".$this->priority."\n".
"X-Mailer: phpMimeMail ( http://www.informed-sources.com/ )\n";
   return $out;
 }
 function  makebody() {
   $boundary2= "=_NextAttachedPart_".time()."_".md5(time()+101)."_";
   $out="";
   if( " ".$this->body_html!=" " ) {
 $out="\nThis is a multi-part message in MIME format.\n\n";
 $out.="--".$this->boundary."\nContent-Type:
multipart/alternative;\n\tboundary=\"$boundary2\"\n";
 $out.="$body_plan\n".
   "--$boundary2\nContent-Type: text/plain\n".
#   "Content-Disposition: inline\n".
   "Content-Transfer-Encoding: quoted-printable\n\n".
   $this->body_plain.
   "\n\n--$boundary2\n".
   "Content-Type: text/html\n".
#   "Content-Disposition: attachment;\n\tfilename=\"message.html\"\n".
   "Conent-Transfer-Encoding: quoted-printable\n".
   "\n$this->body_html\n\n".
   "--$boundary2--\n";
   } else {
 $out="\n\n".$this->body_plain."\n\n";
 $out.="--".$this->boundary."\n".
"Content-Type: text/plain\n".
"Content-Transfer-Encoding: quoted-printable\n\n".
$this->body_plain.
"\n\n--".$this->boundary.
"\n";
   }
   if( is_array( $this->atcmnt_type ) ) {
 reset( $this->atcmnt_type);
 while( list($name, $content_type) = each($this->atcmnt_type) ) {
   $out.="\n--".$this->boundary."\nContent-Type:
application/pdf\nContent-Transfer-Encoding: base64\nContent-Disposition:
attachment; filename=\"$name\"\n\n".
 chunk_split(base64_encode($this->atcmnt[$name]))."\n";
 }   
   }
   $out.="\n--".$this->boundary."--\n";
   return $out;
 }
 function  send(){
   mail( $this->to, $this->subject, $this->makebody(),$this->makeheader() );
   echo "";
 }
}

?>

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



[PHP] Why won't my attached PDF go through ??

2004-10-01 Thread PHP Junkie
Ave,

I created a form which can accept 2 file attachments and send an HTML
Email... Everything works great... The files even get attached and sent, the
ONLY problem is... The PDF file I'm sending attached open up empty! They are
all blank.. Like everything has been wiped off from them!!

Here's my code.. 

 method=post
ENCTYPE="multipart/form-data" name="f1" id="f1" >

  
From
(Name):

  
  
From
(Email):

  
  
To
(First,Last):


  
  
To
(Email):

  
  
Subject:

  
  
Message:

Test Message

  
  
Attachment
1 

  
  
Attachment
2 

  


  

","$from_name
<$from>",$subject);
 $m->mailbody($message_html, $message_html);
 if( $file1) {
$m->attachFile_raw($file1,$file1_name,$file1_type);
 };
 if( $file2)
{$m->attachFile_raw($file2,$file2_name,$file2_type);};
 $m->send();
?>

mailbody("This is simply text","This is HTML
text");
* $m->attach("example.html","text/html",$filebody);
* $m->attachFile("resume.gif","image/gif");
* $m->send();
*/

class CMIMEMail {
 var $to;
 var $boundary;
 var $smtp_headers;
 var $filename_real;
 var $body_plain;
 var $body_html;
 var $atcmnt;
 var $atcmnt_type;
 
 function CMIMEMail($to,$from,$subject,$priority=3) {
   $this->to=$to; $this->from=$from;
   $this->subject=$subject; $this->priority=$priority;
   $this->boundary="=_NextPart_".time()."_".md5(time())."_";
 }
 function  mailbody( $plain, $html="" ) {
   $this->body_plain=$plain;
   $this->body_html=$html;
 }
 function  attach( $name, $content_type, $data ) {
 }
 function  attachfile_raw( $fname, $mailFileName, $content_type ) {
   if([EMAIL PROTECTED]($fname,"r")) {
$this->atcmnt[$mailFileName]=fread($f,filesize($fname));
$this->atcmnt_type[$mailFileName]=$content_type;
fclose($f);
  } 
 }
 function  attachfile( $fname, $content_type ) {
attachfile_raw($fname,$fname,$content_type);
 }
 function  clear() {
   unset( $atcmnt );
   unset( $atcmnt_type );
 }
 function  makeheader() {
   $out ="From: ".$this->from."\n";
   $out.="Reply-To: ".$this->from."\n";
   $out.="MIME-Version: 1.0\n".
"Content-Type: multipart/mixed;\n\t boundary=\"".$this->boundary."\"\n".
"X-Priority: ".$this->priority."\n".
"X-Mailer: phpMimeMail ( http://www.informed-sources.com/ )\n";
   return $out;
 }
 function  makebody() {
   $boundary2= "=_NextAttachedPart_".time()."_".md5(time()+101)."_";
   $out="";
   if( " ".$this->body_html!=" " ) {
 $out="\nThis is a multi-part message in MIME format.\n\n";
 $out.="--".$this->boundary."\nContent-Type:
multipart/alternative;\n\tboundary=\"$boundary2\"\n";
 $out.="$body_plan\n".
   "--$boundary2\nContent-Type: text/plain\n".
#   "Content-Disposition: inline\n".
   "Content-Transfer-Encoding: quoted-printable\n\n".
   $this->body_plain.
   "\n\n--$boundary2\n".
   "Content-Type: text/html\n".
#   "Content-Disposition: attachment;\n\tfilename=\"message.html\"\n".
   "Conent-Transfer-Encoding: quoted-printable\n".
   "\n$this->body_html\n\n".
   "--$boundary2--\n";
   } else {
 $out="\n\n".$this->body_plain."\n\n";
 $out.="--".$this->boundary."\n".
"Content-Type: text/plain\n".
"Content-Transfer-Encoding: quoted-printable\n\n".
$this->body_plain.
"\n\n--".$this->boundary.
"\n";
   }
   if( is_array( $this->atcmnt_type ) ) {
 reset( $this->atcmnt_type);
 while( list($name, $content_type) = each($this->atcmnt_type) ) {
   $out.="\n--".$this->boundary."\nContent-Type:
application/pdf\nContent-Transfer-Encoding: base64\nContent-Disposition:
attachment; filename=\"$name\"\n\n".
 chunk_split(base64_encode($this->atcmnt[$name]))."\n";
 }   
   }
   $out.="\n--".$this->boundary."--\n";
   return $out;
 }
 function  send(){
   mail( $this->to, $this->subject, $this->makebody(),$this->makeheader() );
   echo "";
 }
}

?>

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



[PHP] Attaching 2 files in Mail

2004-09-30 Thread PHP Junkie
Ave,

I'm facing a little problem.
I have this code which enables me to attach a file and send the file as an
attachment with the Mail.

What I need to do is slightly different.

Firstly, I want to send 2 files as attachment, and not one. Secondly, I
don't want the user to select & attach the file, I want the files to be
already attached in the script. I.e., 2 pre-determined, pre-attached files
should go along with the script.

Here's the code I am using thus far for attaching 1 file...
Can anyone suggest what I should do differently?

";
}

If ($emailto=="") {
$error = "1";
$error_text .= "You did not enter your email!";
}

If ($emailto) {
If 
(!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$",$emailto)
){
$error = "1";
$error_text .= "Invalid Email Address!";
}
}


If($allowattach) {

foreach($allowtypes as $it) {
$types .="*.".$it.",";
}

If($attachment) {
$ext=get_ext($_FILES[attachment][name]);
If(!in_array($ext, $allowtypes)) {
$error = "1";
$error_text .= "Invalid extension for your attchment,
only ".$types." are allowed!";
}
}
}

If($error=="1") {

$disperrors=$error_text;

} Else {

$headers = "From: ".$fromname." <".$fromemail.">\n";
$headers .= "Reply-To: ".$fromname." <".$fromemail.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed;
boundary=\"MIME_BOUNDRY\"\n";
$headers .= "X-Sender: ".$_SERVER['REMOTE_ADDR']."\n";
$headers .= "X-Mailer: phMailerv1.3\n";
$headers .= "X-Priority: ".$priority."\n";
$headers .= "Return-Path: <".$emailto.">\n";
$headers .= "This is a multi-part message in MIME format.\n";

If($allowattach) {
If($attachment) {
[EMAIL PROTECTED]($attachment,"r");
[EMAIL PROTECTED]($fp, filesize($attachment));
[EMAIL PROTECTED](base64_encode($str));
}
}

$yourmessage = "The main body content";

$message = "--MIME_BOUNDRY\n";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n";
$message .= "\n";
$message .= "$yourmessage";
$message .= "\n";

If($allowattach) {
If($attachment) {
$message .= "--MIME_BOUNDRY\n";
$message .= "Content-Type: application/octet-stream;
name=\"" . $_FILES['attachment']['name'] . "\"\n";
$message .= "Content-disposition: attachment\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "\n";
$message .= "$str\n";
$message .= "\n";
$message .= "--MIME_BOUNDRY--\n";
}
}

If(!mail($emailto,$emailsubject,$message,$headers)) {
exit("There has been an error, please contact the admin");
}

Echo("".$thanksmessage."Send Another Mail");
exit();

}

}


function cp() {
Echo("...");
}

?>





Informed Sources Inc.



  
First Name 
:

  Last Name : 
  
  
  
Email
:

  
  
Subject
:

  
  
Attach
:

  
  


  


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



[PHP] mysql_num_rows()

2004-09-27 Thread PHP Junkie
Ave,

In one of my scripts, I'm getting the error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /Library/WebServer/Documents/limiteduse.net/dumptoday.php on
line 56

I¹m not clearly sure why. I¹m running PHP5 with mySQL 4 ... Is there a
compatibility issues somewhere?




Re: [PHP] File Download Problems

2004-09-16 Thread PHP Junkie

Ave,

I made a change last evening, and since the change.. It seems to be working
fine. Thus far I haven't had the 1 KB downloaded file problem. I have been
trying all evening and this morning, from different places, and somehow
right now it seems to be working fine.

What I simply did was this:

Instead of 




As my link to the download file, I changed it to



And changed the code in the download file to

 

I didn¹t need to send the ID var to the download file, and I condensed the
number of Variables I was passing.

Somehow this seems to be working for me. I was just trying this out to one
by one eliminate possibilities. And it works.Since I made this change, the
actual file is being downloaded and not the 1 KB file.
I don¹t really know why though. I understand I didn¹t need to divide the
path into 2 variables. But what if I really needed to send the ID variable?
I don¹t exactly understand how this setup of Variables affected the file
being downloaded.

Thanks anyways.







On 9/15/04 5:35 PM, "Marek Kilimajer" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Ave,
>> 
>> I've been having a very nagging and frustrating problem for a while and I
>> hope someone can help me out with this.
>> 
>> I created a simple File Manager application, a lot of you already know about
>> it as you helped me with coding at different stages.
>> 
>> The problem is this: The Download.
>> When you download a file, it's giving problems sometimes. What is happening
>> is, a 1 KB file downloads instead of the actual file. And thus the file
>> downloaded is no good. The file uploaded is absolutely perfect. Since I have
>> the web server which contains this website, I'm easily able to check all
>> these things. When a user uploads a file, it's uploaded absolutely perfect.
>> It's not a 1 KB file.. The whole file is uploaded and it's not corrupt. But
>> when a user downloads the file... Most of the time a 1 KB file is
>> downloaded.. And its' corrupt of course.
>> 
>> The more frustrating part is, it happens sometimes.. Not everytime. It is
>> happening 90% of the time.. But sometimes it is able to download the actual
>> file. If you try the same file from different locations, 15 times... 1 out
>> of 15 times the file will download fine.
>> 
>> I've been doing all sorts of testing to narrow down the problem but I don't
>> know the problem.
>> 
>> This is my download script :
>> 
>> > $file = "$P/$F";
>> header("Content-Description: File Transfer");
>> header("Content-Type: application/force-download");
>> header("Content-Disposition: attachment; filename=".basename($file));
>> @readfile($file);
>> ?> 
>> 
>> Which is called using this link on the main page:
>> 
>> > href=\"imsafm_user_dl.php?ID=$myrow[ID]&P=imsafm/$user&F=$myrow[filename]\">
>> 
>> 
> 
> What does the 1 KB file contain? Is it the beginning of the wanted file?
> Remove @ while debuging.
> Add header('Content-Lenght: ' . filesize($file));
> Check server logs.
> 
> HTH
> 
> 

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



Re: [PHP] Checking file_exists()

2004-09-15 Thread PHP Junkie
Ave,

I can swear it wasn't working with the Double Quotes either because I tried
it first. But well, now it is so no point in anything.

Thanks a lot.




On 9/15/04 3:19 PM, "John Holmes" <[EMAIL PROTECTED]> wrote:

> From: "PHP Junkie" <[EMAIL PROTECTED]>
> 
> $trauma = 'imsafm/$PHP_login/$img1_name';
> 
> http://www.php.net/manual/en/language.types.string.php#language.types.string.s
> yntax.single
> 
> ---John Holmes...
> 
> 
> 

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



[PHP] File Download Problems

2004-09-15 Thread PHP Junkie
Ave,

I've been having a very nagging and frustrating problem for a while and I
hope someone can help me out with this.

I created a simple File Manager application, a lot of you already know about
it as you helped me with coding at different stages.

The problem is this: The Download.
When you download a file, it's giving problems sometimes. What is happening
is, a 1 KB file downloads instead of the actual file. And thus the file
downloaded is no good. The file uploaded is absolutely perfect. Since I have
the web server which contains this website, I'm easily able to check all
these things. When a user uploads a file, it's uploaded absolutely perfect.
It's not a 1 KB file.. The whole file is uploaded and it's not corrupt. But
when a user downloads the file... Most of the time a 1 KB file is
downloaded.. And its' corrupt of course.

The more frustrating part is, it happens sometimes.. Not everytime. It is
happening 90% of the time.. But sometimes it is able to download the actual
file. If you try the same file from different locations, 15 times... 1 out
of 15 times the file will download fine.

I've been doing all sorts of testing to narrow down the problem but I don't
know the problem. 

This is my download script :

 

Which is called using this link on the main page:




I know that my Upload is working excellent so there's no point going into
it. I check the file once it's uploaded on my Server and I find it's
absolutely perfect... I try and download the same file using the same
applications and it gets corrupted.

I don't' know what to do. Can anyone help?

Thanks.

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



[PHP] Checking file_exists()

2004-09-15 Thread PHP Junkie
Ave,

I have a simple file upload form, which uploads without a problem.
Today I added the file_exists() function to my PHP code. And everything
stopped working. What am I doing wrong here:

File $img1_name uploaded to $PHP_login
folder.";
}
}
?>

I'm not getting any errors (for some reason I don't on my MAC browser, just
a blank white page whenever PHP doesn't work).

Thanks.

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



Re: [PHP] importing DBF data into mysql

2004-09-02 Thread PHP Junkie
Ave,

It was the permissions issue. Although even before I used the script, I knew
permissions would play a role so I had set the permissions appropriately.
Unfortunately I didn't set them for an enclosed folder where I was storing
the DBF file. 

Anyhow, it's working now... Thanks a ton!




On 9/2/04 8:55 AM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> This is undoubtedly exactly what I was looking for. What I don't
> understand
> is why its' not converting my DBF file. It gives a "Could not read File"
> error. It reads the dbf file that came with the script. I'm still trying
> to
> figure it out but it won't work...
>> 
>> http://www.coolnet.cz/miro/dbf2mysql/dbf2mysql.tar.bz2
>> 
> [/snip]
> 
> Check the permissions
> 
> 

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



Re: [PHP] importing DBF data into mysql

2004-09-02 Thread PHP Junkie
Ave,

This is undoubtedly exactly what I was looking for. What I don't understand
is why its' not converting my DBF file. It gives a "Could not read File"
error. It reads the dbf file that came with the script. I'm still trying to
figure it out but it won't work...

Thanks though.



On 9/1/04 6:52 PM, "Thornton" <[EMAIL PROTECTED]> wrote:

> This is probably what your looking for
> 
> http://www.coolnet.cz/miro/dbf2mysql/dbf2mysql.tar.bz2
> 
> It should handle your needs
> 
> On Wed, 2004-09-01 at 14:08, PHP Junkie wrote:
>> Ave,
>> 
>> Is there a PHP script that is able to import or convert DBF data into mySQL
>> tables? 
>> 
>> I need to get my DBF data into mySQL and PHPMyAdmin couldn't handle it.
>> Another problem I have is I'm running a MAC OS X... There is a very simple
>> and efficient DBF2MYSQL program for windows but not for MAC.
>> 
>> I did see somewhere a PHP script that could do it, but I don't know where.
>> 
>> Thanks.
> --
> - Thornton [EMAIL PROTECTED] -
> - Cierra Grouphttp://www.cierragroup.com -
> --

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



[PHP] importing DBF data into mysql

2004-09-01 Thread PHP Junkie
Ave,

Is there a PHP script that is able to import or convert DBF data into mySQL
tables? 

I need to get my DBF data into mySQL and PHPMyAdmin couldn't handle it.
Another problem I have is I'm running a MAC OS X... There is a very simple
and efficient DBF2MYSQL program for windows but not for MAC.

I did see somewhere a PHP script that could do it, but I don't know where.

Thanks.

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



Re: [PHP] Closing my Window after Download

2004-09-01 Thread PHP Junkie
Ave,

Oh My Gosh! You did it!! Gosh! I can't believe you solved it.
And well, I don't know when this was "explained" to everyone but if you
actually search the internet and try and lookup what I was trying to do,
you'll find, as I found, a lot, and I mean a "LOT" of people with the exact
same problem... Because everybody tries to window.open() the page with the
force-download script. Yes your logic made sense to me as soon as I read it,
and I had no doubts it will work. I almost said to myself "how dumb could I
be" because it was such a simple logical issue. But unfortunately, trust me,
it has NOT been explained to "everyone". I even came across people who are
using frames and some kind of JS to close to open window. I couldn't use
that solution so I passed it.

But anyhow, thanks a ton, I needed this real bad and now that I got it I
feel stupid that I didn't make this sense myself. But then again, once in a
while you need a hit on the head with a mallet just like this.

Thank you so much.

PHPJunkie.


On 9/1/04 8:52 AM, "John Holmes" <[EMAIL PROTECTED]> wrote:

> From: "PHP Junkie" <[EMAIL PROTECTED]>
> 
>> Which page do you give this code in?
>> For example, I have a page admin.php  Therein is the link on which,
>> when
>> a user clicks, a window "admin_dl.php" opens. The "admin_dl.php" contains
>> my
>> force-download code and it is that window that I'm trying to close.
>> 
>> If I specify this following code in admin.php itself, would it work?
>> Admin.php does contain a lot of other stuff too.
> 
> Are we still on this topic?
> 
> Say for example you request example.org/music.mp3. The file downloads to
> your computer, right? How is a request for a download of an MP3 file going
> to close your browser window? Your request for "admin_dl.php" is no
> different than a direct request for an MP3 file. You can't send a file and
> then expect to execute some HTML/JS or redirect to another page.
> 
> Why are you opening another window, anyhow? Just link to admin_dl.php from
> admin.php. When a user clicks on the link, it'll trigger a download and the
> user will never leave admin.php. When you click on a link to an MP3, the web
> page your on doesn't change, does it?
> 
> I thought this was already explained to everyone? If anyone thinks I'm
> wrong, I'm more than happy to admit it; just show me  how.
> 
> ---John Holmes...
> 
> 
> 

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



Re: [PHP] Closing my Window after Download

2004-09-01 Thread PHP Junkie
Ave,

Which page do you give this code in?
For example, I have a page admin.php  Therein is the link on which, when
a user clicks, a window "admin_dl.php" opens. The "admin_dl.php" contains my
force-download code and it is that window that I'm trying to close.

If I specify this following code in admin.php itself, would it work?
Admin.php does contain a lot of other stuff too.




On 8/31/04 6:31 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> header("Content-Type: application/force-download");
> header("Content-Type: application/octet-stream");
> header("Content-Type: application/download");
> header("Content-Type: $mimetype");
> header("Content-Disposition: attachment; filename=filename.ext");
> header("Content-Transfer-Encoding: binary");
> header("Accept-Ranges: bytes");
> header("Content-Length: $filesize");
> $fo = fopen("/path/to/filename.ext","r");
> fpassthru($fo);
> fclose($fo);

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



Re: [PHP] Closing my Window after Download

2004-08-31 Thread PHP Junkie
Ave,

Indeed, it didn't work. Anymore suggestions?




On 8/31/04 2:09 PM, "Jasper Howard" <[EMAIL PROTECTED]> wrote:

> try this, after you force download of the file, use:
> 
> header("Location: close_window_script.php");
> 
> where the only code in that file is something like this:
> 
> 
> 
> 
> 
> 
> this is a total workaround, but since its the only thing in the document,
> its very possible that it'll work, it won't take any more time to load
> either because you're using the header() function to forward, so the user
> has to download the same amount of info.

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



Re: [PHP] Closing my Window after Download

2004-08-31 Thread PHP Junkie
Ave,

I didn't quite understand what you meant.
The kind of files being saved by this script range from ZIP files to DBF
files to JPG files etcetera. Where will the HTML be in those saved files?

Any suggestions on what I need to do to make this work?



On 8/30/04 8:31 PM, "Curt Zirzow" <[EMAIL PROTECTED]> wrote:

> * Thus wrote PHP Junkie:
>> Ave,
>> 
>> It still doesn't work. Not only that, I put up a "close window" button in
>> the page and even that doesn't show up. Although that's still not what I
>> want. What I want is the window to close automatically.
>> 
>> Here's my page:
>> 
>> > $file = "$P/$F";
>> header("Content-Description: File Transfer");
>> header("Content-Type: application/force-download");
>> header("Content-Disposition: attachment; filename=".basename($file));
>> @readfile($file);
>> ?> 
>> 
>> 
>> D/L Window
>> 

Re: [PHP] Closing my Window after Download

2004-08-31 Thread PHP Junkie
Ave,

I hear you... Even I feel it's a different problem but I don't know what.
My first thought was that HTML or anything doesn't work after the
Force-Download script in general But since you seem to use it, I guess
it does.

Now I don't know what to do, how to make it work. I can't understand what
exactly is causing the problem.

Thanks though.



On 8/30/04 7:13 PM, "Jasper Howard" <[EMAIL PROTECTED]> wrote:

> if you're not getting any html after your php script, then there's a
> different problem. I do the same thing and all I use is:
> 
>  ...
> ?>
> 
> 
> 
> 
> and I've never had a problem with it not closing...



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



Re: [PHP] Closing my Window after Download

2004-08-30 Thread PHP Junkie
Ave,

It still doesn't work. Not only that, I put up a "close window" button in
the page and even that doesn't show up. Although that's still not what I
want. What I want is the window to close automatically.

Here's my page:

 


D/L Window

function close_opener()
 {
 parentwin = window.self;   // Make handle for
current window named "parentwin"
 parentwin.opener = window.self;// Tell current window
that it opened itself
 parentwin.close(); // Close window's parent
(e.g. the current window)
 }







I don't know what to do... The page just won't close.



> 
> Here, try this JS:
> 
>  function close_opener()
>  {
>  parentwin = window.self;   // Make handle for
> current window named "parentwin"
>  parentwin.opener = window.self;// Tell current window
> that it opened itself
>  parentwin.close(); // Close window's
> parent (e.g. the current window)
>  }
> 
> HTH - Miles Thompson 

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



Re: [PHP] sharing records with assigned users

2004-08-27 Thread PHP Junkie
Ave,

Thanks a ton... And this is exactly what I figured I need to do. Someone
else also wrote in something similar which prompted me to go in this
direction. It's working out now by creating an additional table that maps
the users & records through ID and holds information on who is allowed
access.

Thanks again.



On 8/26/04 6:11 PM, "Torsten Roehr" <[EMAIL PROTECTED]> wrote:

> I guess you need to create a table that maps users to records with two
> columns $userID and $recordID. Then you look up in that table if the user is
> allowed to edit/see this record.
> 
> Regards, Torsten Roehr

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



Re: [PHP] sharing records with assigned users

2004-08-27 Thread PHP Junkie
Ave,

Hey thanks a lot. I'm reading up on those.
I appreciate this.

Thanks.



On 8/26/04 10:07 PM, "David Bevan" <[EMAIL PROTECTED]> wrote:

> On Thu, 2004-08-26 at 13:49, PHP Junkie wrote:
>> Ave,
>> 
>> Jay..
>> Firstly thanks a lot for the tips. I appreciate that and in fact I do try to
>> go methodically in most cases, even using the pen & paper to create my flow
>> charts and diagrams of what I'm about to program. I actually love that
>> method of designing an application.
>> 
>> In fact, for this Phonebook application as well, right here in front of me
>> is the piece of paper in which I've tried to draw the different modules,
>> their behaviors and the functions which I will need to create in order to
>> make this application work intelligibly.
>> 
>> Coming back again to my problem..
>> If, in the table I'm storing my records, I create a field which stores the
>> Users allowed access to that particular record, then in case of multiple
>> users, that single field will hold multiple user names... Which is a problem
>> for me. And I might be applying a very wrong approach, logically, which is
>> why I came forward for some assistance.
>> 
>> Thanks again.
>> 
>> 
>> 
>> On 8/26/04 1:37 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
>> wrote:
>> 
>>> [snip]
>>> There is one feature that Admin gets which I'm trying to figure out.
>>> When the Admin is adding a record, he gets to decide which users he
>>> wants to
>>> share the record with. He can choose particular Users by clicking on
>>> their
>>> name to share that record with. How do I make that happen?
>>> 
>>> Any suggestions?
>>> [/snip]
>>> 
>>> I am going to go a little sideways in response to your question because
>>> I believe that we should help people to learn and improve.
>>> 
>>> Many people enter the PHP arena and become exposed to the shear power
>>> available to them, so they want to accomplish more and more complex apps
>>> than they would in the course of normal web site interaction.
>>> 
>>> I believe at this point one makes the leap from web developer to
>>> applications developer.
>>> 
>>> One of the first things an applications developer should learn is how to
>>> design an application before they write the first line of code. This
>>> requires things like flowcharting and UML. Every programming language
>>> book has several words on this.
>>> 
>>> So, Junkie, what you should do is break down the the componenets into
>>> statements. The statements can then be broken down some more...into
>>> processes, decisions, etc. Once done you will know what the code is.
>>> It's very zen.
>>> 
>>> 1. Admin adds record.
>>> 2. Admin chooses user type(s) that will be allowed access to record.
>>> 3. Admin saves information so that application "knows".
>>> 
>>> NAME  ACCESS_LEVEL
>>> bhoover   admin
>>> pnosehair user
>>> 
>>> etc.
>>> 
>>> [/off soapbox]
>>> 
>>> 
> 
> Very much to what Jay mentioned above, you have to take the time to
> design, although you may have the "logic" thought out, you need to look
> at the way you want to interact with the data and the problems it seems
> to be presenting to you.  An app like you are writing is very straight
> forward IF you have the data structured properly.  I used to give
> a project very similar to this to my students when I used to teach
> programming and logic and all of my students had the same
> problem
> 
> I would advise you to read up on normalization particularly second and
> third normal forms and that should clear up your difficulties. Have a
> quick read of:
> http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html
> 
> to start.
> 
> HTH

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



Re: [PHP] sharing records with assigned users

2004-08-26 Thread PHP Junkie
Ave,

That makes sense... Actually I think I know exactly what you're saying and I
think it's gonna work that way. Let me do this.


Thanks a ton!




On 8/26/04 2:42 PM, "Jason Wong" <[EMAIL PROTECTED]> wrote:

> On Friday 27 August 2004 01:49, PHP Junkie wrote:
> 
>> Coming back again to my problem..
>> If, in the table I'm storing my records, I create a field which stores the
>> Users allowed access to that particular record, then in case of multiple
>> users, that single field will hold multiple user names... Which is a
>> problem for me. And I might be applying a very wrong approach, logically,
>> which is why I came forward for some assistance.
> 
> You have a new table which has 2 columns:
> 
>   record_id, user_id
> 
> Then:
> 
>  SELECT user_id FROM new_table WHERE record_id = whatever;

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



Re: [PHP] sharing records with assigned users

2004-08-26 Thread PHP Junkie
Ave,

Jay..
Firstly thanks a lot for the tips. I appreciate that and in fact I do try to
go methodically in most cases, even using the pen & paper to create my flow
charts and diagrams of what I'm about to program. I actually love that
method of designing an application.

In fact, for this Phonebook application as well, right here in front of me
is the piece of paper in which I've tried to draw the different modules,
their behaviors and the functions which I will need to create in order to
make this application work intelligibly.

Coming back again to my problem..
If, in the table I'm storing my records, I create a field which stores the
Users allowed access to that particular record, then in case of multiple
users, that single field will hold multiple user names... Which is a problem
for me. And I might be applying a very wrong approach, logically, which is
why I came forward for some assistance.

Thanks again.



On 8/26/04 1:37 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> There is one feature that Admin gets which I'm trying to figure out.
> When the Admin is adding a record, he gets to decide which users he
> wants to
> share the record with. He can choose particular Users by clicking on
> their
> name to share that record with. How do I make that happen?
> 
> Any suggestions?
> [/snip]
> 
> I am going to go a little sideways in response to your question because
> I believe that we should help people to learn and improve.
> 
> Many people enter the PHP arena and become exposed to the shear power
> available to them, so they want to accomplish more and more complex apps
> than they would in the course of normal web site interaction.
> 
> I believe at this point one makes the leap from web developer to
> applications developer.
> 
> One of the first things an applications developer should learn is how to
> design an application before they write the first line of code. This
> requires things like flowcharting and UML. Every programming language
> book has several words on this.
> 
> So, Junkie, what you should do is break down the the componenets into
> statements. The statements can then be broken down some more...into
> processes, decisions, etc. Once done you will know what the code is.
> It's very zen.
> 
> 1. Admin adds record.
> 2. Admin chooses user type(s) that will be allowed access to record.
> 3. Admin saves information so that application "knows".
> 
> NAME  ACCESS_LEVEL
> bhoover   admin
> pnosehair user
> 
> etc.
> 
> [/off soapbox]
> 
> 

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



[PHP] sharing records with assigned users

2004-08-26 Thread PHP Junkie
Ave,

I'm working on a Phonebook Application for my company. Much of it's
functions and application are pretty much clear and workable for me. But
there's one aspect which I'm trying to figure out.

It's a multi-user application where there's 2 kinds of users... Admin &
User.

The User can only view, add, edit, browse through his own records.
Each user does get a public & private option, wherein the user can make the
record either private, so only he can see it, or public which anybody can
view. 

The Admin can do absolutely anything.

There is one feature that Admin gets which I'm trying to figure out.
When the Admin is adding a record, he gets to decide which users he wants to
share the record with. He can choose particular Users by clicking on their
name to share that record with. How do I make that happen?

Any suggestions?

Thanks.

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



Re: [PHP] Closing my Window after Download

2004-08-26 Thread PHP Junkie

Ave,

Trust me John, I would not post here without trying out "many" javascript
functions first. In fact, the reason I posted here is because I began to
think that a PHP script like that won't allow the window to close, because
from window.close() to self.close() to various "Timeout & Close" scripts,
I've tried many javascript functions. I don't get any errors ... The window
just doesn't close...



On 8/24/04 2:09 PM, "John Nichel" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Ave,
>> 
>> The browser window which launched the Save As window...
> 
> PHP cannot do this.  You'll have to use JavaScript in the browser
> window.  Something like
> 
>  $file = "$P/$F";
> header("Content-Description: File Transfer");
> header("Content-Type: application/force-download");
> header("Content-Disposition: attachment; filename=".basename($file));
> @readfile($file);
> ?>
> 
> window.close();
> 

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave,

IT WORKS!!!
I guess it was the syntax which was the problem! Finally it works!!

system("rm -rf $user_dir", $ret_val);

Works perfectly... Removes folder!

Thanks a TON!



On 8/24/04 2:04 PM, "Jason Wong" <[EMAIL PROTECTED]> wrote:

> Please do not top post.
> 
> On Wednesday 25 August 2004 01:31, PHP Junkie wrote:
>> Ave,
>> 
>> Nope... Didn't work. Didn't return an error or anything, didn't delete the
>> folders either!
> 
>>>> system('rm -rf',$user_dir,$ret_val);
> 
> That should be:
> 
>   system("rm -rf $user_dir", $ret_val);

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave,

IT WORKS!!!
I guess it was the syntax which was the problem! Finally it works!!

system("rm -rf $user_dir", $ret_val);

Works perfectly... Removes folder!

Thanks a TON!



On 8/24/04 2:04 PM, "Jason Wong" <[EMAIL PROTECTED]> wrote:

> Please do not top post.
> 
> On Wednesday 25 August 2004 01:31, PHP Junkie wrote:
>> Ave,
>> 
>> Nope... Didn't work. Didn't return an error or anything, didn't delete the
>> folders either!
> 
>>>> system('rm -rf',$user_dir,$ret_val);
> 
> That should be:
> 
>   system("rm -rf $user_dir", $ret_val);

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave,

Apache to the best of my knowledge runs as "nobody" by default and since I
didn't change any settings, it is probably running as "nobody".

This is what I got with ls -al

rahul:/Library/WebServer/Documents/informed-sources.com/imsafm bob$ ls -al
total 16
drwxrwxrwx5 nobody  nobody170 24 Aug 13:55 .
drwxrwxrwx  102 bob unknown  3468 24 Aug 11:23 ..
-rw-rw-rw-1 bob unknown  6148 24 Aug 13:57 .DS_Store
drwxr-xr-x3 www www   102 24 Aug 11:05 bobkasper
drwxr-xr-x3 www www   102 24 Aug 11:09 rjohari


Now you see the last 2 folders... "bobkasper" and "rjohari". These are 2
users created by the admin. If I delete a user, their corresponding folder
should be deleted as well, which is what I am trying to achieve. But if,
let's say, I delete the user "rjohari"... The folder still remains.

Thanks for helping...




On 8/24/04 1:49 PM, "John Nichel" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Ave,
>> 
>> Nope... Didn't work. Didn't return an error or anything, didn't delete the
>> folders either!
> 
> If you cannot delete via the php functions or via system calls, then you
> have a permission problem.
> 
> What user/group is Apache running as?
> 
> What is the output of 'ls -al' for the files you're looking to delete?

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



Re: [PHP] Closing my Window after Download

2004-08-24 Thread PHP Junkie
Ave,

The browser window which launched the Save As window...




On 8/24/04 1:41 PM, "John Nichel" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Ave,
>> 
>> I use the PHP Header directives to create a page which would force-download
>> the file for the user...
>> 
>> > $file = "$P/$F";
>> header("Content-Description: File Transfer");
>> header("Content-Type: application/force-download");
>> header("Content-Disposition: attachment; filename=".basename($file));
>> @readfile($file);
>> ?>
>> 
>> What I want is to have this window close automatically once it's launched
>> the Save As Dialog Box ... I tried several javascript window.close(),
>> self.close() functions but none of them seem to work. The window wont close.
>> It remains open.
> 
> You wish to close which window?  The "Save As" window, or the browser
> window which launched the "Save As" window?
> 

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave,

Trust me I do... I double checked it actually..


On 8/24/04 1:41 PM, "Richard Whitney" <[EMAIL PROTECTED]> wrote:

> Dumb question - are you sure you got the path right?
> i.e. /home/public_html/rest/of/your/path
> 
> On Tue, 24 Aug 2004 13:31:06 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote:
>> 
>> Ave,
>> 
>> Nope... Didn't work. Didn't return an error or anything, didn't delete the
>> folders either!
>> 
>> 
>> 
>> 
>> On 8/23/04 8:21 PM, "Richard Whitney" <[EMAIL PROTECTED]> wrote:
>> 
>>> Let me clarify:
>>> 
>>> system()  is like working in a shell
>>> rm -rf forces removal of the directory $file_dir, which you define
>>> befiorehand
>>> $ret_val displays to you what happened. if you tget nothing, it did not
>>> work.
>>> 
>>> HTH!
>>> 
>>> Richard
>>> 
>>> On Mon, 23 Aug 2004 16:24:23 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote:
>>>> Ave,
>>>> 
>>>> Richard... What exactly did you mean by this?
>>>> 
>>>> system('rm -rf',$user_dir,$ret_val);
>>>> 
>>>> I don't understand.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On 8/23/04 12:11 PM, "Richard Whitney" <[EMAIL PROTECTED]> wrote:
>>>> 
>>>>> system('rm -rf',$user_dir,$ret_val);
>>>>> 
>>>>> On Mon, 23 Aug 2004 11:57:35 -0400, PHP Junkie <[EMAIL PROTECTED]>
>>>>> wrote:
>>>>>> Ave,
>>>>>> 
>>>>>> I do not really know what the problem is because I don't get an error,
>>>>>> and
>>>>>> in fact my scripts execute fine... Except that, niether is the directory
>>>>>> deleted, nor is the file deleted. Only corresponding database entries are
>>>>>> deleted which I specify in my SQL code.
>>>>>> 
>>>>>> There are 2 different functions in 2 separate places in my File Manager.
>>>>>> 1 function deletes the User including his Folder
>>>>>> The other deletes a particular file.
>>>>>> 
>>>>>> The code I'm using to delete the User & his Folder is:
>>>>>> 
>>>>>> >>>>> if($delete_user) {
>>>>>> $db = mysql_connect("localhost","usr","pwd");
>>>>>> mysql_select_db("mydb",$db);
>>>>>> $sql = "DELETE FROM user where login = '$user'";
>>>>>> $result = mysql_query($sql) or die("There is a problem.");
>>>>>> $sql2 = "DELETE FROM file where login = '$user'";
>>>>>> $result2 = mysql_query($sql2) or die("There is a problem.");
>>>>>> rmdir (imsafm/$user);
>>>>>> echo "User $user deleted.";
>>>>>> }
>>>>>> ?>
>>>>>> 
>>>>>> The name of Folder of a user is the same as his Login.
>>>>>> Anyhow... The above code doesn¹t generate any error, and in fact does
>>>>>> delete
>>>>>> the database entries from the table... But it doesn¹t remove the user¹s
>>>>>> directory. Why is that?
>>>>>> 
>>>>>> Similarly, this is the code for deleting the file:
>>>>>> 
>>>>>> >>>>> $db = mysql_connect("localhost","usr","pwd");
>>>>>> mysql_select_db("mydb",$db);
>>>>>> $sql = "DELETE FROM file where ID = '$ID'";
>>>>>> $result = mysql_query($sql) or DIE("Cannot Do!");
>>>>>> unlink($P/$F);
>>>>>> echo "File Deleted";
>>>>>> ?>
>>>>>> 
>>>>>> Again, no error... The entries in the table get deleted.. But file
>>>>>> remains
>>>>>> in the directory.
>>>>>> 
>>>>>> Any suggestions?
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
> 

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-24 Thread PHP Junkie

Ave,

Nope... Didn't work. Didn't return an error or anything, didn't delete the
folders either!



On 8/23/04 8:21 PM, "Richard Whitney" <[EMAIL PROTECTED]> wrote:

> Let me clarify:
> 
> system()  is like working in a shell
> rm -rf forces removal of the directory $file_dir, which you define befiorehand
> $ret_val displays to you what happened. if you tget nothing, it did not work.
> 
> HTH!
> 
> Richard
> 
> On Mon, 23 Aug 2004 16:24:23 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote:
>> Ave,
>> 
>> Richard... What exactly did you mean by this?
>> 
>> system('rm -rf',$user_dir,$ret_val);
>> 
>> I don't understand.
>> 
>> 
>> 
>> 
>> On 8/23/04 12:11 PM, "Richard Whitney" <[EMAIL PROTECTED]> wrote:
>> 
>>> system('rm -rf',$user_dir,$ret_val);
>>> 
>>> On Mon, 23 Aug 2004 11:57:35 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote:
>>>> Ave,
>>>> 
>>>> I do not really know what the problem is because I don't get an error, and
>>>> in fact my scripts execute fine... Except that, niether is the directory
>>>> deleted, nor is the file deleted. Only corresponding database entries are
>>>> deleted which I specify in my SQL code.
>>>> 
>>>> There are 2 different functions in 2 separate places in my File Manager.
>>>> 1 function deletes the User including his Folder
>>>> The other deletes a particular file.
>>>> 
>>>> The code I'm using to delete the User & his Folder is:
>>>> 
>>>> >>> if($delete_user) {
>>>> $db = mysql_connect("localhost","usr","pwd");
>>>> mysql_select_db("mydb",$db);
>>>> $sql = "DELETE FROM user where login = '$user'";
>>>> $result = mysql_query($sql) or die("There is a problem.");
>>>> $sql2 = "DELETE FROM file where login = '$user'";
>>>> $result2 = mysql_query($sql2) or die("There is a problem.");
>>>> rmdir (imsafm/$user);
>>>> echo "User $user deleted.";
>>>> }
>>>> ?>
>>>> 
>>>> The name of Folder of a user is the same as his Login.
>>>> Anyhow... The above code doesn¹t generate any error, and in fact does
>>>> delete
>>>> the database entries from the table... But it doesn¹t remove the user¹s
>>>> directory. Why is that?
>>>> 
>>>> Similarly, this is the code for deleting the file:
>>>> 
>>>> >>> $db = mysql_connect("localhost","usr","pwd");
>>>> mysql_select_db("mydb",$db);
>>>> $sql = "DELETE FROM file where ID = '$ID'";
>>>> $result = mysql_query($sql) or DIE("Cannot Do!");
>>>> unlink($P/$F);
>>>> echo "File Deleted";
>>>> ?>
>>>> 
>>>> Again, no error... The entries in the table get deleted.. But file remains
>>>> in the directory.
>>>> 
>>>> Any suggestions?
>>>> 
>>>> 
>>> 
>> 
>> 
> 

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



[PHP] Closing my Window after Download

2004-08-24 Thread PHP Junkie
Ave,

I use the PHP Header directives to create a page which would force-download
the file for the user...



What I want is to have this window close automatically once it's launched
the Save As Dialog Box ... I tried several javascript window.close(),
self.close() functions but none of them seem to work. The window wont close.
It remains open.

Anyone's got any tips for me?

Thanks.

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave,

Richard... What exactly did you mean by this?

system('rm -rf',$user_dir,$ret_val);

I don't understand.



On 8/23/04 12:11 PM, "Richard Whitney" <[EMAIL PROTECTED]> wrote:

> system('rm -rf',$user_dir,$ret_val);
> 
> On Mon, 23 Aug 2004 11:57:35 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote:
>> Ave,
>> 
>> I do not really know what the problem is because I don't get an error, and
>> in fact my scripts execute fine... Except that, niether is the directory
>> deleted, nor is the file deleted. Only corresponding database entries are
>> deleted which I specify in my SQL code.
>> 
>> There are 2 different functions in 2 separate places in my File Manager.
>> 1 function deletes the User including his Folder
>> The other deletes a particular file.
>> 
>> The code I'm using to delete the User & his Folder is:
>> 
>> > if($delete_user) {
>> $db = mysql_connect("localhost","usr","pwd");
>> mysql_select_db("mydb",$db);
>> $sql = "DELETE FROM user where login = '$user'";
>> $result = mysql_query($sql) or die("There is a problem.");
>> $sql2 = "DELETE FROM file where login = '$user'";
>> $result2 = mysql_query($sql2) or die("There is a problem.");
>> rmdir (imsafm/$user);
>> echo "User $user deleted.";
>> }
>> ?>
>> 
>> The name of Folder of a user is the same as his Login.
>> Anyhow... The above code doesn¹t generate any error, and in fact does delete
>> the database entries from the table... But it doesn¹t remove the user¹s
>> directory. Why is that?
>> 
>> Similarly, this is the code for deleting the file:
>> 
>> > $db = mysql_connect("localhost","usr","pwd");
>> mysql_select_db("mydb",$db);
>> $sql = "DELETE FROM file where ID = '$ID'";
>> $result = mysql_query($sql) or DIE("Cannot Do!");
>> unlink($P/$F);
>> echo "File Deleted";
>> ?>
>> 
>> Again, no error... The entries in the table get deleted.. But file remains
>> in the directory.
>> 
>> Any suggestions?
>> 
>> 
> 

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
I guess phpinfo() is *OUR* friend!! Great guy!
Although I'd be happier if my files & folders started getting deleted with
the script, which still ain't happening.



On 8/23/04 2:32 PM, "John Nichel" <[EMAIL PROTECTED]> wrote:

> Jason Wong wrote
>> phpinfo() is your friend.
>> 
> 
> I thought phpinfo() was *MY* friend??? ;)

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave,

I do have the original permission set to CHMOD 777 thus the uploads are
working fine. 

I had presumed that anything uploaded by the server is owned by it thus I
wouldn't have to interfere with the permissions thereafter... But somehow
that doesn't seem to be working out.

I did actually set the permissions for group "nobody" to 'Read & Write'...
But I'm still there. The Files or Folders are not getting deleted.

Ave.


On 8/23/04 1:41 PM, "Jonathan Haddad" <[EMAIL PROTECTED]> wrote:

> the chmod 666 sets the exisiting files to be edited by the server.
> anything that's uploaded by the server is owned by it, and thusly can be
> edited.
> 
> as a side note, you'd have to chmod 777 the directory to be edited if
> you want uploads to work.
> 
> PHP Junkie wrote:
> 
>> Ave,
>> 
>> Well here's my situation...
>> You see the File Manager allows users to Upload files ... Once a user
>> uploads the file... It resides in a particular folder on my server. Users
>> will be constantly uploading, downloading, deleting files. I can't possibly
>> CHMOD 777 all the time...
>> 
>> My question is... If I select the "nobody" group for the base folder where
>> the files are stored & created... Will all the directories & files which are
>> created later by the users using the website therein have the permissions to
>> be deleted, if I set the permissions to read & write on that base folder?
>> 
>> Thanks.
>> 
>> 
>> 
>> 
>> On 8/23/04 12:48 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
>> wrote:
>> 
>>  
>> 
>>> [snip]
>>> How do I find out which user/group my web server is running as?
>>> I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine.
>>> I can change the user/group permissions... But which user/group does the
>>> web
>>> server use?
>>> [/snip]
>>> 
>>> For security reasons Apache typically runs as "nobody"
>>> 
>>> 
>>>
>>> 
>> 
>>  
>> 

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave,

Well here's my situation...
You see the File Manager allows users to Upload files ... Once a user
uploads the file... It resides in a particular folder on my server. Users
will be constantly uploading, downloading, deleting files. I can't possibly
CHMOD 777 all the time...

My question is... If I select the "nobody" group for the base folder where
the files are stored & created... Will all the directories & files which are
created later by the users using the website therein have the permissions to
be deleted, if I set the permissions to read & write on that base folder?

Thanks.




On 8/23/04 12:48 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> How do I find out which user/group my web server is running as?
> I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine.
> I can change the user/group permissions... But which user/group does the
> web
> server use?
> [/snip]
> 
> For security reasons Apache typically runs as "nobody"
> 
> 

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



Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread PHP Junkie
Ave,

Yes indeed that's what it's doing. But that's ok... My main concern was for
Windows users because that's the majority of the users for this application.

Thanks.



On 8/23/04 12:50 PM, "Jonathan Haddad" <[EMAIL PROTECTED]> wrote:

> In Safari it'll download the file and then open it.
> 
> Jon
> 
> PHP Junkie wrote:
> 
>> Ave,
>> 
>> IT WORKS!!
>> There wasn't one bit of a problem..
>> I'll just paste the code here again for anyone who might be looking for it.
>> I guess I was very close to it but just doing one thing wrong... I wasn't
>> specifying the Basename directive.
>> 
>> > $file = "$P/$F";
>> header("Content-Description: File Transfer");
>> header("Content-Type: application/force-download");
>> header("Content-Disposition: attachment; filename=".basename($file));
>> @readfile($file);
>> ?> 
>> 
>> Although this doesn't work on MAC... It works on Windows .. In Mac it still
>> opens up the file in it's supported software. But it's not an issue for me.
>> 
>> Thanks a ton guys...
>> 
>> 
>> 
>> On 8/23/04 10:51 AM, "John Holmes" <[EMAIL PROTECTED]> wrote:
>> 
>>  
>> 
>>> From: "PHP Junkie" <[EMAIL PROTECTED]>
>>> 
>>>
>>> 
>>>> I have created a File Manager Application for my company which has a place
>>>> where authorized users can download the stored files. The files are of
>>>> various MIME Types.. Mainly PDF, TXT & DOC.
>>>> What I want to do is basically... When the user clicks on the Download
>>>> Button... The Save As Dialog Box should appear...
>>>> What is happening right now is that the file opens in it's related
>>>> software
>>>> (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
>>>> native software.
>>>> 
>>>> I know I need to use the
>>>> header ("Content-type: application/octet-stream");
>>>> But I don't know how.
>>>>  
>>>> 
>>> Read the first comment here: http://us4.php.net/readfile
>>> 
>>> ---John Holmes...
>>>
>>> 
>> 
>>  
>> 

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



Re: [PHP] unlink() & rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave,

How do I find out which user/group my web server is running as?
I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine.
I can change the user/group permissions... But which user/group does the web
server use?

Thanks.

On 8/23/04 12:08 PM, "John Nichel" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Again, no error... The entries in the table get deleted.. But file remains
>> in the directory.
>> 
>> Any suggestions?
> 
> Neither of these functions return an error.  They will return false on
> failure.  Does the user/group which your web server is running as have
> permission to remove these files/directories?

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



[PHP] unlink() & rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave,

I do not really know what the problem is because I don't get an error, and
in fact my scripts execute fine... Except that, niether is the directory
deleted, nor is the file deleted. Only corresponding database entries are
deleted which I specify in my SQL code.

There are 2 different functions in 2 separate places in my File Manager.
1 function deletes the User including his Folder
The other deletes a particular file.

The code I'm using to delete the User & his Folder is:

User $user deleted.";
}
?>

The name of Folder of a user is the same as his Login.
Anyhow... The above code doesn¹t generate any error, and in fact does delete
the database entries from the table... But it doesn¹t remove the user¹s
directory. Why is that?

Similarly, this is the code for deleting the file:

File Deleted";
?>

Again, no error... The entries in the table get deleted.. But file remains
in the directory.

Any suggestions?




Re: [PHP] How do I open Save As Dialog Box?

2004-08-23 Thread PHP Junkie

Ave,

IT WORKS!!
There wasn't one bit of a problem..
I'll just paste the code here again for anyone who might be looking for it.
I guess I was very close to it but just doing one thing wrong... I wasn't
specifying the Basename directive.

 

Although this doesn't work on MAC... It works on Windows .. In Mac it still
opens up the file in it's supported software. But it's not an issue for me.

Thanks a ton guys...



On 8/23/04 10:51 AM, "John Holmes" <[EMAIL PROTECTED]> wrote:

> From: "PHP Junkie" <[EMAIL PROTECTED]>
> 
>> I have created a File Manager Application for my company which has a place
>> where authorized users can download the stored files. The files are of
>> various MIME Types.. Mainly PDF, TXT & DOC.
>> What I want to do is basically... When the user clicks on the Download
>> Button... The Save As Dialog Box should appear...
>> What is happening right now is that the file opens in it's related
>> software
>> (Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
>> native software.
>> 
>> I know I need to use the
>> header ("Content-type: application/octet-stream");
>> But I don't know how.
> 
> Read the first comment here: http://us4.php.net/readfile
> 
> ---John Holmes... 

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



[PHP] How do I open Save As Dialog Box?

2004-08-23 Thread PHP Junkie
Ave,

I'm facing a little problem.
I have created a File Manager Application for my company which has a place
where authorized users can download the stored files. The files are of
various MIME Types.. Mainly PDF, TXT & DOC.
What I want to do is basically... When the user clicks on the Download
Button... The Save As Dialog Box should appear...
What is happening right now is that the file opens in it's related software
(Word, Acrobat, Notepad etcetera). I don't want the file to open in it's
native software.

I know I need to use the
header ("Content-type: application/octet-stream");
But I don't know how.

Can anyone help?

Thanks.

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



[PHP] Save Dialog Box

2004-08-18 Thread PHP Junkie
Ave,

I'm working on creating a File Manager for my Company, in PHP & MySQL.
I had a question

The File Manager allows authenticated users to download & upload various
types of files from the available Zones. What I basically do is specify a
link to the Original file stored on the server so that the user can click on
the filename in the File Manager and download it.

What is happening is, depending on what type of a file it is... Instead of
giving a "Save Dialog Box", the file opens up in it's supported software.
For example.. If it's a text file... The file opens in notepad when you
click on the link on the webpage... Or if it's a PDF, it opens the Adobe
Acrobat Reader.

I understand why it does that and that it will do this.
But is there a way to alter it? What I want to do is, irrespective of the
File Format, I want the Save Dialog Box to appear, so that the user can
download the file on his system.

Thanks.

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



[PHP] PHP Calendar/Planner Project

2004-08-10 Thread PHP Junkie
Ave,

I'm working to create a sophisticated PHP Calendar/Planner application for
my company's web server. I was wondering if there is a nice powerful
calendar/planner application out there which could help me in guidance
towards building my project. What I'm looking for is something sophisticated
with features of users/groups, private/public calendars etcetera.

I'd really appreciate if someone can point to an existing application which
I can get.

Thanks,
Ave.

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



Re: [PHP] postfix with PHP on Mac OS X

2004-07-22 Thread PHP Junkie

Sounds interesting and what I need to do, so let me try this first.
Thanks A ton!

RSJ


On 7/22/04 5:03 PM, "Brent Baisley" <[EMAIL PROTECTED]> wrote:

> One way to reduce the amount of spam your server receives is to have it
> validate the domain of the sender. In this case, the mail server tried
> to lookup the domain rahul.local, which of course doesn't exist, so
> your mail was rejected. Read up on the mail() command, specifically the
> additional headers where you can specify the MAIL FROM.
> http://us2.php.net/manual/en/function.mail.php
> 
> One thing that helped me in understanding how the mail process worked
> was to walk through it manually from the terminal. It's ridiculously
> simple what goes on in transferring a message to another mail server.
> Which explains why some viruses have there own mail servers built-in.
> 
> On Jul 22, 2004, at 4:49 PM, PHP Junkie wrote:
> 
>> Astrum Et Securis
>> 
>> I tried using the "mail" command at the Terminal Window In fact it
>> did
>> have all my sent messages recorded there, but they are all giving an
>> error... Which is something like this:
>> 
>> __
>> Content-Description: Delivery error report
>> Content-Type: message/delivery-status
>> 
>> Reporting-MTA: dns; rahul.local
>> Arrival-Date: Thu, 22 Jul 2004 16:39:14 -0400 (EDT)
>> 
>> Final-Recipient: rfc822; [EMAIL PROTECTED]
>> Action: failed
>> Status: 5.0.0
>> Diagnostic-Code: X-Postfix; host nymx-1.nyroc.rr.com[24.92.226.31]
>> said: 553
>> 5.1.8 <[EMAIL PROTECTED]>... Domain of sender address
>> [EMAIL PROTECTED] does
>> not exist (in reply to MAIL FROM command)
>> __
>> 
>> And then the content of the Email follows.
>> 
>> The name of my server (localhost) is "rahul.local"
>> 
>> I'm not sure what this error is trying to tell me...
>> Any help will be greatly appreciated.
>> 
>> Thanks,
>> Rahul S. Johari
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 

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



Re: [PHP] postfix with PHP on Mac OS X

2004-07-22 Thread PHP Junkie
Astrum Et Securis

I tried using the "mail" command at the Terminal Window In fact it did
have all my sent messages recorded there, but they are all giving an
error... Which is something like this:

__
Content-Description: Delivery error report
Content-Type: message/delivery-status

Reporting-MTA: dns; rahul.local
Arrival-Date: Thu, 22 Jul 2004 16:39:14 -0400 (EDT)

Final-Recipient: rfc822; [EMAIL PROTECTED]
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host nymx-1.nyroc.rr.com[24.92.226.31] said: 553
5.1.8 <[EMAIL PROTECTED]>... Domain of sender address [EMAIL PROTECTED] does
not exist (in reply to MAIL FROM command)
__

And then the content of the Email follows.

The name of my server (localhost) is "rahul.local"

I'm not sure what this error is trying to tell me...
Any help will be greatly appreciated.

Thanks,
Rahul S. Johari

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



Re: [PHP] postfix with PHP on Mac OS X

2004-07-22 Thread PHP Junkie
Astrum Et Securis

I used the Postfix Enabler software which sets up the mail server.
How do I test the mail server? How can I determine if it actually sends
mail?

RSJ


On 7/22/04 2:45 PM, "Matthew Sims" <[EMAIL PROTECTED]> wrote:

>> Astrum Et Securis,
>> 
>> I'm using a PowerMac G5 machine, which has the MacOS X Panther. It comes
>> with the Postfix mail server, which I'm now trying to use with PHP.
>> 
>> I was able to define the sendmail_path to the Postfix sendmail in the
>> PHP.INI ..
>> 
>> Now what happens is, on my localhost when I run the website, and I run a
>> php
>> page that sends form data to email using the mail() function, it doesn't
>> give me any error, but the mail never arrives in the defined mailbox.
>> 
>> Any help appreciated.
>> 
>> RSJ
> 
> You should see if the mail server works first before trying it out with
> PHP. Does Postfix actually send mail?
> 
> --Matthew Sims
> --
> 
> 
> 

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



[PHP] postfix with PHP on Mac OS X

2004-07-22 Thread PHP Junkie
Astrum Et Securis,

I'm using a PowerMac G5 machine, which has the MacOS X Panther. It comes
with the Postfix mail server, which I'm now trying to use with PHP.

I was able to define the sendmail_path to the Postfix sendmail in the
PHP.INI .. 

Now what happens is, on my localhost when I run the website, and I run a php
page that sends form data to email using the mail() function, it doesn't
give me any error, but the mail never arrives in the defined mailbox.

Any help appreciated.

RSJ

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



Re: [PHP] The Mail Server on Mac OS X

2004-07-21 Thread PHP Junkie

Astrum Et Securis,

In fact, I did find out that Mac OS X (Panther) comes with a built-in Mail
Server called "Postfix"... Now what I need to know is how to use it with my
PHP Which I'm thinking is going to happen by defining the path to some
mail protocol of Postfix in my PHP.INI...

Any help?

Thanks,
RSJ


On 7/21/04 5:11 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 07/21/2004 06:05 PM, Php Junkie wrote:
>> We're running our Apache Web Server with PHP & MySQL on a Power MAC G5
>> (MacOS X) system. And we're currently thinking of making it our web server
>> giving public access to our website hosted on this machine.
>> 
>> PHP, MySQL, FTP etcetera are all fine, but what about the Mail Server? How
>> does the mail() in the PHP work... It requires a Mail Server? If so, how can
>> I install/configure such a mail server so that the mail() can work from our
>> own server machine?
> 
> I think there is sendmail for OS X now.

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



[PHP] The Mail Server

2004-07-21 Thread PHP Junkie
Astrum Et Securis,

We're running our Apache Web Server with PHP & MySQL on a Power MAC G5
(MacOS X) system. And we're currently thinking of making it our web server
giving public access to our website hosted on this machine.

PHP, MySQL, FTP etcetera are all fine, but what about the Mail Server? How
does the mail() in the PHP work... It requires a Mail Server? If so, how can
I install/configure such a mail server so that the mail() can work from our
own server machine?

Thanks,
RSJ

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



RE: [PHP] PHP on MAC

2004-07-13 Thread PHP Junkie
Astrum Et Securis

AWESOME!! Needed to hear something like that.. 
Thanks a ton! And I will definitely get the Installer from the mentioned
location.

Thank you.

Dominor,
RSJ

-Original Message-
From: Larry E. Ullman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 13, 2004 7:32 PM
To: PHP Junkie
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP on MAC

> We've just bought a new Power Mac G5 Macintosh computer for the office 
> and
> I'll need to do some backend engineering work using it. I've never 
> worked
> with PHP on MAC, so I really have no experience with what happens on a
> MAC... are there on issues regarding working with PHP on a MAC?

Not at all. OS X is essentially Unix and you've already got Apache 
built in. I believe it comes with PHP installed (but not enabled) but I 
would recommend using Marc's installer from www.entropy.ch. This will 
give you the most current version of PHP (normally). In short, PHP is 
great on a Mac.

Hope that helps,
Larry

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



[PHP] PHP on MAC

2004-07-13 Thread PHP Junkie

Astrum Et Securis

We've just bought a new Power Mac G5 Macintosh computer for the office and
I'll need to do some backend engineering work using it. I've never worked
with PHP on MAC, so I really have no experience with what happens on a
MAC... are there on issues regarding working with PHP on a MAC?

Thanks,
RSJ

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



[PHP] Moving a PHP/MySQL web site ???

2001-07-27 Thread PHP Junkie

Hi 

I will be having to face the dubious task of moving my PHP/MySQL-based website to 
another server.  Can anyone out there point me to some "GOOD" documentation on this?  
The .php files I'm not as concerned about.  I've been using the $DOCUMENT_ROOT in all 
of my includes.  I'm more concerned about getting the MySQL databases ( actual files 
??? ) moved over correctly.

I know this isn't a MySQL list, but I thought that enough of you out there work with 
PHP/MySQL enough to get some good feedback.  I'd also like to hear feedback on just 
your general experience with the process of moving from one web server over to another.

Thanks all -- --

Gene Kelley
BizFlow Data Solutions
http://www.bizflowdata.net/



__
Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.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: Re: [PHP] Capitalize Function ??

2001-07-24 Thread PHP Junkie

True.  or what about the Irish.. The Mc***'s or the Mac*'s !!
Hmmm?  This will be a challenge for sure!!

Alexander Skwar <[EMAIL PROTECTED]> wrote:

>So sprach »PHP Junkie« am 2001-07-23 um 21:39:07 -0400 :
>> I'm taking in first name and last name data into a MySQL db through a
>> form. Users sometimes don't capitalize their first and last names when
>> entering the data.  Is there a function to clean this up for
>> consistency?  If so, what is the name of the function that performs
>> this?
>
>Yep, ucwords.
>
>But this is not a good idea!  There are Names (like "Hans vom Bach" or
>somesuch) which do NOT have to be captialized.  Actually, capitalizing
>the "vom" would be wrong.  Although this was just a German example, I'd
>bet there are names in French, Dutch, Spanish, Italian as well which
>should not be capitalized.  Hmm, how about English?  Sometimes there are
>suffixes like "the 3rd", no?  Would it be right to capitalize this?
>
>
>Alexander Skwar
>--
>How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
>Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
>   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
>Uptime: 1 day 7 hours 12 minutes
>


__
Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.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] Capitalize Function ??

2001-07-23 Thread PHP Junkie

I know this one will be an easy one ...

I'm taking in first name and last name data into a MySQL db through a form. Users 
sometimes don't capitalize their first and last names when entering the data.  Is 
there a function to clean this up for consistency?  If so, what is the name of the 
function that performs this?

Thanks in advance,

Gene Kelley
Web Developer
BizFlow Data Solutions, Inc.
http://www.bizflowdata.net/


__
Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.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]