Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Graham Cossey
On Fri, Jan 8, 2010 at 3:48 AM, Robert Cummings rob...@interjinn.com wrote: They almost always make your shit run faster. I love your final statement Robert! A reply of good grammar and vocabulary summarised most succinctly. -- Graham -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Storing £ (pound sterling) sign and displaying in HTML email

2008-06-03 Thread Graham Cossey
On Tue, Jun 3, 2008 at 12:06 AM, James Dempster [EMAIL PROTECTED] wrote: This is most likely a character encoding issue. Check that the html encoding is set to the same type as what your storing it as in mysql. Thanks James, it certainly was a character encoding issue. My dev box didn't have

[PHP] Storing £ (pound sterling) sign and displaying in HTML email

2008-06-02 Thread Graham Cossey
Could someone please point me in the right direction here please? I have a form textarea field (submitted using POST) that accepts free text that will include the likes of '£' (pound sterling symbol) that is written to a MySql database and later retrieved to output into an HTML email. I have

Re: [PHP] Converting tab delimited file to CSV

2008-02-20 Thread Graham Cossey
On Feb 20, 2008 3:05 AM, Richard Lynch [EMAIL PROTECTED] wrote: On Mon, February 18, 2008 12:08 pm, Graham Cossey wrote: proceed accordingly... My biggest gripe with tab delimited files is that they are quite a bit bigger than comma delimited files so I may have to split the large files I

Re: [PHP] Converting tab delimited file to CSV

2008-02-20 Thread Graham Cossey
I have a suspision the files I receive are in unicode which is causing the problems. How can I categorically determine if a file uses unicode? Am I correct in believing PHP4 doesn't work with unicode files? -- Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Converting tab delimited file to CSV

2008-02-20 Thread Graham Cossey
On Wed, Feb 20, 2008 at 9:50 PM, Chris [EMAIL PROTECTED] wrote: Back to my 'original' problem/question, if I '$f = fopen($file, r)' and 'while ($data = fgets($f))' on the above first format and do a $data = str_replace(\t,,,$data); the resulting file looks like the second example

[PHP] Converting tab delimited file to CSV

2008-02-18 Thread Graham Cossey
I was wondering if someone could offer some advice please. I'm being sent data in tab delimited files which I'm trying to split into smaller files and convert to comma delimited using PHP. Now, I can replace the tabs with commas and opening the resulting files in a basic text editor all looks

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Graham Cossey
On Feb 18, 2008 1:58 PM, Edward Kay [EMAIL PROTECTED] wrote: Now, I can replace the tabs with commas and opening the resulting files in a basic text editor all looks fine. When you do this, ensure you escape any commas that may exist in the data. IIRC, Excel handles this be enclosing the

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Graham Cossey
On Feb 18, 2008 5:23 PM, Andrew Ballard [EMAIL PROTECTED] wrote: On Feb 18, 2008 12:02 PM, Edward Kay [EMAIL PROTECTED] wrote: On Mon, February 18, 2008 10:36 am, Jay Blanchard wrote: [snip] That's funny... MS defaults to tabs for a file whose extension is .csv which is an

Re: [PHP] Converting tab delimited file to CSV

2008-02-18 Thread Graham Cossey
On Feb 18, 2008 6:45 PM, Andrew Ballard [EMAIL PROTECTED] wrote: On Feb 18, 2008 1:39 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Mon, 2008-02-18 at 13:24 -0500, Andrew Ballard wrote: On Feb 18, 2008 1:08 PM, Graham Cossey [EMAIL PROTECTED] wrote: My biggest gripe with tab

Re: [PHP] Creating a File in Memory

2007-09-07 Thread Graham Cossey
Can't help with your main problem, however I find it easier to write the likes of : $kml_string = $kml_string . Document; as: $kml_string .= Document; ;-) On 9/7/07, John Schattel [EMAIL PROTECTED] wrote: Hello All, I am trying to zip data in a PHP program using the following code. The

Re: [PHP] Pragmatically changing a Record Number

