php-general Digest 17 Nov 2002 18:43:16 -0000 Issue 1710

Topics (messages 124771 through 124809):

Re: Fractions
        124771 by: Jason Wong

Re: Display cell if dates are between 2 dates - help
        124772 by: Jason Wong
        124785 by: Ray Healy \(Data Net Services\)

Serialization of references to objects
        124773 by: Jonathan Sharp

Unusual HTTP header control
        124774 by: Morgan Hughes
        124775 by: Brendon G
        124776 by: Morgan Hughes

Re: Php Form Issue
        124777 by: Justin French

Re: Opening a file to manipulate it
        124778 by: Justin French

what is the PHP equivalent of Transactional ASP page
        124779 by: See Kok Boon
        124780 by: Rasmus Lerdorf
        124782 by: Justin French

Re: I'm in need of a PHP web host recommendation
        124781 by: John Lim
        124801 by: Jason Sheets

Re: POSIX and PCRE help
        124783 by: Aaron
        124792 by: OrangeHairedBoy

post files array and registered globals off
        124784 by: electroteque

PHP search engines
        124786 by: Phil Schwarzmann
        124787 by: cece.syrup
        124788 by: Richard Pijnenburg
        124789 by: Khalid El-Kary

gd library
        124790 by: A3-Mail Proxy Handler
        124800 by: Jason Sheets

Calling $PATH_INFO
        124791 by: Mr. BuNgL3
        124793 by: OrangeHairedBoy

Re: Searching a Table
        124794 by: Stephen
        124798 by: Stephen

How do I get email address of sender
        124795 by: AKHIL KODALI

error handling
        124796 by: Mattia
        124805 by: Rasmus Lerdorf

preg_match_all - how does it work?
        124797 by: Randall Perry
        124799 by: Marco Tabini
        124802 by: Randall Perry

Re: can I retrieve jsp varibable with get or post???
        124803 by: Jeff Bluemel

Whois Search in PHP
        124804 by: Chandu Nannapaneni
        124809 by: Hatem Ben

Uploading images to Mysql
        124806 by: William Glenn
        124807 by: Marco Tabini
        124808 by: Marco Tabini

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Sunday 17 November 2002 03:09, Stephen wrote:
> 9/5 and 5/9 would be a repeating deicmal. I find fractions would be easier
> to multiply then a repeating deicmal. 

But php doesn't care one bit (and neither should you) whether you use 

    echo ( (5/9) * (80-32) );
OR  echo ( 0.55556 * (80-32) );

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

/*
If the code and the comments disagree, then both are probably wrong.
                -- Norm Schryer
*/

--- End Message ---
--- Begin Message ---
On Sunday 17 November 2002 04:10, Ray Healy \(Data Net Services\) wrote:
> Dear all
>
> I'm trying to create a search function that can check the current day in a
> calendar against a mysql database where there is a startdate and enddate
> and if the date is there then colour code the cell in the calendar.
>
> I have tried to use the following command
>
> $eventQuery = "SELECT title FROM prestigecal WHERE '$sql_currentday'
> BETWEEN startdate AND enddate;";
>
> The database has an ID - title - startdate - enddate

What types are the columns 'startdate' and 'enddate'?

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

/*
You're ugly and your mother dresses you funny.
*/

--- End Message ---
--- Begin Message ---
Dear Jason

The startdate and endate columns are "date" format - have any ideas what i
can do

Thanks for yout help

Ray
----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 17, 2002 6:22 AM
Subject: Re: [PHP] Display cell if dates are between 2 dates - help


> On Sunday 17 November 2002 04:10, Ray Healy \(Data Net Services\) wrote:
> > Dear all
> >
> > I'm trying to create a search function that can check the current day in
a
> > calendar against a mysql database where there is a startdate and enddate
> > and if the date is there then colour code the cell in the calendar.
> >
> > I have tried to use the following command
> >
> > $eventQuery = "SELECT title FROM prestigecal WHERE '$sql_currentday'
> > BETWEEN startdate AND enddate;";
> >
> > The database has an ID - title - startdate - enddate
>
> What types are the columns 'startdate' and 'enddate'?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> You're ugly and your mother dresses you funny.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
How is serialization of references handled? Example:

class foo
{
   var $abc;
   function bar()
   {
      echo $this->abc;
   }
}

$obj = array( &new foo(), &new foo() );
$baz = serialize($obj);

/* ... dancing monkey for entertainment while time passes ... */

$obj = unserialize($baz);


Will references be restored upon unserialization?

-js

--- End Message ---
--- Begin Message ---
  Hello list, I'm hoping someone can shed some light on a problem I'm
  having with the header() function...

  I'm building a script to spool MP3 files to Winamp/xmms using the HTTP
  protocol.  And it works fine, except I want to suppress the normal
  "HTTP/1.1 200 OK" header sent by PHP/Apache and instead send "ICY 200
  OK", to fool the player into thinking it's listening to a ShoutCast
  server...

  Does anyone know how to do this?  The docs on header() don't mention it,
  nor do the user notes...  Any ideas?  Thanks!

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356



--- End Message ---
--- Begin Message ---
Not that I've ever used them but wouldn't Sockets be a good place to start?

Cheers

Brendon

-----Original Message-----
From: Morgan Hughes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 17, 2002 4:40 PM
To: PHP General List
Subject: [PHP] Unusual HTTP header control



  Hello list, I'm hoping someone can shed some light on a problem I'm
  having with the header() function...

  I'm building a script to spool MP3 files to Winamp/xmms using the HTTP
  protocol.  And it works fine, except I want to suppress the normal
  "HTTP/1.1 200 OK" header sent by PHP/Apache and instead send "ICY 200
  OK", to fool the player into thinking it's listening to a ShoutCast
  server...

  Does anyone know how to do this?  The docs on header() don't mention it,
  nor do the user notes...  Any ideas?  Thanks!

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Sun, 17 Nov 2002, Brendon G wrote:

> Not that I've ever used them but wouldn't Sockets be a good place to start?
> Cheers
> Brendon

  Possibly, but the rest of the script works well...  And I've got more
  experience feeding files back with PHP, and letting PHP do the heavy
  lifting for me... ^_^

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356


--- End Message ---
--- Begin Message ---
Hi,

on 17/11/02 7:58 AM, Keith Spiller ([EMAIL PROTECTED]) wrote:

> Does anyone have an idea how I can make the php script gather all the multiple
> &browser=lynx&browser=mosaic&browser=explorer
> instead of only the last entry?

That URL is like writing:

<?
$foo = "betty";
$foo = "bob";
?>

And expecting that $foo contains both betty AND bob.  It's just not the way
the GET variables work.

Post your JS to a JS list/forum, and tell them you need to have the
checkboxes names something[] -- hopefully someone will be abel to spot the
glitch with ease.


Justin French
--------------------
http://Indent.com.au
Web Developent & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
Hi,

on 17/11/02 1:45 PM, Troy May ([EMAIL PROTECTED]) wrote:

> <? $header = fopen("header.html","r");
> 
> echo $header; ?>
> 
> It writes "Resource id #1" at the top of the page.  What is that?!  :)


You're missing some code -- instead, try this example from the fread() page
in the manual:

<?php
// get contents of a file into a string
$filename = "header.html";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
?>

Cheers,


Justin French
--------------------
http://Indent.com.au
Web Developent & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
hi people,

just want to know if there such a thing as a Transactional PHP Page and who
do i go about setting up a page like this?

for those who don't know about ASP, a Transactional ASP page is able to
reverse its operations. it is used mainly in ecommerce, in a page where the
transaction is carried out.

the reason for this is so that if for example,

you click checkout to buy a downloaded software -> the software removed from
shopping cart -> money is deducted from your credit card -> the download
page appears -> the lightning strikes -> your internet connection gone ->
the download page expires ...

if i don't use a Trasactional Page, i will keep the money without having to
give my customer the software, which is good!!! lol but not for my customer.
so the Transactional Page will then detect that the lightning has striked...

... -> transactional page realize that the transaction is not completed ->
the money is returned to the credit card -> the software back to the
shopping cart -> i wait for the customer to fix the computer and return

And that is a transactional page. so can i also do that in PHP?

Yours sincerely,
See Kok Boon
Realize Creations
http://www.realizecreations.com
-------------------------------
looking for - jobs? career? customer?
look in realPortal!
http://realportal.realizecreations.com

--- End Message ---
--- Begin Message ---
That's what you use a database transaction for,  It does not belong at the
scripting language level.  PHP is built to be scalable, and as such the
various requests that make up the "transaction" can come in on different
processes and different machines even.  The shopping cart data has to live
in a central storage somewhere and in order to support rollback on these
transactions this central data store must support that.

-Rasmus

On Sun, 17 Nov 2002, See Kok Boon wrote:

> hi people,
>
> just want to know if there such a thing as a Transactional PHP Page and who
> do i go about setting up a page like this?
>
> for those who don't know about ASP, a Transactional ASP page is able to
> reverse its operations. it is used mainly in ecommerce, in a page where the
> transaction is carried out.
>
> the reason for this is so that if for example,
>
> you click checkout to buy a downloaded software -> the software removed from
> shopping cart -> money is deducted from your credit card -> the download
> page appears -> the lightning strikes -> your internet connection gone ->
> the download page expires ...
>
> if i don't use a Trasactional Page, i will keep the money without having to
> give my customer the software, which is good!!! lol but not for my customer.
> so the Transactional Page will then detect that the lightning has striked...
>
> ... -> transactional page realize that the transaction is not completed ->
> the money is returned to the credit card -> the software back to the
> shopping cart -> i wait for the customer to fix the computer and return
>
> And that is a transactional page. so can i also do that in PHP?
>
> Yours sincerely,
> See Kok Boon
> Realize Creations
> http://www.realizecreations.com
> -------------------------------
> looking for - jobs? career? customer?
> look in realPortal!
> http://realportal.realizecreations.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I don't know if the 'transaction' page could really determine if the
download was *completed* -- perhaps if it was *started*...

>From what I can tell, most online s/ware purchases are done in two ways:

1. free download / demo which can be 'unlocked' with a key, which is
provided upon payment... rather than giving them a download address upon
payment, give them a key.

2. provide a link to the downloadable file upon payment.  i've seen this
done on the cheap ("here's the URL, please don't tell you friends!!") and
done properly (A certain user is given access to the downloadable file for a
certain period [eg 5 days]) -- I buy a little bit of stock photography, and
from what I can tell i'm allowed to download it over and over, since I
paid... I'm not sure what's stopping me from telling my friends my password,
but the same argument can be made for option #1... I could tell my friends
the unlock code.

But, I'm getting OT... :)


Justin


on 17/11/02 6:09 PM, See Kok Boon ([EMAIL PROTECTED]) wrote:

> hi people,
> 
> just want to know if there such a thing as a Transactional PHP Page and who
> do i go about setting up a page like this?
> 
> for those who don't know about ASP, a Transactional ASP page is able to
> reverse its operations. it is used mainly in ecommerce, in a page where the
> transaction is carried out.
> 
> the reason for this is so that if for example,
> 
> you click checkout to buy a downloaded software -> the software removed from
> shopping cart -> money is deducted from your credit card -> the download
> page appears -> the lightning strikes -> your internet connection gone ->
> the download page expires ...
> 
> if i don't use a Trasactional Page, i will keep the money without having to
> give my customer the software, which is good!!! lol but not for my customer.
> so the Transactional Page will then detect that the lightning has striked...
> 
> ... -> transactional page realize that the transaction is not completed ->
> the money is returned to the credit card -> the software back to the
> shopping cart -> i wait for the customer to fix the computer and return
> 
> And that is a transactional page. so can i also do that in PHP?
> 
> Yours sincerely,
> See Kok Boon
> Realize Creations
> http://www.realizecreations.com
> -------------------------------
> looking for - jobs? career? customer?
> look in realPortal!
> http://realportal.realizecreations.com
> 

