php-general Digest 1 Nov 2002 18:19:05 -0000 Issue 1679

Topics (messages 122384 through 122438):

PHP-GTK 0.5.2 released
        122384 by: Andrei Zmievski

Re: Displaying Data of a MySQL Table in PHP
        122385 by: Jason Wong

php development environment
        122386 by: Simon Taylor
        122392 by: Jason Wong
        122400 by: . Edwin
        122403 by: . Darwin

client-side zip of POST or GET data, auto unzip on server.
        122387 by: Petre Agenbag
        122398 by: . Edwin
        122401 by: Petre Agenbag

Re: counting clicks on a flash ad
        122388 by: James Redfern

New Server advice
        122389 by: David Russell
        122391 by: John Nichel
        122396 by: . Edwin

Require_once problem
        122390 by: Kerry Kobashi
        122399 by: Kerry Kobashi
        122404 by: . Darwin
        122424 by: Ford, Mike               [LSS]

Simple Problems taking me hours to solve!
        122393 by: Steve Jackson
        122395 by: Petre Agenbag
        122408 by: Petre Agenbag

Re: ^M at the end of each line when I use php to write file
        122394 by: Gerard Samuel

xml parser breaking on legal xml chars
        122397 by: Gerard Samuel

Re: why does eregi match for whitespace when there is none?
        122402 by: Erwin

Apache Installation Problem
        122405 by: Ramesh Pillai
        122409 by: Jason Wong

Array solution...
        122406 by: Davíð Örn Jóhannsson
        122407 by: Jason Wong

Need help with regexp for preg_split
        122410 by: David Brannlund

Serverside script
        122411 by: Davíð Örn Jóhannsson
        122412 by: Petre Agenbag
        122413 by: John W. Holmes

Get shipping problem continued!
        122414 by: Steve Jackson
        122420 by: Michael T. Babcock

php4 Mac OSX
        122415 by: Pierre Vaudrey
        122425 by: Matt T. Galvin
        122431 by: Pierre Vaudrey
        122434 by: Matt T. Galvin

Cookies
        122416 by: Shaun
        122417 by: Shaun

how to avoid security thread when user able to press back button?
        122418 by: James Ting

Help please.
        122419 by: Steve Jackson
        122421 by: Jason Wong

String Expression for aplpahnumeric password
        122422 by: Adam

PHP & WebDAV
        122423 by: GC

OT - mysql question...
        122426 by: Kelly Meeks
        122428 by: John Nichel

phpinfo
        122427 by: David Russell

How do I check if a checkbox has been checked?
        122429 by: DonPro
        122430 by: John Nichel
        122432 by: Tom Woody

search
        122433 by: samug
        122435 by: Robert Cummings
        122436 by: John Nichel

Re: Who can tell me where I can get the cracked Zend Encoder3.0 ?
        122437 by: Steve Keller
        122438 by: Liam.Gibbs.dfait-maeci.gc.ca

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 ---
To all crazy users of PHP-GTK,

Version 0.5.2 has been released (after a half a year hiatus). This
release has some bug fixes and also some minor feature enhancements,
mostly in the graphics area.

Download the releaes from;

        http://gtk.php.net/download.php

Version 0.5.2 "Bass does a body good" 01-Nov-2002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    - simplified GdkPixbuf constructor parameters. (Andrei)
    - fixed setting of tile/stipple/clip_mask/bg_pixmap properties of
      GdkGC. (Andrei)
    - implemented GdkPixbuf::fill(). (Andrei)
    - changed failure to allocate color to output only a notice instead
      of a warning. (Andrei)
    - made depth parameter of GdkPixmap constructor optional. (Andrei)
    - added copy_area() method for drawables. (Andrei)
    - added group() and set_group() methods for
      GtkRadioButton/GtkRadioMenuItem. (Andrei)
    - added GDK functions pointer_grab(), pointer_ungrab(),
      keyboard_grab(), keyboard_ungrab(). (Andrei)
    - added utf8 support to GtkRadioButton, GtkToggleButton,
      GtkCheckMenuItem, and GtkCheckButton. (Frank)
    - fixed a crash bug when using non-string variables to access
      overloaded object's properties. (Andrei)
    - fixed a crash bug in GtkCheckButton constructor. (Andrei)

Enjoy,

-Andrei                                       http://www.gravitonic.com/
* Reality isn't all it's cracked up to be. *
--- End Message ---
--- Begin Message ---
On Friday 01 November 2002 14:14, Ben C. wrote:
> I want to create a table in PHP with data from a MySQL database table.  Can
> someone please help with a sample script.  I know this is probably easy but
> I need quick help.  I searched the archives and couldn't find something
> this simple.

google -> "mysql php tutorial"

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

/*
Mother told me to be good but she's been wrong before.
*/

--- End Message ---
--- Begin Message ---
Hi All,
Does anyone know if there is a good php development environment around, you
know something that will hold a list of functions/classes so you don't have
to scroll through thousands of line of code looking for a few lines of
spurious code...and all the other goodies that come with that sort of
thing.. At the moment I use homesite which is pretty cool and makes all me
lines come out in pretty colours, but I am getting frustrated as things are
growing..
Thanks..
_____________________________________
Simon Taylor
AfriTol (Pty) Ltd.
--- End Message ---
--- Begin Message ---
On Thursday 31 October 2002 18:34, Simon Taylor wrote:
> Hi All,
> Does anyone know if there is a good php development environment around, you
> know something that will hold a list of functions/classes so you don't have
> to scroll through thousands of line of code looking for a few lines of
> spurious code...

Maguma Studio

> and all the other goodies that come with that sort of
> thing.. 

Biggest downside to it is that it doesn't manage your projects. 

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

/*
        "You've got to think about tomorrow!"
        "TOMORROW!  I haven't even prepared for *_________yesterday* yet!"
*/

