php-general Digest 10 Oct 2002 10:24:20 -0000 Issue 1635

Topics (messages 119465 through 119508):

Re: My boss wants to know...
        119465 by: Timothy J Hitchens
        119469 by: John W. Holmes

Re: 4.2.2 > 4.2.3 - Incompatibility
        119466 by: Liam MacKenzie

Re: Encrypting passwords in a flat file before import
        119467 by: Brad Bonkoski

ASP Option Explicit equivalent in PHP
        119468 by: R. Z.
        119471 by: John W. Holmes
        119472 by: Marco Tabini
        119473 by: Nick Eby
        119474 by: Nick Eby

Re: Object methods - memory usage?
        119470 by: John W. Holmes

Re: Image problem
        119475 by: Owen Prime

problem with SUM and Postgres
        119476 by: webmaster
        119477 by: Marco Tabini
        119478 by: Marco Tabini

CC Processing Merchants
        119479 by: Andrew Brampton
        119480 by: Jarrad Kabral
        119492 by: Peter J. Schoenster
        119496 by: Joshua Alexander
        119498 by: olinux

Re: Found the problem with the libmcrypt.....
        119481 by: Tom Rogers

PHP problem
        119482 by: Miguel Brás
        119483 by: John W. Holmes

Re: POST method not allowed
        119484 by: Tom Rogers

displaying a select number of rows from a sql query
        119485 by: Keith Posehn
        119486 by: Owen Prime

Extract HTML tags
        119487 by: Shawn McKenzie
        119488 by: Smith, Benjamin
        119489 by: Owen Prime
        119491 by: Jonathan

Multi-Dimensional Arrays
        119490 by: Jonathan Duncan
        119497 by: Jonathan

Re: MySQL back up
        119493 by: Ken
        119495 by: Owen Prime

Re: Undefined variable
        119494 by: Steve Yates

Animation in PHP
        119499 by: arun kv
        119500 by: arun kv
        119508 by: Marek Kilimajer

how to get id from table I just inserted into
        119501 by: Pablo Oliva
        119502 by: Jason Wong

how to ping
        119503 by: Achi
        119504 by: Timothy J Hitchens

Re: how to create files??
        119505 by: Aidal

Embed C in PHP
        119506 by: arun kv

how can i work with trace an IP or host ?
        119507 by: yasin inat

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 ---
Look at the odbc access using php:

http://www.php.net/manual/en/ref.odbc.php

You will still need to have a windows box with odbc to your
webserver.. pref unixish..



Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Randum Ian [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, 10 October 2002 8:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] My boss wants to know...


Hi guys, got a tricky question here and I know I will probably get
flamed for asking it here but here goes!

My boss wants me to put a large Access database onto the net so that
people can query it both from the company and from the outside and he
wants to be able to have the database up to date and also easy to
change.

As far as I can see that leaves me with only Active Server Pages in
which to access this database or am I wrong?

Randum Ian
[EMAIL PROTECTED]
DJ / Reviewer / Webmaster, DancePortal (UK) Limited 
DancePortal.co.uk - Global dance music media




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


--- End Message ---
--- Begin Message ---
> Hi guys, got a tricky question here and I know I will probably get
> flamed for asking it here but here goes!
> 
> My boss wants me to put a large Access database onto the net so that
> people can query it both from the company and from the outside and he
> wants to be able to have the database up to date and also easy to
> change.
> 
> As far as I can see that leaves me with only Active Server Pages in
> which to access this database or am I wrong?

You can use PHP, of course. ODBC or COM.

Here is an example some program automatically created that shows how to
connect to and query an Access database:

$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$conn->Open("Driver={Microsoft Access Driver (*.mdb)};Dbq="
.realpath("datab/test.mdb"). ";Password=;");
$SQL="SELECT COUNT(*) AS Count FROM test";
$countx = 0;
$rs = $conn->Execute("$SQL");
while (!$rs->EOF) {
$countx = $rs->Fields("Count");

---John Holmes...


--- End Message ---
--- Begin Message ---
Well, just in case anyone's interested...

My problem was fixed by just compiling PHP as a standard module, not APXS.



----- Original Message -----
From: "Liam MacKenzie" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, October 08, 2002 10:37 PM
Subject: Re: [PHP] 4.2.2 > 4.2.3 - Incompatibility


Another note, phpMyAdmin causes a segmentation fault as well...

APACHE:
------------------------------------------
./configure \
"--with-layout=Apache" \
"--sysconfdir=/home/nobody/conf" \
"--iconsdir=/home/nobody/icons" \
"--htdocsdir=/home/nobody/htdocs" \
"--cgidir=/home/nobody/cgi-bin" \
"--logfiledir=/home/nobody/logs" \
"--enable-module=so" \
"--enable-module=imap" \
"--enable-module=rewrite" \
"--enable-module=headers" \
"$@"
------------------------------------------


PHP:
------------------------------------------
'./configure' \
'--with-apxs=/usr/local/apache/bin/apxs' \
'--with-config-file-path=/home/nobody/conf' \
'--with-mysql=/usr/local' \
'--enable-safemode' \
"$@"
------------------------------------------


Slackware 8.1

Any ideas yet  ;-)

Cheers,
Liam



----- Original Message -----
From: "Liam MacKenzie" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, October 08, 2002 10:26 PM
Subject: [PHP] 4.2.2 > 4.2.3 - Incompatibility


