Re: [PHP] Limit to size of autoindex in MySQL/PHPMyAdmin?

2003-01-03 Thread Jasper Bryant-Greene
e field type from TINYINT to SMALLINT or MEDIUMINT. UNSIGNED TINYINT only has a range of 0 thru 255. Regards. Jasper Bryant-Greene http://fatal.kiwisparks.co.nz/ smime.p7s Description: S/MIME Cryptographic Signature

[PHP] SquirrelMail + Writable Directories

2003-07-14 Thread Jasper Bryant-Greene
My question is simple - I want to install Squirrelmail on my webserver, but I can't chmod or chown the data directory. Is there any way to stop Squirrelmail from trying to write to the directory without limiting functionality too much, or is there a way to allow it to write without using chmod,

Re: [PHP] mail()

2003-07-14 Thread Jasper Bryant-Greene
mail() returns true if the email delivery worked, false if it failed. However, occasionally the email delivery will work, but will fail at a later stage (a "delivery failed" message will be returned to the sender) - you can check for this by having a script check the mailbox that was sent from,

[PHP] Re: Fetch Information Via a link

2003-12-21 Thread Jasper Bryant-Greene
iously you will need to change that to suit your site, and you may want to add some security to the $_GET variable being passed to the MySQL server to prevent attacks. Other than that, hope this helps. Regards Jasper Bryant-Greene Cabbage Promotions http://fatalnetwork.com/ [EMAIL PROTECTED] Er

[PHP] Re: Passing or not passing SID in links etc

2003-12-22 Thread Jasper Bryant-Greene
No, that will work fine. Just having ? at the end of the URL just means an empty querystring - same as if you had nothing there. Regards Jasper Bryant-Greene Cabbage Promotions http://fatalnetwork.com/ [EMAIL PROTECTED] Gerard Samuel wrote: Im currently modifying templates to include the SID

[PHP] Re: How New Is <<

2003-12-25 Thread Jasper Bryant-Greene
It doesn't execute the code between the << Say you had a really long string, with lots of variables in it that needed parsing, and lots of " and ' signs. Instead of using print "" you can use the heredoc syntax. You start with <<< and an identifier (in this case 'HERE') and then end with that i

[PHP] Re: create multiple jpg thumbnails and use in a page

2005-03-26 Thread Jasper Bryant-Greene
1. You'd want to do input checking on the file GET variable to ensure no-one could get hold of stuff they shouldn't. 2. Make sure you don't output anything else in the file that outputs the thumbnail, or it won't work. HTH -- if you need more specifics let

[PHP] Re: Avoiding SQL injections: htmlentities() ?

2005-03-26 Thread Jasper Bryant-Greene
to protect against SQL Injection is: for string data, mysql_real_escape_string() or your database's equiv. function for all other data, type-check it with intval(), floatval() etc. -- Jasper Bryant-Greene Cabbage Promotions www:www.cabbage.co.nz email: [EMAIL PROTECTED] phone: 021 232

[PHP] Re: live records

2005-03-26 Thread Jasper Bryant-Greene
se) { unset($cart_arr[$array_key]); } Best regards -- Jasper Bryant-Greene Cabbage Promotions www:www.cabbage.co.nz email: [EMAIL PROTECTED] phone: 021 232 3303 Public Key: Jasper Bryant-Greene <[EMAIL PROTECTED]> keyID 0E6CDFC5 Fingerprint: 2313 5641 F8F6 5606 8844 49C0 1D6B 29

[PHP] Re: auto appending .php extension

2005-03-26 Thread Jasper Bryant-Greene
ed it also occurs on my other servers. The thing is, it causes some big problems with mod_rewrite. For example: [snip] I think you'll find that the MultiViews Apache option is enabled. Create an .htaccess file in your web root and put Options -MultiViews in it. Best regards -- Jasper Bryant

[PHP] Re: Getting values from the Javascript namespace

2005-03-27 Thread Jasper Bryant-Greene
but it might be better to figure out an alternative way to do it without requiring the second call back to the server. I can't really help any more without more specifics (maybe some code). HTH -- Jasper Bryant-Greene Cabbage Promotions www: www.cabbage.co.nz email: [EMAIL PROTECTED] phone: 021

[PHP] Re: Illegal string offset error in array

