[PHP] Re: Concerning number_format()

2003-11-06 Thread pete M
$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?

[PHP] binary or text file

2003-11-06 Thread pete M
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

[PHP] dictionary

2003-11-05 Thread pete M
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

Re: [PHP] dictionary

2003-11-05 Thread pete M
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

[PHP] Re: How to get the server information

2003-11-04 Thread 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

[PHP] Re: PHP script for mysql queries

2003-11-04 Thread pete M
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

[PHP] Re: hard(?) syntax problem

2003-11-04 Thread pete M
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

Re: [PHP] Session for creating a unique shopping cart for each user

2003-10-31 Thread pete M
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.

[PHP] Re: Calendar Script

2003-10-29 Thread pete M
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, ___

[PHP] Re: $HTTP_SERVER_VARS[HTTP_PC_REMOTE_ADDR] returns no value

2003-10-29 Thread pete M
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

[PHP] Re: PDF File generation on Fly in PHP

2003-10-28 Thread pete M
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

[PHP] Re: Globals set to off - Sessions

2003-10-27 Thread pete M
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

[PHP] Re: Post variables and mysql queries

2003-10-27 Thread pete M
$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

[PHP] Re: Simple array question

2003-10-23 Thread pete M
$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') {

[PHP] Re: Create Popup Window using PHP

2003-10-23 Thread pete M
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

[PHP] Re: Comments / Feedback script?

2003-10-22 Thread pete M
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

[PHP] Re: File Upload problem

2003-10-20 Thread pete M
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

[PHP] Re: 'Return values' from links

2003-10-17 Thread pete M
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

[PHP] Re: Creating local vars from HTTP Post Array

2003-10-17 Thread pete M
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

[PHP] Re: date for mysql

2003-10-17 Thread pete M
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

[PHP] Re: SQL security

2003-10-17 Thread pete M
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

Re: [PHP] ms word problems again !!

2003-10-16 Thread pete M
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:

[PHP] Re: Max no of recipients in To field of mail function

2003-10-15 Thread pete M
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

[PHP] ms word problems again !!

2003-10-15 Thread pete M
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

[PHP] Re: pad numbers

2003-10-10 Thread pete M
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 , ___);

[PHP] help - with pdf downloads

2003-10-03 Thread pete M
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

[PHP] Re: arrays and php

2003-09-30 Thread pete M
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

[PHP] Re: str_pad

2003-09-26 Thread pete M
$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

[PHP] Re: HTML mailing list

2003-09-26 Thread pete M
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

Re: [PHP] PHP Editor - which to use?

2003-09-25 Thread pete M
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

[PHP] Re: Users Online

2003-09-24 Thread pete M
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

[PHP] Re: Users Online

2003-09-24 Thread pete M
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

[PHP] Re: Problem with adding text to emails using the date function

2003-09-24 Thread pete M
$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

Re: [PHP] Shopping Cart Solutions

2003-09-23 Thread pete M
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

<    1   2