Hi guys,

I've found me a problem...

A portion of a script is causing the child apache process to be terminated:
[notice] child pid 23620 exit signal Segmentation fault (11)

I never had a problem with this script until I upgraded to 4.2.3.
The only other difference is that now I have PHP compiled as an APXS module,
whereas before it was compiled into apache.

The script is below...

$pass_gen = substr(ereg_replace("[^A-Za-z0-9]", "", crypt(time())) .
                    ereg_replace("[^A-Za-z0-9]", "", crypt(time())) .
                    ereg_replace("[^A-Za-z0-9]", "", crypt(time())),
                    9, 10);


Any ideas?

Cheers,
Liam




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







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






--- End Message ---
--- Begin Message ---
Or if you use md5() which encrypts the same way every time you could just get a
CD-ROM with a trillion different character combinations that could be valid
passwords and encrypt them, then compare the encrypted strings....  With the
current hardware available that might take..oh a half a second ro so.  So, it's
more important to protect the actual SOURCE then the information stored in the
source.  Of course this is a debate that coudl go on forever, when does hardware
encryption rule all?
-Brad

"SHEETS,JASON (HP-Boise,ex1)" wrote:

> Storing passwords in MD5 or another hash is an excellent idea because it is
> generally not possible to decrypt them (if the user uses a bad password they
> can be brute forced but you can only do so much).  By storing passwords in
> MD5 you protect your users passwords, if your database gets cracked their
> passwords are still relatively secure.
>
> You generally should not use a reversible encryption technique to store
> something like user passwords, the reason being that in order to decrypt the
> passwords you must store the encryption key in your code, when someone gets
> access to your code (which they will or at least you must assume they will)
> all they have to do is look in your code for your encryption key, after that
> decrypting your user's passwords is trivial.  The worst thing is most users
> use the same password for almost everything that means that many of their
> other accounts are now compromised and they may not even know it.  It can be
> argued the user should use a more secure password and not use the same one
> in many places however the user is a being of convenience and is unlikely to
> remember more than one password anyway :)
>
> In short this has been covered probably thousands of times on this list but
> I did not want a newer user to make the mistake of using an insecure method
> of storing passwords, either putting them in the DB in plain text or using a
> reversible encryption technique that is equally insecure because of the
> implementation.
>
> Jason Sheets, CCNA, MCSE
>
> -----Original Message-----
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 2:24 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Encrypting passwords in a flat file before import
>
> I was comparing it to what I was thinking about.  Like if the field in the
> table (database) have a username and password.  Then you encrypt it with
> features like this, then how can it be de-crypt if I had like a thousand
> users account. It was just a thought in my mind.
>
> Now based on your responses and feedback.  It seem that the md5() is such a
> bad idea and instead, using mcrypt function would help.
>
> "Marco Tabini" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I think that generally you do not want passwords to be decryptable. What
> > I normally do is try to encrypt whatever the user enters as a password
> > and compare the resulting encrypted string with what's in the database
> > to make sure they correspond. If the encrypting function is univocal
> > (and md5 is) then the correct password will always return the same
> > encrypted string.
> >
> >  On Wed, 2002-10-09 at 16:06, Scott Fletcher wrote:
> > > Can it be de-encrypt???  I don't see how since you just use the function
> > > md5().
> > >
> > > "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > If you don't need the file to be changed to contain md5 encrypted
> > > > passwords use *fgetcsv() *to read the contenta,
> > > > then use *md5()* on the password and insert it into database using
> > > > mysql_query. No need to write a new file.
> > > >
> > > > Verdon Vaillancourt wrote:
> > > >
> > > > >Hi,
> > > > >
> > > > >I hope this question isn't too basic...
> > > > >
> > > > >I have a flat file (CSV) that I want to import into a mySQL db via
> > > > >phpMyAdmin. The file has about 1200 rows and is in a format like:
> > > > >"value","value","password","value","value","etc"
> > > > >The passwords are in clear text. I need them to be encrypted in md5.
> > > > >
> > > > >Is there any advice out there as to how I could process this
> flat-file
> > > > >before I import into my db or after the fact?
> > > > >
> > > > >Thanks, verdon
> > > > >Ps. Please cc me if replying to list as I am on digest mode
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I'm on a roll with the ASP questions these days, since I picked up the 
Chiliasp.

Here's one:

ASP has the function Option Explicit build in, it yells when you use 
variables without prior declaration, couldn't find anything like that in 
PHP documentation.
Thanks in advance.

R>
--- End Message ---
--- Begin Message ---
> I'm on a roll with the ASP questions these days, since I picked up the
> Chiliasp.
> 
> Here's one:
> 
> ASP has the function Option Explicit build in, it yells when you use
> variables without prior declaration, couldn't find anything like that
in
> PHP documentation.
> Thanks in advance.

If you set error_reporting to E_ALL (or include E_NOTICE, I think), then
PHP will give warnings when an undeclared variable is used.

---John Holmes...


--- End Message ---
--- Begin Message ---
Well, you can set error_reporting to E_ALL, which will cause PHP to
complain if you use a variable without having it initialized. There is
no exact equivalent to Option Explicit--and there still isn't any need
to declare the variables, just to initialize them before use.


Marco

