php-general Digest 5 Jan 2005 16:16:34 -0000 Issue 3210

Topics (messages 205647 through 205676):

Re: making FORM dissapear when successful login
        205647 by: JHollis

apache 1 vs 2 w/php
        205648 by: Sebastian
        205658 by: Lester Caine
        205667 by: Rasmus Lerdorf
        205669 by: Matthew Weier O'Phinney
        205672 by: Josh Whiting

XML File validation using PHP????
        205649 by: Brent Clements

Re: png.h not found, something's going wrong in my PHP installation
        205650 by: Curt Zirzow

Re: oscommerce
        205651 by: Curt Zirzow

Re: How to argue with ASP people...
        205652 by: Leif Gregory
        205660 by: Sagar C Nannapaneni
        205670 by: Ron Clark
        205673 by: Jay Blanchard
        205674 by: Ron Clark

Please help!
        205653 by: �{�@

php ignores php_value from httpd.conf?
        205654 by: Steve Kieu
        205662 by: Sebastian

SSL
        205655 by: gustav.varupiraten.se

Re: migrating to PHP 5 + Apache 2 from PHP 4.3.8 + Apache 1.3.33.
        205656 by: symbulos partners
        205663 by: Matthew Weier O'Phinney

Re: Apache Server with php
        205657 by: Lester Caine
        205659 by: Lester Caine

multiple deleting and updating raw mysql via php
        205661 by: Sejati Opreker
        205666 by: Jay Blanchard
        205668 by: Jason Barnett

Re: Persistent PHP web application?
        205664 by: electroteque

Re: Saving Files
        205665 by: Bogomil Shopov
        205675 by: Richard Davey
        205676 by: Richard Davey

PHP cacher?
        205671 by: Kimmo Alm

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 --- Thank you for your suggestion, but do you care to be more descriptive, maybe some examples would be nice. Can you tell my why the code i have doesnt work? I would love to use sessions, but i was just trying to get an understanding of how the basics work first.

Jonathan wrote:
I think you should use session control after checking for login.

"JHollis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

I had this code working the way i wanted it to (as far as correct
username and password allowing successful login)...but what i want to
happen now is when a user successfully logs it it will make the login
form disappear and just say successfully logged in or welcome user and a
link below it so they can log off and make the form re-appear.  Below is
the code that i have where i tried to get it to disappear on successful
login, but it stays disappeared all the time.  Can someone please point
out what im doing wrong.  I have tried everything i can think of...and
nothing works.  Im a PHP newbie...so im sure some of you might get a
laugh out of this...if it is real easy.

<---snippet


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> <html> <head> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container"> <div id="top"> <h1>header</h1>

</div>
<div id="leftnav">
<p>

<?php

$username=$_POST['username'];
$password=$_POST['password'];
$db="user";
$server="localhost";
$db_username="root";
$db_password="*******";

$connect = mysql_connect($server,$db_username,$db_password);
if (!$connect) {
die ("could not connect to database");
}
$select = mysql_select_db($db,$connect);
if (!$select) {
die ("could not select database $db");
}
 /*username='$username'";*/
$sql = "SELECT * FROM passwords, user_info where id=PID and
username='$username'";
$result = mysql_query($sql);
/*$num_rows = mysql_num_rows($result);*/
while ($user = mysql_fetch_array($result))
{
$id = $user['id'];
$username2 = $user['username'];
$password2 = $user['password'];
$firstname = $user['firstname'];
$email = $user['email_address'];


IF ($username=="$username2" && $password=="$password2") { echo("\"Welcome, <b>$firstname</b>\"");?><br><? echo ("\"Your email address is <b>$email<b>\"");?></td><tr> <a href="<?$_SERVER['PHP_SELF']?>?username=""&?password=""">Logoff</a><? break; } else { ?> <FORM action="<?$_SERVER['PHP_SELF']?>" method="post"> <INPUT type="hidden" name="id"> <table> <td><b>*</b>Username:</td> <td><INPUT class="input" size="8" type="text" name="username" value="<?echo $username?>"></td><tr> <td><b>*</b>Password:</td> <td><INPUT class="input" size="8" type="password" name="password"></td><tr> <td class="xsmall"><b>* Case Sensitive</b></td> <td><INPUT type="submit" value="Login"></td><tr> <td>&nbsp </td> </table> </FORM> <?

break;
}

}
//IF ($username != $username2 || $password != $password2) {//



?><br>
<?
if  ($username == "" && $password == "") {
echo ("Please type in a Username and Password");}

if  ($username != "" && $password == "") {
echo ("Please type in a password");}

if  ($username == "" && $password != "") {
echo ("Please type in a username and password");}

?>


</p> </div> <?if (($username2==$username && $password2==$password) && ($username2!="" || $password2!="")){?> <div id="rightnav" class="box"> <p> </p> </div> <?}?> <div id="content"> <h2>Subheading</h2> <p> </p> <p> </p> </div> <div id="footer"> <p> Today is <?php echo( date("F dS Y.")); ?> </p> </div> </div> </body> </html> ---->snippet

--- End Message ---
--- Begin Message ---
I am undecided whether to upgrade to apache 2 (currently running 1.3.33)
I've heard some bad stuff (some good maybe) about using apache 2 with php..
does anyone have an opinions?

I know everything has cons/pros but i am just looking for advice on whether
my site will benifit from the upgrade. I'm curious to know if a site that
normally sees 300-500 users online would see any improvements.

any on going issues? is php faster/slower? downsides? advantages? anything
in general that can help me decide.

thanks.

--- End Message ---
--- Begin Message ---
Sebastian wrote:

I am undecided whether to upgrade to apache 2 (currently running 1.3.33)
I've heard some bad stuff (some good maybe) about using apache 2 with php..
does anyone have an opinions?

General opinion is if Apache1 is working stick with it. I'm using Apache2 and never installed Apache1 so can't compare. The main development effort is focused only on Apache1 support though.


I know everything has cons/pros but i am just looking for advice on whether
my site will benifit from the upgrade. I'm curious to know if a site that
normally sees 300-500 users online would see any improvements.

That would be nice information to find out, but does not seem to be available.


any on going issues? is php faster/slower? downsides? advantages? anything
in general that can help me decide.

If you have a working Apache1 setup leave it alone for the time being. And watch out for movement, perhaps next year?


--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message --- Lester Caine wrote:
Sebastian wrote:
I know everything has cons/pros but i am just looking for advice on whether
my site will benifit from the upgrade. I'm curious to know if a site that
normally sees 300-500 users online would see any improvements.

That would be nice information to find out, but does not seem to be available.

If you are serving up a lot of static file, you will see an improvement. If it is all dynamic PHP requests, then you won't. Apache really doesn't have much to do on a PHP request so all the performance depends on the speed of PHP, not Apache. There are a few places where Apache2 has improved things for a PHP request, but these tend to be countered by a few places where things have gotten ore expensive. Every benchmark I have done puts PHP under Apache2 right in the same ballpark as PHP under Apache1 with Apache1 usually a little bit ahead. But do your own testing on your own platform. Other peoples' benchmarks are meaningless.


-Rasmus
--- End Message ---
--- Begin Message ---
* Sebastian <[EMAIL PROTECTED]>:
> I am undecided whether to upgrade to apache 2 (currently running 1.3.33)
> I've heard some bad stuff (some good maybe) about using apache 2 with php..
> does anyone have an opinions?
>
> I know everything has cons/pros but i am just looking for advice on whether
> my site will benifit from the upgrade. I'm curious to know if a site that
> normally sees 300-500 users online would see any improvements.
>
> any on going issues? is php faster/slower? downsides? advantages? anything
> in general that can help me decide.

This study might help you make up your mind:

    http://ilia.ws/archives/32-Apache-1-vs-Apache-2-Performance.html

In summary: apache2 is faster for static content, but slower at serving
PHP; additionally, if using the prefork version of apache2 (which you
need to do to keep PHP stable), much of your performance boost for
static content will be lost. Your best bet: stick with apache1 if using
PHP heavily.

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

--- End Message ---
--- Begin Message ---
> I am undecided whether to upgrade to apache 2 (currently running 1.3.33)
> I've heard some bad stuff (some good maybe) about using apache 2 with php..
> does anyone have an opinions?

a somewhat interesting discussion on the subject was recently on
slashdot, i suggest reading at least the blog entries linked in the main
story blurb: http://slashdot.org/apache/04/12/21/1837209.shtml

the "bad stuff" you're referring to is the threading problem, which is
completely solved if you just use the "prefork" MPM in apache 2, which
AFAIK is the default on linux.  not sure about Win32.

as for a performance improvement... it isn't hard to setup apache 2 on
the same server as apache 1 listening on a different port, then do
benchmarks and see for yourself.

/jw

--- End Message ---
--- Begin Message ---
We are running PHP 4.3.2 

Is there a class out there that can validate an xml file against a schema?

I know in PHP 5+ that the dom package includes simple validation
function, but until we upgrade, that's not an option.

Can anybody point me in the write direction?

I want something simple to where I can:

<?php

include "xmlvalidator.class.php";

$xmlvalidator = new xmlvalidator();
$xmlvalidator->xmlfile('/foolocation/foo.xml');
$xmlvalidator->schemafile('/foolocation/foo.xsd');
echo $xmlvalidator->validate();
?>


If there is someting out there similiar that'd be great, if not can
someone please explain to me the basics of validating xml against a
schema file?

Thanks,
Brent

--- End Message ---
--- Begin Message ---
* Thus wrote Richard Lynch:
> Curt Zirzow wrote:
> > * Thus wrote Aaron Paulley:
> >> I found a thread a couple of weeks ago where someone had to create
> >> symbolic links in order to get their install of PHP to work because
> >> PHP wasn't able to find png.h.
> >
> > A reference to that thread could be helpfull.
> 
> http://marc.theaimsgroup.com/?l=php-general&m=110288456229253&w=2

The symlinc'ing this is doing makes sense.  According to your
original post you had png.h in your /usr/lib directory wich doesn't
make sense.


Curt
-- 
Quoth the Raven, "Nevermore."

--- End Message ---
--- Begin Message ---
* Thus wrote Ahmed Abdel-Aliem:
> hi
> i have a site using oscommerce script, 
> i made some modifications but i am stuck with a variable there.
> i can't describe it here cause no one will understand what i mean, so
> is there any one familiar with oscommerce , so he can guide me, it
> won't take more than 5 minutes
> if yes plz add me to msn messenger with [EMAIL PROTECTED] or yahoo msn
> with ID me2resh

You might want to research or ask a question on ths oscommerce
forum.


Curt
-- 
Quoth the Raven, "Nevermore."

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

Tuesday, January 4, 2005, 10:28:18 AM, you wrote:
RL> Or am I mis-remembering the horrors of ASP? It's been awhile since
RL> I've used it, and you don't have enough money to make me use it
RL> again.

You're telling me!!! <grin> I wrote three, count 'em, all of three ASP
database front ends before I'd even heard of PHP. I then got into PHP
and just a month ago I was asked to make a few changes to one of those
ASP apps I did a cpl years back and I sat there staring at the code
going "Where the H*ll did all the opening and closing curly braces
go?" I can't tell where a while statement ends and a for loop begins.

It actually took me a while of staring at it before anything started
coming back to me. After I made the changes, I just felt, well, so
dirty.... ;-)