2005-03-27 Thread Jasper Bryant-Greene
rly braces {} instead. Square brackets [] for arrays, curly braces {} for string offsets. -- Jasper Bryant-Greene Cabbage Promotions www: www.cabbage.co.nz email: [EMAIL PROTECTED] phone: 021 232 3303 public key: Jasper Bryant-Greene <[EMAIL PROTECTED]> keyID 0E6CDFC5 fingerprint: 2313 564

[PHP] Re: Still fighting setcookie

2005-03-27 Thread Jasper Bryant-Greene
better just to think up an alternative way to do it though. Best regards -- Jasper Bryant-Greene Cabbage Promotions www: www.cabbage.co.nz email: [EMAIL PROTECTED] phone: 021 232 3303 public key: Jasper Bryant-Greene <[EMAIL PROTECTED]> keyID 0E6CDFC5 fingerprint: 2313 5641 F8F6 5606 8844 4

[PHP] Re: Still fighting setcookie

2005-03-27 Thread Jasper Bryant-Greene
Jasper Bryant-Greene wrote: [snip] function setcookie2($name, $value="", $expire="", $path="", $domain="", $secure=false) { $_COOKIES[$name] = $value; return setcookie($name, $value, $expire, $path, $domain, $secure); } [snip] Sorry, that should

Re: [PHP] Re: Illegal string offset error in array

2005-03-27 Thread Jasper Bryant-Greene
Rasmus Lerdorf wrote: Jasper Bryant-Greene wrote: You can't access string offsets with square brackets [] in PHP5. You need to use curly braces {} instead. Not sure where you got that idea. This is not true. -Rasmus Actually, it is. See the following URL: http://www.php.net/manu

Re: [PHP] Re: Illegal string offset error in array

2005-03-27 Thread Jasper Bryant-Greene
Rasmus Lerdorf wrote: Jasper Bryant-Greene wrote: You can't access string offsets with square brackets [] in PHP5. You need to use curly braces {} instead. Not sure where you got that idea. This is not true. -Rasmus Actually, it is. See the following URL: http://www.php.net/manu

Re: [PHP] security risk by using remote files with include(); ?

2006-03-24 Thread Jasper Bryant-Greene
Merlin wrote: I am wondering if I am opening a potential security risk by including files on remote servers. I am doing an include ('http:/www.server.com/file.html') inside a php script of mine to seperate content from function. Content is produced by a friend of mine and I do not want to gran

Re: [PHP] Switching to UTF-8. Need help.

2006-03-24 Thread Jasper Bryant-Greene
Is the file saved in UTF-8 encoding (the PHP script itself)? Jasper Andy wrote: This is my code: "; echo utf8_encode ($str); ?> öüééééÉõõÕÕ I tried all the ways: and etc. The first echo... is not showed correctly. The second (with the encoding function) work

Re: [PHP] Switching to UTF-8. Need help.

2006-03-24 Thread Jasper Bryant-Greene
If you're on *nix: man iconv otherwise, I have no idea, sorry. Jasper Andy wrote: No it was not. If I save it with UFT8 encoding it works well. So, do I have to convert all the files to UTF8 encoding? Is there an easy way to do that? - Original Message - From: "Jasper Bry

Re: [PHP] mysql query/$post problem

2006-03-27 Thread Jasper Bryant-Greene
PHP Mailer wrote: Mark skrev: [snip] $query = "INSERT INTO users AVATARS WHERE id =$user_id '','$avname')"; mysql_query($query);s [snip] I am trying to insert the value of $avname into the users table, into the avatar field. I think what you are trying to do is coordinated a bit wrong, perh

Re: [PHP] $i vs. $r

2006-03-27 Thread Jasper Bryant-Greene
Kevin Murphy wrote: Does anyone have a clue why using this code doesn't work: Please specify what "doesn't work" means in this case :) $i = 0; while ($row = mysql_fetch_array($result)) { echo ("Blah blah blah"); $i++; } $r = 0; while ($row = mysql_fetch_arra

Re: [PHP] unset a constant

2006-03-27 Thread Jasper Bryant-Greene
There is no way using the core language. You can, however, use the runkit function if you absolutely have to: http://php.net/runkit_constant_remove Jasper Suhas wrote: Hi, How do I unset a defined variable. e.g. define('AA',1); unset(AA) // gives error any suggestions! Thanks SP -- P

Re: [PHP] private $foo

2006-03-28 Thread Jasper Bryant-Greene
Anthony Ettinger wrote: private $foo; cannot be accessed directly outside the script. print $f->foo; #fails Fatal error: Cannot access private property Foo::$foo in /x/home/username/docs/misc/php/client.php on line 11 Did you define the __get and __set functions in your class as in the prev