On Wed, 2002-10-09 at 18:47, R. Z. wrote:
> I'm on a roll with the ASP questions these days, since I picked up the 
> Chiliasp.
> 
> Here's one:
> 
> ASP has the function Option Explicit build in, it yells when you use 
> variables without prior declaration, couldn't find anything like that in 
> PHP documentation.
> Thanks in advance.
> 
> R>
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
There's 2 ways to get that: use the php.ini setting ERROR_REPORTING, or the
function error_reporting().  to see undeclared variable use, call
error_reporting(E_NOTICE) at the top of your script.

http://www.php.net/manual/en/function.error-reporting.php

/nick

"R . Z ." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I'm on a roll with the ASP questions these days, since I picked up the
> Chiliasp.
>
> Here's one:
>
> ASP has the function Option Explicit build in, it yells when you use
> variables without prior declaration, couldn't find anything like that in
> PHP documentation.
> Thanks in advance.
>
> R>


--- End Message ---
--- Begin Message ---
wait, I take that back... I meant "to see uninitialized variable use", since
there's really no such thing as "declaring" a variable in PHP unless it's a
class member.

"Nick Eby" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> There's 2 ways to get that: use the php.ini setting ERROR_REPORTING, or
the
> function error_reporting().  to see undeclared variable use, call
> error_reporting(E_NOTICE) at the top of your script.
>
> http://www.php.net/manual/en/function.error-reporting.php
>
> /nick
>
> "R . Z ." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > I'm on a roll with the ASP questions these days, since I picked up the
> > Chiliasp.
> >
> > Here's one:
> >
> > ASP has the function Option Explicit build in, it yells when you use
> > variables without prior declaration, couldn't find anything like that in
> > PHP documentation.
> > Thanks in advance.
> >
> > R>
>
>


--- End Message ---
--- Begin Message ---
OK.

> -----Original Message-----
> From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 4:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Object methods - memory usage?
> 
> Well, I guess my questions are just too stupid to deserve an answer
> anyway. Sorry for spamming you guys with my retarded questions! I'll
> refrain from asking any more questions on this list in the future,
since
> I always seem to ask the wrong ones.
> 
> Humbly yours,
> Bogdan
> 
> Bogdan Stancescu wrote:
> > Hello!
> >
> > Ok, this is probably a very stupid question for someone who knows
how
> > these things work internally - but I don't, therefore I ask. :)
> >
> > When I instantiate an object, do the methods get instantiated as
well?
> > The question is asked memory-wise, not functionality-wise. More to
the
> > point, if I instantiate many identical objects with no class
variables
> > of their own but with many methods, will I get memory used up for
the
> > methods?
> >
> > If I were to guess, I'd say no extra memory is used for the methods
> > since I don't think you can dynamically redefine class methods, so
there
> > would be no reason for duplicating them instead of simply
referencing
> > the class definition - but then again, I don't know how PHP works
> > internally...
> >
> > Thank you!
> >
> > Bogdan
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
If the browser still doesn't listen, you can always put a time() arg in you 
img src. ie. "<img src=\"image.gif?" . time() . "\">"

David Erickson wrote:

> I had a similar problem and I just put this in front of my php so
> everytime my scripts are called they always tell the browser and any proxy
> servers not to cache anything from me.
> 
> 
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
> header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
>                                                      // always modified
> header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1
> header("Cache-Control: post-check=0, pre-check=0", false);
> header("Pragma: no-cache");                          // HTTP/1.0
> 
> 
> ----- Original Message -----
> From: "Donahue Ben" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 09, 2002 1:00 PM
> Subject: [PHP] Image problem
> 
> 
>> I upload an image.  Once I upload this image using the
>> is_uploaded_file function, then writing this image
>> file using the copy function.  Everything seems to
>> work fine.  When i try to update (that is uploading a
>> new file and saving it with the same name as the first
>> file created) it shows the first image instead of the
>> second image.  So what I did was closed my browser,
>> then reopened it, then everything was ok.  So I figure
>> that I have a cache problem.  I then tried using the
>> clearstatcache() function right after I update this
>> image file.  But it did not seem to work.  So am I
>> going to have to close and reopen my browser to see
>> these changes take place or is there something else I
>> can do?
>>
>> Ben
>>
>> __________________________________________________
>> Do you Yahoo!?
>> Faith Hill - Exclusive Performances, Videos & More
>> http://faith.yahoo.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>

-- 
Cheers,

Owen Prime
http://www.noggin.com.au
--- End Message ---
--- Begin Message ---
I can't figure out why the following code is not returning a column
total:

$sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver =
'$webserver'";
$hosting = pg_exec($connect, $sql1);
echo $hosting;

This returns: Resource ID #3

The only thing I can think of is that the hostingcost column's default
value is set to MONEY which is a postgres specific constraint.  The
query works fine within psql on the server, but not with php.

Thanks for any help.


--- End Message ---
--- Begin Message ---
Because pg_exec only executes the query and returns the resource that's
associated with the returns. If you want to read the results, you should
use pg_fetch_result():

$sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver =
'$webserver'";
$hosting_rs = pg_exec($connect, $sql1);
$hosting_data = pg_fetch_row ($hosting_rs, 0);
$hosting = $hosting_data[0];


Marco