Cheers,
Leif Gregory 

-- 
TB Lists Moderator (and fellow registered end-user)
PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
Web Site <http://www.PCWize.com>

--- End Message ---
--- Begin Message ---
Ya..

I just had an argument with my collegue (who is ASP programmer).
He said that in ASP he can use a global variable to store the counter and
then
when the IIS is shutting down he can grab that event and dump the counter
variable
to a text file. I just betted him that i can also do that with PHP.

/sagar
----- Original Message -----
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Sagar C Nannapaneni" <[EMAIL PROTECTED]>;
<[email protected]>
Sent: Tuesday, January 04, 2005 10:12 PM
Subject: Re: [PHP] How to argue with ASP people...


> --- Sagar C Nannapaneni <[EMAIL PROTECTED]> wrote:
> > But just 2 days ago i came along a situation where i have to
> > write a hit counter for my website without using a database
> > or a text file. Just using a global variable i wanted to do
> > this.
> >
> > I dont know whether php can do this...(or may b i missed it
> > out)...but i couldnt get any equivalent thing in php like we
> > have GLOBAL.ASA in ASP.
>
> If GLOBAL.ASA isn't considered a text file, then you can probably use
> SQLite. Just don't call it a database. :-)
>
> What sort of situation did you encounter where you were required to
> persist data without the two primary means of doing so? You can persist
> data in memory, I guess, depending on how permanent you need this to be -
> your hit counter would be reset when the server reboots. It could be like
> the high scores on an arcade machine. :-)
>
> Chris
>
> =====
> Chris Shiflett - http://shiflett.org/
>
> PHP Security - O'Reilly     HTTP Developer's Handbook - Sams
> Coming Soon                 http://httphandbook.org/
>
>

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



