[PHP] Nested foreach statement

2006-07-31 Thread Chris Grigor
Have been wondering if this is possible Basically I have 3 posted arrays, $_POST['reporton_company'] (this can be various company id's. ie 3,6,7) $_POST['report_period'] (this can be various periods but a max of 4 submitted. ie 3,4,5) $_POST['questions_groups'] (this can be various - starting

[PHP] Checking $_POST var and stripping

2006-07-24 Thread Chris Grigor
Hi Can anyone help with this ? its checking the $_POST and seeing if any of the items begin with answer_, if the do it should remove it from the beginning and place it into $value_new.. does not seem to work though... foreach($_POST as $qid => $value) { $findme = 'answer_'; if(stripos($va

[PHP] Help with dynamic radio buttons

2006-07-22 Thread Chris Grigor
Afternoon all I need some help here with a problem on dynamic radio buttons. I have a script that calls a database for a list of questions. The questions are returned and each question needs to have 5 radio buttons assigned to it. The radio buttons are a score of 1 - 5 (1 being bad, 5 being good)

[PHP] Difference between 2 time entries

2006-07-20 Thread Chris Grigor
Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between

[PHP] Difference between 2 time entries

2006-07-20 Thread Chris Grigor
Morning all, I am looking to get the differnce in hours / minutes between 2 values. Currently I have 2 time entries being retruned from mysql, one which is a start time and the other which is a finish time. So $start = '13:12:17'; $finish = '23:12:17'; How would one get the differnce between

[PHP] Views on e-commerce download tracking

2006-05-15 Thread Chris Grigor
Hey all Was just wondering what others have used on there e-commerce sites to manage digital downloads, for instance how to track if a user succesfully downloaded a complete file from you (what happens if there connection drops halfway through a download) Is there something in php / java

[PHP] Is there an easier way of doing this?

2006-05-10 Thread Chris Grigor
morning all, Is there an easier way of doing the following?? form1 submitting to form1.php failed:" . mysql_error()); mysql_select_db('yourdbname', $link) or die ("selection failed: " . mysql_error()); if(isset($_POST[1])) { mysql_query("INSERT INTO menu (label) VALUES ('item 1 selecte

Re: [PHP] Pushing Vars into $_SESSION

2006-04-20 Thread Chris Grigor
Richard Lynch wrote: On Wed, April 19, 2006 1:36 am, Chris Grigor wrote: Richard Lynch wrote: On Tue, April 18, 2006 10:05 am, Chris Grigor wrote: Was wondering if there is an easier way to get returned variables into the $_SESSION rather than going through each one

[PHP] Pushing Vars into $_SESSION

2006-04-18 Thread Chris Grigor
Afternoon Was wondering if there is an easier way to get returned variables into the $_SESSION rather than going through each one?? eg $link_id = mysql_connect($dbhost, $dbuser, $dbpass) or die("Connection to $dbhost failed on verification section"); mysql_select_db($logindb

[PHP] Files

2005-06-28 Thread Chris Grigor
Hey all, I am having a bash at working with flat files. What I am trying to achieve is the following There are 2 files with info in them, file1 has id,email and file2 has id,filename what I am trying to achieve is open up file1 get the id and email then open file2 and match the id of file1 t

[PHP] str_pad

2003-09-26 Thread Chris Grigor
This should be quite an easy task for some... say for example $line->dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line->dbranch_no, 6); so the value of $dbranch should look like "3 " Is there anyway to right justify the 3 using

[PHP] fopen

2003-09-25 Thread Chris Grigor
Hi I am writing to a file different sources. The one writes the date and the next starts writing data. The date writes fine. $header = "0$gpsdate"; echo $out_file; $fp = fopen($out_file, "a"); $write = (fwrite($fp, "$header\n")); fclose($fp); Now I get to another batch process that in

[PHP] Fw: Am stuck

2003-09-25 Thread Chris Grigor
Sorry maybe I should elaborate Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = "Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has t

[PHP] Am stuck

2003-09-25 Thread Chris Grigor
Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = "Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has to be 40 charecters long before it g

[PHP] Genrate a graph

2002-11-12 Thread Chris Grigor
Howdi All Anyone know if there is a function in php that can take values and generate a graph ??? Thanks in advance C -- Chris Grigor -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

[PHP] printing an array

2002-10-24 Thread Chris Grigor
Regards Chris ------ Chris Grigor -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] for loop and array

2002-09-24 Thread Chris Grigor
Good Morning all I need some help as to how to print this array, its input name is labtype and they all have differnet values. Amylase Cholesterol CMV Ab IgM/G GLUCOSE - Fasting GLUCOSE - Random Hepatitus B S Ag On the page I created if the person selects any of these then it should submit it a

[PHP] time

2002-05-27 Thread Chris Grigor
howdi all anyone know how to get a simple time print ? all the functions I have looked at gmtime() time() dont give the right thing ... all I want is a simple time print e.g 17:51 I know that there is an easy way, Im just missing it somewhere ... Chris -- PHP General Mailing List (http://www

[PHP] output problem

2002-05-23 Thread Chris Grigor
Howdi Alll some of you might laugh at this but I cant get this to work Im doing a count on a field and want to diplay the result here is an example... "); print (" $line->user\n"); print (""); } ?> what am I missing as it returns no value at all from $line->user, should I be doing thi

RE: [PHP] ping

2002-03-27 Thread Chris Grigor
6:04 PM To: Chris Grigor; Php-General-List (E-mail) Subject: RE: [PHP] ping Hi CHris! > has anyone written a script to check if a host is alive - > like a ping script ? Something like this? BTW, any hints to weak or wrong code are welcome, I'm not this experienced with PHP ;

[PHP] ping

2002-03-27 Thread Chris Grigor
Hey all has anyone written a script to check if a host is alive - like a ping script ? Chris Grigor 2nd Line Support Tel : +27 11 340 7390 Fax : +27 11 340 7345 E-Mail : [EMAIL PROTECTED

RE: [PHP] Mysql Connection

2002-01-28 Thread Chris Grigor
Hey Uma call to undefined function, well thats exactly what it means (it doesnt like the function specified eg mysql_connect)this means that your php installation does not have support for mysql. You can check this with the following run this via a browser and check the config of php... it

RE: [PHP] weird fopen problem

2002-01-10 Thread Chris Grigor
I copied you script and ran it no probelm. are you sure that apache is running as nobody? run ps -aux | grep httpd mine is like this apache6320 0.0 5.8 49120 7248 ?S10:54 0:00 /usr/sbin/httpd - but yours might say nobody6320 0.0 5.8 49120 7248 ?S10:5

RE: [PHP] foreach statement

2002-01-09 Thread Chris Grigor
ith $this_is_one_address }; I suggest that you use the for-loop if $emails array is big. Takes less memory. Niklas -Original Message- From: Chris Grigor [mailto:[EMAIL PROTECTED]] Sent: 9. tammikuuta 2002 9:44 To: '[EMAIL PROTECTED]'; Php-General Subject: RE: [PHP] foreach sta

RE: [PHP] foreach statement

2002-01-08 Thread Chris Grigor
would say foreach($recipient) { send mail } anyone that could maybe guide me? Thanks in advance C-Ya Chris Grigor -- Client Services Call Center: 0860 100 154 Fax: +27 11 340 7345 E-Mail: [EMAIL

[PHP] foreach statement

2002-01-08 Thread Chris Grigor
($recipient) { send mail } anyone that could maybe guide me? Thanks in advance C-Ya Chris Grigor -- Client Services Call Center: 0860 100 154 Fax: +27 11 340 7345 E-Mail: [EMAIL PROTECTED

[PHP] really weird

2002-01-08 Thread Chris Grigor
runs every 10 mins and just keeps notifying me over & over. Any Help would be cool ...please !!! C-Ya Chris Chris Grigor -- Client Services Cal