Re: [PHP] IE Not Following Header(Location: /path/to/file.php);

2007-09-06 Thread Andrew Brampton
That is not valid, the Location field must contain the full URL, so /path/to/file.php should be http://yourserver/path/to/file.php Read RFC rfc2616, section 14 Will help find it: http://www.google.com/search?hl=enq=HTTP+Header+FieldbtnG=Google+Search Andrew - Original Message -

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

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

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] 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] 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] 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:

[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] 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:

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] 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] 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] 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

[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] 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

[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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

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] 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] 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] 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] 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] 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

[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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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 =

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] 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] 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] 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] 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] 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] 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] 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

[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] 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

Re: [PHP] whois query

2002-09-12 Thread Andrew Brampton
If you can't do a exec or system call on your server, then look at the many examples of whois scripts here: http://www.hotscripts.com/PHP/Scripts_and_Programs/Networking_Tools/Whois/ some of which use sockets or other methods which might be allowed on your server Also for reference,

Re: [PHP] few things...

2002-08-31 Thread Andrew Brampton
comments inline - Original Message - From: Matt Zur [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 31, 2002 4:40 AM Subject: [PHP] few things... First of all... I'm a bit confused is there really a difference between echo and print? They seem to do the same thing?

Re: [PHP] Download site down?

2002-08-31 Thread Andrew Brampton
It seems that php.net does load balancing of its downloads and every time you open the downloads page it displays downloads from different mirrors... so keep refreshing http://www.php.net/downloads.php until you find a mirror which works for you. Usually all the mirrors work first time but I did

Re: [PHP] Average Number For Math Functions

2002-08-29 Thread Andrew Brampton
I can't seem to see a pre-built functions but here is one I just wrote in my email client: function average($numberArray) { $sum = 0; for ($i=0;$icount($numberArray);$i++) $sum += $numberArray[$i]; return $sum / count($numberArray); } echo average(array (1,2,3,4,5)); Hope

Re: [PHP] Does this call for an array?

2002-08-28 Thread Andrew Brampton
It calls for a intermediate table. You need 3 tables: pf_survey, categories and survey_cat They look like: pf_survey survey_id, Questions, Whatever, but no categories fields categories category_id, category_name survey_cat survey_id and category_id for each record in pf_survey you will have

Re: [PHP] How can I strip the code from HTML pages to extract the contents of a HTML page.

2002-08-28 Thread Andrew Brampton
the striptag function is what I think you want, it just removes all HTML tags and returns whatever is left php.net/striptag Andrew - Original Message - From: Charles Fowler [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 2:58 PM Subject: [PHP]

Re: [PHP] exec problem

2002-08-27 Thread Andrew Brampton
If you are trying to receive the output of the command line you can use the backtick notation $list = `ls`; Hope that helps Andrew Mark [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... i'm basicly trying to execute an executeable with this following script.

Re: [PHP] A Doubt!

2002-08-19 Thread Andrew Brampton
In the php.ini file there is somewhere to set the smtp server to use if you don't have sendmail... Look for that and that might help Andrew - Original Message - From: Thiruvelraj Pokkishamani [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 19, 2002 5:55 PM Subject: [PHP] A

Re: [PHP] Shared network server failing to include files

2002-08-14 Thread Andrew Brampton
Hi, I don't think this is a PHP question, but the line Alias /cs/ //192.168.0.253/apachedir/ try Alias /cs/ \\192.168.0.253/apachedir/ Because //isn't valid for UNCs, but \\ is.. If this doesn't work, then with dos map \\192.168.0.253/apachedir/ to a network drive and point apache at that

Re: [PHP] PHP-Ebay Interface

2002-08-13 Thread Andrew Brampton
Well not a legal idea no :) Andrew - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 4:52 PM Subject: [PHP] PHP-Ebay Interface Anyone have any idea how to easily interface with the Ebay engine other then with the expensive

Re: [PHP] requesting sites running OS X

2002-08-13 Thread Andrew Brampton
A good reference I can point you to is Netcraft.com, they record what OS/Webserver 1000s of sites are using, you can type in a website name and it will tell you all sorts of stats... Usally it will also tell you other similar sites running on the same OS and or Server... but for some reason it

Re: [PHP] Making PHP faster?

2002-08-12 Thread Andrew Brampton
I don't know any good ways of making PHP go faster, but may I suggest that the time you use in coding and figuring out ways to make PHP faster would be greater than the time you have saved by using such features... If this is a one of thing I think 30minutes is better than 15minutes plus

Re: [PHP] Case Sensitivity

2002-08-11 Thread Andrew Brampton
Linux file systems are case sensitive... So the file Hello.php is different to hello.php... Both can exist at the same time and contain different content, but they are different...On the windows file system files aren't case sensitive so Hello.php would be the same as hello.php... So I suggest

Re: [PHP] which function can do so ?

2002-08-04 Thread Andrew Brampton
I read his question as wanting to know how to figure out the URL of his site, use the varible $_SERVER['HTTP_HOST'] or $HTTP_HOST on old PHP versions, that will return the full domain, from the www. to the .com so you may want to do some spliting of that varible to figure out what just the bit in

[PHP] Safe Mode seems to turn on and off randomly

2002-08-03 Thread Andrew Brampton
Hi, I was discussing with a friend at a webhost I use and they have been experience a wierd problem recently with their php safe mode, I went to help and after spending a while in the bug database I couldn't find anything to explain it. Basically every time you view a phpinfo page it will

[PHP] Vote to ban Acer

2002-08-03 Thread Andrew Brampton
Ok, I'm not a professional PHP developer, I'm just a plain student that loves PHP, I don't have the money to spend on Encoders and high end IDEs or whatever is out there, I just love the fact that I have a near unlimited supply of software out there which free to use, comes with source, and

Re: [PHP] .htaccess

2002-08-02 Thread Andrew Brampton
place a phpInfo() page behind the .htaccess and you will see what varibles php has :) I'm pretty sure there is ones contianing the username/password that was entered Andrew - Original Message - From: Oliver Witt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 02, 2002 3:21

Re: [PHP] PHP Hosting

2002-08-02 Thread Andrew Brampton
This has been discussed in great detail before.. but the simplist solution is running PHP in safe mode, it does limit the user to certain things, but it stops them bringing the server down or altering others files andrew - Original Message - From: Matt Babineau [EMAIL PROTECTED] To:

Re: [PHP] php3 to php4 migration woes

2002-07-31 Thread Andrew Brampton
Since 4.1.? the way things worked changed... Instead of using $album you need to use $_GET['album'] you can default back the old behaviour with a php.ini change, but the new way is prefered andrew - Original Message - From: Bruce Riddle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent:

Re: [PHP] Re: Q:What is the easiest way to test my PHP+Html pages?

2002-07-27 Thread Andrew Brampton
Just install apache (for windows), MySQL (for windows), and PHP... voila a local webserver, and the only way to view your pages, no need to upload since you can point your webserver to where you are developing your php. andrew - Original Message - From: Marcus Unlimited [EMAIL PROTECTED]

Re: [PHP] ob_start

2002-07-14 Thread Andrew Brampton
I don't think you need to do the if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],gzip)) { because ob_start(ob_gzhandler); checks to see if the browser will accept gzip content before gzipping it.. But I think the reason that it isn't working for you is that you don't have the correct compression

Re: [PHP] HTTP_USER_AGENT?

2002-07-10 Thread Andrew Brampton
the $HTTP_USER_AGENT varible contains nothing... Try doing a phpinfo(); to see what the correct varible to use is, it is most likly $_SERVER['HTTP_USER_AGENT'] since the way these varibles are handled changed a few versions ago Andrew George Hester [EMAIL PROTECTED] wrote in message [EMAIL

Re: [PHP] ??????????????????????????????????????????????????????````````````````````ØØØØØØØØØØ

2002-07-09 Thread Andrew Brampton
If you read the 3 emails he sent previous to his spam you will see that he tried to get the moderators to remove him but after 6 hours he is still on the list, so I guess he thinks that if he starts to spam he will be kicked Andrew - Original Message - From: Rodolfo Gonzalez [EMAIL

Re: [PHP] upgrading php...

2002-07-02 Thread Andrew Brampton
Takes the time of the download + 5minutes Download the full version of php... extract the zip file to where php is currently... then copy the new versions of php.ini and php4ts.dll into your c:\windows\ directory... Then make any minor changes you need to to the php.ini and voila all done (don't

Re: [PHP] [more info] Finding all instances

2002-06-30 Thread Andrew Brampton
Well I'm not good enough at SQL to do this, but how about you get PHP to figure out all the combinations, ie 1, 3, 5, 2, 6, 52, 32, 321, 51, 61, 21, 31 Then do a set of SELECT * FROM table WHERE number=1 SELECT * FROM table WHERE number=3 SELECT * FROM table WHERE number=3 OR number=1 Then

Re: [PHP] Design Tips

2002-06-26 Thread Andrew Brampton
Not so long ago (well last week), I wrote a PHP proxy script which worked in the form: www.myserver.com/proxy/www.whatever.com/blah and it would request the page www.whatever.com/blah and then display it changing all the links on the page to point to my proxy script... The whole script took a

Re: [PHP] PHP with IIS

2002-06-24 Thread Andrew Brampton
Does the user to which ISS runs under have network permissions to access p:\ ? IIRC you need to set up ISUR_machine_name to have permission to the remote share. Andrew - Original Message - From: Dave Leather [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 24, 2002 6:29 PM

Re: [PHP] Is this a BUG?

2002-06-23 Thread Andrew Brampton
If the code is in a function then don't you need to call global $HTTP_POST_VARS; at the top of the function so that it knows you can use that varible? Andrew - Original Message - From: César Aracena [EMAIL PROTECTED] To: PHP General List [EMAIL PROTECTED] Sent: Sunday, June 23, 2002

Re: [PHP] Can a php script be placed within a stylesheet?

2002-06-10 Thread Andrew Brampton
Yes you can place one in a style sheet you just need to tell apache (or whatever) that .css should be parsed by PHP, this can be done via a .htaccess or something similar... Here is a example in a .htaccess file: AddType application/x-httpd-php .css andrew - Original Message - From:

Re: [PHP] Smart URLs

2002-06-02 Thread Andrew Brampton
You can do this with just PHP, but I think php must be installed as a module. Basically place a file called thumbnails.php in your site route, then whenever a URL like mysite.com/thumbnails/funny/4 i called the thumbnails.php is excuted, in which you chop up the URL, and find all your varibles...

Re: [PHP] Smart URLs

2002-06-02 Thread Andrew Brampton
Hey try it, it works when are running the PHP Module in apache. I have a server with proxy.php yet I access it via myserver.com/proxy/whatever and it works with no special changes to the config files. Andrew - Original Message - From: Adrian Murphy [EMAIL PROTECTED] To: Andrew Brampton

[PHP] reg exp problems

2002-06-01 Thread Andrew Brampton
Hi, I've never used a reg exp, but I was trying to do something simple, and I just can't seem to do it :) I have a varible $fdata which contains the contents of a webpage, and I want to strip out the base tag. I try: $fdata = preg_replace(base.*,,$fdata); But its stripping out everything

  1   2   >