On Tue, 4 Jan 2005, Richard Davey wrote:

> Hello Ron,
>
> Tuesday, January 4, 2005, 5:59:31 PM, you wrote:
>
> RC> You then do <%=filen%> to go back into ASP to get the value of the
> RC> variable into the HTML code that you wrote. ASP is not including the file,
> RC> it is only supplying a file name for SSI includes whether apache SSI or
> RC> IIS SSI. The server parsing the HTML recognizes the HTML comment is
> RC> sentax for server side include and includes the suppplied file name.
>
> Perhaps this is a better example for you:
>
> script1.asp
> <%
>   StrName = "bob"
> %>
>
> script2.asp
> <!--#include file="script1.asp"-->
> <%
>   Response.Write "Hello " & StrName
> %>
>
> Clearer now? I understand what you're saying perfectly, but in the
> context of ASP scripts I am afraid it's wrong.
>
> Best regards,
>
> Richard Davey
> --

With this new example you are still using SSI from the web server to
include an ASP file. ASP itself is not including the file.

--- End Message ---
--- Begin Message ---
[snip]
...stuff...
[/snip]

I think we can all agree that PHP and ASP can do the same things, so the
one glaring difference is COST. An efficient Apache / PHP server can be
set up for much less than an IIS / ASP server, even if you take the same
'box' to do it with. Given the same 'box' you will find the Apache / PHP
server to be much more efficient.

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