Justin French
--------------------
http://Indent.com.au
Web Developent & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
I would recommend http://futurequest.net

Good, reliable, and very skilled technical people, who know linux and
web-hosting inside out.

"John Kenyon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Jason Reid wrote:
>
> >I suggest paying a visit to www.webhostingtalk.com and search the
forums... theres tons of information on the large, and small hosts that
might help.
> >
>
> I use www.phpwebhosting.com and have been happy with them so far. $10 a
> month, but they are generous (and flexible, at least so they say) about
> space and bandwidth.
>
> jck
>


--- End Message ---
--- Begin Message ---
I think this thread has gone on a while but ... I personally recommend
pair (http://www.pair.net) to everyone who asks.  They have an excellent
infrastructure, excellent support, excellent hosting plans and they have
been doing web hosting for years (and making a profit at it).

They own their hardware and Internet connections so they can resolve
issues much faster than someone who is colocated.

pair also lets you host multiple domains on one hosting account which
saves you money if you have multiple domains.

Additionally I would also recommend fidelityhost.com, they also allow
multiple domains have good network speeds and excellent customer
service.

Jason


On Sun, 2002-11-17 at 01:47, John Lim wrote:
> I would recommend http://futurequest.net
> 
> Good, reliable, and very skilled technical people, who know linux and
> web-hosting inside out.
> 
> "John Kenyon" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> > Jason Reid wrote:
> >
> > >I suggest paying a visit to www.webhostingtalk.com and search the
> forums... theres tons of information on the large, and small hosts that
> might help.
> > >
> >
> > I use www.phpwebhosting.com and have been happy with them so far. $10 a
> > month, but they are generous (and flexible, at least so they say) about
> > space and bandwidth.
> >
> > jck
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
In what case would you have a semi-colon in the string?


"Orangehairedboy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Aaron,
>
> Thanks for the advise, but I'm got a problem. If I first split it up by
/;/,
> how do I catch it if there's a semi-colon inside a string?
>
> Lewis
>
>
> "Aaron" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Lewis,
> >
> > First I would look at breaking out the tags:
> >
> >     // User: JohnDoe; age=32; nickname="Billy 'the' Kid";
> haircolor=orange;
> >
> >     $string = 'User: JohnDoe; age=32; nickname="Billy \'the\' Kid";
> > haircolor=orange;';
> >     $stringArray = preg_split('/;/', $string, -1, PREG_SPLIT_NO_EMPTY);
> >
> > Then split by the = or :
> >
> >     // split by = or :
> >
> >     foreach ($stringArray as $item) {
> >         list($tag, $element) = preg_split('/\:|\=/', $item, 1,
> > PREG_SPLIT_NO_EMPTY);
> >         echo "$tag => $element<br />";
> >     }
> >
> > -aaron
> >
> > "Orangehairedboy" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I am trying to learn more about regular expressions as I haven't used
> them
> > > much in the past. I am working with email, and I'm looking for a way
to
> > > split the following expression up:
> > >
> > > Content-Type: text/plain; boundary="whatever";
> > >
> > > Using   "/^(\S+)\:\s*(.+)$/iU"   I can split it into:
> > >
> > > [Content-Type] and [text/plain; boundary="whatever";]
> > >
> > > Problem is, it might have different tags. Here's a sketch of the whole
> > > thing:
> > >
> > > [Header Name a-zA-Z0-9] [\s*] [:] [\s*] [ Header value a-zA-Z0-9/_ ]
> [\s*]
> > > [;] [ unlimited repeating pattern of ( [Property Name a-zA-Z0-9] [\s*]
> [=]
> > > [\s*] ( string optionally surrounded by quotes - but necessary if
value
> > has
> > > spaces - but can't include quotes ) [\s*] [;] ) ]
> > >
> > > So, if I had:
> > >
> > > User: JohnDoe; age=32; nickname="Billy 'the' Kid"; haircolor=orange;
> > >
> > > I would need:
> > >
> > > User - "JohnDoe" - age - "32" - nickname - "Billy 'the' Kid" -
> haircolor -
> > > "orange"
> > >
> > > in the outputted array. I have no idea how to do repeating patterns
like
> > > this...maybe I'm making this too complex?
> > >
> > > Thanks for your help!
> > >
> > > Lewis
> > >
> > >
> >
> >
>
>


--- End Message ---
--- Begin Message ---
Probably none of the standard headers, but perhaps a custom header defined
by the user. It's allowed for in RFC 822 and I'd like to support it.

Why do you ask? Do you have a solution?


"Aaron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In what case would you have a semi-colon in the string?
>
>
> "Orangehairedboy" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Aaron,
> >
> > Thanks for the advise, but I'm got a problem. If I first split it up by
> /;/,
> > how do I catch it if there's a semi-colon inside a string?
> >
> > Lewis
> >
> >
> > "Aaron" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Lewis,
> > >
> > > First I would look at breaking out the tags:
> > >
> > >     // User: JohnDoe; age=32; nickname="Billy 'the' Kid";
> > haircolor=orange;
> > >
> > >     $string = 'User: JohnDoe; age=32; nickname="Billy \'the\' Kid";
> > > haircolor=orange;';
> > >     $stringArray = preg_split('/;/', $string, -1,
PREG_SPLIT_NO_EMPTY);
> > >
> > > Then split by the = or :
> > >
> > >     // split by = or :
> > >
> > >     foreach ($stringArray as $item) {
> > >         list($tag, $element) = preg_split('/\:|\=/', $item, 1,
> > > PREG_SPLIT_NO_EMPTY);
> > >         echo "$tag => $element<br />";
> > >     }
> > >
> > > -aaron
> > >
> > > "Orangehairedboy" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > I am trying to learn more about regular expressions as I haven't
used
> > them
> > > > much in the past. I am working with email, and I'm looking for a way
> to
> > > > split the following expression up:
> > > >
> > > > Content-Type: text/plain; boundary="whatever";
> > > >
> > > > Using   "/^(\S+)\:\s*(.+)$/iU"   I can split it into:
> > > >
> > > > [Content-Type] and [text/plain; boundary="whatever";]
> > > >
> > > > Problem is, it might have different tags. Here's a sketch of the
whole
> > > > thing:
> > > >
> > > > [Header Name a-zA-Z0-9] [\s*] [:] [\s*] [ Header value a-zA-Z0-9/_ ]
> > [\s*]
> > > > [;] [ unlimited repeating pattern of ( [Property Name a-zA-Z0-9]
[\s*]
> > [=]
> > > > [\s*] ( string optionally surrounded by quotes - but necessary if
> value
> > > has
> > > > spaces - but can't include quotes ) [\s*] [;] ) ]
> > > >
> > > > So, if I had:
> > > >
> > > > User: JohnDoe; age=32; nickname="Billy 'the' Kid"; haircolor=orange;
> > > >
> > > > I would need:
> > > >
> > > > User - "JohnDoe" - age - "32" - nickname - "Billy 'the' Kid" -
> > haircolor -
> > > > "orange"
> > > >
> > > > in the outputted array. I have no idea how to do repeating patterns
> like
> > > > this...maybe I'm making this too complex?
> > > >
> > > > Thanks for your help!
> > > >
> > > > Lewis
> > > >
> > > >
> > >
> > >
> >
> >
>
>


--- End Message ---
--- Begin Message ---
hi i need to do a foreach on post files array ie

<input type=file name=photo[]>

_REQUEST['photo'] or _POST['photo'] doesnt work

only _FILES['photo'] works and if i do a foreach on this it gets the 5
associated array values for it not on the input value array ? say i had 2
input files i should get a count of 2 not 5 :|


--- End Message ---
--- Begin Message ---
So I would like to make a search engine for my site.  Can you use PHP to
do this?  Or is another language/application/whatever more appropriate??
If so, can you give me links to where I can find information on this
topic.
 
Thanks!!
--- End Message ---
--- Begin Message ---
Hello!

PS> So I would like to make a search engine for my site.  Can you use PHP to
PS> do this?  Or is another language/application/whatever more appropriate??
PS> If so, can you give me links to where I can find information on this
PS> topic.

http://php.net/mnogo
http://mnogosearch.org

=============================================================
Heilig (Cece) Szabolcs - [EMAIL PROTECTED] - http://www.phphost.hu
=============================================================


--- End Message ---
--- Begin Message ---
I have created my own search engine. It searches in a mysql database,
sins all the text from the site is in the database.

Richard Pijnenburg
Klik-on Internet Solutions


> -----Original Message-----
> From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, November 17, 2002 11:59 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP search engines
> 
> So I would like to make a search engine for my site.  Can you use PHP
to
> do this?  Or is another language/application/whatever more
appropriate??
> If so, can you give me links to where I can find information on this
> topic.
> 
> Thanks!!

--- End Message ---
--- Begin Message --- hi,

It depends on the data storage system you use, and the more you get deeper with it the more you get it more customized for your own site, i mean that when you do it with the natural PHP APIs it's better rather than obtaining a ready-made search system, however if you want to use a ready-made one check ht://Dig(http://www.htdig.org/), it's the one used by PHP.net in the site search (whole site search) ... good search :)

khalid



_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
Hi,
I am trying to add gd support to my php configuration. But I could not
manage...

Here is the versions:
php 4.2.3, gd 2.0.7, slackware 8.1, apache 1.3.27

in the make of php, php gives error with gd librarys...
(sorry, I cannot give errors now, I cannot simulate the situation for now)

Is this a known issue?
Does this happens to everyone?
Should I add something different during configure?
(I used only --with-gd)

Thanks...

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

YOu will need to provide some more information like your configure line,
the errors that you are receiving. Did you specifcy
--with-gd=/path/to/gd/install or just --with-gd?

What errors did you receive?  --with-gd=/path-to-gd works fine with me
with FreeBSD 4.7-STABLE, gd2 and PHP 4.2.3 and 4.3, and dev.

As you can see there are many different system configurations out there
so more details are needed before anyone can help you.

Jason

On Sat, 2002-11-16 at 19:14, A3-Mail Proxy Handler wrote:
> Hi,
> I am trying to add gd support to my php configuration. But I could not
> manage...
> 
> Here is the versions:
> php 4.2.3, gd 2.0.7, slackware 8.1, apache 1.3.27
> 
> in the make of php, php gives error with gd librarys...
> (sorry, I cannot give errors now, I cannot simulate the situation for now)
> 
> Is this a known issue?
> Does this happens to everyone?
> Should I add something different during configure?
> (I used only --with-gd)
> 
> Thanks...
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I'm with a little problem... i have this php code and when i lick F5
(refresh) it keeps adding files do database... i think "if ($Submit)" is not
doing what i want! My propose is clicking on submit it adds me the
$titulotxt and $cds to the database using $PATH_INFO. How must i do to
resolve my problem?
Thanks : )

if ($Submit)
{
 $ligacao=mysql_connect("localhost","nac31915","alanis") or die
(mysql_error());
 $sql="INSERT INTO divxtemp (titulo,cds) VALUES ('$titulotxt','$cdstxt')";
 if ($ligacao)
 {
  mysql_db_query("DB_nac31915",$sql) or die (mysql_error());
 }
 mysql_close();
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <title>Adicionar Novo(s) Filme</title>
</head>

<body bgcolor="#DEE3E7">
 <table width="50%" height="20" border="1" align="center"
bordercolor="#000000">
  <tr><td align="center" bgcolor="#98AAB1"><font color="#FFFFFF"
face="Courier New, Courier, mono"><strong>Adicionar
Filme</strong></font></td></tr>
  <tr><td>
   <form action="<?echo $PATH_INFO?>" method="post" name="divxadd"
id="divxadd">
    <table width="70%" height="20" border="0" align="center" cellspacing=10>
     <tr><br><td align="right">Título:</td><td align="left"><input size="40"
name="titulotxt" type="text" id="titulotxt"></td></tr>
     <tr><td align="right">Cds:</td><td>
              <table width="100%" height="20" border="0" align="center">
               <tr><td align="left"><input size="2" name="cdstxt"
type="text" id="cdstxt"></td><td align="center"><input type="Submit"
name="Submit" value="Adicionar"></td>


              </table>
               </td>
     </tr>
    </table>

   </form>
  </td></tr>
 </table>
 <br>
 <?
  include('addlist.php');
 ?>

</body>
</html>


--- End Message ---
--- Begin Message ---
When you press F5 it's probably resubmitting the contents of the form,
including the value of the submit button. You might want to use sessions to
control what they submit, and how ofter they submit on the server side.

Lewis


"Mr. Bungl3" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm with a little problem... i have this php code and when i lick F5
> (refresh) it keeps adding files do database... i think "if ($Submit)" is
not
> doing what i want! My propose is clicking on submit it adds me the
> $titulotxt and $cds to the database using $PATH_INFO. How must i do to
> resolve my problem?
> Thanks : )
>
> if ($Submit)
> {
>  $ligacao=mysql_connect("localhost","nac31915","alanis") or die
> (mysql_error());
>  $sql="INSERT INTO divxtemp (titulo,cds) VALUES ('$titulotxt','$cdstxt')";
>  if ($ligacao)
>  {
>   mysql_db_query("DB_nac31915",$sql) or die (mysql_error());
>  }
>  mysql_close();
> }
> ?>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
>  <title>Adicionar Novo(s) Filme</title>
> </head>
>
> <body bgcolor="#DEE3E7">
>  <table width="50%" height="20" border="1" align="center"
> bordercolor="#000000">
>   <tr><td align="center" bgcolor="#98AAB1"><font color="#FFFFFF"
> face="Courier New, Courier, mono"><strong>Adicionar
> Filme</strong></font></td></tr>
>   <tr><td>
>    <form action="<?echo $PATH_INFO?>" method="post" name="divxadd"
> id="divxadd">
>     <table width="70%" height="20" border="0" align="center"
cellspacing=10>
>      <tr><br><td align="right">Título:</td><td align="left"><input
size="40"
> name="titulotxt" type="text" id="titulotxt"></td></tr>
>      <tr><td align="right">Cds:</td><td>
>               <table width="100%" height="20" border="0" align="center">
>                <tr><td align="left"><input size="2" name="cdstxt"
> type="text" id="cdstxt"></td><td align="center"><input type="Submit"
> name="Submit" value="Adicionar"></td>
>
>
>               </table>
>                </td>
>      </tr>
>     </table>
>
>    </form>
>   </td></tr>
>  </table>
>  <br>
>  <?
>   include('addlist.php');
>  ?>
>
> </body>
> </html>
>
>


--- End Message ---
--- Begin Message ---
http://www.melchior.us is not the site I am talking about. The site I'm
talking about is not yet up.


----- Original Message -----
From: "Rick Widmer" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Sent: Saturday, November 16, 2002 11:56 PM
Subject: Re: [PHP] Searching a Table


> At 10:40 PM 11/16/02 -0500, you wrote:
>
> <http://www.melchior.us>http://www.melchior.us
>
> I recently tried hitting your web site with Netscape 7.0, and it would not
> let me in.
>
> Also, it is usually best to send only plain text to mailing lists.  The
> fine print you are using is very hard to read.
>
>
> Rick
>
>

--- End Message ---
--- Begin Message ---
Thanks, this is what I was looking for. But does it ommit common words like
'it' or 'the?'


----- Original Message -----
From: "Marco Tabini" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, November 16, 2002 10:47 PM
Subject: Re: [PHP] Searching a Table


> Ok, then you can use FULLTEXT queries.
>
> Take a look here:
>
> http://www.mysql.com/doc/en/Fulltext_Search.html
>
>
> Marco
>
> On Sat, 2002-11-16 at 22:49, Stephen wrote:
> > I don't have control of my server, it's hosted. All my content is in a
MySQL
> > database and is outputed through a php page that selects the information
> > from an id variable passed through the URL...
> >
> >
> > ----- Original Message -----
> > From: "Marco Tabini" <[EMAIL PROTECTED]>
> > To: "Stephen" <[EMAIL PROTECTED]>
> > Cc: "PHP List" <[EMAIL PROTECTED]>
> > Sent: Saturday, November 16, 2002 10:38 PM
> > Subject: Re: [PHP] Searching a Table
> >
> >
> > > Well, if you're using a database, say MySQL, you can look at FREETEXT
> > > indexes and queries. If you want to index your web pages, you should
be
> > > looking at a search engine that works with your web server. For
example,
> > > ht:dig (http://www.htdig.org/) works with Apache.
> > >
> > >
> > > Marco
> > >
> > > --
> > > ------------
> > > php|architect - The magazine for PHP Professionals
> > > The first monthly worldwide magazine dedicated to PHP programmers
> > > Check us out on the web at http://www.phparch.com
> > >
> > >
> > >
> > > On Sat, 2002-11-16 at 22:40, Stephen wrote:
> > > > I need to make a search engine for my site. Instead of making a
table
> > with all the words of my content of my reviews, I need to make it
simple.
> > How could you search a table of articles (let's say game_reviews) by
> > comparing keywords the user types in, to the text of the article? All
the
> > tutorials I can find make a table with a list of words of every single
> > keyword...
> > > >
> > > >
> > > > Thanks,
> > > > Stephen Craton
> > > > http://www.melchior.us
> > > >
> > > > "Life is a gift from God. Wasting it is like destroying a gift you
got
> > from the person you love most." -- http://www.melchior.us
> > > > ----
> > > >
> > >
> > > > --
> > > > 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
> > >
> > >
> >
>
>
>

--- End Message ---
--- Begin Message ---
Hi,

        How to I get from e-mail address using imap function.
        I was able to retrieve the name only.

        imap_fetch_overview doesn't provide this facility.

-- 
AKHIL K
200101009
Room No. 15
BH-2
IIIT
--------------------------------------------------------------------------

Look at me. My life has no meaning or direction, and I'm happy


--- End Message ---
--- Begin Message ---
When the display_errors is Off, and the output of the page comes all in the
end, or when you're using some template engine or some output buffer
function (ob_start()), no output is displayed to the screen! I would like to
tell a message to the use in case of failure of the scripy, without giving
the information of the kind of error it is.

Display a message like: the application has caused an error! the webmaster
has been notified by email.

And the precise error in the error log, like: Parse error in line .... file
....

Is there anythig to do it without setting up a custom error log?

thanks
Mattia


--- End Message ---
--- Begin Message ---
Try this.  In your php.ini file:

  display_errors = Off
  log_errors = On
  track_errors = On

Then in your code:

  $php_errormsg = false;
  ob_start();
  ... your code ...
  if($php_errormsg) {
    ob_end_clean();  // Error - discard buffer
    echo "An error occurred - webmaster notified";
  } else {
    ob_end_flush();  // No error, send buffer
  }

-Rasmus

On Sun, 17 Nov 2002, Mattia wrote:

> When the display_errors is Off, and the output of the page comes all in the
> end, or when you're using some template engine or some output buffer
> function (ob_start()), no output is displayed to the screen! I would like to
> tell a message to the use in case of failure of the scripy, without giving
> the information of the kind of error it is.
>
> Display a message like: the application has caused an error! the webmaster
> has been notified by email.
>
> And the precise error in the error log, like: Parse error in line .... file
> ....
>
> Is there anythig to do it without setting up a custom error log?
>
> thanks
> Mattia
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
I have some experience in using regular expressions in Perl, and have been
able to use preg_match in php, but am having a problem with preg_match_all.

I'm trying to extract data from an HTML table. Here's my preg_match call
that correctly grabs the 1st row of data in the table. It grabs 4 columns of
data:

preg_match("|<tr 
class=\"CART_TD_REG\".+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.*?<inp
ut.*?>[&nbsp;]*(.*?)</td>.*?</tr>|", $res, $match);

If I use preg_match_all on the same table:
preg_match_all("|<tr
class=\"CART_TD_REG\".+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.*?<inp
ut.*?>[&nbsp;]*(.*?)</td>.*?</tr>|", $res, $match, PREG_PATTERN_ORDER);

...and try to print output, I get:

$match[0] = Array
$match[0][0] = Array[0]
$match[1][0] = Array[0]
$match[0][1] = Array[0]
$match[1][1] = Array[0]


Same result with PREG_SETORDER.

What am I doing wrong?

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/


--- End Message ---
--- Begin Message ---
Hi Randall,

If you look closely at the definition of preg_match_all(), you'll see
that it generates an array of arrays--that's because, for each match, it
generates an array that corresponds to the result of a single call to
preg_match, then puts all the resulting array into another array.

If you use PREG_SET_ORDER, your $match array contains an array for each
of the matches found. Each array then contains:

* The entire matched string in element 0
* Each of the substring (defined in brackets in your pattern) starting
from array 1.

Hope this helps!


Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com


On Sun, 2002-11-17 at 11:13, Randall Perry wrote:
> I have some experience in using regular expressions in Perl, and have been
> able to use preg_match in php, but am having a problem with preg_match_all.
> 
> I'm trying to extract data from an HTML table. Here's my preg_match call
> that correctly grabs the 1st row of data in the table. It grabs 4 columns of
> data:
> 
> preg_match("|<tr 
> class=\"CART_TD_REG\".+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.*?<inp
> ut.*?>[&nbsp;]*(.*?)</td>.*?</tr>|", $res, $match);
> 
> If I use preg_match_all on the same table:
> preg_match_all("|<tr
> class=\"CART_TD_REG\".+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.*?<inp
> ut.*?>[&nbsp;]*(.*?)</td>.*?</tr>|", $res, $match, PREG_PATTERN_ORDER);
> 
> ...and try to print output, I get:
> 
> $match[0] = Array
> $match[0][0] = Array[0]
> $match[1][0] = Array[0]
> $match[0][1] = Array[0]
> $match[1][1] = Array[0]
> 
> 
> Same result with PREG_SETORDER.
> 
> What am I doing wrong?
> 
> -- 
> Randall Perry
> sysTame
> 
> Xserve Web Hosting/Co-location
> Website Development/Promotion
> Mac Consulting/Sales
> 
> http://www.systame.com/
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
That was my understanding. Question is, why don't my print commands
work...or...how do you access 2 dimensional arrays in php?

> Hi Randall,
> 
> If you look closely at the definition of preg_match_all(), you'll see
> that it generates an array of arrays--that's because, for each match, it
> generates an array that corresponds to the result of a single call to
> preg_match, then puts all the resulting array into another array.
> 
> If you use PREG_SET_ORDER, your $match array contains an array for each
> of the matches found. Each array then contains:
> 
> * The entire matched string in element 0
> * Each of the substring (defined in brackets in your pattern) starting
> from array 1.
> 
> Hope this helps!
> 
> 
> Marco
> --
> ------------
> php|architect - The magazine for PHP Professionals
> The first monthly worldwide magazine dedicated to PHP programmers
> Check us out on the web at http://www.phparch.com
> 
> 
> On Sun, 2002-11-17 at 11:13, Randall Perry wrote:
>> I have some experience in using regular expressions in Perl, and have been
>> able to use preg_match in php, but am having a problem with preg_match_all.
>> 
>> I'm trying to extract data from an HTML table. Here's my preg_match call
>> that correctly grabs the 1st row of data in the table. It grabs 4 columns of
>> data:
>> 
>> preg_match("|<tr
>> class=\"CART_TD_REG\".+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.*?<inp
>> ut.*?>[&nbsp;]*(.*?)</td>.*?</tr>|", $res, $match);
>> 
>> If I use preg_match_all on the same table:
>> preg_match_all("|<tr
>> class=\"CART_TD_REG\".+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.+?<td.+?>(.*?)<.*?<inp
>> ut.*?>[&nbsp;]*(.*?)</td>.*?</tr>|", $res, $match, PREG_PATTERN_ORDER);
>> 
>> ...and try to print output, I get:
>> 
>> $match[0] = Array
>> $match[0][0] = Array[0]
>> $match[1][0] = Array[0]
>> $match[0][1] = Array[0]
>> $match[1][1] = Array[0]
>> 
>> 
>> Same result with PREG_SETORDER.
>> 
>> What am I doing wrong?
>> 
>> -- 
>> Randall Perry
>> sysTame
>> 
>> Xserve Web Hosting/Co-location
>> Website Development/Promotion
>> Mac Consulting/Sales
>> 
>> http://www.systame.com/
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 
> 

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales

http://www.systame.com/


--- End Message ---
--- Begin Message ---
ok - the more I look at this the more I'm a bit lost.  passing the variables
from php to java makes sense.  however, from your scripts you listed it is
only possible to pass jsp variables to php by opening a new page, or by
activating a form.

is there a way to pass jsp variables to php while a script is running?  i.e.
use a jsp prompt to get a value as the php script goes on, and then take an
action on that variable?  for instance I have a situation where I need to
apply a credit.  granted, I could use a form to accomplish this, but I feel
it would be much cleaner to use jsp to get the value.

I also have situation where before proceeding I want to get an ok / cancel.

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> php => javascript
> 1st way:
> <script>
> var var_name= <?= $var_value ?>
> </script>
> 2nd way:
> <input type="hidden" name="input_name" value="<?= $input_value ?>">
>
> javascript => php
> 1st way:
> location='http://server/script.php?var_name="; + js_var_name;
> 2nd way:
> form_name.input_name.value = js_var_name;
>
> hope you get the point :-)
>
> Jeff Bluemel wrote:
>
> >Can I utilize java script variables with get or post?  any information on
> >integrating the 2, and passing info back & forth?
> >
> >thanks,
> >
> >Jeff
> >
> >
> >
> >
> >
>


--- End Message ---
--- Begin Message ---
Hi guys,

I have just downloaded whois2.php
from http://www.easydns.com/~markjr/whois2/


It's working great except for certain domains, 
for ex : google.com is being shown as available.

I am in need of a good PHP script which gives me
accurate results about availability of domains.

/Chandu

--- End Message ---
--- Begin Message ---
this is what the whois server return exactly for Google (using
whois.internic.net):

Whois Server Version 1.3

Domain names in the .com, .net, and .org domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

GOOGLE.COM.IS.THE.GREATEST.SEARCH.ENGINE.EVER.JIMPHILLIPS.ORG
GOOGLE.COM

To single out one record, look it up with "xxx", where xxx is one of the
of the records displayed above. If the records are the same, look them up
with "=xxx" to receive a full display for each record.

>>> Last update of whois database: Sun, 17 Nov 2002 05:25:23 EST <<<

The Registry database contains ONLY .COM, .NET, .ORG, .EDU domains and
Registrars.

it isn't the problem of the whois script only :))

Hatem

----- Original Message -----
From: "Chandu Nannapaneni" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 17, 2002 6:49 PM
Subject: [PHP] Whois Search in PHP


Hi guys,

I have just downloaded whois2.php
from http://www.easydns.com/~markjr/whois2/


It's working great except for certain domains,
for ex : google.com is being shown as available.

I am in need of a good PHP script which gives me
accurate results about availability of domains.

/Chandu



--- End Message ---
--- Begin Message ---
Hey all, need some quick help. I have some code I was trying to get to work but I keep 
getting this error: 
Warning: fopen("", "rb") - Success in /home/digital/public_html/upload_test.php3 on 
line 18

Warning: stat failed for (errno=2 - No such file or directory) in 
/home/digital/public_html/upload_test.php3 on line 18

Warning: fread(): supplied argument is not a valid File-Handle resource in 
/home/digital/public_html/upload_test.php3 on line 18


Here's my code:

<html>
<head>
<title>Store binary data into SQL Database</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
 <?php
// code that will be executed if the form has been submitted:

if ($submit) {

// connect to the database
    // (you may have to adjust the hostname,username or password)

    MYSQL_CONNECT("localhost","","");
    mysql_select_db("ipp_products");
$data = addslashes(fread(fopen($form_data, "rb"), filesize($form_data)));
   

    $result=MYSQL_QUERY("INSERT INTO display_images (description,data) ".
        "VALUES ('$form_description','$form_data')");

    $id= mysql_insert_id();
    print "<p>This file has the following Database ID: <b>$id</b>";

    MYSQL_CLOSE();
echo "$data";
 
} else {

    // else show the form to submit new data:
?> 
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
  File Description:<br>
  <input type="text" name="form_description"  size="40">
  <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
  <br>
  File to upload/store in database:<br>
  <input type="file" name="form_data"  size="40">
  <p>
    <input type="submit" name="submit" value="submit">
</form>
<?php

}

?> 
</body>
</html>

Any ideas?

Thanks,
William Glenn
Import Parts Plus
http://www.importpartsplus.com
--- End Message ---
--- Begin Message ---
Seems to me $form_data might be undefined or empty. Could be a problem
related to register_globals if that value is coming from an HTML form.
Try $_REQUEST['form_data'] instead.


Marco

On Sun, 2002-11-17 at 13:58, William Glenn wrote:
> Hey all, need some quick help. I have some code I was trying to get to work but I 
>keep getting this error: 
> Warning: fopen("", "rb") - Success in /home/digital/public_html/upload_test.php3 on 
>line 18
> 
> Warning: stat failed for (errno=2 - No such file or directory) in 
>/home/digital/public_html/upload_test.php3 on line 18
> 
> Warning: fread(): supplied argument is not a valid File-Handle resource in 
>/home/digital/public_html/upload_test.php3 on line 18
> 
> 
> Here's my code:
> 
> <html>
> <head>
> <title>Store binary data into SQL Database</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> 
> <body bgcolor="#FFFFFF">
>  <?php
> // code that will be executed if the form has been submitted:
> 
> if ($submit) {
> 
> // connect to the database
>     // (you may have to adjust the hostname,username or password)
> 
>     MYSQL_CONNECT("localhost","","");
>     mysql_select_db("ipp_products");
> $data = addslashes(fread(fopen($form_data, "rb"), filesize($form_data)));
>    
> 
>     $result=MYSQL_QUERY("INSERT INTO display_images (description,data) ".
>         "VALUES ('$form_description','$form_data')");
> 
>     $id= mysql_insert_id();
>     print "<p>This file has the following Database ID: <b>$id</b>";
> 
>     MYSQL_CLOSE();
> echo "$data";
>  
> } else {
> 
>     // else show the form to submit new data:
> ?> 
> <form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
>   File Description:<br>
>   <input type="text" name="form_description"  size="40">
>   <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
>   <br>
>   File to upload/store in database:<br>
>   <input type="file" name="form_data"  size="40">
>   <p>
>     <input type="submit" name="submit" value="submit">
> </form>
> <?php
> 
> }
> 
> ?> 
> </body>
> </html>
> 
> Any ideas?
> 
> Thanks,
> William Glenn
> Import Parts Plus
> http://www.importpartsplus.com


--- End Message ---
--- Begin Message ---
Sorry--I should have read ALL your code...

Try taking a look at this manual page: 

http://ca.php.net/manual/en/features.file-upload.php

It explains how to handle file uploads. Your file name should appear in
$_FILES['form_data'].

On Sun, 2002-11-17 at 12:54, Marco Tabini wrote:
> Seems to me $form_data might be undefined or empty. Could be a problem
> related to register_globals if that value is coming from an HTML form.
> Try $_REQUEST['form_data'] instead.
> 
> 
> Marco
> 
> On Sun, 2002-11-17 at 13:58, William Glenn wrote:
> > Hey all, need some quick help. I have some code I was trying to get to work but I 
>keep getting this error: 
> > Warning: fopen("", "rb") - Success in /home/digital/public_html/upload_test.php3 
>on line 18
> > 
> > Warning: stat failed for (errno=2 - No such file or directory) in 
>/home/digital/public_html/upload_test.php3 on line 18
> > 
> > Warning: fread(): supplied argument is not a valid File-Handle resource in 
>/home/digital/public_html/upload_test.php3 on line 18
> > 
> > 
> > Here's my code:
> > 
> > <html>
> > <head>
> > <title>Store binary data into SQL Database</title>
> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> > </head>
> > 
> > <body bgcolor="#FFFFFF">
> >  <?php
> > // code that will be executed if the form has been submitted:
> > 
> > if ($submit) {
> > 
> > // connect to the database
> >     // (you may have to adjust the hostname,username or password)
> > 
> >     MYSQL_CONNECT("localhost","","");
> >     mysql_select_db("ipp_products");
> > $data = addslashes(fread(fopen($form_data, "rb"), filesize($form_data)));
> >    
> > 
> >     $result=MYSQL_QUERY("INSERT INTO display_images (description,data) ".
> >         "VALUES ('$form_description','$form_data')");
> > 
> >     $id= mysql_insert_id();
> >     print "<p>This file has the following Database ID: <b>$id</b>";
> > 
> >     MYSQL_CLOSE();
> > echo "$data";
> >  
> > } else {
> > 
> >     // else show the form to submit new data:
> > ?> 
> > <form method="post" action="<?php echo $PHP_SELF; ?>" 
>enctype="multipart/form-data">
> >   File Description:<br>
> >   <input type="text" name="form_description"  size="40">
> >   <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
> >   <br>
> >   File to upload/store in database:<br>
> >   <input type="file" name="form_data"  size="40">
> >   <p>
> >     <input type="submit" name="submit" value="submit">
> > </form>
> > <?php
> > 
> > }
> > 
> > ?> 
> > </body>
> > </html>
> > 
> > Any ideas?
> > 
> > Thanks,
> > William Glenn
> > Import Parts Plus
> > http://www.importpartsplus.com
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---

Reply via email to