Re: [PHP] How do I prevent a session from rebuilding itself?

2006-07-13 Thread Andrew Brampton
If anyone reads DailyWTF, then you might remember this post: http://thedailywtf.com/forums/thread/78892.aspx Explaining the dangers of rm -rf /tmp I'm sure you won't fall victim to this, but it is a fun read :) Andrew - Original Message - From: Daevid Vincent [EMAIL PROTECTED] To:

Re: [PHP] Sort Array

2006-07-18 Thread Andrew Brampton
ksort won't do what he wants... Look at usort, and something like this: function cmp($a, $b) { return strcmp($a['Country'], $b['Country']); } usort($array, cmp); Andrew - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: weetat [EMAIL PROTECTED];

Re: [PHP] convert byte to MB

2006-07-25 Thread Andrew Brampton
Divide by 1024 and you get KiB Divide by 1000 and you get KB Read: http://physics.nist.gov/cuu/Units/binary.html Andrew - Original Message - From: André Medeiros [EMAIL PROTECTED] To: weetat [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Tuesday, July 25, 2006 12:41 PM

Re: [PHP] Disable all caching

2006-10-10 Thread Andrew Brampton
Caching occurs client side (ie in the webbrowser) not by apache or php unless you have setup something especially to do so... How are you testing that something stays cached? There is also a HTTP header you can make your PHP send to ask the page not to be cached. Looking at this page:

Re: [PHP] Variance Function

2007-01-11 Thread Andrew Brampton
, and throw away any value more than X days out. Andrew Brampton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Warning: filemtime() (errno=75 - Value too large for defined data type)

2005-05-29 Thread Andrew Brampton
Hi, I'm receiving the following warning: Warning: filemtime(): Stat failed for master.log (errno=75 - Value too large for defined data type) in test.php on line 5 when I do the following line of code: filemtime ('master.log'); The file in question is over 2GB, but I'm not interested in its

Re: [PHP] Uploading pic

2006-04-27 Thread Andrew Brampton
getimagesize() can obtain the image type as well as the dimensions of the image. Once the file is uploaded us this to check the extension is correct and that the image is not too large. php.net/getimagesize Andrew - Original Message - From: Rosen [EMAIL PROTECTED] To:

[PHP] PEAR Algorithms/Containers

2006-05-18 Thread Andrew Brampton
Hi, In the past few weeks I've found the need for a hash table and a container that gives me O(log) search efficiency. Now I'm aware I can use associative arrays for my hash table, but I wanted to ensure efficiency. For my O(log) container I ended up using a sorted array, and a binary search

Re: [PHP] Get Mac Address

2005-10-09 Thread Andrew Brampton
M. Sokolewicz have you ever typed arp at a command line? It may give you a local mac address, but it is normally used to show your arp cache. Now if you are on the same physical segment as the requester than you can obtain to mac address from parsing the output and matching it to the

Re: [PHP] Mcrypt 3DES encrypt/decrypt Help

2005-11-07 Thread Andrew Brampton
I've never used the mcrypt functions, but from a quick read of the documentation I think you are using a 384 bit key!... Each letter in your key string is a 8bit ASCII character, and since you have 48 chars, you have 8*48 bits. The documentation says: Key is the key with which the data will

Re: [PHP] ftp_nlist problem