On Wed, 2002-10-09 at 19:29, webmaster wrote:
> I can't figure out why the following code is not returning a column
> total:
> 
> $sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver =
> '$webserver'";
> $hosting = pg_exec($connect, $sql1);
> echo $hosting;
> 
> This returns: Resource ID #3
> 
> The only thing I can think of is that the hostingcost column's default
> value is set to MONEY which is a postgres specific constraint.  The
> query works fine within psql on the server, but not with php.
> 
> Thanks for any help.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
Sorry, folks... I meant "result" and not "returns" below. End of day =
brain fried. :)


Marco

On Wed, 2002-10-09 at 19:32, Marco Tabini wrote:
> Because pg_exec only executes the query and returns the resource that's
> associated with the returns. If you want to read the results, you should
> use pg_fetch_result():
> 
> $sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver =
> '$webserver'";
> $hosting_rs = pg_exec($connect, $sql1);
> $hosting_data = pg_fetch_row ($hosting_rs, 0);
> $hosting = $hosting_data[0];
> 
> 
> Marco
> 
> On Wed, 2002-10-09 at 19:29, webmaster wrote:
> > I can't figure out why the following code is not returning a column
> > total:
> > 
> > $sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver =
> > '$webserver'";
> > $hosting = pg_exec($connect, $sql1);
> > echo $hosting;
> > 
> > This returns: Resource ID #3
> > 
> > The only thing I can think of is that the hostingcost column's default
> > value is set to MONEY which is a postgres specific constraint.  The
> > query works fine within psql on the server, but not with php.
> > 
> > Thanks for any help.
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
Sorry for this slightly off topic question, but I beleive many of you will
have delt with this kind of thing before.

My client is asking for a Online Merchant that will allow him to validate
and charge credit cards. He orginally suggested Pay Pals but after I read
their docs I found that the Customers would have to sign up for a Pay Pals
account, which my client dislikes.

So can anyone recommend a good (maybe cheap) Merchant that can validate and
charge credit cards online? My client is searching for some reviews online,
but he asked if I could maybe get a list from progammers which have done it
before.

Thanks
Andrew

--- End Message ---
--- Begin Message ---
Most of our local banks here in Australia offer merchant facilities.

Judging by your email address your from the UK but I cant see any reason why
it should be different. Why dont you find out who your boss his/her banking
with and contact them regarding a merchant service...?


Regards
Jarrad Kabral



-----Original Message-----
From: Andrew Brampton [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 10 October 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] CC Processing Merchants


Sorry for this slightly off topic question, but I beleive many of you will
have delt with this kind of thing before.

My client is asking for a Online Merchant that will allow him to validate
and charge credit cards. He orginally suggested Pay Pals but after I read
their docs I found that the Customers would have to sign up for a Pay Pals
account, which my client dislikes.

So can anyone recommend a good (maybe cheap) Merchant that can validate and
charge credit cards online? My client is searching for some reviews online,
but he asked if I could maybe get a list from progammers which have done it
before.

Thanks
Andrew


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

On 10 Oct 2002 at 0:48, Andrew Brampton wrote:

> Sorry for this slightly off topic question, but I beleive many of you
> will have delt with this kind of thing before.

Yeah off-topic but I was wondering the same thing myself as I have not 
done many carts in awhile.

> So can anyone recommend a good (maybe cheap) Merchant that can validate
> and charge credit cards online? My client is searching for some reviews
> online, but he asked if I could maybe get a list from progammers which
> have done it before.

A few months ago I setup a client with Authorize.net. I always hated 
using them as I lose control for a click but it worked out well. I save 
all the data before I send them off and then update their record when 
Authorize.net sends them back to the url that I gave them. It has 
worked well.

Last year I used Verisign and they were very good. Very helpful and 
simple API. They bought cybercash who I used to use all the time.
--- End Message ---
--- Begin Message ---
We use an Authorize.net reseller, merchantexpress.com. While the sign 
up process can be a hassle, I'm pretty happy with Authorize.net. 
Since we use the ADC Direct method, we don't lose control at all. 
When the customer submits their credit card info, our PHP script uses 
Curl to securely request authorization from Authorize.net and then 
decides what page to show the customer based on the response it gets 
(i.e., card declined, card accepted, etc)

-Josh

>A few months ago I setup a client with Authorize.net. I always hated
>using them as I lose control for a click but it worked out well. I save
>all the data before I send them off and then update their record when
>Authorize.net sends them back to the url that I gave them. It has
>worked well.
--- End Message ---
--- Begin Message ---
You can find a lot of good information and comparisons
here:

http://www.merchantworkz.com

olinux

> 
> -----Original Message-----
> From: Andrew Brampton
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 10 October 2002 9:49 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] CC Processing Merchants
> 
> 
> Sorry for this slightly off topic question, but I
> beleive many of you will
> have delt with this kind of thing before.
> 
> My client is asking for a Online Merchant that will
> allow him to validate
> and charge credit cards. He orginally suggested Pay
> Pals but after I read
> their docs I found that the Customers would have to
> sign up for a Pay Pals
> account, which my client dislikes.
> 
> So can anyone recommend a good (maybe cheap)
> Merchant that can validate and
> charge credit cards online? My client is searching
> for some reviews online,
> but he asked if I could maybe get a list from
> progammers which have done it
> before.
> 
> Thanks
> Andrew

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--- End Message ---
--- Begin Message ---
Hi,

