$price = number_format( (int) $price, 2, '.', '');
Ed Curtis wrote:
I'm using an example straight from the manual on the php site that
doesn't seem to work.
$price = 1234.567890;
$price = number_format($price, 2, '.', '');
echo $price;
Returns 1234.567890
Should return 1234.57 correct?
I'm doing a bit of data recovery using php as the scripting language..
Is there a way to determine is a file is binary or text ?
all the files are recovered but the file names do not have extensions !
eg chkdsk.exe would be dgfhgj5767363874 as a file name
pete
--
PHP General Mailing List
Got a bit of a peculiar problem.
I'm recovering a hard disk which has got corrupted (work for a data
recovery business).
I've got a whole stack of text files which I need to clean up to try and
get back some of the text information
here's an example snippet
Linux
;-
Craig Lonsbury wrote:
are you using windows or *nix?
There is a good dictionary (I think it is called dict)
built into most *nix distros,and have yet to find a
good dictionary for windows.
maybe someone else knows a good one =)
Craig
-Original Message-
From: pete M
print_r($_SERVER);
pete
K. Praveen Kumar wrote:
Dear All,
How can I get the Server Information which operating system the
server is running? Using PHP. please let me know
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
web client
http://www.phpmyadmin.net/home_page/
;-)
Joffrey L Leevy wrote:
Hi:
Going thru some teething problems. Does anyone have a simple PHP program
that will enable mysql queries to be executed and displayed using internet
explorer or another medium?
thanks
--
PHP General Mailing List
unfortunately Constants are scalar only, arrays not allowed
below is from the manual
---
Constants do not have a dollar sign ($) before them;
Constants may only be defined using the define() function, not by simple
assignment;
Constants may be defined
why use a cookie - the $_SESSION is itself a cookie
I'd code it like
php
session_start()
if (!isset($_SESSION['cart_id']))
{
// code to get cart_id
$_SESSION['cart_id'] = $cart_id;
}
include(db)
include(products)
Tore E. Mackay wrote:
Don't realy know.
Here is what I have:
1.
here's the calendar I use
http://dynarch.com/mishoo/calendar/index.html
pete
Vijay Killu wrote:
Dear PHP,
Where can I find the Calendar script that has been used on the PHP.net site.
I believe I can use it on my website since it is open source :-)
Thanks Regards,
___
its $HTTP_SERVER_VARS['REMOTE_ADDR']
or in php4+
$_SERVER['REMOTE_ADDR']
Randall Perry wrote:
Want to grab the client IP after client agrees to a contract, but am getting
no value from the $HTTP_SERVER_VARS[HTTP_PC_REMOTE_ADDR] var.
Anyone know why this might happen?
--
PHP General Mailing List
on windows you need to comment out the php_pdf.dll (or similar) in
php.ini and reboot apache/iis to enable the pdf extension.
pete
Vijay Killu wrote:
Hello,
I've just came through a function which generates PDF files on fly in a php
script.
On going through the documentation, I came to know
function check_admin_user()
{
//global $admin_user;
// if ( (session_is_registered(admin_user)) (isset($admin_user)) )
if ( isset($_SESSION['admin_user']) )
return true;
else
return false;
}
Steve Jackson wrote:
I am not sure what I have to do in order to control sessions in PHP
$query=Select * from users where userid='.$_POST['userid'].';
;-)
pete
Luis Lebron wrote:
This may be a dumb question but here goes. I have been trying to use $_POST
globals in sql queries.
If I use the following query string it does not work
$query=Select * from users where
$array = array(
'fruit1' = 'apple',
'fruit2' = 'orange',
'fruit3' = 'grape',
'fruit4' = 'apple',
'fruit5' = 'apple');
// this cycle echoes all associative array
// key where value equals apple
while ($fruit_name = current($array)) {
if ($fruit_name == 'apple') {
need a little bit of Javascript
Here's a cut and paste from one of my projects
script language=JavaScript
function confirmEdit()
{
var f = document.frmEdit;
if(confirm('Are you sure you want to save the changes. This operation
CANNOT BE REVERSED'))
{
f.submit();
}
}
/script
and then a
have a sniff around
http://www.hotscripts.com/PHP/Scripts_and_Programs/index.html
pete
Mike Yrabedra wrote:
Anyone know of a good 'comments/ feedback' creation script that writes to a
static text file (no MySQL)?
The user would enter their email, name and comment. They would then be
displayed
It might be the script timing out - defaults to 20 seconds
check
set_time_limit()
regards
pete
Grant Rutherford wrote:
Hi there,
I'm trying to get a file upload to work with PHP.
The file I'm attempting to upload is a 742kB pdf file, but this will
have to work for files up to 50Mb of all
Some XML would do the trick
pete
[EMAIL PROTECTED] wrote:
First of all, Hi!
I just started getting into php a week ago, but already ran into a problem I
can't seem to solve.
The issue is this : I code 2 different websites, each has it's own mySQL-DB.
Website A has a login-section, each time you
try extract($_POST)
pete
Javier . wrote:
I'm re-coding a fairly large multi step form which was written with
PHP's register globals turned on. Since upgrading PHP this form has
stopped working and needs editting.
Rather than manually changing each var -
$foo to$_POST['foo']
(there
insert into table (date_created) values( now() )
;-)
pete
Diana Castillo wrote:
how can I format the current date and time so that I can insert it into a
mysql table with an insert query?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
take a look at this
http://phpinsider.com/php/code/SafeSQL/
pete
Jeremy Russell wrote:
Hello list,
I was just sitting here thinking how to secure my php code and
thought I would run it by the pros. I don't know what the standard
practice is to secure against sql injection and malformed
thankyou,thankyou, thankyou, thankyou, thankyou, !!
I spent at least a day on trying to get it to work - now does
pete ;-
Chris Hayes wrote:
At 18:16 15-10-03, you wrote:
I'm trying to send the following header to force ms-word to open a
html document
header(Content-type:
I use phpmailer
http://phpmailer.sourceforge.net/
Makes life much easier
An example of mass mailing is here
http://phpmailer.sourceforge.net/extending.html
pete
Binay wrote:
Hi all!
i need to email out newsletter to say 1000 recipients. I want to know what is the maximum number of recipients i
I'm trying to send the following header to force ms-word to open a html
document
header(Content-type: application/msword);
header('Content-Disposition: attachment; filename=invoice.doc');
it works in Mozilla but NOT in IE..
any ideas as its driving me crazy..
tia
pete
--
PHP General
from php manual str_pad function
?php
$input = Alien;
print str_pad($input, 10); // produces Alien
print str_pad($input, 10, -=, STR_PAD_LEFT); // produces -=-=-Alien
print str_pad($input, 10, _, STR_PAD_BOTH); // produces __Alien___
print str_pad($input, 6 , ___);
I'm directing client via a link to a download page for pdf documents.
This code works on mozilla + firebird but in IE however it pops up with
a open/save dialog - with the filetype missing and then an error when
open/save pressed saying cannot find the site.
As you can see below I've tried all
echo td width=\15\ bgcolor=\#9FD9FF\
input type=\checkbox\ name=\chkR[$i]\
value=\$chkSessionF[$i]\/td);
might solve the problem
pete
hi I have a table with rows and each row contains a checkbox ( array) and a
record. TD of the checkbox:
echo(td width=15 bgcolor=#9FD9FFinput type=checkbox
$dbranch = str_pad($line-dbranch_no, 6, STR_PAD_LEFT);
there's a aslo
$dbranch = str_pad($line-dbranch_no, 6, STR_PAD_BOTH);
and that pads it in the centre
pete
Chris Grigor wrote:
This should be quite an easy task for some...
say for example $line-dbranch has a value of 3
I know that 3 spaces
www.hotscripts.com
Angelo Zanetti wrote:
anyone know of a good HTML mailing list? sorry for the OT post.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I write my code with pencil and paper and then scan it..
Dont need an editor !
John Nichel wrote:
I know we've discussed this numerous times, but I'll chime in again
(mainly because I'm bored).
By far, I have been totally satisfied with UltraEdit. Lightweight, just
about any language you
I've dome this recently using a small iframe src=users_online.php in
the top right corner.
users_online.php has the meta refresh tag set.
META HTTP-EQUIV=refresh content=2;URL=users_online.php
pete
Matias Hohl wrote:
Hello php-Freaks
I would like to display the number of users that are
Does xml_HTTP work with Mozilla ??? !
pete
al wrote:
You can use XML-HTTP - works both Mozilla 1.x and I.E. 5.x and write it
to a DIV.
Pete M wrote:
I've dome this recently using a small iframe src=users_online.php
in the top right corner.
users_online.php has the meta refresh tag set
$subject .= \nBooking Commences: .date(jS F Y). at .date(H\:i)
Shaun wrote:
Hi,
using the folling line fo code i am trying to add some text to an email:
$subject .= \nBooking Commences: .date(jS F Y \a\t H\:i,
strtotime($booking_start_date));
However the output is:
Booking Commences: 24th
loads at hotscripts.com
http://www.hotscripts.com/PHP/Scripts_and_Programs/E-Commerce/index.html
Adrian Teasdale wrote:
Charles
Try oscommerce.org - it's an open source app written in PHP that has a
fantastic community and is incredibly feature-rich. I'm not associated
with the project, but I
101 - 134 of 134 matches
Mail list logo