Try.. printf(%.2f, $amount);
-Kevin
- Original Message -
From: Bryan Koschmann - GKT [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Tuesday, November 26, 2002 12:29 PM
Subject: [PHP] decimal places
Hello,
Does anyone here have a good way to make sure dollar amounts are
$amount = 17.9;
$dollars = $ . number_format($amount, 2);
echo $dollars;
you should see $17.90.
Robbert van Andel
-Original Message-
From: Bryan Koschmann - GKT [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 11:29 AM
To: PHP General
Subject: [PHP] decimal places
Hello,
Usually the best solution is to use whatever backend you are talking to
correctly. For a long-running MySQL query, for example, you should have a
look at the non-blocking mysql_unbuffered_query() call.
There is a fork() function in the pcntl extension and there is also a very
experimental thread
As an addition to that, if you don't want the thousands separator to be ',';
do the following:
$amount = 1234.567
$fmt1 = number_format($amount,2);
$fmt2 = number_format($amount,2,'.','');
echo($fmt1\n$fmt2);
This will output:
1,234.56
1234.56
Matt
- Original Message -
From: Van Andel,
input type=text size=20 name=rsname ?php if($_SESSION['rfname'] !=
''){print value='{$_SESSION['rfname']}'';}
but I just get a ? in the value field, not the name.
Yeah there's a good reason for that. You're not ending yoiur PHP tag! :-P
Joking aside you're on the right track. This IS the
Perfect!
Thanks for the quick responses everyone! I really appreciate the help.
Have a good day!
Bryan
On Tue, 26 Nov 2002, Matt Vos wrote:
|As an addition to that, if you don't want the thousands separator to be ',';
|do the following:
|
|$amount = 1234.567
|$fmt1 =
Hi everyone,
I have an application, where users can upload data files formatted as
follows:
0.0106375 686.60165.391
0.01147 606.46754.997
0.0122815 640.284 46.5355
0.0130753 668.396 39.3671
Hi
I´m using php version 4.2.3 with GD version 2.0.7 (with JPG and PNG Support
enabled). When i try to a specific color in my map, nothing happenes. Why?
?php
header(Content-type: image/png);
$im = ImageCreatefrompng ('mapa2.png');
$origem = imagecolorexact($im, 255, 255, 0);
Loop an fgets()
i.e.
$fp = fopen($file)
while ($filerow = fgets($fp,1024)) /* Read 1024 bytes or to EOL, whichever
is first) */
{
$filerow = str_replace(; ,, $filerow);
$filerow = str_replace(# ,, $filerow);
$filerow = str_replace(\r,, $filerow);
$size = strlen($filerow);
Hi Kevin,
Bunch of thanks to you. It works beautifully! Now, all I have to do is go
back over 200+ files and fix 'em all!
Sigh . . . nice way to memorize your code! :
Btw, in my test code, I did have the ending ? -- matter of act, I had two of
them!! Hmmm -- it amazing how easily the obvious
Marco,
Would you have any examples for using an SSH tunnel? I'm using fsockopen
to get data from proprietary server software (just returns data to me in
different formats) and I would like to have it secure. I'm just not sure
how I could incorporate that.
Thanks,
Bryan
On 26 Nov 2002,
You could try Mercury, which is free.
Mercury Information: http://www.pmail.com/overviews/ovw_mercwin.htm
Mercury Download: http://www.pmail.com/downloads_maine_t.htm
You'll want the Mercury Mail Transport System for Win32 and Netware
Systems v.3.32. Don't
worry, Netware is not required.
-Rod
Hi,
Thanks for the reply. I appreciate your help. fgets() reads to the EOF; not the
EOL. Is there something similar to fgets() that I can use? Perhaps where I can
state explicity read the file until you encounter and EOL char?
Cheers,
Lee
Matt Vos wrote:
Loop an fgets()
i.e.
$fp =
Is there an actual way to store the data in a temporary table as you go
through the multi-page form and then extract that data from the temporary
storage from the DB App and either process the data or store it in a
permanent place?
I have never done this before, but maybe someone else has? Any
Actually, there appears to be a solution on the PHP.web
[http://www.php.net/manual/en/function.fgets.php]
Note: The length parameter became optional in PHP 4.2.0, if omitted, it would
assume 1024 as the line length. As of PHP 4.3, omitting length will keep reading
from the stream until it reaches
PHP v4.2.3
Win2K Sp2
Apache v1.3.24
I'm testing some file upload code for a image library type site and the file
upload keeps failing... here's some code to explain what the issue is...
?
// The form has been posted and we are processing the posted data
print_r($_FILES);
I would like to make a "Lost Password" part to my member's
area script but the problem is, the passwords in the database are encrypted
using the password function. How could I decrypt it for a lost password
thing?
Thanks,Stephen Cratonhttp://www.melchior.us
"Life is a gift from God. Wasting
Hi all
I am looking for a messaging system (like majordomo) where users can have
the posted messages forwarded to their email account. Also to be able to
post from their own email account and all subscribed memebers will receive a
copy.
But in the same time to be able to access the message
I would like to make a Lost Password part to my member's area script
but the problem is, the passwords in the database are encrypted using
the password function. How could I decrypt it for a lost password thing?
You don't. You create some sort of mechanism to allow them to change
their
Password function is one way only...your only choice is to use
encrypt() decrypt() or just do like most other places, they say they
lost it, and you email it to a verified email address.
On Tue, 26 Nov 2002 16:16:22 -0500
Stephen [EMAIL PROTECTED] wrote:
I would like to make a Lost Password
On Wednesday 27 November 2002 05:16, Stephen wrote:
I would like to make a Lost Password part to my member's area script but
the problem is, the passwords in the database are encrypted using the
password function. How could I decrypt it for a lost password thing?
1) Please do not use HTML mail
That's what I'm going to do but how can I pull it from the database to
decrypt it, then send it?
- Original Message -
From: Tom Woody [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 26, 2002 4:22 PM
Subject: Re: [PHP] Decrypt Password
On Wednesday 27 November 2002 05:16, The Gabster wrote:
Hi all
I am looking for a messaging system (like majordomo) where users can have
the posted messages forwarded to their email account. Also to be able to
post from their own email account and all subscribed memebers will receive
a copy.
On Wednesday 27 November 2002 05:11, [EMAIL PROTECTED] wrote:
Is there an actual way to store the data in a temporary table as you go
through the multi-page form and then extract that data from the temporary
storage from the DB App and either process the data or store it in a
permanent place?
No, fgets() reads to EOL, I use it all the time.
fread() will read to EOF, if you let it, as it is binary safe.
Matt
- Original Message -
From: Lee P. Reilly [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 26, 2002 4:09 PM
Subject: Re: [PHP] Upload problem - PC, *nix, and
Hello guys
I have an script that just shows a list of names brought from a data base as this:
name 1
name 2
etc...
I want to have the following:
name 1 Delete
name 2 Delete
etc...
And when the user hits the Delete link a pop up dialog box (javascript style) asks
for confirmation.
I guess
Ah, okay. However, it seems to ignore a Mac EOL character. I'm installing the
PHP4.3 (test version) to try the auto_detect_line_endings configuration option.
Cheers,
Lee
Matt Vos wrote:
No, fgets() reads to EOL, I use it all the time.
fread() will read to EOF, if you let it, as it is binary
Don't bother to respond people... worked out the issue - the double
backslashes in the name...
Cheers
Rich
-Original Message-
From: Rich Gray [mailto:[EMAIL PROTECTED]]
Sent: 26 November 2002 21:14
To: [EMAIL PROTECTED]
Subject: [PHP] File upload on Win2k ...
PHP v4.2.3
Win2K Sp2
Apache
Thanks Jason...
I went through those but so far nothing in php... :-(
Thanks anyway,
Gabi.
Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Wednesday 27 November 2002 05:16, The Gabster wrote:
Hi all
I am looking for a messaging system (like
Is there an actual way to store the data in a temporary table as you go
through the multi-page form and then extract that data from the temporary
storage from the DB App and either process the data or store it in a
permanent place?
I have never done this before, but maybe someone else has?
howdy all,
this should be fairly simple but not turning out to be so am asking for a
little help..
I have a script that fetches all the records in a table and display's them
on the screen.
I get and display the records with the following:
?
// get the list of resellers from the db
$res =
I tried it it fails. The browser sends the query string with the amp;
the $_GET access fails.
I am using IE 6. I can't imagine that it would be buggy in this regard.
--
JR
-Original Message-
From: @ Edwin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 11:17 AM
To:
This is the fact:
I'm building a homepage that can access a mysql database, and display the records
within a certain condition. Following this it is verified if the sql result was empty
then it should write a certain frase, if not it should write the records. I've got
the worst part ok, the
Hi
you can use password('password_var_name')
for example (insert into bla password('$password'));
and
after selecting the password you can use and no need encrypt decrypt
the value
echo(password('password')); will write the real value...
I would like to make a Lost Password part to my
Ok ... I take back what I said about amp; not working in a query string.
It works just fine.
But, none of this explains why I am sometimes receiving a request with amp;
in the query string, especially I am using '' in the A link.
The only way I think I can find out is by augmenting the error
?
// get the list of resellers from the db
$res = mysql_query(SELECT * FROM resellers ORDER BY id);
// print all records in the DB
while ($myrow = mysql_fetch_array($res)){
echo trtddiv align='center'font
class=\content\.$myrow['id']./font/div /tdtdnbsp;/tdtddiv
align='justify'font
Hi
When I pass variables to a new page in the address bare of the browser it looks like
www.whatever.com/index.php?uName=KrispassWd=1234
How can I hide this so it's just
www.whatever.com/index.php or even better just
www.whatever.com
thanks
Kris
At 00:00 27.11.2002, Jonathan Rosenberg \(Tabby's Place\) said:
[snip]
Ok ... I take back what I said about amp; not working in a query string.
It works just fine.
[snip]
Ahhh - and I just created a test page for all
when using session registered variables
i can only get them to save as session variables for one page
then on the next page they are gone
far as i can tell the variables are not getting written over or unset
and the session is not gettting destroyed
any other ideas what it might be?
Jason
--
There does not seem to be an 'IF' statement?
Bret
Register your Domain for as little as $8.95 yr.
At pgaws.com
Find a contractor or find a contract at Tech-Temp.com
- Original Message -
From: Rodrigo de Oliveira [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 26,
If index.php is the index page of your website, then you do not need to
specify it at all.
i.e. www.whatever.com/index.php?uName=Kris
is functionally equivalent to www.whatever.com?uName=Kris
A way to get rid of the variables passed in the query string is to use
POST instead of GET as the
try using the extract command instead of the array reference
ie:
?
while ($row = mysql_fetch_array($res)) {
extract($row);
echotrtdID Profissional/td;
echotd$id/td/tr;
?
instead of :
while ($row = mysql_fetch_array($res)) {
?
?
echotrtdID Profissional/td;
echotd.$row['id']./td/tr;
Jason
Thanks Kyle, got it working like a treat :) for some reason it wasn't
selecting the DB but it is now :D
-Original Message-
From: Kyle Gibson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 27 November 2002 10:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: deleting a record.
?
//
when using session registered variables
i can only get them to save as session variables for one page
then on the next page they are gone
far as i can tell the variables are not getting written over or unset
and the session is not gettting destroyed
any other ideas what it might be?
Do you
?
include db_dados.php;
?
? $sql = SELECT * FROM tb_tao WHERE area='$area'and status=1;
$res = @mysql_query($sql,$id)
?
?
echo table width='100%' height='100%' border='0' align='center'
?
?
$rodrigo=mysql_fetch_array($res);
if($rodrigo=false){
echo trtddiv align='center'Nenhum profissional
--- Jonathan Rosenberg [EMAIL PROTECTED] wrote:
I tried it it fails. The browser sends the query
string with the amp; the $_GET access fails.
I am using IE 6. I can't imagine that it would be
buggy in this regard.
I just tried this in IE 6, and it worked fine for me. My test code
Hello -
There were several discussions on how to do zip code location lookups,
distance checks, zipcode data, etc. Well, for everyone that was following
those threads, check this out:
http://www.sanisoft.com/ziploc/
Opensource (and free) php class to do everything you zipcode distances.
Downright
I already use POST as the form method.
I know
www.whatever.com/index.php?uName=Kris can be the same as
www.whatever.com?uName=Kris
I just want to get rid of the ?uName=Kris part on the end
I still need the variables to be passed I just don't want the user to be
able to see them.
Thanks for your
You might also want to look at this solution. It seems functional and
elegant, worked simply for me...
http://codewalkers.com/tutorials.php?show=28page=1
On 11/26/2002 01:42 PM, Shane McBride wrote:
It's been a while since I have done any PHP work. I am creating an online
employment
Then the only solution I can think of is to make them part of the POST
variables somehow--ie. through a hidden field, which you can even fill
dynamically with Javascript. AFAIK that's the only way.
Cheers,
Marco
--
php|architect - The magazine for PHP Professionals
The first
You could try Sendmail, it comes with it's own version of Linux for free
:)
Just kidding, you sounded too serious.
Bryan
On Tue, 26 Nov 2002, Manuel Ochoa wrote:
|
|I'm setting up a Windows 2000 server with Apache, PHP and MySQL. I also need to setup
|email service for 1 domain name.
howdy,
I've had a look around and haven't been able to find what I'm after..
What I'm trying to do is display the number of each individual record with
in a table in a db WITH OUT relying on the records id, here what I've come
up with so far:
//get and count the number of records in the table
I have an array $keywords, how do I test to see if it is empty? $keywords == '' seems
to throw out an error.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$result = mysql_query(select * from [database table]);
echo table;
while($data = mysql_fetch_array($result))
{
$count++;
echo tr;
echo td$count/td;
echo td$data[0]/td;
echo td$data[1]/td;
...and so on
echo /tr;
}
echo /table;
This
I believe if(empty($keywords)) or even if(!$keywords) will check if they are empty
Robbert van Andel
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] testing for empty array
I have an
There may be an easier way, but I usually use sessions when I want to pass
variables around that I want to remain hidden, but want to use links.
Best Regards
Bob Irwin
Server Admin Web Programmer
Planet Netcom
- Original Message -
From: Kris [EMAIL PROTECTED]
Cc: PHP-General [EMAIL
Thanks Robert
-Original Message-
From: Van Andel, Robert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 27 November 2002 11:43 AM
To: Peter Houchin; php_gen
Subject: RE: [PHP] displaying record number in a cell in a table
$result = mysql_query(select * from [database table]);
echo
I have an array $keywords, how do I test to see if it is empty? $keywords == '' seems to throw out an error.
Maybe...
if(count($keywords) = 0)
{
//...
}
--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Tue, 26 Nov 2002, Kyle Gibson wrote:
I have an array $keywords, how do I test to see if it is empty?
$keywords == '' seems to throw out an error.
Maybe...
if(count($keywords) = 0)
{
//...
}
I use sizeof(), which apparently is an alias to count(), and it works
fine, so
hi to all;
sorry for posting this mysql question again. im searching for a report
builder for mysql specifically for creating reports for
invoice/receipt..etc.
just like crystal reports and oracle report builder. or is there any
suggestion to do it in PHP .
any idea? thanks in advance
Have you index.php page as a frameset, and load all pages into the
frameset. No matter where the user is on your site, they'll just see
http://www.whatever.com
Kris wrote:
Hi
When I pass variables to a new page in the address bare of the browser it looks like
sorry for posting this mysql question again. im searching for a report
builder for mysql specifically for creating reports for
invoice/receipt..etc.
just like crystal reports and oracle report builder. or is there any
suggestion to do it in PHP .
Get any of the hundreds of PDF classes out
Oh, ok. That makes a lot more sense. Thanks for the info John :)
- Nilaab
-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:00 PM
To: @ Nilaab; [EMAIL PROTECTED]
Subject: Re: [PHP] Multiple page form
Is there an actual
It's not the same as simply generating a report in PDF. He's looking for a
band-type of report writer with groupoing levels, automatic totals,
subtotals, sub reports, drag anddrop fields, right click formatting
options, etc. One of the great leaps backwards with PHP, or any of the
scripting
Hi, everyone:
I am a Chinese, I am a programmer.
I encounter a problem about php.
Attachment is 1.php,
when i open this file (this file is saved at linux server, apache and
php 4.2.3 are installed on this server) in Internet Explorer, error
displays:
Parse error: parse error,
I am not positive of the problem as I can not see your code, but if you
want to display the words that end in '5C' the you can do them like so:
\(escape character) like this: \(95 5C 5C)
If you could sttach some code we might have a better idea.
-tom culpepper
[EMAIL PROTECTED] wrote:
Hi,
Hello,
I am a newbie in this PHP world. I was just looking around for
information on Download of files using PHP.
I need to provide link/button, by clicking which a user can download a file
(Say a CSV file..). Does PHP provide any class or methods to achieve the
same...? Looking forward for
Yes, we are way off topic.
You offered a solution, and it rang warning bells for me from an
accessibility P.O.V... yes, I miss-quoted the spec, but yes, i'm right
about IE, and almost every developer using px should be very worried for
quite some time, until it gets addressed.
Cheers,
Justin
--- Venkatesh Hosur [EMAIL PROTECTED] wrote:
I was just looking around for information on Download
of files using PHP. I need to provide link/button, by
clicking which a user can download a file (Say a CSV
file..)
The best solution, in my opinion, is just to use a straightforward
HTML link:
Hey
Also in your php.ini do you have
session.use_cookies = 1
if its set to 0 then you will need to pass the variables through the URL.
- Lee
Jason Romero [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
when using session registered variables
i can only get them
Hi, everyone:
I am a Chinese, I am a programmer.
I encounter a problem about php.
Attachment is 1.php,
when i open this file (this file is saved at linux server, apache and
php 4.2.3 are installed on this server) in Internet Explorer, error
displays:
Parse error: parse error,
Hi,
I am a newbie in this PHP world. I was just looking around for
information on Download of files using PHP.
I need to provide link/button, by clicking which a user can download a file
(Say a CSV file..). Does PHP provide any class or methods to achieve the
same...? Looking forward for
Hey again.
In the php.ini if
register_globals = Off - which is the default setting
then you will need to use $_SESSION['variable']
- Lee
Jason Romero [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
when using session registered variables
i can only get them to
On Wednesday 27 November 2002 05:56, The Gabster wrote:
Thanks Jason...
I went through those but so far nothing in php... :-(
google - mailing list manager software
SIGH
Try adding 'php' to the list of search terms above.
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source
lookup ereg() and eregi()
-tom culpepper
Philip J. Newman wrote:
Where should i start, tips wanted.
I would like to check a username string for valid charactors before the name
is processed.
Someone point me in the right direction please
---
Philip J. Newman.
Head Developer.
PhilipNZ.com New
Hello php-general,
Hi.
I want to know how i can export tree structure from Mysql table to
XML
mysql table structure is:
ID - Group Unique Id
P_ID - Parent Id
Name - Name of group
I want to make XML whit tree structure. Can some body help me!
--
Best regards,
Boris
hai php-general,
I want to know how can I redirect the browser to contact to a new ip
address of the same server.
In Detail
I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine
running Apache).
I contact the server through a client(Browser), through this client
I change the
Wow this was really elegant!! thank you!! :-)
if (0 strlen(implode('',$a))) {
// error
}
Stas
-
Per te Blu American Express è gratis
Hi,
if(!preg_match(/^[a-z0-9_]*$/, $username))
{
// the string contained a char other than a-z, 0-9 and _ (underscore)
}
Season to taste :)
Justin
on 27/11/02 6:18 PM, Philip J. Newman ([EMAIL PROTECTED]) wrote:
Where should i start, tips wanted.
I would like to check a
On Wednesday 27 November 2002 15:52, Adharsh Praveen R wrote:
hai php-general,
I want to know how can I redirect the browser to contact to a new ip
address of the same server.
In Detail
I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine
running Apache).
I contact the
101 - 180 of 180 matches
Mail list logo