2007-09-04 Thread Graham Cossey
Surely we're into basic database design. If you have an auto_increment record key that needs changing from time to time then you've designed the database incorrectly. Use a 'normal' key field such as Product_Id and have your application generate the number. Simple. No? On 9/4/07, tedd [EMAIL

Re: [PHP] Pragmatically changing a Record Number

2007-09-02 Thread Graham Cossey
If I've understood correctly your record/Id number relates to a message/post. Let's say the PHP list has message numbers and this post is number 456. If I have a list of posts and sort them by user and provide the user with a numbered list of posts from 1 to N in user sequence there's VERY little

Re: [PHP] what is the problem with this query?

2005-12-29 Thread Graham Cossey
On 12/29/05, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] could you please tell me what is the problem with this query mysql_query(SELECT * FROM mailbox WHERE read=''); i always get this warning: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in

[PHP] readdir and mime types

2005-11-22 Thread Graham Cossey
I'm attempting to read a list of files in a directory using readdir() but am having problems with mpeg files not seemingly being read. Cope snippet: $count = 0; while (false !== ($file = readdir($open_dir))) { if ($file != '.' $file != '..') {

Re: [PHP] readdir and mime types

2005-11-22 Thread Graham Cossey
On 11/22/05, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] I'm attempting to read a list of files in a directory using readdir() but am having problems with mpeg files not seemingly being read. Cope snippet: $count = 0; while (false !== ($file = readdir($open_dir)))

Re: [PHP] readdir and mime types