On Wed, 5 Jan 2005, Jay Blanchard wrote:

> [snip]
> ...stuff...
> [/snip]
>
> I think we can all agree that PHP and ASP can do the same things, so the
> one glaring difference is COST. An efficient Apache / PHP server can be
> set up for much less than an IIS / ASP server, even if you take the same
> 'box' to do it with. Given the same 'box' you will find the Apache / PHP
> server to be much more efficient.
>

I totally agree and would add more secure

--- End Message ---
--- Begin Message ---
To whom it may concern,
When I worte php for ldap_search(), It always shows the warning 
message:"Warning: ldap_search(): Search: Operations error "...
My server is windows 2003 with AD.
I have seen one solution on the network, they said that I should add 
"ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);"
in my code if I used windows 2003 with AD. 
I did it. But the warning message is still the same.
What should I do?
Please help me to deal this solution.
Thank you so so so much....:)

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

I am trying to debug the problem I have; which is that php seems to ignore all php_value I set in httpd.conf. Example I have:

<VirtualHost 10.0.44.254:800>
DocumentRoot /var/www/webssl
<Directory "/var/www/webssl">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    php_value upload_max_filesize "20M"
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

but when I access http://10.0.44.254:800/some_upload.php
it still sees that the file upload size if 2M (set in global php.ini). If I comment out in php.ini; it doesn't have a value at all.
Is it a bug in apache or php or I missed something when compiling them?
apache-1.3.33 PHP 4.3.10.