--- End Message ---
--- Begin Message ---
Hello,
(B
(B"Simon Taylor" <[EMAIL PROTECTED]> wrote:
(B> Hi All,
(B> Does anyone know if there is a good php development environment around,
(Byou
(B
(BZend Studio ?
(Bhttp://www.zend.com/store/products/zend-studio.php
(B
(B- E
(B
(B...[snip]...
--- End Message ---
--- Begin Message ---
I use the Maguma Studio environment (http://www.maguma.com/). It features
some pretty little colors in the code too. It also makes it easy to find
what you need from all your classes and other files in a convenient style,
and it is almost totally customizable. You can even customize PHP and HTML
tags and variables, etc. Not to forget that all lines are numbered and it
has a find feature. It has it's own browser that acts like IE's browser to
test your scripts while you write them. It also has an autocomplete feature
(kind of like with Interdev). Give it a try, I'm sure you'll like it. I like
it better than Homesite, Dreamweaver, Interdev or lower-end environments.

-- Darwin

> -----Original Message-----
> From: Simon Taylor [mailto:simon.taylor@;afritol.co.za]
> Sent: Thursday, October 31, 2002 4:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php development environment
>
>
> Hi All,
> Does anyone know if there is a good php development environment
> around, you
> know something that will hold a list of functions/classes so you
> don't have
> to scroll through thousands of line of code looking for a few lines of
> spurious code...and all the other goodies that come with that sort of
> thing.. At the moment I use homesite which is pretty cool and makes all me
> lines come out in pretty colours, but I am getting frustrated as
> things are
> growing..
> Thanks..
> _____________________________________
> Simon Taylor
> AfriTol (Pty) Ltd.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hi
I'm wondering if something like this will be possible.

I am correct in thinking that POST and GET data are sent as plain text?
And, that being plain text, they should probably be highly compactable
by zip utils?

The reason I'm thinking this route is that I have a couple of forms for
some client websites that are particularly large, some of the POST data
sent are more than 2 MB, but obviously it can vary depending on the
amount of data entered by the user ( I cannot limit this, as these forms
are assessment forms, and they need to contain all relevant info,
regardless of size ).
All fields are text fields.

So, what happens now is that for some users on slow connections, these
forms can either take years or they simply time out every time.

Being a specific application with controlled number of users, I wouldn't
think it bad practise to force the user to install a "zip" package on
his pc; that's to say if it would be possible to write some client side
script (JS?) that will receive the form data, zip it, then send the
zipped packet via POST or GET as per usual to the server, where, upon
receipt, the POST package is "unzipped" and the handled as per usual.

Would something like this be possible or feasible at all? Are there
other better ways to accomplish this?

Thanks



--- End Message ---
--- Begin Message ---
Hello,
(B
(B"Petre Agenbag" <[EMAIL PROTECTED]> wrote:
(B> Hi
(B> I'm wondering if something like this will be possible.
(B>
(B> I am correct in thinking that POST and GET data are sent as plain text?
(B
(BNot always. (POST -> SSL)
(B
(B> And, that being plain text, they should probably be highly compactable
(B> by zip utils?
(B
(BNot really sure how you can do this...
(B
(B> The reason I'm thinking this route is that I have a couple of forms for
(B> some client websites that are particularly large, some of the POST data
(B> sent are more than 2 MB, but obviously it can vary depending on the
(B> amount of data entered by the user ( I cannot limit this, as these forms
(B> are assessment forms, and they need to contain all relevant info,
(B> regardless of size ).
(B> All fields are text fields.
(B
(B2MB of TEXT? If my calculation is correct hat would be over 2 million
(Bcharacters! I'm sure you can limit the size depending on when and where they
(Benter "relevant info".
(B
(B> So, what happens now is that for some users on slow connections, these
(B> forms can either take years or they simply time out every time.
(B
(BI'm afraid so...
(B
(B> Being a specific application with controlled number of users, I wouldn't
(B> think it bad practise to force the user to install a "zip" package on
(B> his pc; that's to say if it would be possible to write some client side
(B> script (JS?) that will receive the form data, zip it, then send the
(B
(BI don't think this is possible.
(B
(B> zipped packet via POST or GET as per usual to the server, where, upon
(B> receipt, the POST package is "unzipped" and the handled as per usual.
(B
(BHow?
(B
(B> Would something like this be possible or feasible at all? Are there
(B> other better ways to accomplish this?
(B
(BI think it'd be better to divide your form(s) in different sections and POST
(Bdata in smaller units. Or, perhaps, you can just ask them to (1) create a
(Btext file (better if it's XML) then (2) zip it if it's big and then (3)
(Bupload them to the server.
(B
(BThen, perhaps, you can write a script that would parse the file and do
(Bwhatever is needed. (Unzip it first if necessary.)
(B
(BJust an idea...
(B
(B- E
--- End Message ---
--- Begin Message ---
Hi
Yes, I thought your last comment would also be "doable", but it would be
nice to have this zipping done on the user' behalf. The whole reason why
I *think* this is possible, is because you can unzip and process the
data on the server side in an automatic way, so it *should* be possible
to do this on client side as well, I just don't know how...
Something like a "zip-wrapper" for form data, or any data for that
matter...

Hope someone else can shed some ideas???

On Fri, 2002-11-01 at 10:56, @ Edwin wrote:
> Hello,
> 
> "Petre Agenbag" <[EMAIL PROTECTED]> wrote:
> > Hi
> > I'm wondering if something like this will be possible.
> >
> > I am correct in thinking that POST and GET data are sent as plain text?
> 
> Not always. (POST -> SSL)
> 
> > And, that being plain text, they should probably be highly compactable
> > by zip utils?
> 
> Not really sure how you can do this...
> 
> > The reason I'm thinking this route is that I have a couple of forms for
> > some client websites that are particularly large, some of the POST data
> > sent are more than 2 MB, but obviously it can vary depending on the
> > amount of data entered by the user ( I cannot limit this, as these forms
> > are assessment forms, and they need to contain all relevant info,
> > regardless of size ).
> > All fields are text fields.
> 
> 2MB of TEXT? If my calculation is correct hat would be over 2 million
> characters! I'm sure you can limit the size depending on when and where they
> enter "relevant info".
> 
> > So, what happens now is that for some users on slow connections, these
> > forms can either take years or they simply time out every time.
> 
> I'm afraid so...
> 
> > Being a specific application with controlled number of users, I wouldn't
> > think it bad practise to force the user to install a "zip" package on
> > his pc; that's to say if it would be possible to write some client side
> > script (JS?) that will receive the form data, zip it, then send the
> 
> I don't think this is possible.
> 
> > zipped packet via POST or GET as per usual to the server, where, upon
> > receipt, the POST package is "unzipped" and the handled as per usual.
> 
> How?
> 
> > Would something like this be possible or feasible at all? Are there
> > other better ways to accomplish this?
> 
> I think it'd be better to divide your form(s) in different sections and POST
> data in smaller units. Or, perhaps, you can just ask them to (1) create a
> text file (better if it's XML) then (2) zip it if it's big and then (3)
> upload them to the server.
> 
> Then, perhaps, you can write a script that would parse the file and do
> whatever is needed. (Unzip it first if necessary.)
> 
> Just an idea...
> 
> - E

--- End Message ---
--- Begin Message ---
On Fri, 01 Nov 2002 12:45:45 +1000, [EMAIL PROTECTED] (Justin
French) wrote in <[EMAIL PROTECTED]>:

¦ Looks to me like you've named your directory:
¦ /phpadsnew/ 
¦ 
¦ And looks to me like it's look for:
¦ /phpAdsNew/
¦ 
¦ Perhaps try that simple change and see what happens?

Oh god, I wish that were it, but it isn't.  That was just me being
careless when I wrote the message.  Sorry.  And thanks for trying, but
that isn't it.

JR.


-- 
James Redfern [The Redfern Organization]
PGP Auto-responder <mailto:pgpkeys@;privacyx.co.uk?subject=0xCB81E8E8>
Fingerprint: 6809 FE89 4CEF E76F C6DF  04BF 46DC 58B9 CB81 E8E8

...You always suppress momentary anger at something you deeply and permanently 
hate"--Robert M. Persig
--- End Message ---
--- Begin Message ---
Hi all,

I am setting up a new production server. Assuming that I do not need
register globals, what does everyone suggest for setting it up:

Linux machine
Apache 
PHP 4.2.3

My real question is whether I should install with Apache 1.3.27 or
Apache 2.0.43 This implies 3 questions:
1. Does PHP 4.2.3 work properly with Apache 2.0.43? In a production
server?
2. Are there features in Apache 2.0 that would be beneficial?
3. What is the learning curve line from moving to installing,
configuring and running Apache 1.3 to 2.0?

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com

Attachment: smime.p7s
Description: application/pkcs7-signature

--- End Message ---
--- Begin Message ---
Production Server -> Apache 1.3.x

Apache2 is not even to be considered.

Apache2 and PHP are not "bedfellows" yet.

David Russell wrote:
Hi all,

I am setting up a new production server. Assuming that I do not need
register globals, what does everyone suggest for setting it up:

Linux machine
Apache PHP 4.2.3

My real question is whether I should install with Apache 1.3.27 or
Apache 2.0.43 This implies 3 questions:
1. Does PHP 4.2.3 work properly with Apache 2.0.43? In a production
server?
2. Are there features in Apache 2.0 that would be beneficial?
3. What is the learning curve line from moving to installing,
configuring and running Apache 1.3 to 2.0?

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com

--- End Message ---
--- Begin Message ---
Hello,
(B
(B"David Russell" <[EMAIL PROTECTED]> wrote:
(B
(B> Hi all,
(B> 
(B> I am setting up a new production server. Assuming that I do not need
(B> register globals, what does everyone suggest for setting it up:
(B> 
(B> Linux machine
(B> Apache 
(B> PHP 4.2.3
(B> 
(B> My real question is whether I should install with Apache 1.3.27 or
(B> Apache 2.0.43 This implies 3 questions:
(B> 1. Does PHP 4.2.3 work properly with Apache 2.0.43? In a production
(B> server?
(B
(BNot yet supported. Stick to the latest 1.3.x
(B
(B> 2. Are there features in Apache 2.0 that would be beneficial?
(B
(BI think this will help:
(B
(B  http://httpd.apache.org/docs-2.0/new_features_2_0.html
(B
(B> 3. What is the learning curve line from moving to installing,
(B> configuring and running Apache 1.3 to 2.0?
(B
(B  http://httpd.apache.org/docs-2.0/upgrading.html
(B
(B- E
--- End Message ---
--- Begin Message ---
Whats the difference between require_once and include_once?

I been running into a problem, perhaps someone can help.

I require_once in a Pear database extension. Inside that pear database
extension
is a require_once("pear.php") and a require_once("db.php")

This file, Thomas Voxs' DbPage.php file, gets require_once inside yet
another
file (my file).

The problem is, my file brings in many require_once file's, some of which
require_once(db.php) inside of it. All I get redefinition problems all over
the place.

It appears to me that require_once doesn't work as advertised? For if it
did,
there should never be redefinition problems.

Why didn't all PHP code do like we do in C/C++ with
#define BLAH
if !defined(BLAH)
{
   your code here.
}

I realize the #define trick works as I used it in my own PHP code... but
when
the basic PHP core files don't have this in them, it sort of  makes
require_once
and include_once hacks! (that don't work)

Any ideas suggestions?



--- End Message ---
--- Begin Message ---
The problem is that under Windows, case sensitivity is important on
require_once

require_once("DB.php")
is different than
require_once("db.php");

Arggggggggh! I hate you Windows.


"Kerry Kobashi" <[EMAIL PROTECTED]> wrote in message
news:20021101073558.1581.qmail@;pb1.pair.com...
> Whats the difference between require_once and include_once?
>
> I been running into a problem, perhaps someone can help.
>
> I require_once in a Pear database extension. Inside that pear database
> extension
> is a require_once("pear.php") and a require_once("db.php")
>
> This file, Thomas Voxs' DbPage.php file, gets require_once inside yet
> another
> file (my file).
>
> The problem is, my file brings in many require_once file's, some of which
> require_once(db.php) inside of it. All I get redefinition problems all
over
> the place.
>
> It appears to me that require_once doesn't work as advertised? For if it
> did,
> there should never be redefinition problems.
>
> Why didn't all PHP code do like we do in C/C++ with
> #define BLAH
> if !defined(BLAH)
> {
>    your code here.
> }
>
> I realize the #define trick works as I used it in my own PHP code... but
> when
> the basic PHP core files don't have this in them, it sort of  makes
> require_once
> and include_once hacks! (that don't work)
>
> Any ideas suggestions?
>
>
>


--- End Message ---
--- Begin Message ---
Well, the way I've read it is that if you use require within control
structures then all files are included, regardless of whether the script
exits before it reaches its next if...elseif...else or case statement. With
include that does not happen. So the general rule of thumb would be to use
require() if you are not using it within these control structures, and use
include() if you actually do need to use include statements in your control
structures. Now, that said, I'm really not sure if that is true for the
require_once and include_once functions also. You might want to look into
that. Hope this helps a little.

-- Darwin

> -----Original Message-----
> From: Kerry Kobashi [mailto:kkobashi@;thegrid.net]
> Sent: Friday, November 01, 2002 1:36 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Require_once problem
>
>
> Whats the difference between require_once and include_once?
>
> I been running into a problem, perhaps someone can help.
>
> I require_once in a Pear database extension. Inside that pear database
> extension
> is a require_once("pear.php") and a require_once("db.php")
>
> This file, Thomas Voxs' DbPage.php file, gets require_once inside yet
> another
> file (my file).
>
> The problem is, my file brings in many require_once file's, some of which
> require_once(db.php) inside of it. All I get redefinition
> problems all over
> the place.
>
> It appears to me that require_once doesn't work as advertised? For if it
> did,
> there should never be redefinition problems.
>
> Why didn't all PHP code do like we do in C/C++ with
> #define BLAH
> if !defined(BLAH)
> {
>    your code here.
> }
>
> I realize the #define trick works as I used it in my own PHP code... but
> when
> the basic PHP core files don't have this in them, it sort of  makes
> require_once
> and include_once hacks! (that don't work)
>
> Any ideas suggestions?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: @ Darwin [mailto:superbus22@;attbi.com]
> Sent: 01 November 2002 10:17
> 
> Well, the way I've read it is that if you use require within control
> structures then all files are included, regardless of whether 
> the script
> exits before it reaches its next if...elseif...else or case 
> statement. With
> include that does not happen. So the general rule of thumb 
> would be to use
> require() if you are not using it within these control 
> structures, and use
> include() if you actually do need to use include statements 
> in your control
> structures.

That's how it *used* to work (somewhere back around 4.0.3, if memory
serves).  Now, the only difference is that the require versions will produce
a fatal error if the file is not present, whereas the include versions will
only generate a warning.

Cheers!

Mike

----------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Beckett Park
Tel: extn 4730        Fax: extn 3211 
--- End Message ---
--- Begin Message ---
This is the query I am running on my database:
 
$query = "select orderid from receipts order by receipt_id DESC LIMIT
0,1";
 $orderid = mysql_query($query);
 
That should return the last record in the DB? Correct?
 
I currently get a number returned which is the number plus 1.
IE if 423 is the last DB record then 424 is returned.
 
Any ideas why this happens?
 
Also in the same table I have a shipping price variable.
My query for this is:
$query = "select shipping from receipts order by receipt_id DESC LIMIT
0,1";
 $shipping_cost = mysql_query($query);
 
Again this should return the last record?
It doesn't return anything however. Any ideas?

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com <http://www.violasystems.com/> 
[EMAIL PROTECTED]
Mobile +358 50 343 5159



 
--- End Message ---
--- Begin Message ---
No, it should not return what you want.
When you do 
$orderid = mysql_query($query);
all this does is actually execute the query, and returns an array
containing the actual result set.

What you need to do from here is to do:

$myrow = mysql_fetch_assoc($orderid);
Now, what you have is an associative array in $myrow containing the row
with identifiers being the collumn names in the db, 

So, from your query, you should do:

$my_id = $myrow["orderid"];

$my_id will now contain the id you want...


On Fri, 2002-11-01 at 10:21, Steve Jackson wrote:
> This is the query I am running on my database:
>  
> $query = "select orderid from receipts order by receipt_id DESC LIMIT
> 0,1";
>  $orderid = mysql_query($query);
>  
> That should return the last record in the DB? Correct?
>  
> I currently get a number returned which is the number plus 1.
> IE if 423 is the last DB record then 424 is returned.
>  
> Any ideas why this happens?
>  
> Also in the same table I have a shipping price variable.
> My query for this is:
> $query = "select shipping from receipts order by receipt_id DESC LIMIT
> 0,1";
>  $shipping_cost = mysql_query($query);
>  
> Again this should return the last record?
> It doesn't return anything however. Any ideas?
> 
> Steve Jackson
> Web Developer
> Viola Systems Ltd.
> http://www.violasystems.com <http://www.violasystems.com/> 
> [EMAIL PROTECTED]
> Mobile +358 50 343 5159
> 
> 
> 
>  

--- End Message ---
--- Begin Message ---
Well, OK
I think your problem is here:
You sql *could* and probably does return more than one row.
Yet, your code as it is now will only return the first row.

You need to cycle through the result rows with a while statement, like
this:

while ($myrow = mysql_fetch_assoc($result)) {
        $my_id = $myrow["shipping"];
        echo $my_id;
        echo <br>;
}

Now, this will probably be a bit difficult to incorporate "as is" into
your function, as you will have multiple "returns", and each will
override the previous value, so you'll end up with only the last row's
id..

Some pointers:

Use something like $result = mysql_query($sql) instead of saying
$shipping = mysql_query()

It will work the same, but it is easier to read throuhgh your code and
see where you actually invoke a result, and where you are simply
assigning a value to a variable ( which you are NOT doing with this
command, $result only contains the result set identifier of the query,
not the actual result, that's why you pass the $result to a
mysql_fetch_assoc(), only then do you have any kind of "workable" data)

Next, use mysql_fetch_assoc(), instead of ...fetch_array()

Difference is:

array => [0,pointer1,value1,1,pointer2,value2,2,pointer3,value3.....]
associative array => [pointer1,value1,pointer2,value2,pointer3,value3
....]

So, they hold the same data, but assoc's are "smaller" as they don't
have the numerical pointer, which you don't use anyway.
When you do the 
$my_id = $myrow["shipping"];
what you are doing is retrieving the "shipping-th" value from the array,
and you would never do a 
$my_id = $myrow[2]; for instance...

So, assoc's are generally better to use. You can safely change it in
your code, the previous errors you got was not because of this, it was
simply because your result set was empty, and mysql_fetch_array OR
mysql_fetch_assoc would have given the error...

I would suggest you try to accomplish your goal without a function at
this point as to allow you to understand what you are trying to do
better. 
You will have to either build a loop into your function, or call your
function from within a loop, and both can be quite difficult to grasp
initially...


On Fri, 2002-11-01 at 12:24, Steve Jackson wrote:
> Ok thanks.
> Still having problems though.
> This is the function now:
> function get_shipping_cost()
>       {
>       //Get order ID from DB to pass to receipt.
>       $conn = db_connect();
>       //$query = "select * from receipts order by receipt_id DESC
> LIMIT 0,1";
>       $query = "select shipping from receipts order by receipt_id DESC
> LIMIT 0,1";
>       $shipping = mysql_query($query);
>       $myrow = mysql_fetch_array($shipping);
>       $my_id = $myrow["shipping"];
>       $shipping_cost = $my_id;
>       return $shipping_cost;
>       }
> Still zero DB results. There is definitely a connection as DB_connect()
> works.
> 
> > No!!!
> > Why are you doing this?
> > $my_id = $myrow["shipping"];
> > >   $my_id = $shipping_cost;<<<<<<<<<
> > >   return $shipping_cost;
> > 
> > $my_id already contains the value you want, just return 
> > $my_id, the reason it doesn't work now, is because 
> > $shipping_cost has no value. If you really want to have the 
> > value stored in $shipping_cost, you must
> > do:
> > $shipping_cost = $my_id.
> > 
> > You see, $my_id has a value in it the moment you say:
> > $my_id = $my_row["shipping"];
> > but when you do $my_id = $shipping_cost, you are overwriting 
> > the value inside $my_id with $shipping_cost, which is like 
> > saying $my_id = 0;
> > 
> > 
> > 
> > 
> > On Fri, 2002-11-01 at 11:07, Steve Jackson wrote:
> > > Okay. Now I have this and it still returns nothing.
> > > 
> > > function get_shipping_cost($shipping_cost)
> > >   {
> > >           //Get order ID from DB to pass to receipt.
> > >   $conn = db_connect();
> > >   $query = "select shipping from receipts order by 
> > receipt_id DESC 
> > > LIMIT 0,1";
> > >   $shipping = mysql_query($query);
> > >   $myrow = mysql_fetch_array($shipping);
> > >   $my_id = $myrow["shipping"];
> > >   $my_id = $shipping_cost;
> > >   return $shipping_cost;
> > >   }
> > > 
> > > And I still get one added to the variable in this function 
> > which pulls 
> > > orderid from the same table.
> > > 
> > > function get_order_id_receipt($orderid)
> > >   {
> > >           //Get order ID from DB to pass to receipt.
> > >   $conn = db_connect();
> > >   $query = "select orderid from receipts order by 
> > receipt_id DESC LIMIT 
> > > 0,1";
> > >   $order = mysql_query($query);
> > >   $myrow = mysql_fetch_array($order);
> > >   $my_id = $myrow["orderid"];
> > >   $my_id = $orderid;
> > >   return $orderid;
> > >   }
> > > 
> > > Well and truly confused!
> > > 
> > > Steve Jackson
> > > Web Developer
> > > Viola Systems Ltd.
> > > http://www.violasystems.com
> > > [EMAIL PROTECTED]
> > > Mobile +358 50 343 5159
> > > 
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: Petre Agenbag [mailto:internet@;vsa.co.za]
> > > > Sent: 1. marraskuuta 2002 10:23
> > > > To: [EMAIL PROTECTED]
> > > > Cc: [EMAIL PROTECTED]
> > > > Subject: Re: [PHP] Simple Problems taking me hours to solve!
> > > > 
> > > > 
> > > > No, it should not return what you want.
> > > > When you do
> > > > $orderid = mysql_query($query);
> > > > all this does is actually execute the query, and returns an 
> > > > array containing the actual result set.
> > > > 
> > > > What you need to do from here is to do:
> > > > 
> > > > $myrow = mysql_fetch_assoc($orderid);
> > > > Now, what you have is an associative array in $myrow
> > > > containing the row with identifiers being the collumn names 
> > > > in the db, 
> > > > 
> > > > So, from your query, you should do:
> > > > 
> > > > $my_id = $myrow["orderid"];
> > > > 
> > > > $my_id will now contain the id you want...
> > > > 
> > > > 
> > > > On Fri, 2002-11-01 at 10:21, Steve Jackson wrote:
> > > > > This is the query I am running on my database:
> > > > >  
> > > > > $query = "select orderid from receipts order by receipt_id
> > > > DESC LIMIT
> > > > > 0,1";  $orderid = mysql_query($query);
> > > > >  
> > > > > That should return the last record in the DB? Correct?
> > > > >  
> > > > > I currently get a number returned which is the number 
> > plus 1. IE 
> > > > > if
> > > > > 423 is the last DB record then 424 is returned.
> > > > >  
> > > > > Any ideas why this happens?
> > > > >  
> > > > > Also in the same table I have a shipping price 
> > variable. My query 
> > > > > for this is: $query = "select shipping from receipts order by 
> > > > > receipt_id
> > > > DESC LIMIT
> > > > > 0,1";  $shipping_cost = mysql_query($query);
> > > > >  
> > > > > Again this should return the last record?
> > > > > It doesn't return anything however. Any ideas?
> > > > > 
> > > > > Steve Jackson
> > > > > Web Developer
> > > > > Viola Systems Ltd.
> > > > > http://www.violasystems.com <http://www.violasystems.com/> 
> > > > > [EMAIL PROTECTED] Mobile +358 50 343 5159
> > > > > 
> > > > > 
> > > > > 
> > > > >  
> > > > 
> > > > 
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > 
> > > 
> > 
> 

--- End Message ---
--- Begin Message ---
Im not sure, but I believe Ive noticed this when I fopen() a file with
the 'b' value like fopen($foo, 'wb');
I may be totally wrong...


Brandon Orther wrote:

Hello,

Does anyone know a way around all the ^M at the end of each line that my
php file writes to on a linux box?


--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager

<mailto:brandon@;webintellects.com> [EMAIL PROTECTED]
800-994-6364

<http://www.webintellects.com/> www.webintellects.com

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




--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



--- End Message ---
--- Begin Message --- Im some what new to xml but I've put together a basic xml parsing script, and for some reason, on data like ->
<description>It&apos;s been a few days since...</description>
the parser thinks its 3 lines. Its parsing a new line on htmlentities like &apos;
So with the above line the looped output is like ->

Data --> It
Data --> '
Data --> s been a few days since

Here is a downsized version of the script Im working with ->
---------------------
<?php

class XMLParser
{
var $xmlparser;

function XMLParser()
{
$this->xmlparser = xml_parser_create();
xml_set_object($this->xmlparser, $this);
xml_set_element_handler($this->xmlparser, 'start_tag', 'ending_tag');
xml_set_character_data_handler($this->xmlparser, 'character_handler');
xml_parser_set_option ($this->xmlparser, XML_OPTION_CASE_FOLDING, FALSE);
}

function parse($data)
{
xml_parse($this->xmlparser, $data);
}

function parse_File($xmlfile)
{
$fp = fopen($xmlfile, 'r');
while ($xmldata = fread($fp, 4096))
{
// parse the data chunk
if (!xml_parse($this->xmlparser, $xmldata))
{
// if parsing fail print the error description and line number
echo 'ERROR: ';
echo xml_error_string(xml_get_error_code($this->xmlparser)) . '<br>';
echo 'Line: ';
echo xml_get_current_line_number($this->xmlparser) . '<br>';
echo 'Column: ';
echo xml_get_current_column_number($this->xmlparser) . '<br>';
}
}

fclose($fp);
}

function start_tag($xmlparser, $tag, $attributes)
{
echo 'Opening tag: ' . $tag . "\n";
}

function ending_tag($xmlparser, $tag)
{
echo 'Ending tag: ' . $tag . "\n";
}

function character_handler($xmlparser, $data)
{
echo 'Data --> ' . $data . "\n";
}

function close_Parser()
{
xml_parser_free($this->xmlparser);
}
}

?>
-----------------

Thanks for any input you may provide.

--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/


--- End Message ---
--- Begin Message ---
Peter J. Schoenster wrote:
> Here is the example:
>
> <?php
>
> $string = 'asfddsaz';
>
> if (eregi('\s', $string)) {
>     echo "Whitespace present";
> }else {
>     echo "NO Whitespace present";
> }
> ?>
>
> Why does the above return true? There is no whitespace in the string.
> What am I missing?

Try using [[:space:]] when using eregi. See also
http://www.developers-resources.com/stories.php?story=01/10/25/0549771

Grtz Erwin

--- End Message ---
--- Begin Message ---
Hai!
I had downloaded Apache2.0.43 from apache site and
installed on my linux7.1 box, the configure/make .make
install went smooth, after that I started Apache
server. 

Now my problem is when I tried to access localhost
through any browser(ie http://localhost) its saying
host not found(or unknownhost), Why is it so?
and when try to restart Apache it shrows follwing
error
[ address already in use make_sock:coudnt bind to
address 127.0.0.1:80 no listening sockets available,
shutting down, Unable to open logs]

Any one please help me out. Since I  didnt find any
general mailing list for Apache installation I am
asking in this mailing Please excuse me.

Regards
Ramesh N


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
--- End Message ---
--- Begin Message ---
On Friday 01 November 2002 19:11, Ramesh Pillai wrote:
> Hai!
> I had downloaded Apache2.0.43 from apache site and
> installed on my linux7.1 box, the configure/make .make
> install went smooth, after that I started Apache
> server.
>
> Now my problem is when I tried to access localhost
> through any browser(ie http://localhost) its saying
> host not found(or unknownhost), Why is it so?
> and when try to restart Apache it shrows follwing
> error
> [ address already in use make_sock:coudnt bind to
> address 127.0.0.1:80 no listening sockets available,
> shutting down, Unable to open logs]

Probably something is already using 127.0.0.1:80. 
As root, run 'netstat -lp' to find out what process it is.

> Any one please help me out. Since I  didnt find any
> general mailing list for Apache installation I am
> asking in this mailing Please excuse me.

How hard did you look? Going to www.apache.org or httpd.apache.org will 
display a link to "mailing lists".

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

/*
He is the MELBA-BEING ... the ANGEL CAKE ... XEROX him ... XEROX him --
*/

--- End Message ---
--- Begin Message ---
I have two arrays and I have complete list of numbers in one of them,
lets call it $complete[] 
and another that has some values of the complete one, lets call that one
$part[], now if I want to
return an array with all the values that are in $complete[] but not in
$part[], how would I do that?
 
Regards, David
 
--- End Message ---
--- Begin Message ---
On Friday 01 November 2002 19:22, Davíð Örn Jóhannsson wrote:
> I have two arrays and I have complete list of numbers in one of them,
> lets call it $complete[]
> and another that has some values of the complete one, lets call that one
> $part[], now if I want to
> return an array with all the values that are in $complete[] but not in
> $part[], how would I do that?

array_diff()

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

/*
<viro> "scanf is tough" -- programmer Barbie...

        - Al Viro on #kernelnewbies
*/

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

I need some help with a regexp for preg_split. I want the string

  str = "this is 'a string that' contains phrases";

to be split into:

  arr[] = "this";
  arr[] = "is";
  arr[] = "a string that";
  arr[] = "contains";
  arr[] = "phrases";

but I'm having some trouble coming up a good regexp that would do the job.
Any regexp gurus out there who can point me in the right direction?



Thanks,
David Brännlund



--- End Message ---
--- Begin Message ---
I need to write a stand alone script runing on a server that checks and
updates a database every week, is this posable and if so
could some one direct me to a tutorial or to any info on doing this.
 
Regards, David
--- End Message ---
--- Begin Message ---
Are you familiar with PHP, or are you more worried about how to "call"
and execute the script from the server itself on a weekly basis ( cron
job) ?

On Fri, 2002-11-01 at 14:41, Davíð Örn Jóhannsson wrote:
> I need to write a stand alone script runing on a server that checks and
> updates a database every week, is this posable and if so
> could some one direct me to a tutorial or to any info on doing this.
>  
> Regards, David

--- End Message ---
--- Begin Message ---
> I need to write a stand alone script runing on a server that checks
and
> updates a database every week, is this posable and if so
> could some one direct me to a tutorial or to any info on doing this.

Yes, it's possible. Look into cron to run your script on a schedule. 

---John Holmes...


--- End Message ---
--- Begin Message ---
Sorry to keep on at you guys but this is really getting to me now!

I want to pull a shipping quantity (the very last record in the Db) into
a page and am still having problems. Tried looping through the records
and I can't seem to get it to return anything:

function get_shipping($shippingvar)
{
$conn = db_connect();
$query = mysql_query("SELECT MAX(receipt_id) from receipts");
$myrow = mysql_fetch_row($query);
$shippingvar = $myrow["shipping"];
return $shippingvar;

}

Surely it can't be much more complicated than that? 
Help please. Smoked 10 fags already!

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159

--- End Message ---
--- Begin Message ---
Steve Jackson wrote:

function get_shipping($shippingvar)
{
$conn = db_connect();
$query = mysql_query("SELECT MAX(receipt_id) from receipts");
$myrow = mysql_fetch_row($query);
$shippingvar = $myrow["shipping"];
return $shippingvar;

Check http://php.net/mysql_fetch_row ... specifically, mysql_fetch_row specifically is not mysql_fetch_array and the latter is probably what you want. You may also want some error checking in that function if you don't already have any.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


--- End Message ---
--- Begin Message --- I installed PHP 4.2.3 on Mac OS 10.2.1 , activating the PHP Module with the following commands on terminal window

cd /etc/httpd"
sudo apxs -e -a -n php4 libexec/httpd/libphp4.so"
echo 'echo "AddType application/x-httpd-php .php" >> /etc/httpd/httpd.conf' | sudo sh -s

It works fine and I would like install xpl library but I don't have a php.ini file .

Could you help me to configure that ?

Thanks for your help


Pierre Vaudrey
email [EMAIL PROTECTED]

--- End Message ---
--- Begin Message --- Did you install from the source code or a pre-compiled bin? (from Marc Liyanage.?)

If so there is usually no php.ini file with it. If you are using Marc's binary package then create a blank php.ini
file:

sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini

Then you will have to add the appropriate configuration options to it. You can find an example php.ini file in the
php source code file php4.2.3.tar.gz or whatever it is called. There will be a file called php.ini-recommended, you can
copy the options in this file and use it, or the php.ini-dist file.

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

At 02:10 PM 11/1/2002 +0100, you wrote:
I installed PHP 4.2.3 on Mac OS 10.2.1 , activating the PHP Module with the following commands on terminal window

cd /etc/httpd"
sudo apxs -e -a -n php4 libexec/httpd/libphp4.so"
echo 'echo "AddType application/x-httpd-php .php" >> /etc/httpd/httpd.conf' | sudo sh -s

It works fine and I would like install xpl library but I don't have a php.ini file .

Could you help me to configure that ?

Thanks for your help


Pierre Vaudrey
email [EMAIL PROTECTED]


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


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

Did you install from the source code or a pre-compiled bin? (from Marc Liyanage.?)
I installed PHP from Marc Liyanage pre-compiled bin

If so there is usually no php.ini file with it. If you are using Marc's binary package then create a blank php.ini
file:

sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini
Done !

Then you will have to add the appropriate configuration options to it. You can find an example php.ini file in the
php source code file php4.2.3.tar.gz or whatever it is called. There will be a file called php.ini-recommended, you can
copy the options in this file and use it, or the php.ini-dist file.
I would like to install eXtremePHP - Installation document says :

1. Uncompress the contents of the archive to the document root of your
web server.

2. You will have to auto prepend the xpl/common/common.inc.php file. This
can be done of one of two ways.

a) In the PHP.INI, find the field that says "auto_prepend_file" and change
it to look like below on Unix

auto_prepend_file = "/www/xpl/common/common.inc.php"

where "www" is the document root of the webserver.


b) If you are running Apache, create an .htaccess file under your
document root directory and enter the following line and save the file.

php_value auto_prepend_file /www/xpl/common/common.inc.php



My document root is : /Users/pierreva/Sites
Could you tell me what I have to change in php.ini-recommmended ?

Thanks for your help.

Pierre Vaudrey
email [EMAIL PROTECTED]

--- End Message ---
--- Begin Message --- uncompress eXtremePHP. It may get have a weird directory name. Change the directory name to xpl.

copy xpl to /Users/pierreva/Sites/xpl either from the CLI or just drag the xpl dir into your Site dir

cd /usr/local/lib
sudo vi php.ini

while in vi type <ESC> /auto_prepend
(this is to search to the auto_prepend line in the php.ini file)
move to the end of the auto_prepend line then type:
"a" to append to the file then <space> "/Users/pierreva/Sites/xpl/common/common.inc.php"

then type <ESC>:wq<ENTER> to save the changes

then type

sudo apachectl graceful

to restart apache, just in case ;)

That should be all that you have to do. Now try using the libraries and other xpl stuff.

Good Luck,

Matt

At 05:00 PM 11/1/2002 +0100, you wrote:


Did you install from the source code or a pre-compiled bin? (from Marc Liyanage.?)
I installed PHP from Marc Liyanage pre-compiled bin

If so there is usually no php.ini file with it. If you are using Marc's binary package then create a blank php.ini
file:

sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini
Done !

Then you will have to add the appropriate configuration options to it. You can find an example php.ini file in the
php source code file php4.2.3.tar.gz or whatever it is called. There will be a file called php.ini-recommended, you can
copy the options in this file and use it, or the php.ini-dist file.
I would like to install eXtremePHP - Installation document says :

1. Uncompress the contents of the archive to the document root of your
web server.

2. You will have to auto prepend the xpl/common/common.inc.php file. This
can be done of one of two ways.

a) In the PHP.INI, find the field that says "auto_prepend_file" and change
it to look like below on Unix

auto_prepend_file = "/www/xpl/common/common.inc.php"

where "www" is the document root of the webserver.


b) If you are running Apache, create an .htaccess file under your
document root directory and enter the following line and save the file.

php_value auto_prepend_file /www/xpl/common/common.inc.php



My document root is : /Users/pierreva/Sites
Could you tell me what I have to change in php.ini-recommmended ?

Thanks for your help.

Pierre Vaudrey
email [EMAIL PROTECTED]


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


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

When the user logs in , i create a session with session varialbles, the
session cookie is saved on clients computer.

When i log off i say

session_unset();
session_destroy();
setcookie(session_name());

The session in the tmp is deleted , but the cookie is still there , i know
this because when i login , the same session id is used ! Why is that ?

Thanks
    Shaun




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

When the user logs in , i create a session with session varialbles, the
session cookie is saved on clients computer.

When i log off i say

session_unset();
session_destroy();
setcookie(session_name());

The session in the tmp is deleted , but the cookie is still there , i know
this because when i login , the same session id is used ! Why is that ?

Thanks
    Shaun






--- End Message ---
--- Begin Message ---
hi.. a newbie here

a user fill up a form with username and password
passing the form through 'POST'
a session was created,
a user login,
a user logout + session destroy,

but after that if the user press back button
on the browser seems like the browser
will repost the username and password back
through the form so the user need not to reenter
his/hers username/password

how to avoid this problem?
thx

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
--- End Message ---
--- Begin Message ---
Hi,

I have been trying for most of the day to pull a variable from a db.
Finally managed that. Now I need to pass the result of a function to
another function.
How do you do this?
I assume the following if called in another page can be used?

function get_shipping($shipping)
{
$conn = db_connect();
$query = "SELECT * FROM receipts ORDER BY receipt_id DESC LIMIT 1";
$result = mysql_query($query);
//$shippingvar = $myrow["shipping"];
if(mysql_numrows($result)>0)
    $shipping = mysql_result($result, 0, "shipping");
return $shipping;
}

If I return $shipping how can I display that?

I have called it in another page by doing
get_shipping($shipping)

And then 

Echo "test $shipping";

But that doesn't work.

Ideas where I'm going wrong this time?

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159

--- End Message ---
--- Begin Message ---
On Friday 01 November 2002 22:04, Steve Jackson wrote:

Please use a descriptive subject!

> I have called it in another page by doing
> get_shipping($shipping)
>
> And then
>
> Echo "test $shipping";

$returned_variable = get_shipping($shipping);
echo $returned_variable;

Or you can use the returned value directly:

echo get_shipping($shipping);


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

/*
The computing field is always in need of new cliches.
                -- Alan Perlis
*/

--- End Message ---
--- Begin Message ---
I need a string expression to verify an alpha numeric password. This is what
i've come up with , however it does not work:

elseif ( (!ereg ("^[a-zA-Z]+$", $password)) || (!ereg ("^[0-9]+$",
$password)))

can anybody help? Thanks in advance
ADAM


--- End Message ---
--- Begin Message ---
I'm using WebDAV in Apache 2, whenever I try to get an html file it works
fine, but when I try to get a PHP file I get an error saying it cannot get
filename.php.  How come I can only get html files through WebDAV?  Is there
a way to change this?  Thanks!!


--- End Message ---
--- Begin Message ---
Sorry for the OT post, quick mysql question...

I've found a couple of cool utilites that will create basic forms from a mysql table 
(add/edit/delete/search), which look they could save some time coding.

However, I can't connect with them because my server is setup as localhost.  I

How do you create a user/host configuration that will allow you to connect to mysql 
other than via localhost?

Thanks in advance,

Kelly
--- End Message ---
--- Begin Message ---
http://www.mysql.com/doc/en/Adding_users.html
http://www.mysql.com/documentation/lists.html

Kelly Meeks wrote:
Sorry for the OT post, quick mysql question...

I've found a couple of cool utilites that will create basic forms from a mysql table (add/edit/delete/search), which look they could save some time coding.

However, I can't connect with them because my server is setup as localhost.  I

How do you create a user/host configuration that will allow you to connect to mysql other than via localhost?

Thanks in advance,

Kelly


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

I upgraded php and apache on my development machine (Windows XP). I am
now running apache 1.3.27 and php 4.2.3.

When I run a phpinfo(), I get my full list of stuff as expected, except
that the apache version reported is 1.3.24.

Has anyone else seen this. Have I done something wrong? 

Thanks

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com

Attachment: smime.p7s
Description: application/pkcs7-signature

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

I have a form with a checkbox like so:
<input type="checkbox" value="ON" name="shipper_save">

When I submit, the value is always shown as "ON" regardless of whether I've
checked the checkbox or not.  So this begets the question, How can I code my
PHP form processing script to determine whether the checkbox was checked?

Thanks,
Don


--- End Message ---
--- Begin Message ---
if ( isset ( $_POST['shipper_save'] ) ) {
	echo ( "It's Checked" );
}

Or use $_GET['shipper_save'] depending on your forum method.

DonPro wrote:
Hi,

I have a form with a checkbox like so:
<input type="checkbox" value="ON" name="shipper_save">

When I submit, the value is always shown as "ON" regardless of whether I've
checked the checkbox or not.  So this begets the question, How can I code my
PHP form processing script to determine whether the checkbox was checked?

Thanks,
Don




--- End Message ---
--- Begin Message ---
The syntax as I have used it is (not the cleanest or best way to do
it by a long run - but it works):

<?php
if ($_POST['shipper_save'] == "off") {
  $shipper_save = "";
}
else {
  $shipper_save = "checked";
}
?>
<input type="checkbox" name="shipper_save" <?=$shipper_save?>>

this will have the checkbox be checked by default, also you can do what
ever other things you need to do based on the on/off conditions.

On Fri, 1 Nov 2002 10:47:43 -0500
"DonPro" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I have a form with a checkbox like so:
> <input type="checkbox" value="ON" name="shipper_save">
> 
> When I submit, the value is always shown as "ON" regardless of whether
> I've checked the checkbox or not.  So this begets the question, How
> can I code my PHP form processing script to determine whether the
> checkbox was checked?
> 
> Thanks,
> Don
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
Tom Woody
Systems Administrator
NationWide Flood Research, Inc.
phone: 214-631-0400 x209
  fax: 214-631-0800

Don't throw your computer out the window, 
throw the Windows out of your computer! 

--- End Message ---
--- Begin Message ---
There's no php.sql, so I'll put it here.

I'm trying to do a search from mysql database like this:

if (!$inquiry = mysql_query("select id,link,heading,desc from links where
heading like '%$entry%' or desc like '%$entry%'
or keyword like '%$entry%'",$connection)){
    print "<LI>Search was unsuccesful!";
}
else{
    while ($link = mysql_fetch_row($inquiry)){
        print "<LI><A HREF=\"" . $link[1];
        print "\">" . $link[2];
        print "</A> <I>" . $link[3] . "</I>" ;
    }

}

But everytime I get all the possible entries, even though I'm sure it
doesn't match.

Thanks for your answers.





--- End Message ---
--- Begin Message ---
Echo your query and ensure that $entry has data in it, otherwise
matching '%%' will match everything as you are getting.

Cheers,
Rob.

samug wrote:
> 
> There's no php.sql, so I'll put it here.
> 
> I'm trying to do a search from mysql database like this:
> 
> if (!$inquiry = mysql_query("select id,link,heading,desc from links where
> heading like '%$entry%' or desc like '%$entry%'
> or keyword like '%$entry%'",$connection)){
>     print "<LI>Search was unsuccesful!";
> }
> else{
>     while ($link = mysql_fetch_row($inquiry)){
>         print "<LI><A HREF=\"" . $link[1];
>         print "\">" . $link[2];
>         print "</A> <I>" . $link[3] . "</I>" ;
>     }
> 
> }
> 
> But everytime I get all the possible entries, even though I'm sure it
> doesn't match.
> 
> Thanks for your answers.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer  |
:----------------------------------------------:
| Mail  : mailto:robert.cummings@;webmotion.com |
| Phone : (613) 731-4046 x.109                 |
:----------------------------------------------:
| Website : http://www.webmotion.com           |
| Fax     : (613) 260-9545                     |
`----------------------------------------------'
--- End Message ---
--- Begin Message --- And you may want to try....

$query = "select `id`, `link`, `heading`, `desc` from `links` where `heading` like '%" . $entry . "%' or `desc` like '%" . $entry% . "' or `keyword` like '" . %$entry% . "'";
if ( ! $inquiry = @mysql_query ( $query, $connection ) )

Robert Cummings wrote:
Echo your query and ensure that $entry has data in it, otherwise
matching '%%' will match everything as you are getting.

Cheers,
Rob.

samug wrote:

There's no php.sql, so I'll put it here.

I'm trying to do a search from mysql database like this:

if (!$inquiry = mysql_query("select id,link,heading,desc from links where
heading like '%$entry%' or desc like '%$entry%'
or keyword like '%$entry%'",$connection)){
   print "<LI>Search was unsuccesful!";
}
else{
   while ($link = mysql_fetch_row($inquiry)){
       print "<LI><A HREF=\"" . $link[1];
       print "\">" . $link[2];
       print "</A> <I>" . $link[3] . "</I>" ;
   }

}

But everytime I get all the possible entries, even though I'm sure it
doesn't match.

Thanks for your answers.

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


--- End Message ---
--- Begin Message ---
At 10/31/2002 03:00 PM, John Wards wrote:

On Thursday 31 Oct 2002 3:00 pm, jianking wrote:
> Who can tell me where I can get the cracked Zend Encoder 3.0 ?

Are you a muppet?

This list is run by the people who make Zend Encoder!

FOOL
Ah, my first laugh of the day.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

--- End Message ---
--- Begin Message ---
> > Who can tell me where I can get the cracked Zend Encoder 3.0 ?

>Are you a muppet?
>
>This list is run by the people who make Zend Encoder!
>
>FOOL

>Ah, my first laugh of the day.

Okay, that's enough. I'm incredibly disappointed in this list. It's very
helpful at times, but at other times can degenerate into immature
namecalling and fingerpointing like the above and other examples. So this
poster made a mistake. Cut him or her some slack. But I guess since none of
the fingerpointers here have ever made a mistake, then I guess you all have
the right to go ahead and make fun. This person made a post that he or she
shouldn't have made, and since then has been ridiculed on a public forum by
about four or five of us. If we all can look past this mistake and get back
to posting constructive comments, this poster can get back to feeling a
little sense of community here when needing legitimate help. So can we give
this poster a break, or should we continue and then respond to every
fingerpointer with the same lack of respect next time a mistake is made?
--- End Message ---

Reply via email to