Re: [PHP] addslashes()

2006-03-29 Thread Jasper Bryant-Greene
From http://php.net/addslashes : "Having the PHP directive magic_quotes_sybase set to on will mean ' is instead escaped with another '." Jasper Chris Boget wrote: Can someone explain something to me: $string = "Bob's carwash's door"; echo 'addslashes(): ' . addslashes( $string ) . '

Re: [PHP] parent constructor

2006-03-29 Thread Jasper Bryant-Greene
SLaVKa wrote: Hey guys just a general question... if you have a parent::__constructor() call in your constructor function, should that call ideally be placed before or after the code inside the current constructor? or it doesnt really matter That depends on which code you want to run first. S

Re: [PHP] Outputting text "

2006-03-30 Thread Jasper Bryant-Greene
. "\n"; ?> -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM [EMAIL PROTECTED] 021 708 334 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP4: calling method on returned object

2006-03-30 Thread Jasper Bryant-Greene
this->Location->GetMap())->GetUrl() .. which doens't work. In short, no. That syntax was introduced in PHP5. For OO work, I would strongly recommend upgrading to PHP5 as there are many other important OO features that simply are not available in PHP4. -- Jasper Bryant-Greene General

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-30 Thread Jasper Bryant-Greene
27;])) { unset($tc->arr['b']); } you just removed b from the array under 'arr' in the $vars member array. //var_dump is only to see results of above var_dump($tc); this should show something equiv. to: array( 'arr' => array(

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-30 Thread Jasper Bryant-Greene
e 'a' key inside that array. Or at least it should, dammit. -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM [EMAIL PROTECTED] 021 708 334 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-30 Thread Jasper Bryant-Greene
Jochem Maas wrote: Jasper Bryant-Greene wrote: Jochem Maas wrote: I think its a misunderstanding on the one side and a limitation on the other, you can't use overloading directly on items of an overloaded array e.g: echo $tc->arr['a'] this is triggers a call to __g

Re: [PHP] Outputting text "

2006-03-30 Thread Jasper Bryant-Greene
ersion="1.0" encoding="ISO-8859-1" ?>'; would work just as well and is a hell of a lot easier to look at. That's assuming you actually want it to appear on the page for the user to see, if you want the browser to interpret it you'll have to change the < a

Re: [PHP] HTTP status code

2006-03-30 Thread Jasper Bryant-Greene
-- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Anthony Ettinger Signature: http://chovy.dyndns.org/hcard.html -- Jasper Bryant-Greene General Manager Album Limited http

Re: [PHP] HTTP status code

2006-03-30 Thread Jasper Bryant-Greene
as as the default 404 handler... Default is something like this: Not Found The requested URL /asdf was not found on this server. Apache Server at foo.org Port 80 On 3/30/06, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote: In other words, if you w

Re: [PHP] Visa / MasterCard security compliance

2006-03-30 Thread Jasper Bryant-Greene
rcard's requirements. :) -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM [EMAIL PROTECTED] 021 708 334 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Database connections

2006-03-30 Thread Jasper Bryant-Greene
Chris wrote: If they're accessing the same database you don't need to disconnect/reconnect. Different db's - well, yeh you don't have a choice. Of course you do. mysql_select_db() or whatever it's called. Or just issue a USE [databasename] query. No need to reco

Re: [PHP] setting the same value to multiple variables

2006-03-30 Thread Jasper Bryant-Greene
y code (have you considered an array? what is the point of all those variables if they all hold the same value?), replace all of those '&&' with '=' and you will be fine. PHP evaluates right-to-left and the result of an assignment is the value that was assigned, so th

Re: [PHP] Overloading Limitation- Can Someone Confirm?

2006-03-31 Thread Jasper Bryant-Greene
Jim Lucas wrote: Jasper Bryant-Greene wrote: Jochem Maas wrote: [snip] you guess wrong :-) .. I couldn't resist testing it: php -r ' class T { private $var = array(); function __set($k, $v) { $this->var[$k] = $v; } function __get($k) { var_dump($k); } } $t = new T; $t->a

Re: [PHP] preg_match

2006-03-31 Thread Jasper Bryant-Greene
e-insensitive flag, since there's no characters in your pattern). The strpos() solution above is much better and faster in this case, though. -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM [EMAIL PROTECTED] 021 708 334 -- PHP Ge

Re: [PHP] MySQL close connection, what's the purpose?

