php-general Digest 3 Dec 2001 22:35:43 -0000 Issue 1031

Topics (messages 76371 through 76425):

Re: best way to handle a form with 60 fields !!!
        76371 by: Remigiusz Sokolowski

P3P Implementation and PHP-Sessions
        76372 by: Bruno Baketaric

Re: call_user_func problem
        76373 by: Bruno Baketaric

howto run shell script
        76374 by: Danar Prabandaru
        76383 by: Steve Werby

variable scope / preg_replace_callback question
        76375 by: Peter Bowyer
        76376 by: Andrey Hristov

Multiple database seeking
        76377 by: Alen Nonkovič
        76380 by: Miles Thompson
        76381 by: Valentin V. Petruchek

3000           Would you like to lose weight while you sleep?                  4537552
        76378 by: 5245375travelincentives.aol.com

Re: php without the php.ini
        76379 by: Erik Price

Re: How to set file extension php Mac OSX and PHP 4.0.6
        76382 by: Erik Price
        76385 by: Stefan Rusterholz

Some clients can't see PDF
        76384 by: Miles Thompson

which merchant account
        76386 by: Daniel Guerrier

PHP problem with freetype
        76387 by: MDowling.hew.de

Something wrong with the file() command.
        76388 by: Jose
        76396 by: Fred
        76398 by: Mark Charette
        76399 by: Valentin V. Petruchek
        76404 by: faeton

Re: problems with looping array
        76389 by: Jim Musil

Re: PHP Bulletin Boards...how they work.
        76390 by: Jonathan Chum

ereg help
        76391 by: Valentin V. Petruchek
        76392 by: Jim Musil

RealMedia
        76393 by: Randum Ian
        76394 by: Jim Musil

Anyone got PHP to work under RedHat 7.2
        76395 by: Hai Nguyen
        76397 by: Mark Charette

Session_start() issue??
        76400 by: Chris Seymour
        76405 by: Jim Musil
        76406 by: Jim Musil
        76417 by: Chris Seymour

problem with ImageCreateJPEG ...
        76401 by: Miguel Loureiro
        76403 by: Jim Musil

Session confusion
        76402 by: Jon Drukman
        76410 by: Jon Drukman

wordwrap
        76407 by: Scott Aikin

Duplicating a mySQL row
        76408 by: Jim Musil
        76409 by: Julio Nobrega Trabalhando
        76411 by: Jim Musil
        76413 by: Julio Nobrega Trabalhando

Uploading to Apache server from VB
        76412 by: Henk Sandkuyl
        76414 by: Jim Musil

The Truth Told!
        76415 by: DSTRONGZ.aol.com
        76416 by: Julio Nobrega Trabalhando

Mass Mailing
        76418 by: Nathan Cavicchi

newbie: Supplied argument is not a valid MySQL result..?
        76419 by: Lee Philip Reilly
        76420 by: Lee Philip Reilly

Using urlencode to pass varfiables in a URL
        76421 by: Don
        76423 by: Martin Towell

Zend Encoder
        76422 by: Mark

Re: MySQL ORDER BY or PHP Sort?
        76424 by: Rick Emery
        76425 by: Mike Eheler

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 ---
Krzysztof Kocjan wrote:

> 
> 
> Fred wrote:
> 
>> Third, it is ineffecient and unneccessary to put 60 fields in a single 
>> form.
>> If you are using the GET method it probably will not work since it passes
>> the variable names and values in the URL, which has a maximum length 
>> of 255
> 
> 
> 
> In my mind maximum length 255 is not true. There isn't any limit for 
> GET/POST requests as I read in RFC documents. The limit depends on Your 
> web server implementation. I've never tested but suppose Apache could 
> handle GET method with URL longer than 255 characters. I've never had 
> problems with form's data length using Apache and GET/POST methods.
> But if I'm wrong I apologize.


This depends also on Your browser of course. AFAIK GET is OK for data up 
to 8kB, POST can be used for much bigger data




-- 
-------------------------------------------------------------------/\------
Remigiusz Sokolowski      e-mail: [EMAIL PROTECTED]            /  \          
-----------------------------------------------------------------/____\-----

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

I assume everyone has heard of P3P (Platform for Privacy Preferences), so
I'll skip explaining in detail what it is. If you don't know, just skip this
message *g*.

I've got one Problem with this, and PHP may solve it:

P3P has absolutely no Application-Server/Scripting support. It's just a
simple XML-File that tells the User what (personal) data the Website
collects, and is Requested with "hard-coded" relative URL's.
Assume a PHP Website with URL-based Session's. A User Request the Homepage
(/index.phtml) - he's anonymous, collected data is anonymous. The (static)
P3P File tells the User that the collected data is anon. Well, now the User
logs-in via a Form-Submit and reloads the Page (/index.phtml). The
information is set in the PHP-Session, the User is shown other
(personalized) Content, but the P3P-File is still the same, telling the
user, that the collected data is still anonymous - this is (or may be) wrong
now.
P3P has no mechanism to handle this case, in P3P you can only set a
different policy for (sub-)folders (differrent URI's). The problem is, that
the GET Request is absolutely the same, it doesn't matter if the user is
logged-in or anonymous (well, it would be a security hole, if someone is
able to find out, if a user is logged-in when (s)he takes a look at the URL,
hm?).

Sure, it's possible to copy all "templates" to another subfolder and link
logged-in users to this one, but why should I do so? The advantage of using
templates (a I define them) is that they just show any content. They don't
care if this content is personalized or not. The content is "prepared" by
the "business logic" - programmed in PHP - and stored in a database. This
way, I'm able to use the same "templates" for logged-in and anonymous
users - well, half the work to do...

I already talked to some P3P-Members, they think, it is no Problem, but
didn't provide a solution - at least none I was able to understand *g*.

I think, P3P should (must!!) be supported by the Application-Server or
Scripting Language. It should be possible to catch a request for a P3P file
from the Webserver, match Information from the Session, and generate the
correct XML-contents on the fly or assign a matching P3P-File.


Links:
P3P - http://www.w3.org/P3P/
One of our Website's that will have the described problem. (Not coded in
PHP - we do quite the same thing with PHP and the BroadVision Application
Server): http://www.siemens.de/solutionprovider/dialog


Bruno Baketaric
Development Director

WOB Interactive AG
Werner-Heisenberg-Strasse 6a
68519 Viernheim
Fon +49 (0)6204.970-274
Fax +49 (0)6204.970-211
E-Mail: [EMAIL PROTECTED]
ICQ: 818981
http://www.wob.ag
http://www.bbn-advertising.com
Part of: BBN The multicultural agency


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

just do it like this - the result will be the same, and $bar is still passed
by reference:
________________
$result = call_user_func("foo", $bar);