2006-01-13 Thread Andrew Brampton
When you do FTP its actually two TCP connections, a outgoing to port 21, and then a incoming. The most common problem with FTP is that the incoming connection gets blocked by a firewall or NAT. So most people use passive FTP where instead it makes two outgoing TCP connections. I think the

Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-20 Thread Andrew Brampton
A bot could find it if it parses (and executes) javascript. Andrew - Original Message - From: Gerry Danen [EMAIL PROTECTED] To: comex [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 20, 2006 3:58 AM Subject: Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

Re: [PHP] passing argument between scripts

2002-12-07 Thread Andrew Brampton
try: require(test/inc/scriptB.php); I beleive that you may be including scriptB after it has been displayed by apache (ie with all the PHP executed) Andrew - Original Message - From: Geert Arts [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, December 07, 2002 4:53 PM Subject:

Re: [PHP] Find Next Integer

2002-12-09 Thread Andrew Brampton
Well that case then if ($sign = ) ceil($number); else floor($number); Is that nearer to what you mean? Andrew - Original Message - From: Stephen [EMAIL PROTECTED] To: Andrew Brampton [EMAIL PROTECTED] Cc: PHP List [EMAIL PROTECTED] Sent: Monday, December 09, 2002 8:19 PM

Re: [PHP] Spaces

2002-12-09 Thread Andrew Brampton
replace more than 1 space in a row with a nbsp; OR, when outputing their text place a pre tag around it Andrew - Original Message - From: Stephen To: PHP List Sent: Monday, December 09, 2002 9:25 PM Subject: [PHP] Spaces I have a article submission thing where the user

Re: [PHP] Fractions

2002-12-09 Thread Andrew Brampton
Well how would you do it on paper? $numerator = 8; $denominator = 12; $factor = 1; //Start at the greater of the 2, and loop down til you find a common factor for ($i=max($numerator,$denominator);$i1;$i--) { //Check if each number divided by $i has no remainder if (($numerator % $i) ==

Re: [PHP] Variables problem

2002-12-09 Thread Andrew Brampton
The problem is as the error says, totalqty is not the name of one of your form elements, I think infact you want: echo Items ordered: . $totalqty . br\n; Since the $_POST is just used to read varibles sent to you from a form, whereas any other varibles you make ie: $totalqty = $_POST[tireqty] +

Re: [PHP] FTP UPLOAD

2002-12-16 Thread Andrew Brampton
Well I think the error is telling you whats up The file C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt Doesn't exist Try changing the line to something like this: $source_file = $HTTP_POST_FILES['thefile']['tmp_name']; This or $source_file = $_FILES['userfile']['tmp_name']; (if you are

Re: [PHP] Sound with PHP

2002-12-19 Thread Andrew Brampton
If you are trying to play the sounds on the client's PC, then you can't do this with PHP PHP is a server side language, so if you tried playing soudns with it, it would only be heard by the people standing next to your server :).. You might want to take a look at some HTML or JScript, or Flash,

Re: [PHP] forum?

2002-12-24 Thread Andrew Brampton
phpBB2 www.phpbb.com Or do what another poster suggested and google for it Andrew - Original Message - From: Fatih Üstündað [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Tuesday, December 24, 2002 2:51 PM Subject: [PHP] forum? do you know freeware forum in php I can easly

Re: [PHP] objects within arrays

2002-12-24 Thread Andrew Brampton
Big guess but I think maybe: $header[0]-from['mailbox']; Also I suggest you turn your PHP Error Level up to E_ALL in your php.ini file (or temporarly at the top of your scripts with error_reporting (E_ALL);, this will help debug programs like this :)) Andrew - Original Message - From:

Re: [PHP] uploading + downloading Large files ...

2002-12-27 Thread Andrew Brampton
There is a limit in the php.ini saying how big a upload can be. Also I beleive there might be a limit in apache, but I'm not sure. But uploading 100mb files over HTTP is a very dodgy thing to be doing, if anything goes wrong the user has to start again. Downloading 100mb is no problem, but

Re: [PHP] Repeats of values

2002-12-31 Thread Andrew Brampton
Hi, I think changing while(list (,$value) = each ($line)) { to foreach ($line as $value) { might help but I'm unsure, either way foreach is easier to read :) Andrew - Original Message - From: Anthony Ritter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 31, 2002 4:47 PM

Re: [PHP] Problem in $_SERVER[PHP_SELF]

2003-01-02 Thread Andrew Brampton
As far as I'm aware you should be using $_SERVER[PHP_SELF] instead of $PHP_SELF its been like this for a while now. Andrew - Original Message - From: ªüYam [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 02, 2003 6:30 PM Subject: [PHP] Problem in $_SERVER[PHP_SELF]

Re: [PHP] PHP complied code

2003-01-02 Thread Andrew Brampton
If maybe you googled, or even read a message posted 4 minutes earier, you would see there are such programs as: ionCube PHP Accelerator: www.php-accelerator.co.uk Zend optimizer/encoder www.zend.com Andrew - Original Message - From: Manuel Ochoa [EMAIL PROTECTED] To: [EMAIL PROTECTED]

Re: [PHP] way to insert timer / pause?

2003-01-02 Thread Andrew Brampton
I beleive you can use output buffering to stop anything from being displayed until the very last moment. Or you can code your page with tables. I know IE wont' render a table until the last /table (I beleive), so this could stop your html from showing. Or if there is going to be a long pause, you

Re: [PHP] PHP running perl running java OR PHP running java?

2003-01-03 Thread Andrew Brampton
Try backticks $yo = `java PFProJava test-payflow.verisign.com 443 ... 30`; echo $yo; Andrew - Original Message - From: Sam [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Saturday, January 04, 2003 1:37 AM Subject: [PHP] PHP running perl running java OR PHP running java? I'm in way

Re: [PHP] Second (Bizarre) Question regarding PHP and ASP

2003-01-04 Thread Andrew Brampton
It would look like any other user. In ASP you will have to check the request's IP (if its static), or you can use some kind of username/password combinition... Or if you are real lazy use just a hidden url ie mysite.com/akjdhsanlfas/process.asp There is no way to tell the page process.php is

Re: [PHP] How to get the mail sending stuff to work on Win2k?

2003-01-05 Thread Andrew Brampton
change that line to your ISPs email server. OR install a email server locally Andrew - Original Message - From: Rad Craig [EMAIL PROTECTED] To: PHP Mailing List [EMAIL PROTECTED] Sent: Sunday, January 05, 2003 11:20 PM Subject: [PHP] How to get the mail sending stuff to work on Win2k?

Re: [PHP] Advanced Search

2003-01-14 Thread Andrew Brampton
$sql = 'SELECT p.* FROM properties p WHERE '; if(isSet($city)) $sql .= 'city = ' . $city . ' AND '; if(isSet($sub_name )) $sql .= 'sub_name = ' . $sub_name . ' AND '; //Remove last AND and append 'ORDER by price asc' mysql_query($sql ); Hope this helps Andrew - Original

Re: [PHP] Redirecting

2003-01-16 Thread Andrew Brampton
php.net/header check out the examples Andrew - Original Message - From: Denis L. Menezes [EMAIL PROTECTED] To: PHP general list [EMAIL PROTECTED] Sent: Thursday, January 16, 2003 4:21 PM Subject: [PHP] Redirecting Hello friends. I want ot redirect users to another page after successful

Re: [PHP] Does remote file(image) exist ?

2003-01-18 Thread Andrew Brampton
If you looked at the usercomments for file_exists you would see it saying to look at the fopen page for a example In the usercomments for fopen there is a post saying this: jamie.watt at murchison.com.au 03-Feb-2000 01:39 To check if a file exists using http or ftp use the following: pre $fp

Re: [PHP] HTML embedding

2003-01-30 Thread Andrew Brampton
Try urlencode your data before outputing it. php.net/urlencode Andrew - Original Message - From: Todd Barr [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 30, 2003 10:11 PM Subject: [PHP] HTML embedding Hello, I am having an issue. I am using an access database,

Re: [PHP] Graphic Pie Charts

2003-02-02 Thread Andrew Brampton
You will have to look up how to use the GD libraries Look up Image Functions in the manual... Or you could also google for online tutorials/classes Andrew - Original Message - From: Vernon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 03, 2003 1:19 AM Subject: [PHP]

Re: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Andrew Brampton
Just a minor change, the HTTP Specification says that the Location header should use a absoluteURI which includes the full URL not just page.php... so http://yoursite.com/page.php is what you should be using there. Andrew - Original Message - From: Chris W. Parker [EMAIL PROTECTED] To:

Re: [PHP] FTP - Can't build data connection

2003-07-26 Thread Andrew Brampton
This would happen when a incoming or a outgoing port 20 (FTP Data) connection can't be made. I don't know how PHP ftp functions work but normally the FTP client makes a outgoing connection on port 21, and then the FTP Server makes a incoming connection from port 20 when any kind of data is sent

Re: [PHP] replacing but not special chars

2003-07-27 Thread Andrew Brampton
How about you decode the string, and then encode it like so: $decode = html_entity_decode($input); $output = htmlentities($decode); If you have the string abamp;somethingblah the decode will turn that into absomethingblah and then encode it into abamp;somethingamp;blah This can run into

Re: [PHP] POST/GET using a proxy server

2003-07-27 Thread Andrew Brampton
Something like so: /* sendToHost * ~~ * Params: * $proxy - Proxy you want to use * $host - Just the hostname. No http:// or /path/to/file.html portions * $method- get or post, case-insensitive * $path - The /path/to/file.html part *

Re: [PHP] fpdf

2003-07-30 Thread Andrew Brampton
The way I would do it is I would make the Save button (or link) point to display.php?save... Now in the display.php I would have it figure out if save is in the URL, if it is then it should output a pdf file instead of a html file. This does however mean that your query is done twice (once for

Re: [PHP] Pushing array onto array

2003-08-02 Thread Andrew Brampton
Well I just coded up a very small example, and it pushing 1 array into the other... Check out: http://81.102.229.151/push.php and http://81.102.229.151/push.phps It works exactly how it should... However really the array isn't a 2 dimensional one, since PHP doesn't have them, its rather a array

Re: [PHP] CRC and Polynomials

2003-08-24 Thread Andrew Brampton
I found this mentioned in a old user comment (it might not be relevant now): Some quick reverse engineering shows they're using the standard CRC32 parameters: Polynomial 0x04C11DB7l Initial register value 0x Register is inverted at end of calculation Bytes are reflected as they come in,

Re: [PHP] auto 'jump' to link

2003-09-03 Thread Andrew Brampton
if ($x == 5) header('Location: http://blah.com/blah'); This what you were looking for? Also make sure this is sent before any other output Andrew - Original Message - From: DougD [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 6:32 AM Subject: [PHP] auto

Re: [PHP] suggestion: recursive calls

2003-09-04 Thread Andrew Brampton
I was just testing PHP with this code: ?php function blah($varible) { if ($varible 860) exit(); echo $varible . 'br'; flush(); blah($varible + 1); } blah(1); ? This would show 1 to 860, however if I tried any number greater than 860, ie 861 then the page would give

Re: [PHP] GD problem

2003-09-23 Thread Andrew Brampton
ImagePNG() ouputs to the browser unless you specify the filename parameter So those funny symbols you are seeing is the PNG file but displayed as text. To fix this you need to add a Header(Content-type: image/png); somewhere in your PHP (preferably before ImagePNG), and it will tell your browser

Re: [PHP] Finding the height of a JPG in pixels using PHP

2003-04-05 Thread Andrew Brampton
You can use getimagesize on a jpg file to read its size, so either save the jpg in MySQL to a file and then do a getImageSize, or before you place the jpg in to the database read its size and store its dimensions with it in the db. Andrew - Original Message - From: Phil Schwarzmann [EMAIL

Re: [PHP] Protecting files with PHP

2003-07-17 Thread Andrew Brampton
Place a .htaccess in the files directory denying all access to it, and also possibly redirecting them to a login page. However since your users should never know about the files/ directory there is no real point :) Then code a PHP script to serve the files just in the same way you would if they

[PHP] Making /something/blah work instead of /something.php/blah

2003-02-04 Thread Andrew Brampton
Hi, I did a bit of googling for this, but I was unsure on what to google for, so I came up with nothing :( Anyway I have a 3 servers, windows, freeBSD, and my web hosts. I have used the following style URLs for many of my scripts, ie: www.mysite.com/something/blah/blah/blah where something is

Re: [PHP] Execute at a defined time

2003-02-05 Thread Andrew Brampton
If you have PHP compiled as cgi then you can run something like: php /path/to/my/script.php or if you can request the page via your website with something like: lynx -dump http://your site.com/yourscript.php Also if you want to know how to use cron, try typing man cron in your shell Hope this

Re: [PHP] Files upload

2003-02-09 Thread Andrew Brampton
I beleive move_uploaded_file is prefered since copy won't work in Safe Mode. Andrew - Original Message - From: Max 'AMiGo' Gashkov [EMAIL PROTECTED] To: PHP General list [EMAIL PROTECTED] Sent: Sunday, February 09, 2003 6:09 PM Subject: [PHP] Files upload Is there any difference

Re: [PHP] Counter has gremlins

2003-02-17 Thread Andrew Brampton
I believe this is a concurrency problem... 2 PHP scripts can run at the same time and the problem is that your first script gets as far as the unlink thus deleting the file. Then the 2nd script is ran (at the same time) and trys to open the file which doesn't exist, therefore it reads a num of 0.

Re: [PHP] test for rtf

2003-03-07 Thread Andrew Brampton
Not to sure on the RTF file format, but checking the first few letters might help Quickly opening a RTF file I see that they start with {\rtf Maybe look for that. Andrew - Original Message - From: bill [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 07, 2003 4:22 PM Subject:

Re: [PHP] Humour in programming?

2003-04-01 Thread Andrew Brampton
The image is stored locally inside your compiled php binaries. php returns a image instead of parsing the script if the query string is one of the following: ?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 ?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 ?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 Try appending

Re: [PHP] Using PHP to create tables?

2002-10-02 Thread Andrew Brampton
It appears to me you are not actually executing the SQL you are storing in the varible. Did you accidently miss that out of your email? I would supply you with more information but I don't know how to use PostgreSQL, but since you are coding with it, I guess you should be able to figure out the

[PHP] CC Processing Merchants

2002-10-09 Thread Andrew Brampton
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

Re: [PHP] WinAMP Plugin Question

2002-10-12 Thread Andrew Brampton
You could create a PHP script on your webserver that pulls the info from your machine, parses it and then re-displays it in the way you like. This way people won't actually know your IP,. and all the processsing will be done on your webserver. If you want to allow them to download your MP3s, you

Re: [PHP] Detecting GD version

2002-10-13 Thread Andrew Brampton
try function_exists('imagecopyresampled'); otherwise I'm sure there has to be some function that returns versions of libs. Andrew - Original Message - From: Owen Prime [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:37 AM Subject: [PHP] Detecting GD version

Re: [PHP] Best way to store Votes for Survey app

2002-10-27 Thread Andrew Brampton
Say item_id was a int(10) member_id was a int(10) date was a timestamp(14) rating was a int(1) then each record would take up 35bytes + a little overhead Neglecting the overhead 20,000 records would take up only 700kb of space. So size of the db shouldn't be a issue. But if it is then you could

Re: [PHP] ftp_rawlist problems

2002-11-02 Thread Andrew Brampton
This is a known bug on the windows platform. It has been fixed in CVS, and is most likly fixed in the current 4.3.0pre2 release. I experience this problem a few weeks ago, but once I downloaded the lastest CVS Snapshot it worked as expected. hope this helps Andrew - Original Message -

Re: [PHP] Problem with is_dir function

2002-11-02 Thread Andrew Brampton
what values of $user_dir are you passing to is_dir? echo them out before the test, you might be sending paths which are most certainly not directories... for example: c:\windows /home/blah would be valid, but c:\windows\win.com /home/blah/myfile http://somesite/somepath

Re: [PHP] Rotating Ads

2002-11-09 Thread Andrew Brampton
you can use SQL: SELECT id, url, image FROM tblAdds ORDER BY RAND() LIMIT 1 I think thats just about it, that should evenly show them, if you want to bias the displying of your ads you would need to get a count of the ads in the DB, then use some random number generated from PHP to chose which to

Re: [PHP] Rotation of images

2002-11-12 Thread Andrew Brampton
You could write your own rotation code, moving every pixel one by one, Otherwise I've not used GD enough to know one... but actually quickly looking at the GD Function list I found: http://www.php.net/manual/en/function.imagerotate.php Voila Andrew - Original Message - From: Sear, Mick

Re: [PHP] Listing files and their details on a text file

2002-11-18 Thread Andrew Brampton
You would do it just like you would if you were outputing to the browser look up the following: dir, fopen and fwrite. Just be looking at the examples and user comments you will have all the source you need Andrew - Original Message - From: Carlos Fernando Scheidecker Antunes [EMAIL

Re: [PHP] Graph Question..

2002-11-20 Thread Andrew Brampton
Try going direct to the image's URL, this might show any PHP errors. If that doesn't work, you can request the page via telnet and see if any errors are appearing Andrew - Original Message - From: James Hatridge [EMAIL PROTECTED] To: PHP-GEN [EMAIL PROTECTED] Sent: Wednesday, November 20,

Re: [PHP] login_script_help needed.

2002-12-01 Thread Andrew Brampton
Well quickly looking at the code I can't see what line is causing the Warning: Cannot add header information but there have been many discussion explaining why this happens... as for your Unknown MySQL Server Host '$198.63.221.3' the error for that is on the line: if(!($link_id =

[PHP] SQL Query OT question for the experts :)

2003-10-17 Thread Andrew Brampton
Hi, I have a client with a database of around 17k entries. Now due to powers out of my control the table structure looks like: CREATE TABLE londonhotelsallphotos ( HotelID double default NULL, active_hotel_photo_Name varchar(255) default NULL, URL varchar(255) default NULL, Number

Re: [PHP] php special permissions

2003-12-18 Thread Andrew Brampton
Another solution would be to place each change to the files in a MySQL table, and then have a cron that is run every X minutes read this table, and makes the actual changes I'm not sure if this idea is suitable in your situation due to the time lag between the client asking for the change, and

Re: [PHP] How to eject cd-rom with php code?

2007-05-23 Thread Andrew Brampton
If you are on linux just shell out the linux eject command (which should eject the drive for you). If you are on windows (or another OS), then I'm sure you can still find a similar commnad line app that will do the same task. There isn't a built in way in PHP. Andrew - Original Message

<    1   2