2006-04-01 Thread Jasper Bryant-Greene
connect and disconnect from the same database multiple times within the same request? In my experience, connecting to the database takes up more than half of the execution time of the average database-driven PHP script (I said *average*, there are exceptions). You don't want to be doing it

Re: [PHP] MySQL close connection, what's the purpose?

2006-04-01 Thread Jasper Bryant-Greene
any problems doing that. I don't see it as sloppy programming, it is a documented feature that PHP closes resources such as database connections at the end of the script. But, as has been said, each to their own. -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz

Re: [PHP] MySQL close connection, what's the purpose?

2006-04-01 Thread Jasper Bryant-Greene
Robert Cummings wrote: On Sat, 2006-04-01 at 20:48, Jasper Bryant-Greene wrote: Yeah, e.g. I have a database objects layer that means I only write SQL in classes, everything else is just calling object methods. I create the database object at the start of every script but that doesn&#

Re: [PHP] MySQL close connection, what's the purpose?

2006-04-01 Thread Jasper Bryant-Greene
Robert Cummings wrote: On Sat, 2006-04-01 at 21:39, Jasper Bryant-Greene wrote: Robert Cummings wrote: There's smart lazy programming, and sloppy lazy programming. I don't trust anything magical in PHP. Most of us are familiar with the magic quotes and global vars fiascos *LOL*. B

Re: [PHP] MySQL close connection, what's the purpose?

2006-04-01 Thread Jasper Bryant-Greene
John Nichel wrote: Jasper Bryant-Greene wrote: I never close connections; PHP does that for me and has never caused any problems doing that. I don't see it as sloppy programming, it is a documented feature that PHP closes resources such as database connections at the end of the s

Re: [PHP] MySQL close connection, what's the purpose?

2006-04-03 Thread Jasper Bryant-Greene
a transaction. That will hold up certain other queries. But that's at a whole other layer. -- Jasper Bryant-Greene General Manager Album Limited http://www.album.co.nz/ 0800 4 ALBUM [EMAIL PROTECTED] 021 708 334 -- PHP General Mailing List (http://www.php.net/) To unsubscr

[PHP] Re: SAFEMODE w/ PEAR

2005-06-25 Thread Jasper Bryant-Greene
Ashley M. Kirchner wrote: >I'm having a small problem with SAFE MODE and PEAR that I'm unsure > how to solve: > >[error] PHP Warning: raiseerror(): SAFE MODE Restriction in effect. > The script whose uid is 524 is not allowed to access > /usr/lib/php/PEAR.php owned by uid 0 in /path/to/s

Re: [PHP] How do I create an Outlook calendar entry?

2005-06-25 Thread Jasper Bryant-Greene
Daevid Vincent wrote: > There are some pretty crazy "Thread-Index:" and "UID:" things in there. > Do I have to generate them somehow? No. They are email headers relating to the tracking of replies and the internal tracking of emails on the mail server. It should be safe to leave them out, in fa

[PHP] Re: css/html expertise??

2005-06-25 Thread Jasper Bryant-Greene
bruce wrote: > i'm playing around with css (classes/ids/etc...) does anybody here > have any experience with this or could answer a few questions?? Email me directly with your issues and I'll try to help you sort it out. Cheers, Jasper Bryant-Greene -- PHP General Ma

[PHP] Re: A Bug in string ' e

2005-06-26 Thread Jasper Bryant-Greene
cchereTieShou wrote: > You can actually try to use this to verify the problem: > > echo ' e > What you get? I got > Quite confusing. Anyone think this is a bug or something I missed? Are you viewing this via a web server? It's probably returning content-type text/html, which means that you migh

Re: [PHP] including the result of one query in another query

2005-06-26 Thread Jasper Bryant-Greene
Jochem Maas wrote: >> I have two databases, on for aeromodelistas (aeromodelling) and >> another for Códigos Postais (Postal Codes). I whant to do the > > what DB are you using? MySQL? > you can't select across multiple DBs in any RDMS that I know of ... > so it looks like either use 2 queries or

Re: [PHP] Re: A Bug in string ' e

2005-06-26 Thread Jasper Bryant-Greene
Kevin L'Huillier wrote: > Could you copy the relevant code into a message? Seeing > pseudo-script is different from seeing what you are actually > doing. Sure, either set the content-type to text/plain (to see the raw string rather than have the browser interpret it as HTML), like this: or ht

Re: [PHP] Re: A Bug in string ' e