function foo( &$bar ) {
    $bar .= 'foobar';
    return 1;
}
_________________

This error just tells you, that you have to declare "pass-by-reference" in
your functions, and cannot use a "generic" function, that sometimes takes
parameters by reference and sometimes by value. This problem has nothing to
do with "call_user_func()".

"C" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Prior to 4.0.6 it worked fine, however, now when I try:
>
> $result = call_user_func("foo", &$bar);
>
> function foo( &$bar ) {
>    $bar .= 'foobar';
>    return 1;
> }
>
> I get this:
>
> Warning: Call-time pass-by-reference has been deprecated - argument passed
> by value; If you would like to pass it by reference, modify the
declaration
> of call_user_func(). If you would like to enable call-time
> pass-by-reference, you can set allow_call_time_pass_reference to true in
> your INI file. However, future versions may not support this any longer.
>
> Does that mean I can't pass by reference anymore? I kinda need to (the two
> functions above are not my actual functions btw)....
>
> Thanks.
>
>


--- End Message ---
--- Begin Message ---
hello php-general,

   how do I run a shell script from PHP web interface??

   assume /path/to/my/script.sh as the path and the owner and group of
   this script are belong to apache

Regards,
--
Danar PrObOndaru
--

--- End Message ---
--- Begin Message ---
"Danar Prabandaru" <[EMAIL PROTECTED]> wrote:
>    how do I run a shell script from PHP web interface??
> 
>    assume /path/to/my/script.sh as the path and the owner and group of
>    this script are belong to apache

See exec(), system(), etc.

-- 
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/

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

Does anyone know of a way of passing other variables to the function being called by 
preg_replace_callback?  For instance, I have the following code:

function smarty_compile_lang($tpl_source) {
// en.php contains a very large array, $_lang
        include_once '/home/test/en.php';
        global $_lang;
        return preg_replace_callback('/##(.+?)##/', '_compile_lang', $tpl_source);
}

function _compile_lang($key){
// If I include $_lang here then it gets
// loaded again and again - bad for performance as it is _very_ large
        return $_lang[$key[1]];
} // End _compile_lang

Somehow I need to make $_lang global, or pass it through the function 
preg_replace_callback as an arguement for _compile_lang() - which I don't think is 
possible?

What can I do?  I've tried a global statement everywhere I can think of... and I don't 
want to include en.php outside the functions, as it'll be included then whether the 
templates are being compiled or not.  I'm 
guessing that I may want to look at a higher level of abstraction from these 
functions, as even if I have the include in the current place, it means that every 
time a template is compiled it gets reloaded (though that's 
not as bad as every time preg_replace_callback() finds something) whereas the best way 
would be to load it once per script invocation - and then only when the templates wer 
being compiled...

Suggestions?

TIA,
Peter.


--- End Message ---
--- Begin Message ---
function _compile_lang($key){
global $_lang;
return $_lang[$key[1]];
} // End _compile_lang


HTH

Regards,
Andrey Hristov
----- Original Message -----
From: "Peter Bowyer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 3:45 PM
Subject: [PHP] variable scope / preg_replace_callback question


> Hi,
>
> Does anyone know of a way of passing other variables to the function being called by 
>preg_replace_callback?  For instance, I have
the following code:
>
> function smarty_compile_lang($tpl_source) {
> // en.php contains a very large array, $_lang
> include_once '/home/test/en.php';
> global $_lang;
> return preg_replace_callback('/##(.+?)##/', '_compile_lang', $tpl_source);
> }
>
> function _compile_lang($key){
> // If I include $_lang here then it gets
> // loaded again and again - bad for performance as it is _very_ large
> return $_lang[$key[1]];
> } // End _compile_lang
>
> Somehow I need to make $_lang global, or pass it through the function 
>preg_replace_callback as an arguement for _compile_lang() -
which I don't think is possible?
>
> What can I do?  I've tried a global statement everywhere I can think of... and I 
>don't want to include en.php outside the
functions, as it'll be included then whether the templates are being compiled or not.  
I'm
> guessing that I may want to look at a higher level of abstraction from these 
>functions, as even if I have the include in the
current place, it means that every time a template is compiled it gets reloaded 
(though that's
> not as bad as every time preg_replace_callback() finds something) whereas the best 
>way would be to load it once per script
invocation - and then only when the templates wer being compiled...
>
> Suggestions?
>
> TIA,
> Peter.
>
>
>
> --
> 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]
>
>

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

I am trying to make a something like a cooking recipe with some calculations. My 
problem is too much database querying. Is it really a problem???

Let's suppose there is a table with items and prices:
item1    price1
item2    price2
item3    price3
...

Then I have to calculate some new indegrient price, which is a result of calculating 
other prices:
(ex: $new_price1 = 2*$price1 + $price2 )

To get wanted prices I used standard query:
----------------------------------------------------

$result = mysql_query ("SELECT  price from price_list where id = '01'");
$row = mysql_fetch_array($result);
$price1 = $row["price"];

$result = mysql_query ("SELECT  price from price_list where id = '02'");
$row = mysql_fetch_array($result);
$price2 = $row["price"];

//...and so on for about 30 indegrients.

And on the end:
$new_price1 = 2*$price1 + $price2;
print "$new_price1";

----------------------------------------------------------

But, is there a quicker way to do this? Am I doing maybe the wholistic mistake in 
process?
Or this is just OK?

Please, help cooking the soup ;)

regards,
Alen


--- End Message ---
--- Begin Message ---
Allen,

Have you a table of recipes, like so:
recipe1 item1
recipe1 item2
...
recipe1 itemn
recipe2 item1

You could then fetch all the items for a given recipe, and loop through the 
returned results (an array), concatenating the prices.

Alternately, you store all your items in an array for each recipe and loop 
through the array ...

Here's an example of what I'm using, where the prompts for a page are 
stored in a table. This lets me handle different languages very easily:

//all the connection stuff is up above ...
$cLLangCode = "GB";
$cPageName = "user_bid";
$arr_lbl = array();
$sql = "select cLblName,cLblText from prompt
                         where cLangCode = '$cLangCode' and cPageName = 
'$cPageName'";
$result = mysql_query( $sql, $db )
         or die( "Unable to fetch prompts for page $cPageName." );
while( $row = mysql_fetch_array( $result ) )
{
         $arr_lbl[$row[cLblName]] = $row[cLblText];
}

In the $arr_lbl assignment, following the while(), you could execute 
queries for individual item costs, and add them up. Essentially nest the 
same code inside the while, except that it's executing for one ingredient 
at a time.

If you will have to a lot of this, seriously consider PostgreSQL (or 
similar db) as it supports subqueries, and this situation cries out  for 
their use. This single line would give you the sum of all your ingredients:

         Select sum(price) from items where item in (select item from 
recipe where recipe_id = "choc_chip")

