[PHP] Multiple posts?

2004-09-23 Thread Graham Cossey
Is it me or are posts being sent multiple times? I have just received the topic "[PHP] Newbie array problem" for the second time. The first was @ 11:17 the second @ 13:35. I have had a few others come through twice as well. Thanks Graham -- PHP General Mailing List (http://www.php.net/) To un

RE: [PHP] Multiple posts?

2004-09-23 Thread Graham Cossey
-Original Message- [snip] Is it me or are posts being sent multiple times? I have just received the topic "[PHP] Newbie array problem" for the second time. The first was @ 11:17 the second @ 13:35. I have had a few others come through twice as well. [/snip] Sometimes there is a delay on

RE: [PHP] Using '

2004-09-23 Thread Graham Cossey
> Hi! > i have: > $html = ' > >MY HTML > > '; > Inside of my html i used ', this produced a parse error, how can i solved > it?. Try: $html = " ... ... "; However my personal preference is the other way around: $html = ' ... ... '; HTH Graham

[PHP] PDF from PHP generated HTML, possible?

2004-09-23 Thread Graham Cossey
Following the topic about generating PDF documents from within PHP has prompted a thought... Is it possible to have PHP dynamically build an HTML page (from database data etc) and provide an option to output the page as PDF without going through all the database query routine again? In other wor

RE: [PHP] PDF from PHP generated HTML, possible?

2004-09-23 Thread Graham Cossey
> > Following the topic about generating PDF documents from within PHP has > > prompted a thought... > > > > Is it possible to have PHP dynamically build an HTML page (from database > > data etc) and provide an option to output the page as PDF without going > > through all the database query routin

RE: [PHP] Re: PDF from PHP generated HTML, possible?

2004-09-23 Thread Graham Cossey
o allow you to see their source code. HTH, Mikey - Original Message ----- From: "Graham Cossey" <[EMAIL PROTECTED]> Newsgroups: php.general To: "Php-General" <[EMAIL PROTECTED]> Sent: Thursday, September 23, 2004 3:44 PM Subject: PDF from PHP generated HTML,

RE: [PHP] Re: PDF from PHP generated HTML, possible?

2004-09-23 Thread Graham Cossey
to:[EMAIL PROTECTED] Sent: 23 September 2004 17:17 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: PDF from PHP generated HTML, possible? On Thu, 23 Sep 2004 16:25:27 +0100, Graham Cossey <[EMAIL PROTECTED]> wrote: > That's fine for static pages, my question was regarding dynamic page

RE: [PHP] Re: PDF from PHP generated HTML, possible?

2004-09-24 Thread Graham Cossey
ent: 23 September 2004 23:36 To: Php-General Subject: Re: [PHP] Re: PDF from PHP generated HTML, possible? On Thu, 23 Sep 2004 22:39:06 +0100, Graham Cossey <[EMAIL PROTECTED]> wrote: > > Brad: When you say "a hash of the query string" do you mean passing the > variable part of

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 :-) ) > > $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 (pre

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: Cell 1 Cell 2 "; ?> HTH Graham > -Original Message- > From: Philip Thompson [mailt

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: HTH Graham > -Original Message- > From: Harlequin [mailto:[EMAIL PROTECTED] > Sent: 13 October 2004 08:32 >

RE: [PHP] Query Returning Error

2004-10-13 Thread Graham Cossey
ysql_error()); > > ?> > > Note also that you didn't quote the index you were using inside the > $_POST array. This is wrong - it will work in "raw" PHP because it will > be interpreted as an undefined constant, and thus replaced with the > string, howev

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

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 Shi

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 the

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

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

RE: [PHP] Images in PHP and MySQL

2004-09-27 Thread Graham Cossey
I'm no certified expert, but preference would be storing a URL to an image in the database rather than the image itself. If however you do want to store them in the db try using a blob column type. This article is PHP3 but shows the basics: http://www.phpbuilder.com/columns/florian19991014.php3

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 an

RE: [PHP] Re: grabbing information from websites

2004-09-28 Thread Graham Cossey
ght I clearly stated that for the m modifier you need to use PCRE >> functions! >> >> eg: >> >> preg_match('/username=champinoman&category=13.*align="right">(.*)/mi', >> $text, $out); >> >> Champinoman wrote: >> >>

[PHP] Changing mta in /etc/alternatives : how?

2004-09-28 Thread Graham Cossey
Sorry for the probably basic question, but I would like to change the default mta on my FC2 box from sendmail to exim. I believe to do this I need to change the 'entry' in /etc/alternatives/ to point to /usr/sbin/sendmail.exim instead of /usr/sbin/sendmail.sendmail. Doing a 'ls -al' on /etc/alter

[PHP] RE: [IGNORE] [PHP] Changing mta in /etc/alternatives : how?

2004-09-28 Thread Graham Cossey
Sorry, mailed to the wrong list :( -Original Message- From: Graham Cossey [mailto:[EMAIL PROTECTED] Sent: 28 September 2004 23:27 To: Php-General Subject: [PHP] Changing mta in /etc/alternatives : how? Sorry for the probably basic question, but I would like to change the default mta

RE: [PHP] Re: grabbing information from websites

2004-09-29 Thread Graham Cossey
om/aff/runescape/hiscorepersonal.cgi?username=ch ampinoman","r"); $line = fread ($file, 1024); if (preg_match('#username=champinoman&category=13.*align="right">(.*)#mi', $line,$out)) { $rune = $out; } fclose($file); print $rune; ?> "Graham Cossey&

RE: [PHP] Multiple pages of data.

2004-09-29 Thread Graham Cossey
<> 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 totally with SQL,

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 ** $name2) { echo "$id2 $name2 "; } ...some code... // Determine a valid value for $x and then: $name3 = $user_array[$x]; ?> HTH Graham -Original Message- From: Niklas Ojala [mailto:[E

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( '#/', '',

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

RE: [PHP] Zend PHP Certification test

2004-09-30 Thread Graham Cossey
> > > I passed. > > > > 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) n

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 tha

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 " $month_names[$i] "; ** CODE IS UNTESTED ** I'm sure if there is a better way then someone h

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 Mess

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 i

RE: [PHP] Including function libraries

2004-10-02 Thread Graham Cossey
Do you have 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() { retur

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? thanks Graham -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: 02 October 2004 21:07 To: Arnold Cc

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

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 =

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] > > > I find queries even easier to read when they are writte

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

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 foreach(

RE: [PHP] Nested foreach ?

2004-10-18 Thread Graham Cossey
e from zero PHP knowledge 10 months ago to being able to develop and maintain an entire PHP/MySQL based web application subscribed to by several clients. HTH Graham > -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: 18 October 2004 09:37 > To:

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 ac

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 e

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

2004-10-17 Thread Graham Cossey
ein [mailto:[EMAIL 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 althoug

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

2004-10-19 Thread Graham Cossey
Personally I would do as you suggest in 1. I would think your users would get rather annoyed if they had gone through several form pages to be told at the end of an error in form page1. So, page2 validates page1 etc. I would assume that page2 already does some processing of page1 anyway, as I beli

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

2004-10-19 Thread Graham Cossey
hiflett's site, it's 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] > Subjec

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? http://uk2.php.net/manua

RE: [PHP] Validation problem with array.

2004-10-20 Thread Graham Cossey
rt Felenstein [mailto:[EMAIL PROTECTED] > Sent: 20 October 2004 14:06 > To: Graham Cossey; [EMAIL PROTECTED] > Subject: RE: [PHP] Validation problem with array. > > > My problem is not related to the insert or iteration. > It's related to the validaton of those elements: >

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

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[

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: > > $test_array[] = array(); > $i = 0; > while($i < 7){ > $test_array[$i] += $i; > echo '$day_total[$i] = '.$day_total[$i].''; > } > ?> > > Fatal error: Unsuppor

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

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 al

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 T

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

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 ca

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'] || $_POST['ste

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 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 unsubscribe, visit:

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 normal

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 ab

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] 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] 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 . ""; as: $kml_string .= ""; ;-) 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 > resulti

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

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 encl

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 >

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 <

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

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

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 s

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

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 ha

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:

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

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 Octob

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): > > > > > session_start(); > > echo '' . htmlentities(print_r($_COOKIE, true)) > > . ''; > > echo '' . htmlentities(print_r($_GET

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 var

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

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 L

RE: [PHP] Session and validation

2004-10-30 Thread Graham Cossey
[snip] > > Here is the example: > > testarray (page1) > //Start the session > > //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 selections > if (cou

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 bac

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

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

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

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 t

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 dire

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 f

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

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 try

RE: [PHP] Re: Help: Database Search

2004-11-12 Thread Graham Cossey
I think you're implode example is pretty close. 1) { $IndStr = implode("','", $Ind); $where[] = "vendorjobs.Industry IN($IndStr)"; }else{ $where[] = "vendorjobs.Industry = {$Ind[0]}"; }else{ // Is there an error if not an array? } $sql = 'SELECT ... FROM vendorjobs W

RE: [PHP] Re: Help: Database Search

2004-11-12 Thread Graham Cossey
tends to run faster 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 > > > &

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 the

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

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 PROTEC

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

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

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_sta

  1   2   >