2005-06-26 Thread Jasper Bryant-Greene
Kevin L'Huillier wrote: > On 26/06/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote: > >>Kevin L'Huillier wrote: >> >>>Could you copy the relevant code into a message? >> >>Sure, either set the content-type to text/plain (to see the ra

[PHP] Re: $mydata->StampDate

2005-06-26 Thread Jasper Bryant-Greene
John Taylor-Johnston wrote: > I created my own counter. I have a varchar (10) field that resembles a > date: 2005-06-26. Now I would like to parse out $mydata->StampDate to > find how many hits per day I have had since "2003-08-23". Where do I start? > >while ($mydata = mysql_fetch_object($new

[PHP] Re: $mydata->StampDate

2005-06-26 Thread Jasper Bryant-Greene
John Taylor-Johnston wrote: > I could just change the field type. But how do you calculate it? I don't > see much to inspire a start. I'm not a full-time coder either. More of a > tinkerer. I don't want someone to do it for me, but need to get my head > around how to do it. > http://ca3.php.net/man

[PHP] Re: Breaking up data efficiently

2005-06-27 Thread Jasper Bryant-Greene
Wee Keat wrote: > /* BEGIN DATA */ > > Melbourne, AU, 21-07-2005 14:00:00|Perth, AU, 21-07-2005 18:00:00|Perth, > AU, 25-07-2005 14:00:00|Melbourne, AU, 25-07-2005 18:00:00 > > /* END DATA */ > [snip] > /* BEGIN CODE */ > $itenary = explode('|', $booking->booking_flight_de

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread Jasper Bryant-Greene
Brian V Bonini wrote: >>> I can echo out the command and get a well formed command, i.e. >>> one that will execute from a command prompt, but when I try to >>> exec() $cmd from within the script the globbing is taken >>> literally. Try shell_exec(). I don't think exec() goes via the shell. -- PH

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-27 Thread Jasper Bryant-Greene
Kevin L'Huillier wrote: > On 27/06/05, Dr. Brad Lustick <[EMAIL PROTECTED]> wrote: >>I'm a novice trying to understand the exact construction of code for doing an >>HTTP 301 permanent redirect for a server >>coded in PHP. Could someone please tell me how I would handle the following >>example? >

Re: [PHP] Question about HTTP 301 permanent redirects

2005-06-28 Thread Jasper Bryant-Greene
Jochem Maas wrote: >> header('HTTP/1.1 301 Moved Permanently'); > > > also consider that using 'Status' may be better or possibly both to cover > you bases, e.g.: > > > > header("HTTP/1.1 301 Moved Permanently"); > header("Status: 301 Moved Permanently"); > > ?> Waste of time. Go re

[PHP] Re: date problem

2005-06-28 Thread Jasper Bryant-Greene
Firstly, this shouldn't be in the PHP list, as you're asking for help with SQL. Mario netMines wrote: > carrental_from (datetime field) > carrental_to (datetime field) > carrental_price (datetime field) [rates are per hour] carrental_price shouldn't be a datetime field, as it isn't a datetime val

Re: [PHP] force https

2005-06-28 Thread Jasper Bryant-Greene
> Robert Cummings wrote: >> On Tue, 2005-06-28 at 23:26, Dan Trainor wrote: >>> >>> >>> header('Location: https://mydomain.com'); ? >>> >>> >>> >> >> It'll work fine, but here's a something a little more generic :) >> >> header( 'Location: >> https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQU

Re: [PHP] Re: date problem

2005-06-28 Thread Jasper Bryant-Greene
Mario netMines wrote: > Hi Jasper and thanks for the quick reply. > > something tells me it's not a straightforward SQL query that I have to > use here but a logic using PHP and SQL. Please don't top-post. It can be done in SQL quite easily, as can many things people use PHP for. Go to the MySQL

[PHP] Re: MySQL error

2005-07-01 Thread Jasper Bryant-Greene
Wessley Roche wrote: I'm having a problem with the following code: $sql = "LOAD DATA LOCAL INFILE '/path/to/file.txt' INTO TABLE `mytable` FIELDS TERMINATED BY '\t' ESCAPED BY '\' LINES TERMINATED BY '\n'"; mysql_query($sql) or die(''.mysql_error()); I get this MySQL error: You have an erro

Re: [PHP] reading PDF's

2005-07-01 Thread Jasper Bryant-Greene
Ben Ramsey wrote: Another, easy way to create PDFs with PHP is to use PDML: http://pdml.sourceforge.net/ As for reading the text from a PDF, maybe there's some sort of OCR library for PHP out there, but I don't know about it. It'd be a great thing to see, though. You wouldn't need OCR in mo

[PHP] Re: WebHosting suggestions

2005-07-01 Thread Jasper Bryant-Greene
John Jairo Vega Angulo wrote: Hi, hope you have a good programming: I'm still a novice in php topics and I'm looking forward to find a FREE hosting site to publish my .php's, so I hope you could give me an advise, and if the service provides MySQL hosting too, it would be great. That's al

[PHP] Re: Currency stored as cents

2005-07-02 Thread Jasper Bryant-Greene
Satyam wrote: Now, am I missing something in all this? Please comment. Thanks Satyam Just use the Arbitrary Precision Mathematics functions in PHP, set to a precision of 2 decimal places. There's bcmath[1] and GMP[2]. Jasper [1] http://www.php.net/bc [2] http://www.php.net/gmp -- PHP Ge

[PHP] Re: Currency stored as cents

2005-07-02 Thread Jasper Bryant-Greene
Satyam wrote: I would rather use native data types and functions. This is a good idea when you have to deal with the balance sheet of a corporation, where you have to handle huge numbers and still be precise up to the last cent. For most retail business, where the largest amount can still be

[PHP] Re: mail()===false but msg is sent!

2005-07-02 Thread Jasper Bryant-Greene
Andy Pieters wrote: So what I do is ( $header="header for multipart mime message"; $body="body with multipart mime message"; $result=mail("Name Firstname <$address>","Subject",$message,$header); echo ($result?"ok":"bogus"); Well, firstly your subject does not match what you're doing. PHP is w

[PHP] Re: x years old

2005-07-02 Thread Jasper Bryant-Greene
Ryan A wrote: Hey guys, This is the code I am using to display a persons age from the mysql db: $day1=strtotime($age); $day2 = strtotime(date("Y-m-d")); $dif_s = ($day2-$day1); $dif_d = ($dif_s/60/60/24); $age = round(($dif_d/365.24)); but when someone entered their birth day($age) as 1988-07-0

[PHP] Re: Group By problems

2005-07-03 Thread Jasper Bryant-Greene
W Luke wrote: Hi, I used to have problems with this in Cold Fusion - and I'm still struggling this time in PHP! This isn't a PHP-specific question, it's more a MySQL question. You might want to try the MySQL mailing lists if you don't get a satisfactory answer here. Very basic. Looping o

[PHP] Re: setting initial vlaue of optionbox

2005-07-03 Thread Jasper Bryant-Greene
Ross wrote: value="" Keeps the value of $subject that was previously entered in the textarea even after the form is submitted with php_self(). Is this possible with the listbox?? { ?> selected>Some Option Alter to suit your needs, of course. Jasper -- PHP General Mailing List (http://

[PHP] Re: Help a Norwegian student!

2005-07-03 Thread Jasper Bryant-Greene
Bjørn-Erik Dale wrote: When I'm trying to open phpMyAdmin/index.php on my Apache server I get this text: "kan ikke starte mysqli tillegget, vennligst kontroller PHP-konfigurasjonen" witch is Norwegian for "can not start the myswli extension, please check the PHP-configuration" A link follows to:

Re: [PHP] zlib.output_compression

2005-07-12 Thread Jasper Bryant-Greene
LacaK wrote: I see contents using Network Monitor, so I se response header and contents andthey are uncompressed, so somresion does not uccured. It's likely the browser is uncomressing it before you ever see it. I would telnet to port 80 and make an HTTP request to see for sure. To turn

Re: [PHP] zlib.output_compression

2005-07-12 Thread Jasper Bryant-Greene
LacaK wrote: Yes, my browser send "Accept-Encoding: gzip,deflate" When I alter : "zlib.output_compression=on" in php.ini it works fine ! Only runtime alter : ini_set('zlib.output_compression', true); does not work !? LacaK. I'm pretty sure this behaviour is by design -- it doesn't make sense

[PHP] Re: How to read PHP variables.

2005-07-13 Thread Jasper Bryant-Greene
Bruno B B Magalhães wrote: That's my problem: I have a configuration files with the following structure... $vars['varname'] = 'varvalue'; If you trust the config file: Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: 404 Header Problems

2005-07-13 Thread Jasper Bryant-Greene
Scott Taylor wrote: I'm trying to issue a 404 header on one of my pages. But it does not redirect. I figured, with many function calls before it, that it might be outputting something to the screen before the header() command was issued. So, I tried issuing a 404 header from a new page, cons

[PHP] Re: Displaying HTML safely

2005-07-15 Thread Jasper Bryant-Greene
Lauri Harpf wrote: Now, if I make a point of not "chmod 755"ing the .html files in question, the server should be safe from someone feeding a html file with an embedded PHP script, right? Is there something else I should be looking out for - or is there an even better way of handling the transfer

Re: [PHP] Is GD available

2005-07-15 Thread Jasper Bryant-Greene
Todd Cary wrote: Damn! I should have checked the error_log first! PHP Warning: Unknown(): Invalid library (maybe not a PHP library) 'libgd.so.2' in Unknown on line 0 And this is the library from the rpm specified in ww.php.net: http://www.boutell.com/gd/. However, the site says that gd sho

Re: [PHP] Re: Displaying HTML safely

2005-07-16 Thread Jasper Bryant-Greene
Dotan Cohen wrote: On 7/16/05, Lauri Harpf <[EMAIL PROTECTED]> wrote: I've been thinking of limiting this problem by preventing the direct displaying of the code (ie. only allowing "Save As.." for the link to the user-submitted HTML). I guess a bit of JS could prevent accidental left-clicking on

[PHP] Re: Session warning

2005-07-16 Thread Jasper Bryant-Greene
Thomas Bonham wrote: Hello All, I'm working on session and I'm getting this warning. Maybe someone can help fixing this problem. Below is the following code. Warning: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var

[PHP] Re: jpgs into database

2005-07-17 Thread Jasper Bryant-Greene
George B wrote: is it possible to put in a jpg file into a database? I am trying to make like a catalong and have all the files (including pics) and everyone can see. is this possible? Sure -- if you're using a MySQL database, just use a BLOB field and put the data in as you would a string o

[PHP] Re: Post URL ?

2005-07-18 Thread Jasper Bryant-Greene
Joey wrote: OK I understand the difference between a get & a post but if I just have a URL/link which is calling a function like so: abc.com/display_information?customer_number=$value It passes to the display_information the customer number visably, is there a way to do this where it's not v

Re: [PHP] Re: Post URL ?

2005-07-18 Thread Jasper Bryant-Greene
Raz wrote: You can put the value in a hidden form field and submit it with JavaScript, but it's still not truly hidden, as it is still sent in a cleartext HTTP request. Not to mention being visible upon viewing the page source... Well, that depends. If it's user input that is added via JavaSc

[PHP] objects destroyed in same order as created?

2005-07-20 Thread Jasper Bryant-Greene
Hi all I am currently working on a PHP 5 application. For the sake of simplicity, I'll only describe 3 classes here, as that is all that is required for you to see my problem. I have a DB class that interacts with the database, a Session class that controls the session with the user, and a U

[PHP] Re: Rate to charge

2005-07-20 Thread Jasper Bryant-Greene
timothy johnson wrote: I have been asked to look in toprogramming a PHP system for someone, and while I have been programming for a while this will be the first time it will be for someone other then a friend. Just wanted to get some ideas on how much you charge for program PHP/Mysql. Any ideas o

Re: [PHP] Re: Rate to charge

2005-07-21 Thread Jasper Bryant-Greene
Evert | Rooftop wrote: Jasper Bryant-Greene wrote: I'm in New Zealand and charge NZ$50/hour as a base rate for PHP web development. I don't know what that is in your currency, try www.xe.com/ucc to find out. That's almost probably as cheap as india. True, but markets a

Re: [PHP] objects destroyed in same order as created?

2005-07-21 Thread Jasper Bryant-Greene
Shaw, Chris - Accenture wrote: Jasper, I would have thought php would have called the destructors on each of the classes in a LIFO fashion, but if it doesn't, just use unset() as a workaround, where you can remove the classes in the order you want. I should add that this behaviour seems to hav

[PHP] Re: System specific information gathering

2005-07-21 Thread Jasper Bryant-Greene
Vidyut Luther wrote: Hello, I have a question on how to get Server side system specific information via PHP, or just general direction on how to parse some of the information found in /proc I just use file_get_contents() on the files in /proc. I would expect that would be a lot faster tha

Re: [PHP] On register_shutdown_function: What might be the problem?

2005-07-22 Thread Jasper Bryant-Greene
Liang ZHONG wrote: What is the correct way to keep the function running after I redirect an existing page to http client (which I want the client get immediately) and then immediately close the connection? Use the execution functions to call an external script that performs the tasks you want

Re: [PHP] speed - PHP/MYSQL

2005-07-23 Thread Jasper Bryant-Greene
balwant singh wrote: Hi, I have made a webpage in php which retrieves the data from a huge MYSQL tables as below:- $i=0; while ($i<=23) { select a, b from table where hour(time)=$i and date='' order by desc time limit 1; $i++; } then i substract the current hour output from the last hour

[PHP] Re: PHP and Perl

2005-07-23 Thread Jasper Bryant-Greene
Linda H wrote: I am needing to write a front end for an online application written in Perl. Is there a way for PHP to call a module or function written in Perl? Firstly, please don't reply to existing threads with a completely new topic. For those of us that use threaded newsreaders, your mess

[PHP] Re: Don't ejecute a sentence if a field is empty

2005-07-23 Thread Jasper Bryant-Greene
Jesús Alain Rodríguez Santos wrote: Hello I'm new: I need to know how can I stop a php sentence if my db is empty, for example I have writed a php sentence, if every fields from mmy db are full, there is no problem, but I delete every values from the all fields in my db when I ejecute my script m

[PHP] Fundamental question about ADTs

2005-07-29 Thread Jasper Bryant-Greene
Hi all Recently I've been reading /Code Complete/ by Steve McConnell, and in it he recommends the use of ADTs, or Abstract Data Types, which I have been thinking about implementing in a major project I am currently embarking on. Basically the question that I have for the list is this: If I h

Re: [PHP] A question on the term CFG.

2005-08-07 Thread Jasper Bryant-Greene
Or if it's PHP 5 they might be using an __autoload() magic function which gets called whenever a class that isn't declared is instantiated. That function could be require()ing another file. Jasper Chris wrote: That isn't created by PHP, it must be declared in the code somewhere. Maybe there

Re: [PHP] Java - toString() <-> php - ?

2005-08-07 Thread Jasper Bryant-Greene
If you use PHP 5 just use the __toString() magic method which does exactly that. http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring Jasper Rory Browne wrote: Um - did you read my last email regarding var_dump var_export and print_r Did you try them? Do they d

Re: [PHP] A question on the term CFG.

2005-08-07 Thread Jasper Bryant-Greene
ut this and so I did a grep on "autoload" and came up empty. Is there a different way of checking for the magic function? Thanks On Mon, 2005-08-08 at 08:24 +1200, Jasper Bryant-Greene wrote: Or if it's PHP 5 they might be using an __autoload() magic function which gets called wheneve

Re: [PHP] How to start a global variable within a function?

2005-08-08 Thread Jasper Bryant-Greene
Jasper Wong HoWang wrote: as title, how to start a global variable within a function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] About Get_meta_tags()

2005-08-08 Thread Jasper Bryant-Greene
Jimmie wrote: Warning: get_meta_tags(): php_network_getaddresses: gethostbyname failed in d:\apache\htdocs\meta_tag.php on line 3 Looks like your DNS is failing or that host does not have a DNS record. Have you tried going to that URL in a browser on the same machine the PHP script is running

Re: [PHP] Generating a 404 status message with header()

2005-08-09 Thread Jasper Bryant-Greene
Sebastian wrote: Paul Waring wrote: On Mon, Aug 08, 2005 at 04:37:12PM -0400, Eric Gorr wrote: Should it? Is it possible to write a doesexists.php script which would cause the 404 directive to be triggered? I also tried: header("Status: 404 Not Found"); but this did not work either.

Re: [PHP] Generating a 404 status message with header()

2005-08-09 Thread Jasper Bryant-Greene
Sebastian wrote: yeah sorry, i must of deleted the original topic and all i had was the followups.. anyway, what do you want, the cake and eat it too? why two types of 404's? i mean you either use ErrorDocument or use php headers.. i guess i dont understand why use both.. to send 404 header

Re: [PHP] N/A

2005-08-09 Thread Jasper Bryant-Greene
R. Ragunathan wrote: can we implement lock to a table using postgres with php. if any of u all knows the solution do reply back. Please, for the second time, simply read the manual. http://www.php.net/pgsql It explains both the issues you have recently posted about very well. If you have a s

Re: [PHP] N/A

2005-08-09 Thread Jasper Bryant-Greene
R. Ragunathan wrote: can we implement lock to a table using postgres with php. if any of u all knows the solution do reply back. You may also want to look at the following URL: http://www.postgresql.org/docs/8.0/interactive/explicit-locking.html -- PHP General Mailing List (http://www.php.net

  1   2   3   4   >