Kind regards,

S.KIEU
--- End Message ---
--- Begin Message ---
hmm i never even knew you can put that in there.. i always used .htaccess or
in the php.ini
i've never seen anyone do it in the httpd.conf.

also you shouldn't quote the value.. you might also need to increase
post_max_size

----- Original Message ----- 
From: "Steve Kieu" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, January 04, 2005 1:48 PM
Subject: [PHP] php ignores php_value from httpd.conf?


> Hi,
>
> I am trying to debug the problem I have; which is that php seems to
> ignore all php_value I set in httpd.conf. Example I have:
>
> <VirtualHost 10.0.44.254:800>
> DocumentRoot /var/www/webssl
> <Directory "/var/www/webssl">
>      Options Indexes FollowSymLinks MultiViews
>      AllowOverride All
>      php_value upload_max_filesize "20M"
>      Order allow,deny
>      Allow from all
> </Directory>
> </VirtualHost>
>
> but when I access http://10.0.44.254:800/some_upload.php
> it still sees that the file upload size if 2M (set in global php.ini).
> If I comment out in php.ini; it doesn't have a value at all.
> Is it a bug in apache or php or I missed something when compiling them?
> apache-1.3.33 PHP 4.3.10.
>
> Kind regards,
>
> S.KIEU
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
Hi there!

Thinking of going from http to https on the server. My question is: Would
there be any differences in my php-code from now?

/G
@varupiraten.se

--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
> If you re-read the previous emails from Rasmus, you will find that these
> questions are already answered within them.
> 
> So I'm going to go on at length here telling you (again) what you don't
> want to hear.

In my opinion, the answer "some libraries are thread safe, some are not" is
generic. The answer "the libraries in chapter VI. Function Reference of
official PHP Manual version 03-01-2005" is specific. Now I think I
understand the answer a bit better.

We did not understand if you were talking about the libraries we develop,
the libraries you develop, the libraries everybody else develops,
commercial libraries, whatever library you can think of. Not
all the libraries are indeed listed in the manual.

I apologise for being stupid and hard of understanding.

> If you can narrow your focus down a bit from *ALL* of Section VI to *just*
> the libraries you *really* need, you might get the answer you want to
> hear: "Oh, those are all thread-safe."

Here some more specific questions.

1)Is the core of php thread safe? That is, are the function which do not
need external libraries thread safe?

2)Here is the list of the function sets we need to use, from Section VI

Apache-specific Functions
Array Functions
Calendar Functions
Class/Object Functions
CURL, Client URL Library Functions
Cyrus IMAP administration Functions
Date and Time Functions
Direct IO Functions
Directory Functions
DOM Functions
DOM XML Functions
Error Handling and Logging Functions
File Alteration Monitor Functions
Filesystem Functions
Forms Data Format Functions
FTP Functions
Function Handling Functions
Gettext
GMP Functions
HTTP Functions
Image Functions
IMAP, POP3 and NNTP Functions
PHP / Java Integration
LDAP Functions
Mail Functions
Mathematical Functions
Multibyte String Functions
Mimetype Functions
Miscellaneous Functions
MySQL Functions
Improved MySQL Extension
Network Functions
Unified ODBC Functions
Object Aggregation/Composition Functions
Object property and method call overloading
OpenSSL Functions
Output Control Functions
PDF functions
PHP Options&Information
PostgreSQL Functions
Program Execution Functions
Session Handling Functions
Shared Memory Functions
SimpleXML functions
SQLite
Shockwave Flash Functions
Standard PHP Library (SPL) Functions
String Functions
URL Functions
Variable Functions
vpopmail Functions
XML Parser Functions
XML-RPC Functions
XSL functions
XSLT Functions

We would like to know if they are thread safe to a level which is suitable
for production environment.

3)Are there internal mechanisms in php for protecting thread safety (memory
leak, threads overwriting memory in use by another thread, blah, blah)?

We hope these questions are specific enough.
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