Database querying isn't a problem, as it's all server side and really fast, 
no traffic across the wire. If you have a lot of complex queries, really 
consider something other than MySQL.

Cheers - Miles Thompson
http://www.cqagroup.ca

At 03:31 PM 12/3/2001 +0100, =?iso-8859-2?Q?Alen_Nonkovi=E8?= wrote:
>Hello,
>
>I am trying to make a something like a cooking recipe with some 
>calculations. My problem is too much database querying. Is it really a 
>problem???
>
>Let's suppose there is a table with items and prices:
>item1    price1
>item2    price2
>item3    price3
>...
>
>Then I have to calculate some new indegrient price, which is a result of 
>calculating other prices:
>(ex: $new_price1 = 2*$price1 + $price2 )
>
>To get wanted prices I used standard query:
>----------------------------------------------------
>
>$result = mysql_query ("SELECT  price from price_list where id = '01'");
>$row = mysql_fetch_array($result);
>$price1 = $row["price"];
>
>$result = mysql_query ("SELECT  price from price_list where id = '02'");
>$row = mysql_fetch_array($result);
>$price2 = $row["price"];
>
>//...and so on for about 30 indegrients.
>
>And on the end:
>$new_price1 = 2*$price1 + $price2;
>print "$new_price1";
>
>----------------------------------------------------------
>
>But, is there a quicker way to do this? Am I doing maybe the wholistic 
>mistake in process?
>Or this is just OK?
>
>Please, help cooking the soup ;)
>
>regards,
>Alen

--- End Message ---
--- Begin Message ---
Use smth like this ->
$need_prices = '01,02';
$prices = new Array();
$sql = "select * from price_list where id in ($need_prices)"
$result = mysql_query ($sql);

    {//cycle while $result is not empty - for every record
        $row = mysql_fetch_array($result);
        $prices[$row["id"]] = $row["price"];
        }

After this you'll get  array of prices $prices - indexes are id value. so u
can write

$new_price1 = 2*$prices[1] + $prices[2]

Zliy Pes, http://www.zliypes.com.ua


----- Original Message -----
From: "Alen Nonkovi?" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 4:31 PM
Subject: [PHP] Multiple database seeking


Hello,

I am trying to make a something like a cooking recipe with some
calculations. My problem is too much database querying. Is it really a
problem???

Let's suppose there is a table with items and prices:
item1    price1
item2    price2
item3    price3
...

Then I have to calculate some new indegrient price, which is a result of
calculating other prices:
(ex: $new_price1 = 2*$price1 + $price2 )

To get wanted prices I used standard query:
----------------------------------------------------

$result = mysql_query ("SELECT  price from price_list where id = '01'");
$row = mysql_fetch_array($result);
$price1 = $row["price"];

$result = mysql_query ("SELECT  price from price_list where id = '02'");
$row = mysql_fetch_array($result);
$price2 = $row["price"];

//...and so on for about 30 indegrients.

And on the end:
$new_price1 = 2*$price1 + $price2;
print "$new_price1";

----------------------------------------------------------

But, is there a quicker way to do this? Am I doing maybe the wholistic
mistake in process?
Or this is just OK?

Please, help cooking the soup ;)

regards,
Alen


--- End Message ---
--- Begin Message ---
 As seen on NBC, CBS, CNN, and even Oprah! The health 
discovery that actually reverses aging while burning fat, 
without dieting or exercise! This proven discovery has even 
been reported on by the New England Journal of Medicine. 
Forget  aging and dieting forever! And it's Guaranteed!   

Click here:
http://ultimatehgh.81832.com

Would you like to lose weight while you sleep!
No dieting!
No hunger pains!
No Cravings!
No strenuous exercise!
Change your life forever! 

100% GUARANTEED!

1.Body Fat Loss            82% improvement.
2.Wrinkle Reduction     61% improvement.
3.Energy Level              84% improvement.
4.Muscle Strength         88% improvement.
5.Sexual Potency         75% improvement.
6.Emotional Stability      67% improvement.
7.Memory                      62% improvement.

***********************************************************

Click here to see another weight loss product:

http://ultimatehgh.81832.com

You are receiving this email as a subscriber
to the Opt-In America Mailing List. 
To remove yourself from all related maillists,
just click here:
mailto:[EMAIL PROTECTED]?Subject=REMOVE
--- End Message ---
--- Begin Message ---
Isn't it called php.ini-dist first?  Excerpt from the INSTALL file that 
accompanied my PHP 4.0.6 dist:

"Next you must copy php.ini-dist to the appropriate place (normally
/usr/local/lib/php.ini) and edit it as necessary to set PHP options."

Of course, this doesn't matter if you're appending a wildcard to your 
search ( 'php.ini*' ).


Erik


On Friday, November 30, 2001, at 10:40  PM, Paul Warner wrote:

>> Hi,
>> How can PHP work without the php.ini file? I have tried to find the
> php.ini
>> file on a RAQ3, to no success. Looking at the php info and then 
>> looking at
>> the system directories doesnt yield anything.
>> The same goes with a server running the Plesk control panel.
>>
>> Any ideas on how this is done?
>
> Kunal-
>
> /etc/httpd/php.ini and /etc/admserv/php.ini are on mine.
> Try 'find / -name php.ini' from a telnet or ssh session.
>
> -- P
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

--- End Message ---
--- Begin Message ---
I don't think that Sherlock can recognize any file in the /etc 
directories.  If you never use Terminal, then Sherlock is okay, but if 
you do stuff in the Terminal then you are working in levels of your 
computer that Apple has decided to "hide" from most users.  The /etc 
directory is one example of this.  For searches of the hard drive 
outside of the Apple-approved Sherlock-searchable directories, read the 
man page for "find".  In your case, the file is probably located at 
/etc/httpd/httd.conf.  Open this file in pico or emacs, but be sure to 
use "sudo emacs /etc/httpd/httpd.conf" if you are not logged in as root 
because it is not writeable by normal users.



Erik


On Sunday, December 2, 2001, at 04:15  PM, René Fournier wrote:

> OK, that makes sense--that's what I did under WinME. The only problem 
> is that I can't seem to find the httpd.conf file anywhere. At least, 
> Sherlock is not returning any results. Do you know which directory 
> httpd.conf is in?
>
> ...Rene
>
> On Sunday, December 2, 2001, at 01:56  PM, Michael B. Weiner wrote:
>
>> modify the apache configuration file (i.e. httpd.conf) and add it as 
>> and AddType, as in the following:
>>
>>  AddType application/x-httpd-php .php4 .php3 .phtml .php
>>  AddType application/x-httpd-php-source .phps
>> HTH
>> --
>>
>> René Fournier wrote:
>>
>>> I have successfully installed PHP 4.0.6, and it works! Only problem 
>>> is that Apache only sends files to the PHP module that have a .php 
>>> extension. However, I need to name the files .php4 (long story). As 
>>> it stands, all I see is the actual PHP source, not the output.
>>>
>>> Does anyone know how I can change Apache and/or the PHP module to 
>>> recognize .php4 files and execute them as such?
>>>
>>> Thanks.
>>>
>>> ...Rene