2005-11-22 Thread Graham Cossey
[snip] Make sure to always hit reply-all, or the e-mail will not go back to the list. Yep, realised that after hitting 'send'. :-( If file exists is looking for an associated files is it probable that the .mpg files do not have one associated with it in the other directory? It is probable,

Re: [PHP] readdir and mime types

2005-11-22 Thread Graham Cossey
[snip all] OK, of course it's my fault !! :o My directory variables are using relative paths and I was trying to access the parent directory from the sub-directory but not using '..' Sorry. Thanks for your help. -- Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Re: [PHP] A php/*sql/apache webbased document upload, download, management solution?

2005-09-16 Thread Graham Cossey
On 9/16/05, symbulos [EMAIL PROTECTED] wrote: Dear friends, do you know about a good web based document management solution, FS/OS licensed, implemented in PHP/*sql/Apache, for document upload, download, protected, for editing articles or other document of the sort? I am looking for

Re: [PHP] Re: editor in WEB PAGE

2005-08-02 Thread Graham Cossey
Sorry to drag this up again, but I'm attempting to set up FCKeditor and am having problems with the File Browser. Has anyone successfully got this running with the PHP connector? If so some hints tips would be most appreciated. I've set my UserFilePath in config.php (relative to doc root) but

Re: [PHP] Re: editor in WEB PAGE

2005-08-02 Thread Graham Cossey
-Original Message- From: Graham Cossey [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 02, 2005 1:12 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: editor in WEB PAGE Sorry to drag this up again, but I'm attempting to set up FCKeditor and am having problems

Re: [PHP] Adding Fonts to JpGraph

2005-04-11 Thread Graham Cossey
On Apr 6, 2005 2:53 AM, Richard Lynch [EMAIL PROTECTED] wrote: On Mon, April 4, 2005 12:39 pm, Stephen Johnson said: I am using JPGraph for a project that I am working on right now and I have hit a small snag - My client wants to have the user be able to select from a list of about 20

Re: [PHP] PHP file as homepage?

2005-03-15 Thread Graham Cossey
On Tue, 15 Mar 2005 11:10:30 -0500, Phil Neeb [EMAIL PROTECTED] wrote: I've noticed that PHP.net uses index.php as its homepage and well, I'm curious as to how that's possible. Is it the server setup that allows them to load a php file as their homepage or something else? Yes, it's normally

Re: [PHP] Getting two queries into one result set

2005-02-02 Thread Graham Cossey
You don't say how many tables you have, how they are named or anything outside of the query itself. Assuming that not all your tables are named PID_* how about simply doing SHOW TABLES LIKE '%PID_%' and selecting appropriate results within the php script using strstr or regular expressions?

[PHP] File upload difference between browsers

2005-02-01 Thread Graham Cossey
I have a problem uploading a file in IE6 or Firefox1.0 but it works fine using Opera7.54. The problem is that I want to ensure that the file being uploaded is a CSV file, so I test the $_FILES['file']['type'] value. In Firefox IE it is returned as application/octet-stream but in Opera it is

Re: [PHP] Re: Writing static file from dynamic PHP page

2005-01-18 Thread Graham Cossey
On 18 Jan 2005 04:05:27 -, Matthew Weier O'Phinney [EMAIL PROTECTED] wrote: * Chris Bruce [EMAIL PROTECTED]: I am looking for a way to write to a file what the browser would see (raw html) when viewing a dynamic PHP page. I have numerous include files, MySQL db queries, loops etc. and I

Re: [PHP] alternating table entry colors

2004-12-11 Thread Graham Cossey
On Fri, 10 Dec 2004 18:19:35 -0600, Brad Ciszewski [EMAIL PROTECTED] wrote: i need some assistance making my table (rows) change color for every other data. here is what i have so far, but i get a unexpected T_STRING error. this error's line is: if($thisRow mode 2 == 0){ +=+=+ SCRIPT BELOW

RE: [PHP] Have I learned nothing . Foreach()

2004-11-30 Thread Graham Cossey
[snip] Then finally on the transaction page, some pages down the road: and also print_r($_SESSION['schools']); here foreach($_SESSION['schools'] as $school) { What have you find out? They don't exist. [snip] You have got session_start(); at the top of each

RE: [PHP] How to $_POST from a grid

2004-11-25 Thread Graham Cossey
[snip] I'm doing my development in Dreamweaver though the code is basic. To get to the grid I'm passing over the userID . Then basic a select statement in the results grid with a while loop the returns all the records related to the userID. It's just odd - because in Dreamweaver I build

RE: [PHP] include files, .php or .inc ?

2004-11-21 Thread Graham Cossey
Perry Jönsson wrote: Jon-Eirik Pettersen wrote: Perry Jönsson wrote: Hello, Does it make any difference if you include (include/require/include_once/require_once) files with extension .inc or .php? No, it does not. What it the purpose of the .inc file then?

RE: [PHP] Database search logic question

2004-11-15 Thread Graham Cossey
A couple of possibilities are: Store search criteria (form entries) in MySQL Store query string in MySQL If the user has to log-in then the MySQL table would be keyed on the user_id or similar. If the user does not have to log-in then you will most likely need to store something in a

RE: [PHP] Database search logic question

2004-11-15 Thread Graham Cossey
-Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 15 November 2004 10:12 To: Graham Cossey; [EMAIL PROTECTED] Subject: RE: [PHP] Database search logic question Please see inline: --- Graham Cossey [EMAIL PROTECTED] wrote: A couple of possibilities

RE: [PHP] Re: probably stupid, but...

2004-11-13 Thread Graham Cossey
I know I'm a bit late to this topic and I may have missed a comment along the way, but what about making a change to the form, is that possible? Instead of calling your form entries book_title_1, book_title_2, book_title_3 etc why not use book_title[] for all instances of book_title? This way

RE: [PHP] Re: Help: Database Search

2004-11-13 Thread Graham Cossey
Hi Stuart Not sure what's happening with the $Ind variable, maybe check the $_POST array as you enter the script to ensure that the form is passing the data correctly. It is almost as if you are appending it to itself at some point. You don't have a line like this anywhere do you : $Ind[] = $Ind;

RE: [PHP] Re: Help: Database Search

2004-11-12 Thread Graham Cossey
I think you're implode example is pretty close. ?php $Ind = ; $Ind = $_POST['Ind']; if(is_array($Ind) { if (count($Ind) 1) { $IndStr = implode(',', $Ind); $where[] = vendorjobs.Industry IN($IndStr); }else{ $where[] = vendorjobs.Industry = {$Ind[0]}; }else{ // Is there an

RE: [PHP] Re: Help: Database Search

2004-11-12 Thread Graham Cossey
as well. Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 12 November 2004 14:13 To: Graham Cossey; Sebastian Mendel; [EMAIL PROTECTED] Subject: RE: [PHP] Re: Help: Database Search --- Graham Cossey [EMAIL PROTECTED] wrote: This should result

RE: [PHP] Looking for pointers to mysql functions

2004-11-11 Thread Graham Cossey
-Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 11 November 2004 11:32 To: [EMAIL PROTECTED] Subject: [PHP] Looking for pointers to mysql functions I'm building a search function and I think most of the search part is solid. Now I'm trying to

RE: [PHP] Help: Database Search

2004-11-10 Thread Graham Cossey
What about doing something like: $sql = SELECT * FROM my_table WHERE col1=$var1; if (isset($var2)) $sql .= AND col2='$var2'; HTH Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 10 November 2004 14:37 To: [EMAIL PROTECTED] Subject: [PHP]

RE: [PHP] using mysql in php problem

2004-11-09 Thread Graham Cossey
-Original Message- From: Garth Hapgood - Strickland [mailto:[EMAIL PROTECTED] Sent: 09 November 2004 11:27 To: [EMAIL PROTECTED] Subject: [PHP] using mysql in php problem I have created a registration page http://www26a.your-server.co.za/matchm/registration4.php On this page I

RE: [PHP] help with fopen path

2004-11-09 Thread Graham Cossey
-Original Message- From: Giles Roadnight [mailto:[EMAIL PROTECTED] Sent: 09 November 2004 13:07 To: [EMAIL PROTECTED] Subject: [PHP] help with fopen path Hi All I'm developing a fusebox PHP app and have a class in a /classes directory that opens an xml file in a directory

RE: [PHP] silly question - setting .php as default extension (Apache)

2004-11-09 Thread Graham Cossey
Uuuuh... Where do I set the default server extension type to .php in the apache config? Right now the page will execute on my server, but if there is an index.php the server won't automatically open it, but instead browses the directory. Thanks in advance, -Brian Look for

RE: [PHP] How to display a 'please wait' message whilst processing?

2004-11-05 Thread Graham Cossey
[snip] On a number of sites a message and/or graphic is displayed asking you to wait or be patient whilst some processing is being performed to compose the next page. How are these done within PHP scripts? Could output buffering be used for this purpose? For example is it possible to do

[PHP] How to display a 'please wait' message whilst processing?

2004-11-04 Thread Graham Cossey
On a number of sites a message and/or graphic is displayed asking you to wait or be patient whilst some processing is being performed to compose the next page. How are these done within PHP scripts? Could output buffering be used for this purpose? For example is it possible to do something like:

RE: [PHP] using require or include?

2004-11-04 Thread Graham Cossey
Have you looked at the GLOBAL keyword? http://uk.php.net/manual/en/language.variables.scope.php -Original Message- From: Reinhart Viane [mailto:[EMAIL PROTECTED] Sent: 04 November 2004 23:02 To: [EMAIL PROTECTED] Subject: [PHP] using require or include? i have made a page

RE: [PHP] validate international phone numbers

2004-11-02 Thread Graham Cossey
-Original Message- From: Merlin [mailto:[EMAIL PROTECTED] Sent: 02 November 2004 10:49 To: [EMAIL PROTECTED] Subject: [PHP] validate international phone numbers Hi, I am trying to validate international phone numbers before adding into a db. After a bit of research I came up

RE: [PHP] Session and validation

2004-10-30 Thread Graham Cossey
[snip] Here is the example: testarray (page1) //Start the session ?php session_start(); //Check for the array on submit if ( empty( $_SESSION['l_industry'] ) ) { $_SESSION['l_industry']=array(); } $industry = $_POST['industry']; // ?? //Check to make sure user didnt exceed 5

RE: [PHP] Security: Forms and displaying invalid data

2004-10-30 Thread Graham Cossey
-Original Message- From: rjc [mailto:[EMAIL PROTECTED] Sent: 30 October 2004 23:35 To: [EMAIL PROTECTED] Subject: [PHP] Security: Forms and displaying invalid data I have a form, that takes user input, and was wondering what are your thoughts of redisplaying user input back on the

RE: [PHP] Help needed

2004-10-29 Thread Graham Cossey
Hi I developed a html form in which I have text box and combo box. Now my problem is I have to pass the values of this page to another page. How can i pass the values/variables to next page using href Kindly help me Thanks Suma As you've posted to a PHP list I will assume your

RE: [PHP] Code help on a multi select list

2004-10-29 Thread Graham Cossey
[snip] What is not to understand here...you are the one who said, I want to do a server side trap. JavaScript would be the only way to do that. [snip] Jay, you may want to re-read what you typed as JavaScript, to the best of my knowledge, is actually client side... -- PHP General Mailing List

RE: [PHP] Validation and session variables

2004-10-28 Thread Graham Cossey
See in-line comments... -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 28 October 2004 08:54 To: [EMAIL PROTECTED] Subject: [PHP] Validation and session variables I guess my resolution was a fluke. Recap: Adding validation kills my session variables

RE: [PHP] Validation and session variables

2004-10-27 Thread Graham Cossey
--- Chris Shiflett [EMAIL PROTECTED] wrote: On each page, it might be good to add some debugging information near the top (where session_start() is): ?php session_start(); echo 'pre' . htmlentities(print_r($_COOKIE, true)) . '/pre'; echo 'pre' . htmlentities(print_r($_GET,

RE: [PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Graham Cossey
I would certainly agree with Marek. I recently changed a query from using 20 or so 'OR' conditions to use the 'IN' statement and it drastically improved the performance of the query. Graham -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: 25 October 2004 11:37

RE: [PHP] Substr

2004-10-25 Thread Graham Cossey
What about using explode()? $array = explode('_', 'pid_1_date_2004_10_25'); $pid = $array[1]; $yr = $array[3]; $mn = $array[4]; $dy = $array[5]; Graham -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: 25 October 2004 14:00 To: [EMAIL PROTECTED] Subject: [PHP] Substr

RE: [PHP] Php files with .html extension?

2004-10-25 Thread Graham Cossey
Do not forget that if you do this ALL files with the .html extension will be parsed by PHP whether they are PHP scripts or not which could be something you need to consider from a performance perspective. -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: 25 October

RE: [PHP] Question: Simpler loop

2004-10-22 Thread Graham Cossey
Slightly simpler: foreach(...) { $count = 0; if ($skill != '') $count++; if ($skys[$key] != '') $count++; if ($slus[$key] != '') $count++; if $count 3 echo 'Invalid'; else echo 'Valid'; } Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL

RE: [PHP] Question: Simpler loop

2004-10-22 Thread Graham Cossey
Yep, Mike's solution is simpler. It's getting late on Friday and the brain is starting to slow down. (That's my excuse anyway...) [snip] Is there a simpler way / shorter way to check conditions to do this ? So, the entry is valid only if all three are non-blank? In which case:

RE: [PHP] Redirect then error message to user

2004-10-22 Thread Graham Cossey
I think what Brent is suggesting is a single script that will handle the display and processing of all 5 form 'pages'. The code below is just to give an idea of how I think the 'flow' could go, don't go copying the code and expect anything (positive) to happen !! if(!$_POST['step'] ||

RE: [PHP] Validation problem with array.

2004-10-21 Thread Graham Cossey
See inline: [snip] Now the transcation script: $skills = $_SESSION['skills']; $skys = $_SESSION['skys']; $slus = $_SESSION['slus']; foreach($_SESSION['skills'] as $key = $skill) ^^^ ($skills as $key = $skill) { if ($skill != '') // Has this skill

RE: [PHP] Validation problem with array.

2004-10-21 Thread Graham Cossey
See inline: [snip] { if ($skill != '') // Has this skill been entered? I don't know if I care if it's been entered. My main concern would be to make sure that if a $skill was entered, then a matching $skys and $slus should be: skills[0]-baker skys[0]-7

RE: [PHP] Validation problem with array.

2004-10-21 Thread Graham Cossey
[snip] Right now I have this [right below]: If I want to check for skys and slus, I add another set of braces with if($sky != '' ... and below end if ($sky != '') foreach($skills as $key = $skill) { if ($skill != '' $skys[$key] != '' $slus[$key] != '') {

RE: [PHP] Strange Array Error

2004-10-21 Thread Graham Cossey
[snip] Hi, I have been trying for the past two hours to understand why I get an error with the following code: ?php $test_array[] = array(); $i = 0; while($i 7){ $test_array[$i] += $i; echo '$day_total[$i] = '.$day_total[$i].'br'; } ? Fatal error: Unsupported

RE: [PHP] Strange Array Error

2004-10-21 Thread Graham Cossey
Oh @#*! Thanks Greg, I always get that one wrong ! $test_array = array(); :) -Original Message- From: Graham Cossey [mailto:[EMAIL PROTECTED] Sent: 21 October 2004 14:48 To: Shaun; [EMAIL PROTECTED] Subject: RE: [PHP] Strange Array Error [snip] Hi, I have been trying

RE: [PHP] Question: Validation on select boxes and lists.

2004-10-21 Thread Graham Cossey
[snip] Hope this is not off topic, and it might be a dumb question, but I'm new. For drop down menus, list boxes, selects etc, would validation be needed to check the string , say for special characters ? (as a security precaution) I have read several posts/articles on this matter and

RE: [PHP] Question: Validation on select boxes and lists.

2004-10-21 Thread Graham Cossey
[snip] How would a hacker pass an HTTP message ? That is interesting. read the off-list posted message from [EMAIL PROTECTED] (reproduced below for the benefit of other list members) Graham -- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 21 October 2004 23:07 To: Graham

RE: [PHP] Validation problem with array.

2004-10-20 Thread Graham Cossey
Not sure I really know where you have the problem, but I am assuming you are trying to construct the INSERT statement within your foreach loop. If so, why use $_POST[skill[]] when you have $skill which is that current element being iterated? Did you read the foreach doc?

RE: [PHP] Validation problem with array.

2004-10-20 Thread Graham Cossey
['skills'] as $key = $skill) could read foreach($skills as $key = $skill) as you have the line: $skills = $_SESSION['skills']; Same for skys and slus. Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 20 October 2004 14:06 To: Graham Cossey; [EMAIL

RE: [PHP] Help: Suggestions for multi page form validation

2004-10-19 Thread Graham Cossey
got some great info. http://shiflett.org especially: http://shiflett.org/articles HTH Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 19 October 2004 10:26 To: Graham Cossey; [EMAIL PROTECTED] Subject: RE: [PHP] Help: Suggestions for multi page form

RE: [PHP] Nested foreach ?

2004-10-18 Thread Graham Cossey
How about this: // Doing this makes the code below easier to read $skills = $_SESSION['skills']; $skys = $_SESSION['skys']; $slus = $_SESSION['slus']; // Set up the fixed part of teh query $query = INSERT INTO table (skill, sky, sku) VALUES (; // Loop through each set of form elements

RE: [PHP] Nested foreach ?

2004-10-18 Thread Graham Cossey
to by several clients. HTH Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 18 October 2004 09:37 To: Graham Cossey; [EMAIL PROTECTED] Subject: RE: [PHP] Nested foreach ? Wish I had better news. Warning: Invalid argument supplied for foreach

RE: [PHP] Floating values

2004-10-18 Thread Graham Cossey
How about this? http://uk2.php.net/manual/en/function.number-format.php HTH Graham -Original Message- From: Nunners [mailto:[EMAIL PROTECTED] Sent: 18 October 2004 12:03 To: [EMAIL PROTECTED] Subject: [PHP] Floating values Simple question. I'm writing an accounting

RE: [PHP] dirty words

2004-10-18 Thread Graham Cossey
Skippy does have a point. If you still receive spam emails you'll know what he means. I must have seen 20 different ways of spelling viagra, using various accented characters etc: viagra, viagra, viiagra etc etc As for the legit words, there is the tale of Scunthorpe town council having ALL its

[PHP] RE: [PHP-DB] Question: Putting separate form elements into an array

2004-10-17 Thread Graham Cossey
PROTECTED] Sent: 17 October 2004 16:14 To: Stuart Felenstein; Graham Cossey; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Question: Putting separate form elements into an array Changed my direction somewhat but keep getting a parse error and although I know where it is , I can't seem to figure

RE: [PHP] problem with array

2004-10-15 Thread Graham Cossey
Hi guys, Recently, I had to reformat one of the web servers and now I have encountered an unusual problem. I am not sure whether this is an issue which can be fixed in the .ini file or whether its specific to the version of php I am using. Here is the problem: $query=SELECT * FROM

[PHP] PHP websites (www/uk/us2)

2004-10-15 Thread Graham Cossey
I was wondering what the difference is between the various PHP sites linked to in this list, are they mirrors and what determines which site you get directed to when doing a search from www.php.net? http://www.php.net http://uk.php.net http://us2.php.net and presumably others... Thanks

[PHP] Help with sessions problem please

2004-10-14 Thread Graham Cossey
I'm having a bad day with sessions which hopefully someone can help me with. A user logs in to my 'site' (script1.php) and I store relevant details in a session, all fine. I redirect to another page (script2.php) which checks and retrieves certain session values, all fine. My problem is with

RE: [PHP] Help with sessions problem please [SOLVED]

2004-10-14 Thread Graham Cossey
Thanks guys for the help, adding SID to my iframe src solved my immediate problem. Am I correct in thinking then that the SID is automatically passed on relative URLs only within the same browser/[i]frame/window when use_trans_sid is enabled? Graham -Original Message- From: Chris

RE: [PHP] User Defined Forms

2004-10-14 Thread Graham Cossey
I think the problem here will be in the database design. You certainly could store PDFs or the like, but then someone is going to want to run queries, produce reports, make updates etc etc. The problem (I think) is to come up with a db design that is not fixed to a given form structure. Using

RE: [PHP] Query Returning Error

2004-10-13 Thread Graham Cossey
Besides adding $ to Query01, I have had little luck in the past when using $_POST or $_GET directly in an evaluated string. If you are still having problems, try something like: ?php $user = $_POST['TXT_UserID']; $pwd = $_POST['TXT_UserPassword']; // Authenticate User: $Query01 = SELECT *

RE: [PHP] Query Returning Error

2004-10-13 Thread Graham Cossey
it will be interpreted as an undefined constant, and thus replaced with the string, however the behaviour inside a quoted string is even less correct, and will almost certainly not do what you expect. Hope this helps Cheers Chris Graham Cossey wrote: Besides adding $ to Query01, I have had little

RE: [PHP] Exporting HTML to Excel

2004-10-12 Thread Graham Cossey
Philip, have you checked the php freaks website? I do recall seeing a script in their tutorials library that claimed to create Excel files. http://www.phpfreaks.com Just had a search and came up with: ? header(Content-Type: application/vnd.ms-excel); echo

RE: [PHP] PHP gurus...how are they doing this?

2004-10-11 Thread Graham Cossey
[snip] This is how far I have come trying to imitate the above: (Its not working of course :-) ) ?php $url=fsockopen('http://www.jumac.com/'); $html = implode('', file($url)); //put the page source in a string //find the links and put them in an array $links = array(); if

RE: [PHP] code not working...help?

2004-10-08 Thread Graham Cossey
[snip][snip] Secondly I find it easier (to read) to code my SQL statements thus: $countResult = db_query(SELECT count(*) AS msgCount FROM messages WHERE uid='$userID' AND fid='$fid' AND post_date='$lastmonth'); [snip] /quote --- I

RE: [PHP] Sessions not destroyed

2004-10-08 Thread Graham Cossey
[snip] If you are right, then this is a severe design bug. Depends on your point of view. It is a sideeffect of loading current session (and thus accessing it) before the session gc is called. So the question is, should the session module give up on current session just because it should

RE: [PHP] code not working...help?

2004-10-07 Thread Graham Cossey
[snip] $lastmonth = date(YmdHis, mktime(date(H), date(i), date(s), date(m)-1, date(d), date(Y))); $countResult = db_query(SELECT count(*) AS msgCount FROM messages WHERE uid = '. $userID .' AND fid = '. $fid .' AND post_date = '. $lastmonth .'); $countRow = db_fetch_array($countResult);

RE: [PHP] Re: set multiple variables

2004-10-03 Thread Graham Cossey
||= OR = AND -Original Message- From: argesson [mailto:[EMAIL PROTECTED] Sent: 03 October 2004 11:30 To: [EMAIL PROTECTED] Subject: [PHP] Re: set multiple variables Daniel Schierbeck wrote: Argesson wrote: try this: if ($REMOTE_ADDR == 212.3.54.65 $REMOTE_ADDR == 212.3.54.66)

RE: [PHP] Including function libraries

2004-10-02 Thread Graham Cossey
Do you have ?php and ? in functions.lib ? -Original Message- From: Andrew W [mailto:[EMAIL PROTECTED] Sent: 02 October 2004 16:52 To: php-gen Subject: [PHP] Including function libraries Ok, I've got a file called functions.lib which contains the following: function checkLoggedIn() {

RE: [PHP] How to load another php page?

2004-10-02 Thread Graham Cossey
For my own clarification, would it not be possible to use output buffering and then either redirect to another script using header() or output the buffer contents? ?php ob_start(); [php code] if ($variable = 1) header(Location: script1.php); if ($variable = 2) header(Location:

RE: [PHP] Zend Optimizer not installed

2004-10-01 Thread Graham Cossey
Hi Ox I'm UK based but currently use GlobalServers in the US (www.globalservers.com). They run Virtual Private Servers of 3 levels, 2 of which allow root access. They do claim to run Zend Optimizer but as yet I have not determined if this is active on my account. HTH Graham. -Original

RE: [PHP] How do I produce a random database query for each day or week?

2004-10-01 Thread Graham Cossey
A couple of thoughts: As you want to cycle through the list rather than randomly (with repetition) picking from the list, have you considered storing the last CD shown details in the DB? If each CD has a sequential ID then each week (or day) you increment the number which will determine what CD

RE: [PHP] Replace or regex?

2004-09-30 Thread Graham Cossey
If you can change the ##text## to say /#text#/ it would be easier as you could then do something like: $id = substr($orig_text,strpos($orig_text, '/#')+2,strpos($orig_text, '#/')-1); $new_text = str_replace( '/#', 'href=somewhere.php?id='.$id.'', $orig_text); $new_text = str_replace( '#/', '/a',

RE: [PHP] UNSUBSCRIBE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2004-09-30 Thread Graham Cossey
Great, I needed some humour today, thanks all :) Graham -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: 30 September 2004 16:26 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP]

RE: [PHP] Zend PHP Certification test

2004-09-30 Thread Graham Cossey
snip I passed. snip Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ Congratulations Greg. Like the new sig ! ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Two people working on the same app / script?

2004-09-30 Thread Graham Cossey
Please correct me if I'm wrong, but I didn't think SourceSafe allowed for versioning/branching, simply 'locking' a file until it was checked in, but I haven't used it for a while. This is actually the basic functionality I'm looking for, and possibly what the OP requires too, I don't (currently)

RE: [PHP] Zend PHP Certification test

2004-09-30 Thread Graham Cossey
This is very interesting reading. I've been using PHP (almost) daily for the past 7 months so Chris' comments do encourage me to consider the possibility of going for the certification in time. I do think I would need the study guide though as there are many topics being discussed on this list

RE: [PHP] list of Months

2004-09-30 Thread Graham Cossey
What you have is basically what I do, but the current month check could be tidied up and display the month name seeing as you have the array: $selected_QuoteMonth = (date('m')==$i)?'SELECTED':''; echo option value=$i $selected_QuoteMonth $month_names[$i] /option; ** CODE IS UNTESTED ** I'm

RE: [PHP] Re: grabbing information from websites

2004-09-29 Thread Graham Cossey
/runescape/hiscorepersonal.cgi?username=ch ampinoman,r); $line = fread ($file, 1024); if (preg_match('#username=champinomancategory=13.*align=right(.*)/td#mi', $line,$out)) { $rune = $out; } fclose($file); print $rune; ? Graham Cossey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] fgets

RE: [PHP] Multiple pages of data.

2004-09-29 Thread Graham Cossey
Prev 1 2 3 Next tutorial at phpfreaks.com: http://www.phpfreaks.com/tutorials/73/0.php HTH Graham. -Original Message- From: Silvio Porcellana [mailto:[EMAIL PROTECTED] Sent: 29 September 2004 10:53 To: [EMAIL PROTECTED] Subject: Re: [PHP] Multiple pages of data. You can solve it

RE: [PHP] PHP Data cache ideas/solutions

2004-09-29 Thread Graham Cossey
A bit rough and ready but I think this is kind of what you asked for: ** THIS IS UNTESTED CODE ** ?php $user_array = array(); $form_input = $_GET['namesearch']; $sql = SELECT id, name FROM user WHERE name LIKE '%$form_input%' ORDER BY id; $result = mysql_query($sql) or die (Query failed: .

RE: [PHP] Re: grabbing information from websites

2004-09-28 Thread Graham Cossey
From http://gnosis.cx/publish/programming/regular_expressions.html: Sometimes you have a programming problem and it seems like the best solution is to use regular expressions; now you have two problems. To me regular expressions are some kind of black art, I've been programming for 20 years and

RE: [PHP] Re: grabbing information from websites

2004-09-28 Thread Graham Cossey
ment to put the 'm' modifier? or am i still off on the wrong track? Graham Cossey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From http://gnosis.cx/publish/programming/regular_expressions.html: Sometimes you have a programming problem and it seems like the best solution

  1   2   >