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



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

2004-10-05 Thread Jay Blanchard
[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



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

2004-10-05 Thread Marek Kilimajer
PHP Junkie wrote:
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.
Send a text file as an attachement, it will be easier to spot the error. 
You can then run diff on original and attachement.

Also, show the code.
--
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,

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,

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:

form action=?php echo $PHP_SELF ? method=post
ENCTYPE=multipart/form-data name=f1 id=f1 
table
  tr
td align=left valign=middle class=style13From
(Name):/td
tdinput name=from_name type=text value=Gerson Bullock
size=40/td
  /tr
  tr
td align=left valign=middle class=style13From
(Email):/td
tdinput name=from type=text
value=[EMAIL PROTECTED] size=40/td
  /tr
  tr
td align=left valign=middle class=style13To
(First,Last):/td
tdinput name=to_nameF type=text id=to_nameF size=15
input name=to_nameL type=text id=to_nameL size=15/td
  /tr
  tr
td align=left valign=middle class=style13To
(Email):/td
tdinput name=to type=text size=40/td
  /tr
  tr
td align=left valign=middle
class=style13Subject:/td
tdinput name=subject type=text value=Your Conversation
with Gerson Bullock size=40/td
  /tr
  tr
td align=left valign=middle class=style13Attachment
1 /td
tdinput type=file name=file1/td
  /tr
  tr
td align=left valign=middle class=style13Attachment
2 /td
tdinput type=file name=file2/td
  /tr
/table
input name=message_html type=hidden id=message_html
input name=doSubmit type=submit id=doSubmit value=Send
Mail
  /form


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

?php
$message_html = bTest/b;
 $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();
?

?php
/*
* $m = new CMIMEMail($to,$from,$subject);
* $m-mailbody(This is simply text,htmlbodyh1This is HTML
text/h1);
* $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 {
 

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

2004-10-04 Thread Marek Kilimajer
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


Re: [PHP] Can anyone help me

2003-03-27 Thread Peter Houchin
Dude have a look on the web 1000's of examples/tutorials there and also 
in it's documentation. The PHP mailing list is NOT the place to be 
asking this as setting/learning how to use OpenSSL aint related to PHP.

Cheers
Peter
Suhas Pharkute wrote:
Can anyone give me a basic tutorial for 

Secure Site Programming (OpenSSL)

Also How to create certificate on server

Suhas

__
Suhas S Pharkute.
P O Box 8551,
Pocatello, ID 83209.
1.208.221.3896
http://myweb.cableone.net/psuhas/
__



--

Peter Houchin
Sun Rentals STR Manager
Phone: 03 9869 6452
Fax:   03 9866 2511
Mobile:0438 789 220
[EMAIL PROTECTED]
http://www.sunrentals.com.au/


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


RE: [PHP] Can anyone help? PHP script/MySQL problem

2002-12-10 Thread Rich Gray
Hi Steven
so what exactly is the problem then?
Rich

-Original Message-
From: Steven M [mailto:[EMAIL PROTECTED]]
Sent: 10 December 2002 14:25
To: [EMAIL PROTECTED]
Subject: [PHP] Can anyone help? PHP script/MySQL problem


Hi, i am trying to create a member login/authentication script to
automatically send newly signed up people an email with a confirmation link.
I am following a tutorial:

http://www.phpfreaks.com/tutorials/40/0.php

My form is located at:

http://www.tricia-marwick.co.uk/members/join_form.php

[snip]


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




Re: [PHP] Can anyone help? PHP script/MySQL problem

2002-12-10 Thread Steven M
Hi Rich

The prob is that the data isn't stored into the database as it should be and
the user doesn't get an email back with their data.  It seems to get lost
before reaching the database, meaning the rest of it wont work, and i don't
know why.

Thanks

Steven M



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




RE: [PHP] Can anyone help? PHP script/MySQL problem

2002-12-10 Thread Rich Gray
Any error messages? You say it is not stored 'as it should be' does that
mean it *is* stored but incorrectly, or is the data just not there?
FWIW I just used your test form and it said I had registered ok I then
retried with the same info and I got 2 error messages as I would have
expected which implies the data is hitting the database ok...
Rich

-Original Message-
From: Steven M [mailto:[EMAIL PROTECTED]]
Sent: 10 December 2002 14:47
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Can anyone help? PHP script/MySQL problem


Hi Rich

The prob is that the data isn't stored into the database as it should be and
the user doesn't get an email back with their data.  It seems to get lost
before reaching the database, meaning the rest of it wont work, and i don't
know why.

Thanks

Steven M



--
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? PHP script/MySQL problem

2002-12-10 Thread Steven M
Rich,

I'm not getting any error messages.  I have just checked my database and the
only data other than that i manually entered is an auto-increment number and
a random password, which i assume were produced when you filed in the form.
There is no first name, last name, email etc which there should have been if
you filled in the form.

If it was working fine you would recieve an email automatically at the
address you specified.

If you have any ideas what's wrong i'd love to hear them.

Steven M
Rich Gray [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Any error messages? You say it is not stored 'as it should be' does that
 mean it *is* stored but incorrectly, or is the data just not there?
 FWIW I just used your test form and it said I had registered ok I then
 retried with the same info and I got 2 error messages as I would have
 expected which implies the data is hitting the database ok...
 Rich

 -Original Message-
 From: Steven M [mailto:[EMAIL PROTECTED]]
 Sent: 10 December 2002 14:47
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Can anyone help? PHP script/MySQL problem


 Hi Rich

 The prob is that the data isn't stored into the database as it should be
and
 the user doesn't get an email back with their data.  It seems to get lost
 before reaching the database, meaning the rest of it wont work, and i
don't
 know why.

 Thanks

 Steven M



 --
 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? PHP script/MySQL problem

2002-12-10 Thread Peter Houchin
Steven,

given what you've just said have you double checked that the spelling is the
same for the field names in your code and also in the db.. also have you
tried to just pass the info on to another page and displaying it?

 -Original Message-
 From: Steven M [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, 11 December 2002 10:26 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Can anyone help? PHP script/MySQL problem


 Rich,

 I'm not getting any error messages.  I have just checked my
 database and the
 only data other than that i manually entered is an auto-increment
 number and
 a random password, which i assume were produced when you filed in
 the form.
 There is no first name, last name, email etc which there should
 have been if
 you filled in the form.

 If it was working fine you would recieve an email automatically at the
 address you specified.

 If you have any ideas what's wrong i'd love to hear them.

 Steven M
 
 
 
  --
  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 please.

2002-10-27 Thread Tom Rogers
Hi,

Monday, October 28, 2002, 1:44:37 AM, you wrote:
SJ I have two test carts online at the moment.
SJ This one works fine:
SJ http://www.violasystems.com/shop/

SJ this one is the one I want to get working
SJ http://www.violasystems.com/shop_testing/

SJ The code for the first shop basically increments the cart by one when the
SJ submit button is added using the commented out code.

SJ $qty = $formqty;
SJ  if($cart[$new])
SJ   //$cart[$new]++;
SJ$cart[$new] = $cart[$new] + $qty;
SJ else
SJ   $cart[$new] = 1;
SJ $total_price = calculate_price($cart);
SJ $items = calculate_items($cart);

SJ I have added the rest (taking a variable from the form $formqty and adding
SJ it to the cart)
SJ Can anyone see why doesn't this work?

You seem to have other problems than the code here ..

Warning: Invalid argument supplied for foreach() in 
/www/u1255/shop_testing/show_cart.php on line 30


-- 
regards,
Tom


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




RE: [PHP] Can anyone help me out? I am really getting frustrated!

2002-08-15 Thread Matt Schroebel



 -Original Message-
 From: Mike [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, August 15, 2002 2:46 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Can anyone help me out? I am really getting frustrated!
 
 
 Hello all,
 I am very confused. This script that I have been working on 
 for a while
 is giving me a hard time...
 
 $string = Current song: 01. DJ Nightflight - The first 
 flight (original
 \
 mix) (D I G I T A L L Y - I M P O R T E D - European Trance, Techno,
 Hi-\
 NRG... we can't define it!);
 
 if(substr($string,0,1) = C){

You're assigning, not comparing here.
Should be:
  if(substr($string,0,1) == C){

If you write these like this:
  if(C = substr($string,0,1)) {

Php will give a parse error because you can't assign a value to a constant.

   print made it past substr!br\n;
   $TrackName = trim(substr($string,strpos($string,.)+1));
 }
 

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




RE: [PHP] Can anyone help me out? I am really getting frustrated!

2002-08-15 Thread Mike

There were 2 equal signs, when I sent It outlook must have made them
into one.
Mike

-Original Message-
From: Matt Schroebel [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 2:48 PM
To: 'Mike'; [EMAIL PROTECTED]
Subject: RE: [PHP] Can anyone help me out? I am really getting
frustrated!



 -Original Message-
 From: Mike [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, August 15, 2002 2:46 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Can anyone help me out? I am really getting frustrated!
 
 
 Hello all,
 I am very confused. This script that I have been working on 
 for a while
 is giving me a hard time...
 
 $string = Current song: 01. DJ Nightflight - The first 
 flight (original
 \
 mix) (D I G I T A L L Y - I M P O R T E D - European Trance, Techno,
 Hi-\
 NRG... we can't define it!);
 
 if(substr($string,0,1) = C){

You're assigning, not comparing here.
Should be:
  if(substr($string,0,1) == C){

If you write these like this:
  if(C = substr($string,0,1)) {

Php will give a parse error because you can't assign a value to a
constant.

   print made it past substr!br\n;
   $TrackName = trim(substr($string,strpos($string,.)+1));
 }
 

-- 
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 fopen ?

2002-05-17 Thread Jason Wong

On Friday 17 May 2002 14:30, Roman Duriancik wrote:
 I have some text file, in this text file i write some information.
 But my problem is : How write/append new information on beginning of
 document but
 old information will be there too. When I used fopen with option a or
 r+ and
 with command rewind new information rewrited old information.

Read the old file into an array, prepend the new stuff to the array, write out 
the whole array overwriting the old file. Shouldn't be much of a problem if 
your files are not too large (say less than 10MB).

Maybe you should look at restructuring your file so that new stuff are added 
to the /end/ of the file.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Dear Lord: Please make my words sweet and tender, for tomorrow I may
have to eat them.
*/


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




RE: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Patrick Lynch

As fas as I know, the only way to do this is to give somebody
instructions to right click on the file and so Save As.

Plan B is to put the GIF in a ZIP file and let it be downloaded like
that.

Best Regards,
Patrick Lynch.

Optip Ltd, Internet  Mobile Development
Co. Clare, Ireland.
http://www.optip.com/



-Original Message-
From: Victor Polyushko [mailto:[EMAIL PROTECTED]] 
Sent: 16 May 2002 18:05
To: [EMAIL PROTECTED]
Subject: [PHP] Can anyone help me save img from URL?


Hi,

I was wondering if someone knows how to save the image from the given
url http://domain.com/image.gif   into a file on a local machine

Any suggestion will be greatly appreciated.
Thank you in advance


Victor Polyushko





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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Miguel Cruz

On Thu, 16 May 2002, Victor Polyushko wrote:
 I was wondering if someone knows how to save the image from the given
 url http://domain.com/image.gif into a file on a local machine

lynx -source -dump http://domain.com/image.gif  image.gif

miguel


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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Robert Cummings

Miguel Cruz wrote:
 
 On Thu, 16 May 2002, Victor Polyushko wrote:
  I was wondering if someone knows how to save the image from the given
  url http://domain.com/image.gif into a file on a local machine
 
 lynx -source -dump   image.gif

If there were actually an image I'd use:

wget http://domain.com/image.gif

Cheers,
Rob.
--
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

Hi Guys,

Thank you fo your input. I am sorry I am new to the list so + English is not
my first language :-( anyhow., I shoudl 've made my question more clear.

I am trying to save the image from the given URL
(http://domain.com/image.gif) running a PHP script on the page. I have tried
fread() and it does not allow me to accomplish that :-((


Have you guys ever come across such a problem?

Again thank you very much for your suggestions

Best Regards,
Victor Polyushko




- Original Message -
From: Robert Cummings [EMAIL PROTECTED]
To: Miguel Cruz [EMAIL PROTECTED]
Cc: Victor Polyushko [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 2:01 PM
Subject: Re: [PHP] Can anyone help me save img from URL?


 Miguel Cruz wrote:
 
  On Thu, 16 May 2002, Victor Polyushko wrote:
   I was wondering if someone knows how to save the image from the given
   url http://domain.com/image.gif into a file on a local machine
 
  lynx -source -dump   image.gif

 If there were actually an image I'd use:

 wget http://domain.com/image.gif

 Cheers,
 Rob.
 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'



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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Robert Cummings

Victor Polyushko wrote:
 
 Hi Guys,
 
 Thank you fo your input. I am sorry I am new to the list so + English is not
 my first language :-( anyhow., I shoudl 've made my question more clear.
 
 I am trying to save the image from the given URL
 (http://domain.com/image.gif) running a PHP script on the page. I have tried
 fread() and it does not allow me to accomplish that :-((
 
 Have you guys ever come across such a problem?

$imageData = implode( '', file( 'http://domain.com/image.gif' ) );
$length = strlen( $imageData );

if( $length  0 )
{
if( (fh = fopen( 'destination', 'w' )) )
{
fwrite( fh, $imageData );
}
}


Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

BINGO!! thank you guys for your input
I used a very simple command to accomplish that and it works!!
?
$command=wget http://domain.com/images/somepic.gif;;
system( $command, $result);
echo $result; ?

Victor Polyushko

- Original Message -
From: Robert Cummings [EMAIL PROTECTED]
To: Victor Polyushko [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 2:25 PM
Subject: Re: [PHP] Can anyone help me save img from URL?


 Victor Polyushko wrote:
 
  Hi Guys,
 
  Thank you fo your input. I am sorry I am new to the list so + English is
not
  my first language :-( anyhow., I shoudl 've made my question more clear.
 
  I am trying to save the image from the given URL
  (http://domain.com/image.gif) running a PHP script on the page. I have
tried
  fread() and it does not allow me to accomplish that :-((
 
  Have you guys ever come across such a problem?

 $imageData = implode( '', file( 'http://domain.com/image.gif' ) );
 $length = strlen( $imageData );

 if( $length  0 )
 {
 if( (fh = fopen( 'destination', 'w' )) )
 {
 fwrite( fh, $imageData );
 }
 }


 Cheers,
 Rob.
 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'

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

2002-04-01 Thread Miguel Cruz

On Tue, 2 Apr 2002, Denis L. Menezes wrote:
 $query=INSERT INTO news (newsid,title, author, body, posted)
  //VALUES($newsid,'$title','$author', '$body', $posted);)
 
 Explanation : I run the test.htm and then the testphp1.php executes well.
 The databse is connected, but the error
 error adding row appears all the time.

When in doubt, tell it to print your SQL statement to the browser screen, 
and paste it into the MySQL command-line client. Between your own eyes and 
the MySQL CLI's error messages, you'll get your answer.

Or, at the very least, print out mysql_error() when you get a database
error.

miguel


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




RE: [PHP] Can anyone help?

2002-04-01 Thread Rick Emery

  $query=INSERT INTO news (newsid,title, author, body, posted)
 //VALUES($newsid,'$title','$author', '$body', $posted);)

What's with the // in front of VALUES?  Change to:

$query=INSERT INTO news (newsid,title, author, body, posted) .
 VALUES($newsid,'$title','$author', '$body', $posted);

When you have an error indicating that a record was not inserted:
1)  Print $query to ensure it contains what you expect
2)  Change query to:  mysql_query($query) or die(mysql_error())

This will save you much frustration and unnecessary posting

Finally, show us your table structure

-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Can anyone help?


Hello friends. I have two files as follows :

1. The test.htm is as follows :

html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1

/head

body bgcolor=#FF text=#00
form name=form1 method=post action=testphp1.php
  p
input type=text name=newsid
  /p
  p
input type=text name=title
  /p
  p
input type=text name=author
  /p
  p
input type=text name=body
  /p
  p
input type=submit name=Submit value=Submit
  /p
  /form
/body



/html



2. The testphp1.php is as follows:

html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1

/head

body bgcolor=#FF text=#00
?php
$link=mysql_connect(localhost,myid,Mypassword);
if ($link){
print link id is $link;
} else {
print error connecting to database;
}
$posted=time();

$query=INSERT INTO news (newsid,title, author, body, posted)
 //VALUES($newsid,'$title','$author', '$body', $posted);)
//Newsid is an INT, title is a VARCHAR author is a VARCHAR, body is a
VARCHAR
IF (mysql_query($query)){
  print Row added to table;
  } else {
  print error adding row;
  }
  ?
/body



/html

Explanation : I run the test.htm and then the testphp1.php executes well.
The databse is connected, but the error
error adding row appears all the time.

Can someone tell me my error in SDyntax?

Thanks
Denis




-- 
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 this problem(uploads via a form)?

2002-03-19 Thread heinisch

At 19.03.2002  14:16, you wrote:

I'm having a problem with file uploads via a HTML form. I've no luck getting
it to work. After a bit of research I think I've determined that the problem
lies with my host having safe mode enabled and setting a open_basedir that
is outside my scope.

snip
Hi Jack,
It´s important to know that the file will be stored in /tmp !

I have realized it with two pages
page a is a form where the client can enter the necessary data, like 
targetname
the page contains the following form tag
form enctype=multipart/form-data action=save_file.html method=post
While uploading, the file will be stored  in /tmp/,
Page b (save_file.html)  renames it to rename ($userfile,delete_me); 
$userfile is the filename, the user entered.
Now you have to move the file from /tmp/ to your desired directory

$scom=mv ./tmp/delete_me. where_to_move_to;
$ret=system($scom);

HTH Oliver



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




Re: [PHP] Can Anyone Help?

2001-03-28 Thread Stuart J. Browne

Warning: ?php_track_vars? is no longer supported - please use the
track_vars INI directive instead in d:/website/myphp/do_sendfeedback.php on
line 1

Oh no someone stole me command what replaces  ?php_track_vars?  in PHP4 ??




-- 
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] Can Anyone Help?

2001-03-28 Thread Stuart J. Browne

Warning: ?php_track_vars? is no longer supported - please use the
track_vars INI directive instead in d:/website/myphp/do_sendfeedback.php on
line 1

Oh no someone stole me command what replaces  ?php_track_vars?  in PHP4 ??


oops.. umm.. from memory php_track_vars is enabled by default in PHP4..

from doccos:

Note: As of PHP 4.0.3, track_vars is always turned on, regardless of the
configuration file setting.




-- 
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] Can anyone help me on nntp ?

2001-02-12 Thread Ankur Verma

I guess there is a NNTP class avaailable at

http://phpclasses.upperdesign.com/

regards
Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: "James Hsieh" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 12, 2001 1:53 PM
Subject: [PHP] Can anyone help me on nntp ?


 Hi!
 I want to know if I want to post a message to some newsgroup, is there any
 sample or function available ?
 Can you kindly point out where should I go or maybe give me an example for
 this ?

 Thanks.

 James



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