--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Erik Price" <[EMAIL PROTECTED]>
To: "René Fournier" <[EMAIL PROTECTED]>
Cc: "Michael B. Weiner" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 4:23 PM
Subject: Re: [PHP] How to set file extension php Mac OSX and PHP 4.0.6


> I don't think that Sherlock can recognize any file in the /etc
> directories.  If you never use Terminal, then Sherlock is okay, but if
> you do stuff in the Terminal then you are working in levels of your
> computer that Apple has decided to "hide" from most users.  The /etc
> directory is one example of this.  For searches of the hard drive
> outside of the Apple-approved Sherlock-searchable directories, read the
> man page for "find".  In your case, the file is probably located at
> /etc/httpd/httd.conf.  Open this file in pico or emacs, but be sure to
> use "sudo emacs /etc/httpd/httpd.conf" if you are not logged in as root
> because it is not writeable by normal users.

or use locate (you will have to set up the database first). You should be
able to find a tool called "Locator" on www.versiontracker.com which
provides a GUI for locate (although I'd rather use it in terminal).
AND: Sherlock WILL find the files in /etc if you search for "invisible"
files. But unfortunately drag & drop doesn't work for those files and
displayed filepath seems to be wrong (they are always displayed with a path
like "yourharddisk/<filename>")

and another tipp for you:
use BBedit (again available at versiontracker.com or www.barebones.com - for
free) if you don't like terminal apps. It has a point "Open hidden..." below
the menu "File" with which you can easily open and edit the httpd.conf (as
erik said it is normally located under /etc/httpd/httpd.conf) . BBedit will
probably tell you that you haven't appropriate rights to edit and save the
file - log out and log in as root again (or chown/chmod the file).

>
>
> Erik
>


Stefan Rusterholz, [EMAIL PROTECTED]
----------------------------------
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
----------------------------------
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
----------------------------------

> On Sunday, December 2, 2001, at 04:15  PM, René Fournier wrote:
>
> > OK, that makes sense--that's what I did under WinME. The only problem
> > is that I can't seem to find the httpd.conf file anywhere. At least,
> > Sherlock is not returning any results. Do you know which directory
> > httpd.conf is in?
> >
> > ...Rene
> >
> > On Sunday, December 2, 2001, at 01:56  PM, Michael B. Weiner wrote:
> >
> >> modify the apache configuration file (i.e. httpd.conf) and add it as
> >> and AddType, as in the following:
> >>
> >>  AddType application/x-httpd-php .php4 .php3 .phtml .php
> >>  AddType application/x-httpd-php-source .phps
> >> HTH
> >> --
> >>
> >> René Fournier wrote:
> >>
> >>> I have successfully installed PHP 4.0.6, and it works! Only problem
> >>> is that Apache only sends files to the PHP module that have a .php
> >>> extension. However, I need to name the files .php4 (long story). As
> >>> it stands, all I see is the actual PHP source, not the output.
> >>>
> >>> Does anyone know how I can change Apache and/or the PHP module to
> >>> recognize .php4 files and execute them as such?
> >>>
> >>> Thanks.
> >>>
> >>> ...Rene
>
>
> --
> 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]
>
>
>

--- End Message ---
--- Begin Message ---
I'm using this in a script to send pdf files from Apache:
<?
// get the $pdf_name and $len of the $pdf_name
// stuff up here, and then ...
header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename=$pdf_name");
header("Content-Length: $len");
readfile($pdf_name);
?>

About 6 out of 300 subscribers cannot see the PDF, although they can 
download and view other PDF's from the site, or from other sites. I'm also 
aware of the note regarding IE in the Manual, and am contacting them to 
determine what browser/version they are using.

In the meantime, does anyone have any other suggestions?

Regards - Miles Thompson

--- End Message ---
--- Begin Message ---
Can anyone suggest a bank and/or merchant account
provider that you've used successfully in the past.

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com
--- End Message ---
--- Begin Message ---
I've installed PHP-4.0.6 using the following configuration:
 
'./configure' '--prefix=/ECommerce/bin/apache/1.3.22' 
'--with-oci8=/opt/apps/oracle/8.1.7'
'--with-apxs=/ECommerce/bin/apache/1.3.22/bin/apxs'
 '--without-mysql' '--with-zlib-dir=/usr/local'
 '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local'
 '--with-freetype-dir=/usr/local' 
'--enable-ftp' 
'--with-xpm-dir=/usr/local/lib'
 '--with-t1lib=/usr/local'
 '--with-ttf=/usr/local'
 '--with-gd=/usr/local'
 
phpinfo() says that GD support is enabled, Freetype support is enabled and
has
freetype linkage, t1lib, jpeg, png and wbmp supports are all enabled.  In
short, the installation
looks successful.
 
Unfortunately, the developers cannot get the freetype functionality.  If no
font is specified, then
the system chooses its own font which is then displayed.  However, if a font
like arial is
explicitly named, then the fonts are not visible.
 
Does anybody have any ideas as to what is going on?  

M. Dowling
HEW 

 
--- End Message ---
--- Begin Message ---
I try to give it a value with a var, but it doesn't work.

The code is something like this.

$y=str_pad($y,5,".txt"); \\ To give it a filename from a var that contains
only 1 number (with 1 digit)
If in this step I do a "echo $y, it shows the correct string. Suposing it is
2, it shows 2.txt

$temp[]=file($y); \\ To load the file into the array.

But after the file nothing happens, the array only contains "Array".

Sorry for my bad english.
Jose.

Olinet S.L.


--- End Message ---
--- Begin Message ---
When you attempt to print or echo an array the result is simply "array".
You have to iterate through the elements of the array to see what each
element contains.  Read the array chapter in the manual for more
information.

Fred

Jose <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I try to give it a value with a var, but it doesn't work.
>
> The code is something like this.
>
> $y=str_pad($y,5,".txt"); \\ To give it a filename from a var that contains
> only 1 number (with 1 digit)
> If in this step I do a "echo $y, it shows the correct string. Suposing it
is
> 2, it shows 2.txt
>
> $temp[]=file($y); \\ To load the file into the array.
>
> But after the file nothing happens, the array only contains "Array".
>
> Sorry for my bad english.
> Jose.
>
> Olinet S.L.
>
>


--- End Message ---
--- Begin Message ---
From: Jose [mailto:[EMAIL PROTECTED]]