Thursday, October 10, 2002, 5:35:12 AM, you wrote:
SF> Found the problem with libmcrypt-2.5.3.  When I configured PHP using
SF> the --with-mcrypt option and the PHP configuration found libmcrypt without a
SF> problem.  After compiling and installing it.

SF> Once I fired up Apache.  I checked the PHP Info using phpinfo() function.
SF> The mcrypt showed up but there is no support ciphers (algorithms & modes).
SF> So, I had to use the php.ini as the PHP Manual stated on
SF> 'http://php.net/mcrypt'.  So, I added the two lines as shown in the clipping
SF> where libmcrypt was installed in.

SF> --clip--
SF> mcrypt.algorithms_dir = /usr/local/lib/libmcrypt
SF> mcrypt.modes_dir = /usr/local/lib/libmcrypt
SF> --clip--

SF> That is when PHP Info showed the 'mcrypt.algorithms_dir' and
SF> 'mcrypt.modes_dir' with data in it.  But the problem is I still get the
SF> error message when I tried any mcrypt function, the error message range from
SF> being unable to initalize the module to whatever the other error messages
SF> are.  I assumed there's a bug and filed a bug report to PHP but was rejected
SF> because I was told that I had the php.ini incorrect.  That doesn't make
SF> sense.  It took me a long time to find some clues to the problem.  What I
SF> found is that with any files in the "/usr/local/lib/libmcrypt" that end with
SF> *.a and *.la, they don't work.  There is no *.c and *.h files in that
SF> directory.

SF> I discovered that when I set the php.ini to point to the untarred libmcrypt
SF> directory where *.c and *.h are found in both
SF> '/usr/local/src4/libmcrypt-2.5.3/modules/algorithms' and
SF> '/usr/local/src4/libmcrypt-2.5.3/modules/modes'.  That's when the mcrypt
SF> function start working without a problem.  The problem is PHP doesn't work
SF> with the *.la and *.a files.  Again, I saw the OpenSSL directory where *.c
SF> and *.h files are found in both the algorithms and modes directory of the
SF> '/usr/local/ssl/include/openssl/' directory, it work just fine too.

SF> This had lead me to question of whether is there a bug in libmcrypt or php.
SF> You be the judge of it.  It would be so nice if this problem can be
SF> resolved.  I'm not sure if I'm allowed to use the open source code instead
SF> of the compiled codes.

You dont normally need to specify anything in php.ini for it to work
just make sure you have

--with-mcrypt=/usr/src/mcrypt-2.6.x (thats where it was untarred)

when you configure php. I have it working with nothing set in php.ini

-- 
regards,
Tom

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

I need some help here:

1 - I have a table created on a DB where I insert the data that I want.
2 - I have a submit page to submit the info I want to the DB
3 - I have a page that displays the info from the DB (choosed by id)
4 - I have a page where I have a text box field and a button.

When i want to submit some info to database, I give the pretended id (not 
auto_incremment), for example 100001 and the rest of the info.
The info is inserted and the id is 100001.

Now, I want to see the info with the id 100001, so I use the page with the text box 
filed and insert the ID 100001. When hit OK, i want to see the info of id 100001 
displayed on the (for example) info.php page, where ?id=100001.
If i insert the id 100002 and if it exists, I want to see the info displayed on 
info.php page, where ?id=100002.

Any soul can give me a possible code to use on the "search" form, in order to see the 
info displayed on the info.php page??

Thx
Miguel 
--- End Message ---
--- Begin Message ---
SELECT * FROM yourtable WHERE id = $_REQUEST['id']

And show the results...

All you have to do is make a page that receives the ID you typed in,
uses it in a query, and then shows the result of the query.

---John Holmes...