--- End Message ---
--- Begin Message ---
* Symbulos Partners <[EMAIL PROTECTED]>:
> Richard Lynch wrote:
> > If you re-read the previous emails from Rasmus, you will find that these
> > questions are already answered within them.
> > 
> > So I'm going to go on at length here telling you (again) what you don't
> > want to hear.
>
> In my opinion, the answer "some libraries are thread safe, some are not" is
> generic. The answer "the libraries in chapter VI. Function Reference of
> official PHP Manual version 03-01-2005" is specific. Now I think I
> understand the answer a bit better.
>
> We did not understand if you were talking about the libraries we develop,
> the libraries you develop, the libraries everybody else develops,
> commercial libraries, whatever library you can think of. Not
> all the libraries are indeed listed in the manual.

The thing is, the function sets listed in Section VI are not all 'core' PHP
-- in other words, if you were to do a vanilla install of PHP on a
machine, you wouldn't necessarily get all of these functions. Why?
Because most of the sets rely on... drum roll here... external
libraries. And it is the external libraries that PHP cannot guarantee
are threadsafe.

As an example of some function sets requiring external libraries:
<snip>
> 2)Here is the list of the function sets we need to use, from Section VI
>
> Calendar Functions

Depends on libical

> CURL, Client URL Library Functions

Depends on libcurl

> Cyrus IMAP administration Functions

Depends on cyrus imap libraries

> DOM Functions
> DOM XML Functions

Depends on libxml

> Image Functions

Depends on GD, which has optional dependencies on libjpeg, libpng,
libungif...

> IMAP, POP3 and NNTP Functions

Depends on uw-imap cclient

> LDAP Functions

Depends on openldap libraries

I could keep going on, but hopefully you get the idea.

So, what Rasmus and Richard were saying is, if you can narrow down
*which* function sets you need and are compiling in to your PHP install,
you'll get a much better answer to the question of whether or not the
libraries you're utilizing with PHP are threadsafe. But just saying all
functions referenced in the manual is going to give you the answer,
"probably not."

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

--- End Message ---
--- Begin Message ---
John Nichel wrote:

Bruce Douglas wrote:

richard...

i'm not sure of the email/list name.. but there is an apache email list.. if you get to the apache.org site.. they could help you.. they're actually pretty good.. sorry i don't have the name right at my fingers right now!!

good luck...

http://httpd.apache.org/lists.html

Who will refer Richard here - because he needs to set up PHP so it can actually be run?


Richard take a look at the first half of
http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_beginners_php
It covers Apache2, PHP5 and Windows - just ignore the Firebird bits ;)

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message ---
Lester Caine wrote:

It covers Apache2, PHP5 and Windows - just ignore the Firebird bits ;)
*PHP4* - I need to update it for PHP5 ;)

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message ---
Hi all,
I meet a problem when I want to deleting a multiple
row, I have a table that contain columns UserID, name,
company name, and bill. UserID is uniq.
perhaps, some of UserID, say it five UserID I have to
delete, how to delete all raw that contain that UserID
? and if I want to update bill of a users (multiple
user) that data of users taking from a file ( so the
file contain user UserId and bill), how to make it ?

Thanks,

Aji


                
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message ---
[snip]
I meet a problem when I want to deleting a multiple
row, I have a table that contain columns UserID, name,
company name, and bill. UserID is uniq.
perhaps, some of UserID, say it five UserID I have to
delete, how to delete all raw that contain that UserID
? and if I want to update bill of a users (multiple
user) that data of users taking from a file ( so the
file contain user UserId and bill), how to make it ?
[/snip]

Are you looking for a query to do this? If I understand you correctly

DELETE FROM `table` WHERE `UserID` = 'five';

UPDATE `table` SET `bill` = [data] WHERE `UserID` = 'five';

These are database questions and are best asked on a database list.

--- End Message ---
--- Begin Message --- Please do not spam the list. John sent you to the MySQL list as they are better to handle MySQL query questions. If you have a question about how to execute your specific query then you can refer to the PHP manual:

http://php.net/manual/en/function.mysql-query.php

--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

--- End Message ---
--- Begin Message ---
On 05/01/2005, at 2:39 PM, Rasmus Lerdorf wrote:


You are correct, serialization tends to be the bottleneck when it comes to restoring large data structs. So you either avoid recreating the data structure and just use the data directly, or use an in-process mechanism like apc_store/apc_fetch which does a straight memcpy and doesn't need top serialize. Of course, this still doesn't match writing your own extension to manage your persistent data directly without needing to shuffle it around back and forth between process and shared memory.



Extensions to me are a black art, I am looking into this realm for a nice way of storing persistant objects in memory. Currently I have a method that includes the class file, serialize the class object into a session, unserialize when needed. I can also add dynamic arguments to it. Of course this is not useful for db objects.

--- End Message ---
--- Begin Message ---
Hello
Yes you can do that. Please follow the steps:

header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
readfile('original.pdf');

 Bogomil
http://purplerain.org


[EMAIL PROTECTED] wrote:
> Hi all.
> 
> Note, this may be a bit off topic.
> 
> With that said... I am wanting to save a file off my website to a certain 
> location on my computer. Is there a way to click on a button (or something) 
> and that invokes the download, which then saves to (for example) 
> C:\SomePlace\Directory\Pizza\sausage.txt?
> 
> The whole process:
> 1. User uploads from a specific location (that I already know)
> 2. Modifies the file via the web
> 3. Saves/downloads the file to that exact location as pulled from and 
> replaces the old file
> 
> It seems as though this can be done but I have not found a way to do it, and 
> I have searched a lot. Any thoughts on how to?
> 
> Thanks in advance,
> ~Philip

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

Wednesday, January 5, 2005, 8:41:05 AM, you wrote:

gvs> It works very well saving an uploaded file to a specific
gvs> destination? It's basically what Richard wants to do? The
gvs> replacement of the file is automatically done if no options is
gvs> specified in some way to not overwrite in the filesystem...?

He said he wanted to upload the file from his PC, have it modified on
the server via PHP and then saved again on his local PC, over-writing
the original file on the PC with the new modified version.

You cannot do that, you just don't have that level of control over the
browser. The best you could hope for would be to prompt the user to
"Please save this over your original" and hope they do.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

--- End Message ---
--- Begin Message ---
Hello Philip (please email the PHP list directly, not me personally),

Wednesday, January 5, 2005, 4:01:15 PM, you wrote:

PT> Ok, I have another question. Would I be able to execute a batch file
PT> (or something) upon the user hitting a button, which would then save
PT> the file to the specified location?

You could have a button on your web page that when clicked would start
to download a file. However the second your PHP script sends the file
to the browser you are handing over all control regarding how the file
is saved (and where) to the browser. You cannot influence or modify
this behaviour - you send the file to the browser, the browser
takes over from there.

PT> It seems as though this can be done because viruses tend to do it all
PT> the time - you click on a link or open an email attachment which causes
PT> a .exe or .bat file to run. Now I hate relating what I want to do with
PT> a virus, but that's how I can most closely relate it.

Sure.. but that is totally outside the confines of a web browser. Even
if you did click a link on a web page (that linked to a virus EXE) all
you are really doing is sending that exe to the browser. What then
happens with it is us to the user/browser configuration and is out of
your control.

If the user is dumb enough to have their browser automatically run any
EXE file they download without prompting - well, that is another
problem altogether and one PHP could never hope to fix
(mod_brain_replacement perhaps?)

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

--- End Message ---
--- Begin Message ---
Hello!

I've been looking for some PHP cache software for a while now, and I just can't seem to find one suitable for my setup.

I run PHP 5.x on FreeBSD 4.x with Apache 2.x. I don't particularly fancy the Linux compability, but rather would prefer a native solution.

It must be free (no charge)...

PS: How come that this isn't included in PHP itself, just as there's mod_deflate for Apache 2?

// Kimmo Alm.
--- End Message ---

Reply via email to