$temp[]=file($y); \\ To load the file into the array.
-------------------
file() returns an array! So, you ended up with an array ($temp) with element
0 an array (returned from file() ). Read the manual very carefully ...

You probably meant to say

$temp=file($y); // To load the file into the array.

(watch those '//'s, too!)

mark C.

--- End Message ---
--- Begin Message ---
Try this:
<?php
echo "<pre>";
print_r ($temp);
echo "</pre>";
?>
and look for $temp content.

Zliy Pes http://zliypes.com.ua

----- Original Message -----
From: "Fred" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 7:58 PM
Subject: [PHP] Re: Something wrong with the file() command.


> When you attempt to print or echo an array the result is simply "array".
> You have to iterate through the elements of the array to see what each
> element contains.  Read the array chapter in the manual for more
> information.
>
> Fred
>
> Jose <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I try to give it a value with a var, but it doesn't work.
> >
> > The code is something like this.
> >
> > $y=str_pad($y,5,".txt"); \\ To give it a filename from a var that
contains
> > only 1 number (with 1 digit)
> > If in this step I do a "echo $y, it shows the correct string. Suposing
it
> is
> > 2, it shows 2.txt
> >
> > $temp[]=file($y); \\ To load the file into the array.
> >
> > But after the file nothing happens, the array only contains "Array".
> >
> > Sorry for my bad english.
> > Jose.
> >
> > Olinet S.L.
> >
> >
>
>
>
> --
> 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]
>
>


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

Hehe, Valentin. Send my regards to beloved Zaporozhye and it's ppl :)
Haven't been there for ages. Eh...

VVP> Try this:
VVP> <?php
VVP> echo "<pre>";
VVP> print_r ($temp);
VVP> echo "</pre>";
?>>
VVP> and look for $temp content.


--------------------------------------
Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemi.info

--- End Message ---
--- Begin Message ---

First, make sure $item[$index] has anything in it by inserting an 
echo $item[$index].

You also have to prepend item_number with the table name as in ar.item_number.

Try single quotes around $item[$index], too.

If $index is a name, I've had trouble in the past getting associative 
arrays to resolve correctly inside strings. Try using this ...

     $result = mysql_query("SELECT * FROM ar
    LEFT JOIN company on ar.company_id=company.company_id
    LEFT JOIN scale on ar.scale_id=scale.scale_id
    WHERE ar.item_number = '".$item[$index]."')";


>I tried but nothing different happened.  I'm still playing though and I'll
>see if I can make it work.  I'm new to all of this...so we'll see how it
>goes.  Thanks for your help.
>
>-jordan
>
>
>Fred <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>  Strings in your sql query must be quoted.  Try this instead:
>>
>>  >    $result = mysql_query("SELECT * FROM ar
>>  >    LEFT JOIN company on ar.company_id=company.company_id
>>  >    LEFT JOIN scale on ar.scale_id=scale.scale_id
>>  >    WHERE item_number = \"$item[$index]\")";
>>
>>  Fred
>>
>>  Jordan <[EMAIL PROTECTED]> wrote in message
>>  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>  > here's the situation.  I'm making a shopping cart, when an item is added
>>  > it's item number is added into an array.  I then want this array's items
>>  to
>>  > be compared agains the database.  Unfortunately I haven't been able to
>use
>>  a
>>  > variable in the query string of MySQL.  something along the lines of....
>>  >
>>  >
>>  > <?PHP
>>  >
>>  >    include ('connect.php');
>>  >
>>  >    $result = mysql_query("SELECT * FROM ar
>>  >    LEFT JOIN company on ar.company_id=company.company_id
>>  >    LEFT JOIN scale on ar.scale_id=scale.scale_id
>>  >    WHERE item_number =" . $item[$index]);
>>  >
>>  > ?>
>>  >
>>  > where $item is the array of item numbers and $index is an auto
>>  incrementing
>>  > number that increments at the end of the loop.  Please help if you know
>of
>>  > anyway to use this variable.  Also, I can post my whole script if
>>  needed...I
>>  > just didn't want unneeded info posted.  Thanks in advance.
>>  >
>>  > -Jordan
>>  >
>>  >
>>
>>
>
>
>
>--
>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]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
If you are just starting into PHP, try some something more basic. If you
have some background into another language such as PERL, then you shouldn't
have too much trouble. However, if you insist to taking on a bulletin board
script for analyzing purposes, head over to hotscripts.com where I'm sure
there is a few tutorials and many boards from the simplistic recursive
wwwthreads style boards to the vertical setup like infopop and UBB.

I've coded up BlazeBoard script last year and I must say, that majority of
the work is getting the cool features rather than developing a foundation of
the board. All a board does is input/output data from the database. So first
step to take would be developing a core registration module, then utilizing
it, authenticate the user so they can post to a forum, then build the module
to retrieve the data.

Of course there are other factors to consider on the complexity of the
board, that is if you want to consider the ability to create more than one
board for a forum or be able to categorize it. These are really features,
and doesn't represent the core system of any board.

Regards,
Jonathan Chum

http://www.flaap.com
Flash resources


"Anthony Ritter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm using Windows 98 with Apache, mysql and PHP.
>
> I'm in the process of learning PHP and would like to find a few tutorials
on
> PHP/mysql bulletin boards.
>
> I know that there are a few that you can download but I am trying to find
a
> tutorial that will let me anylaze the syntax and logic of the code so that
I
> can understand and breakdown the steps in how a BB program works.
>
> Any URL's will be helpful.
>
> Thanking all in advance.
> Tony Ritter
>
>
>
>


--- End Message ---
--- Begin Message ---

----- Original Message -----
From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 6:35 PM
Subject: [PHP] ereg help


> I'm not new for php, but have no experience working with ereg functions.
My
> problem is the following:
>
> i have string.. for example
>     $s="id {name,title,nick} [http://www.php.net]";;
> i want to break it in several parts:
> $p[0]="id";
> $p[1][0] ="name";
> $p[1][1] ="title";
> $p[1][2] ="nick";
> $p[2]="http://www.php.net";;
>
> The part in [] is not neccessary, count of {} elements is not less than 1
> I can do it with string fucntions, but it seemes to me it's better to use
> regular functions.
>
> Could anybody help me to solve this problem and advise resource for
studying
> regular expresions?
>
> Zliy Pes, http://zliypes.com.ua
>
>



--- End Message ---
--- Begin Message ---
This is a good starter about PHP and regular expressions.

http://www.phpbuilder.com/columns/dario19990616.php3


>----- Original Message -----
>From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, December 03, 2001 6:35 PM
>Subject: [PHP] ereg help
>
>
>>  I'm not new for php, but have no experience working with ereg functions.
>My
>>  problem is the following:
>>
>>  i have string.. for example
>>      $s="id {name,title,nick} [http://www.php.net]";;
>>  i want to break it in several parts:
>>  $p[0]="id";
>>  $p[1][0] ="name";
>>  $p[1][1] ="title";
>>  $p[1][2] ="nick";
>>  $p[2]="http://www.php.net";;
>>
>>  The part in [] is not neccessary, count of {} elements is not less than 1
>>  I can do it with string fucntions, but it seemes to me it's better to use
>>  regular functions.
>>
>>  Could anybody help me to solve this problem and advise resource for
>studying
>>  regular expresions?
>>
>>  Zliy Pes, http://zliypes.com.ua
>>
>>
>
>
>
>
>--
>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]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi guys,