> -----Original Message-----
> From: Miguel Brás [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 09, 2002 9:33 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP problem
> 
> Hi there,
> 
> I need some help here:
> 
> 1 - I have a table created on a DB where I insert the data that I
want.
> 2 - I have a submit page to submit the info I want to the DB
> 3 - I have a page that displays the info from the DB (choosed by id)
> 4 - I have a page where I have a text box field and a button.
> 
> When i want to submit some info to database, I give the pretended id
(not
> auto_incremment), for example 100001 and the rest of the info.
> The info is inserted and the id is 100001.
> 
> Now, I want to see the info with the id 100001, so I use the page with
the
> text box filed and insert the ID 100001. When hit OK, i want to see
the
> info of id 100001 displayed on the (for example) info.php page, where
> ?id=100001.
> If i insert the id 100002 and if it exists, I want to see the info
> displayed on info.php page, where ?id=100002.
> 
> Any soul can give me a possible code to use on the "search" form, in
order
> to see the info displayed on the info.php page??
> 
> Thx
> Miguel


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

Wednesday, October 9, 2002, 10:19:30 PM, you wrote:
MK> Ok, my bad, firstup i didnot set in httpd.conf to process *.php3 files. But
MK> i already fix that. So, now all I'm getting is that when I I try to process
MK> the data from a form whether I'm using GET or POST method,  the value that i
MK> get processed form is still null.

MK> I check in the error log file and this is what it say:
MK> [Wed Oct 09 20:18:47 2002] [error] PHP Notice:  Undefined variable:  name in
MK> e:\program files\apache group\apache\htdocs\test.php3 on line 3

MK> Or is there something wrong in my code?

MK> <form method=GET action=test.php3>

MK>     <tr>
MK>       <td width="50%" style="border-style: none; border-width: medium"
height="20">>
MK>   <p>Name: <input type="text" name="name" size="20"></p>
MK>   <p>&nbsp;</p>
MK>   <p><input type="submit" value="Submit" name="submit"><input type="reset"
MK> value="Reset" name="B2"></p>
MK> </form>
MK> ----------------------------------------------------------------------------
MK> -----------------------
MK> <html>
MK> <?php
MK> print "my name is $name";
?>>
MK> </html>

Try

<?php
print "my name is $_GET['name']";
?>

If that works lookup register_globals on www.php.net

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
Ok, here is the question:

I have a sql query, nothing special. It has 3 variables. I have created the
php code to display the variables in context with the html code. I need it
to loop a select number of times, most likely twice, and therefore display
the first two rows of the query.

In other words, querying the database for a set of rows, it needs to display
the first two of the rows on the page.

Here is the code I have tried so far, which has either looped continuosly or
displayed the top row twice (edited for security):

<?php


 $sql  = "SELECT * FROM [database] ORDER BY [collumn] LIMIT 2";
 $result = mysql_query($sql) or die("problem with $sql");
 // list($title) = mysql_fetch_array($result);
?>

<td width=48% align=left valign=top>

<h3>What's New?</h3>

<?php

/* It tried this: */ while(list($link, $title, $content) =
mysql_fetch_array($result)){

/* And this: */ while($row = mysql_fetch_array($result) and (($count++)<2)){

// The first kept looping infinitely, the second displayed the top row
twice. Grr... >_<

?>

<h4>
<a href="<?php echo mysql_result($result,0,"link"); ?>"><?php echo
mysql_result($result,0,"title"); ?></a>
</h4>
<p>
<?php echo mysql_result($result,0,"content"); ?>
</p>

<?php
}
?>

</td>

Thanks for any help you can provide.

-Keith Posehn


--- End Message ---
--- Begin Message ---
With the line:

while (list($link, $title, $content) = mysql_fetch_array($result)) {

The php docs don't actually say what the list() function returns, but since 
your getting an infinite loop i would say that it probably evaluates to 
true no matter whats on the right hand side of the assignment. I would 
suggest that you use:

while ($tmp = mysql_fetch_array($result)) {
        list($link, $title, $content) = $tmp;

Cheers,

Owen Prime
http://www.noggin.com.au


Keith Posehn wrote:

> Ok, here is the question:
> 
> I have a sql query, nothing special. It has 3 variables. I have created
> the php code to display the variables in context with the html code. I
> need it to loop a select number of times, most likely twice, and therefore
> display the first two rows of the query.
> 
> In other words, querying the database for a set of rows, it needs to
> display the first two of the rows on the page.
> 
> Here is the code I have tried so far, which has either looped continuosly
> or displayed the top row twice (edited for security):
> 
> <?php
> 
> 
>  $sql  = "SELECT * FROM [database] ORDER BY [collumn] LIMIT 2";
>  $result = mysql_query($sql) or die("problem with $sql");
>  // list($title) = mysql_fetch_array($result);
> ?>
> 
> <td width=48% align=left valign=top>
> 
> <h3>What's New?</h3>
> 
> <?php
> 
> /* It tried this: */ while(list($link, $title, $content) =
> mysql_fetch_array($result)){
> 
> /* And this: */ while($row = mysql_fetch_array($result) and
> (($count++)<2)){
> 
> // The first kept looping infinitely, the second displayed the top row
> twice. Grr... >_<
> 
> ?>
> 
> <h4>
> <a href="<?php echo mysql_result($result,0,"link"); ?>"><?php echo
> mysql_result($result,0,"title"); ?></a>
> </h4>
> <p>
> <?php echo mysql_result($result,0,"content"); ?>
> </p>
> 
> <?php
> }
> ?>
> 
> </td>
> 
> Thanks for any help you can provide.
> 
> -Keith Posehn


--- End Message ---
--- Begin Message ---
I've loaded an html file into a string.  What I'd like to do is create two
new strings:

first new string with the original string but remove all content from the
beginning of the file up to and including <body>, and then remove from the
end of file up to and including </body>

second new string only containing content after <head> up to and including
<body>

Any ideas on simple ways to do this?

TIA
-Shawn


--- End Message ---
--- Begin Message ---
There are a couple of ways you could do it, the proper way with a regular expression, 
or you could just kludge it using explode() and chucking out the stuff you did not 
need.

-----Original Message-----
From: Shawn McKenzie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 10 October 2002 7:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Extract HTML tags


I've loaded an html file into a string.  What I'd like to do is create two
new strings:

first new string with the original string but remove all content from the
beginning of the file up to and including <body>, and then remove from the
end of file up to and including </body>

second new string only containing content after <head> up to and including
<body>

Any ideas on simple ways to do this?

TIA
-Shawn



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

--- End Message ---
--- Begin Message ---
If you can guarantee that your body tags are lowercase and have no args, 
then I would check out strtok() in the string functions. If your body tags 
are not that easy to match then I suggest you use either a regex or write a 
state machine to parse the string. A good html parsing state machine is in 
the php source for htmlstriptags. Note that Regex's are extremely expensive 
on large strings.

Cheers,

Owen Prime
http://www.noggin.com.au

Shawn McKenzie wrote:

> I've loaded an html file into a string.  What I'd like to do is create two
> new strings:
> 
> first new string with the original string but remove all content from the
> beginning of the file up to and including <body>, and then remove from the
> end of file up to and including </body>
> 
> second new string only containing content after <head> up to and including
> <body>
> 
> Any ideas on simple ways to do this?
> 
> TIA
> -Shawn


--- End Message ---
--- Begin Message ---
try something along the lines of:

preg_match('/<body[^>]*>([.]*)</body>/im', $string, $foo);

$foo[1] = 'your body string';

preg_match('/<head>([.]*)<body/im', $string, $bar);

$bar[1] = 'your head string';

while not tested (and probably off a little) this should get you going...

-js

Shawn McKenzie wrote:
> I've loaded an html file into a string.  What I'd like to do is create two
> new strings:
> 
> first new string with the original string but remove all content from the
> beginning of the file up to and including <body>, and then remove from the
> end of file up to and including </body>
> 
> second new string only containing content after <head> up to and including
> <body>
> 
> Any ideas on simple ways to do this?
> 
> TIA
> -Shawn
> 
> 
> 



--- End Message ---
--- Begin Message ---
I am trying to create an array to hold shopping cart information.  The array
I am using is called "cartArray".  What I want to do is to define a
sub-array of cartArray with the information from one product.  Then the next
time a product is added it appends then new information as a second
sub-array to cartArray and so forth.  Following is some code I have been
using to test with and so far PHP will let me use ".=" to append but when I
try to call it back with "print_r" or echo array[][] only the first entry is
returned.  Any ideas what I am doing wrong?

--------------------------------------------
 $brand="Brand1";
 $itemnumber="456789";
 $itemname="Some Item Name";
 $itemqty=3;
 $cartArray[] .= array(0=>array($itemnumber=>"$brand", "$itemqty",
"$itemname"));
 print_r($cartArray)."<BR><BR>";
 $brand="Brand2";
 $itemnumber="123456";
 $itemname="Another Item Name";
 $itemqty=9;
 array_push($cartArray, array($itemnumber=>"$brand", "$itemqty",
"$itemname"));
 print_r($cartArray)."<BR><BR>";
 echo $cartArray[0][0]."<BR><BR>";
--------------------------------------------

Thank you,
Jonathan Duncan


--- End Message ---
--- Begin Message ---
try doing this for each item:

$cartArray[] = array('itemnumber' => $itemnumber, 'brand' => $brand, 
'quantity' => $itemqty, 'name' => $itemname);

-js

Jonathan Duncan wrote:
> I am trying to create an array to hold shopping cart information.  The array
> I am using is called "cartArray".  What I want to do is to define a
> sub-array of cartArray with the information from one product.  Then the next
> time a product is added it appends then new information as a second
> sub-array to cartArray and so forth.  Following is some code I have been
> using to test with and so far PHP will let me use ".=" to append but when I
> try to call it back with "print_r" or echo array[][] only the first entry is
> returned.  Any ideas what I am doing wrong?
> 
> --------------------------------------------
>  $brand="Brand1";
>  $itemnumber="456789";
>  $itemname="Some Item Name";
>  $itemqty=3;
>  $cartArray[] .= array(0=>array($itemnumber=>"$brand", "$itemqty",
> "$itemname"));
>  print_r($cartArray)."<BR><BR>";
>  $brand="Brand2";
>  $itemnumber="123456";
>  $itemname="Another Item Name";
>  $itemqty=9;
>  array_push($cartArray, array($itemnumber=>"$brand", "$itemqty",
> "$itemname"));
>  print_r($cartArray)."<BR><BR>";
>  echo $cartArray[0][0]."<BR><BR>";
> --------------------------------------------
> 
> Thank you,
> Jonathan Duncan
> 
> 
> 



--- End Message ---
--- Begin Message ---
Okay here is the new code and this is still not working.

<?php

require("./config.php");

$sqlserver = $server1;
$sqlusername = $username1;
$sqlpassword = $password1;
$sqldatabase = $database1;

//******************************
$nam_bak=date('D,d-m-Y');

exec("mysqldump -u\"$sqlusername\" -p\"$sqlpassword\" \"$sqldatabase\" >
$backupdir/$nam.sql");

exec("gzip $backupdir/$nam.sql");

?>


--- End Message ---
--- Begin Message ---
Haven't really been following this thread but you may want to make sure that

1. mysqldump & gzip are executable by apache
2. $backupdir is writeable by apache
3. You have taken into consideration your php safe mode settings

Cheers,

Owen Prime
http://www.noggin.com.au

Ken wrote:

> Okay here is the new code and this is still not working.
> 
> <?php
> 
> require("./config.php");
> 
> $sqlserver = $server1;
> $sqlusername = $username1;
> $sqlpassword = $password1;
> $sqldatabase = $database1;
> 
> //******************************
> $nam_bak=date('D,d-m-Y');
> 
> exec("mysqldump -u\"$sqlusername\" -p\"$sqlpassword\" \"$sqldatabase\" >
> $backupdir/$nam.sql");
> 
> exec("gzip $backupdir/$nam.sql");
> 
> ?>

--- End Message ---
--- Begin Message ---
"Muhammad Khairuzzaman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I worked, but i dont get it, why use $_POST['name'] or $_GET['name'] when

    If you set a variable inside your script called $validuser=true, how
would you know if that was POSTed to your script or I added

secretpage.php?validuser=true

to the URL?  Bet you wouldn't have checked...

 - Steve Yates
 - Can taglines have sequels?  Hmmm.....

~ Do you like my taglines? Add them to your messages and
~ laugh through hundreds more by downloading Taglinator
~ at www.srtware.com today!


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



  hai ,
       I want to create an animated line in php from (x,y) to (x1,y1).will
  php support animation.if so how do i go about in doing this.how do i
  draw a char so that it keeps on changing colors till i close browser.
              thanks for help
                 Arun





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



 hai ,
      I want to create an animated line in php from (x,y) to (x1,y1).will
 php support animation.if so how do i go about in doing this.how do i
 draw a char so that it keeps on changing colors till i close browser.
             thanks for help
                Arun



--- End Message ---
--- Begin Message ---
This cannot be done in php, but in javascript. I won't tell you how, 
because I'm lazy

arun kv wrote:

>
>  hai ,
>       I want to create an animated line in php from (x,y) to (x1,y1).will
>  php support animation.if so how do i go about in doing this.how do i
>  draw a char so that it keeps on changing colors till i close browser.
>              thanks for help
>                 Arun
>
>
>
>
>
>
>  
>

--- End Message ---
--- Begin Message ---
I have a mysql db with a particular table that I am inserting into.
This table has an id column that auto-increments.  Is it possible to get
the id of the row that I just inserted into, without re-querying???

The problem that I have is that the data being inserted will be
identical for several rows, and hence there is no way to assure that
when I query with certain parameters that a unique row, the row that I
just inserted, will be returned.  The only way that I can think of doing
this is by creating a timestamp as an identifying piece.  Am I making
any sense?

--- End Message ---
--- Begin Message ---
On Thursday 10 October 2002 15:37, Pablo Oliva wrote:
> I have a mysql db with a particular table that I am inserting into.
> This table has an id column that auto-increments.  Is it possible to get
> the id of the row that I just inserted into, without re-querying???

rftm, mysql_insert_id().

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

/*
Consider well the proportions of things.  It is better to be a young June-bug
than an old bird of paradise.
                -- Mark Twain, "Pudd'nhead Wilson's Calendar"
*/

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

 how to ping by PHP  ???   
I wanna to ping some hosts and get echo back. 
 thanx.

--- End Message ---
--- Begin Message ---
Use a call out to a shell ... eg

$result = `ping x.xy.z.i`;

oh and you may need to use a path and capture the stand out.. as well.



Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Achi [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, 10 October 2002 12:18 AM
To: Daniel Kushner; 'Muhammad Khairuzzaman'; [EMAIL PROTECTED]
Subject: [PHP] how to ping 


Hi

 how to ping by PHP  ???   
I wanna to ping some hosts and get echo back. 
 thanx.


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


--- End Message ---
--- Begin Message ---
I'm using the following function to create the files. the function is part
of a class so "$this->somthing" refers to somthing in that class:

function create_file($file_name) {
    if (!$this->fp = fopen($file_name, wb)) {
        $this->error_msg .= $this->error_create . ' ' . $file_name;
        return false;
    } else {
        $this->file = $file_name;
        return $this->fp;
    }
}

Also the script using this class is in the http-server-root and includes
this class. the include file isn't in the http-server-root, but that
shouldn't have any effect since it's not the include file that calls to
function.

The calling script: http-server-root
The include class: http-server-root\nef
Where I want to create files: http-server-root\nef\articles

Hope this gave you a better chance of helping me out :)

~ Aidal


"Timothy J Hitchens" <[EMAIL PROTECTED]> wrote in message
006b01c26f7a$28ffa110$0500a8c0@BAMBINO">news:006b01c26f7a$28ffa110$0500a8c0@BAMBINO...
> If the script is in the same directory just try either "{file}" nothing
> in front or "./{file}"
>
> What function are you using to create files?
>
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Aidal [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 9 October 2002 4:24 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how to create files??
>
>
> Hi NG.
>
> I'm having problems creating files at a certain location.
> If I attemt to create a file it gets created in the rootdir (htdocs)
> even though I add a path infront of the file name. I've tried severel
> ways of adding a path (with "/" and "\\") but nothing works.
>
> eksample: "/nef/articles/54.txt"
>
> File 54.txt gets created but not at the intented location, instead it
> gets created in htdocs.
>
> Can anyone help me by telling me how I'm suppose to do this? I'm running
> PHP on Win98 with Apache.
>
> ~ Aidal
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
hai is it possible to embed C code in PHP as we do in PostGreSQL using
ecpg. if so how do i go about.
             thanks
                     Arun


--- End Message ---
--- Begin Message ---
hii ....
Ý've  tried  a  trace  practice   but  it  doesnt  work ...
my  server  NT5   on  W2K ....

local  testing  W2K  apache2.0.40
i've   been  to  work  it  on  my  local  testing  server  ....

it  return's  a  failure  that :

Warning:  Unable to fork [tracert dummyhost.com] in
D:\inetweb\agencyturk\uziletim.com\uziletim.com\php\trace.php on line 26

url  :
http://www.uziletim.com/php/trace.php

where  is  my  wrong ?  i  couldn't  understand  it  clearly  ?

maybe  www  server  has  no  tracert.exe  ?



--- End Message ---

Reply via email to