I want to write a script that inputs a file variable then it sends out a RealMedia 
header so that it sends the file location to RealPlayer.

EG:

If I click on http://www.randumian.co.uk/getsample.php?file=1234.rm, it should send 
the headers so that the computer thinks its a .rpm file then send me to 
http://www.randumian.co.uk/realaudio/1234.rm.

Can anybody advise me on what to do please?

Randum Ian
DJ / Producer / Web Designer
[EMAIL PROTECTED] - 07903 067339
Webmaster: http://www.randumian.co.uk
Webmaster: http://www.danceportal.co.uk
--- End Message ---
--- Begin Message ---
This must be the first output of your script.

header ("Content-type: audio/x-pn-realaudio");

and then your output should be in .ram file output.

Is this what you are asking?


>Hi guys,
>
>I want to write a script that inputs a file variable then it sends 
>out a RealMedia header so that it sends the file location to 
>RealPlayer.
>
>EG:
>
>If I click on http://www.randumian.co.uk/getsample.php?file=1234.rm, 
>it should send the headers so that the computer thinks its a .rpm 
>file then send me to http://www.randumian.co.uk/realaudio/1234.rm.
>
>Can anybody advise me on what to do please?
>
>Randum Ian
>DJ / Producer / Web Designer
>[EMAIL PROTECTED] - 07903 067339
>Webmaster: http://www.randumian.co.uk
>Webmaster: http://www.danceportal.co.uk


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I am having trouble with php to display from the Netscape.  I installed 
both Apache and PHP using RPM.  I modified httpd.conf file.

Can anyone help me with this?

Where should the php.ini be located?  Mine is located in /etc dir.  
Should it be somewhere else?

Thanks.

Hai Nguyen
--- End Message ---
--- Begin Message ---
Yes, I have PHP running just fine under 7.2 (source compile).

PHP  doesn't care one whit about your browser; however, Netscape is picky
(as it should be) about end tags. The most common problem when pages display
under IE but not under Netscape is the lask of a </table> or </tr> tag.

Mark C.

-----Original Message-----
From: Hai Nguyen [mailto:[EMAIL PROTECTED]]

I am having trouble with php to display from the Netscape.  I installed
both Apache and PHP using RPM.  I modified httpd.conf file.

--- End Message ---
--- Begin Message ---
Hi all,
Has anyone seen this.  I have a login form (login.htm) which calls a login 
handler (check_login.php).  If the login is sucessfull the check_login.php 
will set a couple session variables, then redirect the user to a menu page.  
The problem I am seeing is that when I call session_start() from the menu 
page, I get a new session reference rather than a reference to the session 
I started in the check_login.php.  Is there a setting in the php.ini I 
should change?

Any thoughts would be greatly appreciated.

Chris
--- End Message ---
--- Begin Message ---

If you redirect using the full (http://foo.bar/rex...) URL, it may be 
restarting your session. Try using relative URLs.


>Hi all,
>Has anyone seen this.  I have a login form (login.htm) which calls a login
>handler (check_login.php).  If the login is sucessfull the check_login.php
>will set a couple session variables, then redirect the user to a menu page. 
>The problem I am seeing is that when I call session_start() from the menu
>page, I get a new session reference rather than a reference to the session
>I started in the check_login.php.  Is there a setting in the php.ini I
>should change?
>
>Any thoughts would be greatly appreciated.
>
>Chris
>
>--
>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]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---

Also read about session management at http://php.net/session


>Hi all,
>Has anyone seen this.  I have a login form (login.htm) which calls a login
>handler (check_login.php).  If the login is sucessfull the check_login.php
>will set a couple session variables, then redirect the user to a menu page. 
>The problem I am seeing is that when I call session_start() from the menu
>page, I get a new session reference rather than a reference to the session
>I started in the check_login.php.  Is there a setting in the php.ini I
>should change?
>
>Any thoughts would be greatly appreciated.
>
>Chris
>
>--
>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]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi Jim,
Thanks for you replies.  I was using relative paths and still I got the 
seperate sessions being opened.  The interesting part was this was only 
happening on my dev machine (win32), when I moved the files to a Linux box, 
I did not have the same problem.  Must be something in the IIS or PHP.INI 
on the dev box I guess.

Thanks again.

Chris
--- End Message ---
--- Begin Message ---
Hello all,
anyone can help me ????

in line command to configure php :
                                           './configure' '--with-mysql'

'--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/'

'--with-zlib-dir=/usr/src/packages/SOURCES/zlib/'

'--with-png-dir=/usr/src/packages/SOURCES/libpng/'

'--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/'

'--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars'

in result of phpinfo() :
                                                    gd

                         GD Support
                                                                 enabled

                         GD Version
                                                                 1.6.2
or higher
                         JPG Support
                                                                 enabled

                         PNG Support
                                                                 enabled

                         WBMP Support
                                                                 enabled



                                                            zlib

                         ZLib Support

enabled
                         'zlib:' fopen wrapper

enabled
                         Compiled Version

1.1.3
                         Linked Version

1.1.3


,but when use ImageCreateFromJPEG:
<br>
<b>Warning</b>:  imagecreatefromjpeg: .../testout.jpg' is not a valid
JPEG file in <b>../a.php</b> on line <b>4</b><br>
<br>
<b>Warning</b>:  Supplied argument is not a valid Image resource in
<b>../a.php</b> on line <b>14 =>> ImageJPEG()

what is my problem????

--
Best Regards
Miguel Joaquim Rodrigues Loureiro

--- End Message ---
--- Begin Message ---

It is difficult to know where your problem is without more information.

It would appear that your jpeg file is not valid. Try another .jpg file.

Post the problem code, too.






>Hello all,
>anyone can help me ????
>
>in line command to configure php :
>                                            './configure' '--with-mysql'
>
>'--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/'
>
>'--with-zlib-dir=/usr/src/packages/SOURCES/zlib/'
>
>'--with-png-dir=/usr/src/packages/SOURCES/libpng/'
>
>'--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/'
>
>'--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars'
>
>in result of phpinfo() :
>                                                     gd
>
>                          GD Support
>                                                                  enabled
>
>                          GD Version
>                                                                  1.6.2
>or higher
>                          JPG Support
>                                                                  enabled
>
>                          PNG Support
>                                                                  enabled
>
>                          WBMP Support
>                                                                  enabled
>
>
>
>                                                             zlib
>
>                          ZLib Support
>
>enabled
>                          'zlib:' fopen wrapper
>
>enabled
>                          Compiled Version
>
>1.1.3
>                          Linked Version
>
>1.1.3
>
>
>,but when use ImageCreateFromJPEG:
><br>
><b>Warning</b>:  imagecreatefromjpeg: .../testout.jpg' is not a valid
>JPEG file in <b>../a.php</b> on line <b>4</b><br>
><br>
><b>Warning</b>:  Supplied argument is not a valid Image resource in
><b>../a.php</b> on line <b>14 =>> ImageJPEG()
>
>what is my problem????
>
>--
>Best Regards
>Miguel Joaquim Rodrigues Loureiro
>
>
>
>--
>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]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I have a file called sessionvars.php that I require() as the very first
thing on all my pages, it has

session_register("blah"...) and about 40 or 50 variable names after that.

sometimes I am seeing behavior where a form on one page that references a
session variable doesn't carry over the change to the next page.  in other
words, i filled in a username in a form on page 1, hit submit, got to page 2
and it was remembered.  but now i go back to page 1, change the value in the
form, and when i get to page 2 it has the old value, not the new value!

i have the following options in my apache config:

php_value session.save_path "/home/phpsession/"
php_value session.name "EINFO"
php_value session.cookie_lifetime 2592000
php_flag register_globals on

what do i have to do to get the changes to propagate through??

-jsd-



--- End Message ---
--- Begin Message ---
"Jon Drukman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> sometimes I am seeing behavior where a form on one page that references a
> session variable doesn't carry over the change to the next page.

i just figured this out from reading the user comments at php.net.  form
posted variables don't automatically override session vars.

so i added a loop at the top of each page which overwrites all session vars
from posted form vars.  unfortunately if you go straight to one of the
middle pages (this is a 6 page form) you wind up wiping out whatever is
recorded on that page.  i'll figure out something.... i hope...

-jsd-



--- End Message ---
--- Begin Message ---
Hey Hey!  I've got a question about wordwrap.  It seems that when I run this
on a string that contains spaces, if my replacement string happens to fall
on a space, the space is removed completely from the string.  This isn't
good :-\  Any way around this?  Thanks!

- Scott

--- End Message ---
--- Begin Message ---

What's the best way to duplicate a mysql row with PHP and MYSQL?

-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
  I don't know if it is the best but here's an idea:

INSERT INTO table SELECT ha, he, hi, ho, hu FROM table LIMIT 1;

--

Julio Nobrega

Don't eat the yellow snow.


"Jim" <[EMAIL PROTECTED]> wrote in message
news:p0510100fb8318736de56@[192.168.1.17]...
>
> What's the best way to duplicate a mysql row with PHP and MYSQL?
>
> --
> Jim Musil
> ---------
> Multimedia Programmer
> Nettmedia
> -------------
> 212-629-0004
> [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---

It appears that this is forbidden ...

 From mysql.com:

The target table of the INSERT statement cannot appear in the FROM 
clause of the SELECT part of the query because it's forbidden in ANSI 
SQL to SELECT from the same table into which you are inserting. (The 
problem is that the SELECT possibly would find records that were 
inserted earlier during the same run. When using sub-select clauses, 
the situation could easily be very confusing!)



>   I don't know if it is the best but here's an idea:
>
>INSERT INTO table SELECT ha, he, hi, ho, hu FROM table LIMIT 1;
>
>--
>
>Julio Nobrega
>
>Don't eat the yellow snow.
>
>
>"Jim" <[EMAIL PROTECTED]> wrote in message
>news:p0510100fb8318736de56@[192.168.1.17]...
>>
>>  What's the best way to duplicate a mysql row with PHP and MYSQL?
>>
>>  --
>>  Jim Musil
>>  ---------
>>  Multimedia Programmer
>>  Nettmedia
>>  -------------
>>  212-629-0004
>>  [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]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
  Well, I skiped this manual part :-)

  Maybe the simple select and insert is the simplest form.

--

Julio Nobrega

Don't eat the yellow snow.


"Jim" <[EMAIL PROTECTED]> wrote in message
news:p05101010b8318afec141@[192.168.1.17]...
>
> It appears that this is forbidden ...
>
>  From mysql.com:
>
> The target table of the INSERT statement cannot appear in the FROM
> clause of the SELECT part of the query because it's forbidden in ANSI
> SQL to SELECT from the same table into which you are inserting. (The
> problem is that the SELECT possibly would find records that were
> inserted earlier during the same run. When using sub-select clauses,
> the situation could easily be very confusing!)
>
>
>



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

I have a VB program which can download files from a web-site. The webserver
is running Apache where we use PHP scripting. That is all working OK. 

Now I want to let certain people upload data from their PC's. I don't want
to use FTP, because I don't want to hand out password's (also not in the
code we are distributing). Anonymous FTP is not possible.

I can upload files to the site from a browser, but I would to make it (very)
easy for people to upload their data: a number of them are not very familiar
with computers.

I have seen (www.google.com) references to uploading from VB to IIS servers,
but how about to Apache/PHP? I've tried some examples with the MicroSoft
Internet Control and "executing" the POST command, but the file would not
be uploaded (the PHP script did not get it anyway).

Should it be possible?
If so, can somebody point in the right direction/example?
If not, could somebody please explain why not?

Thanks in advance for your help,

henk sandkuyl

--- End Message ---
--- Begin Message ---

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

I've done this successfully both with PHP and VB/ASP. I think PHP is 
the easiest, but there are several things that could go wrong.

There is usually a 2MB limit to the file size and the safe mode 
setting also affects the outcome.

On the HTML side, you must include ENCTYPE=multipart/form-data in 
your <form> tag.

Once the file is uploaded (you can verify through phpinfo() command) 
you have to move it someplace. This can be tricky depending on how 
your server is set up. As a security, some servers do not allow 
scripts to save files.

One solution is to have your script open an ftp socket and put the 
file in the right place. This way, the script has the ftp password 
which should be kept secret from the user.


>Hello,
>
>I have a VB program which can download files from a web-site. The webserver
>is running Apache where we use PHP scripting. That is all working OK.
>
>Now I want to let certain people upload data from their PC's. I don't want
>to use FTP, because I don't want to hand out password's (also not in the
>code we are distributing). Anonymous FTP is not possible.
>
>I can upload files to the site from a browser, but I would to make it (very)
>easy for people to upload their data: a number of them are not very familiar
>with computers.
>
>I have seen (www.google.com) references to uploading from VB to IIS servers,
>but how about to Apache/PHP? I've tried some examples with the MicroSoft
>Internet Control and "executing" the POST command, but the file would not
>be uploaded (the PHP script did not get it anyway).
>
>Should it be possible?
>If so, can somebody point in the right direction/example?
>If not, could somebody please explain why not?
>
>Thanks in advance for your help,
>
>henk sandkuyl
>
>
>--
>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]


-- 
Jim Musil
---------
Multimedia Programmer
Nettmedia
-------------
212-629-0004
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
                  EDWARD LAWRENCE STRONG PRESENTS  

                 THE INSIDE  EDITION          
                        
                            Author: Edward L. Strong 
                         

                            Order your copy Now! 

                         Amazon .com
            
                                The Truth Told!          



This book tells the secrets of Millionaires.   Real Estate Finance, Credit 
Repair, Real Estate Investments and the list goes on.  " For additional 
information call 708-257-3258.  With the  purchase you receive a guaranteed 
line of credit  for $5,000 to help reestablish or establish your credit. 

  







--- End Message ---
--- Begin Message ---
>                  THE INSIDE  EDITION

  I thought it was out there?

--

Julio Nobrega

Don't eat the yellow snow.


<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]...
>                   EDWARD LAWRENCE STRONG PRESENTS
>
>                  THE INSIDE  EDITION
>
>                             Author: Edward L. Strong
>
>
>                             Order your copy Now!
>
>                          Amazon .com
>
>                                 The Truth Told!
>
>
>
> This book tells the secrets of Millionaires.   Real Estate Finance, Credit
> Repair, Real Estate Investments and the list goes on.  " For additional
> information call 708-257-3258.  With the  purchase you receive a
guaranteed
> line of credit  for $5,000 to help reestablish or establish your credit.
>
>
>
>
>
>
>
>
>


--- End Message ---
--- Begin Message ---

I started writing a set of scripts that would send out mutiple emails to a
list of customers.  I then realized that most likely this program, and/or
snipits had most likely already been written.  If so, can some one point me
in the right direction and save me 3 or 4 days?

Thanks

Nathan

Webmaster

M-Y Communications


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

I wonder if someone could point out what is wrong with the following
piece of code (taken directly from the 'PHP - fast & easy web
development' book) , which gives the following warning :

Warning: Supplied argument is not a valid MySQL result resource in
c:\program files\apache group\apache\htdocs\cms\pick_modcontact.php on
line 23

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$result = mysql_query($sql,$connection);    <--line 23

while ($row = mysql_fetch_array($result)) {
 $id = $row['id'];
 $fname = $row['fname'];
 $lname = $row['lname'];

 $option_block .= "<option value=\"$id\">$lname, $fname</option>";
}
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The mySQL query that is executed returns a result set when I use the
mySQL shell, and the connection string is valid. If someone could advise
me as to the error, I would greatly appreciate it.

- Best regards,

Lee

--- End Message ---
--- Begin Message ---
No reply required; I see the problem.

--- End Message ---
--- Begin Message ---
Is there a limit to the number of variables once can pass in a URL using urlencode()?  
I seem to be hitting a wall where the browser returns a page not found once I go past 
a limit and I can't find any bugs in the code.

Thanks,
Don
--- End Message ---
--- Begin Message ---
There is a limit to the size of a GET request - can't remember what it is
though
POST's can be any size however.

Maybe a search of the RFC's might tell you the limit of GET's
http://sunsite.dk/RFC/


-----Original Message-----
From: Don [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 9:03 AM
To: php list
Subject: [PHP] Using urlencode to pass varfiables in a URL


Is there a limit to the number of variables once can pass in a URL using
urlencode()?  I seem to be hitting a wall where the browser returns a page
not found once I go past a limit and I can't find any bugs in the code.

Thanks,
Don
--- End Message ---
--- Begin Message ---
Hi,
My company is looking into using the Zend Encoder to enforce
licensing of some tools that I'm developing and I have a few
questions that I hope someone who's used it can answer:

1) I understand that when you encode your files, they will stop
working when the zend license expires. how easy is it to get them
working again after you renew? do the pages need to be re-encoded
from source?

2) Will files encoded on a windows machine run on linux with the zend
optimizer?

3) are there any known problems with certain php modules (ming, gd,
mcal)

4) are there competing products I should be looking at?

thanks,
- Mark

--- End Message ---
--- Begin Message ---
SELECT * FROM mytable ORDER BY series,price;


-----Original Message-----
From: René Fournier [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 03, 2001 4:27 PM
To: [EMAIL PROTECTED]
Subject: MySQL ORDER BY or PHP Sort?


I want to select about 25 rows from a table, and sort them by two 
criteria. First, by each row's Series field ("Baby", "Genesis", "Super", 
"Predator", "Millennium" are the various Series, and the order I'd like 
the rows in the array). Within each Series, I'd like the rows sorted by 
their Price field, ascending. For example:

Baby $5
Baby $10
Baby $15
Genesis $20
Genesis $35
Genesis $50

...and so on.

Now, I know how to structure my MySQL Select statment such that the rows 
it pulls from the table will be either sorted by Price OR by Series, but 
not both, in the way I'd like. Does anyone know if it's possibly to do 
this in the Select statement itself? (I'd rather do it that way, than 
resort in PHP.)

Thanks!

...Rene

---
René Fournier
[EMAIL PROTECTED]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
--- End Message ---
--- Begin Message ---
Don't forget LIMIT 0,25 ("I want to select about 25 rows from a table...")

SELECT * FROM mytable ORDER BY series,price LIMIT 0,25

Mike

Rick Emery wrote:

>SELECT * FROM mytable ORDER BY series,price;
>
>
>-----Original Message-----
>From: René Fournier [mailto:[EMAIL PROTECTED]]
>Sent: Monday, December 03, 2001 4:27 PM
>To: [EMAIL PROTECTED]
>Subject: MySQL ORDER BY or PHP Sort?
>
>
>I want to select about 25 rows from a table, and sort them by two 
>criteria. First, by each row's Series field ("Baby", "Genesis", "Super", 
>"Predator", "Millennium" are the various Series, and the order I'd like 
>the rows in the array). Within each Series, I'd like the rows sorted by 
>their Price field, ascending. For example:
>
>Baby $5
>Baby $10
>Baby $15
>Genesis $20
>Genesis $35
>Genesis $50
>
>...and so on.
>
>Now, I know how to structure my MySQL Select statment such that the rows 
>it pulls from the table will be either sorted by Price OR by Series, but 
>not both, in the way I'd like. Does anyone know if it's possibly to do 
>this in the Select statement itself? (I'd rather do it that way, than 
>resort in PHP.)
>
>Thanks!
>
>...Rene
>
>---
>René Fournier
>[EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


--- End Message ---

Reply via email to