Re: [PHP] Persistent data between two executions

2009-06-16 Thread James Colannino
Martin Scotta wrote: > You can use $_SESSION to store the object, and serialize to convert to > string and reverse I like that idea. I think I may end up going that route. I have one question. This is VERY hypothetical, and mostly just to satisfy a curiosity, but let's assume that you write an

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread Ashley Sheridan
On Tue, 2009-06-16 at 20:46 -0400, PJ wrote: > Ashley Sheridan wrote: > > On Tue, 2009-06-16 at 18:19 -0400, PJ wrote: > > > >> Ashley Sheridan wrote: > >> > >>> On Tue, 2009-06-16 at 15:48 -0400, PJ wrote: > >>> > >>> > jenai tomaka wrote: > > > >

Re: [PHP] Persistent data between two executions

2009-06-16 Thread Martin Scotta
You can use $_SESSION to store the object, and serialize to convert to string and reverse http://ar2.php.net/manual/en/language.oop.serialization.php // file one.php require 'user.php'; $user = new User(); $_SESSION[ 'user' ] = serialize( $user ); // file two.php require 'user.php'; // the cla

RE: [PHP] Re: sloppiness & stupidity

2009-06-16 Thread HallMarc Websites
> -Original Message- > From: Shawn McKenzie [mailto:nos...@mckenzies.net] > Sent: Tuesday, June 16, 2009 9:11 PM > To: php-general@lists.php.net > Subject: [PHP] Re: sloppiness & stupidity > > PJ wrote: > > I'm sorry, guys, but I am really getting po'd. > > The irresponsible sloppiness a

[PHP] Persistent data between two executions

2009-06-16 Thread James Colannino
Hey everyone, Long time reader, not such a long time poster :-P (though I have posted to the list occasionally in the past...) Anyway, I have a general question for the list. Basically, I need to maintain persistent objects between page refreshes. So, for example, if while running a PHP script

[PHP] Re: sloppiness & stupidity

2009-06-16 Thread Shawn McKenzie
PJ wrote: > I'm sorry, guys, but I am really getting po'd. > The irresponsible sloppiness and stupidity is just getting to me. > In my quest for a way to populate a multiple option select box I have > run across so many errors that it's beyond belief... such nonsense as > "select for select or sele

RE: [PHP] sloppiness & stupidity

2009-06-16 Thread Asher Snyder
While ranting might be good for the psyche there are trained psychiatric professionals that will readily listen to your rants. The PHP mailing list is not the place to vent. In every large community there will be those with less experience than others, and yes, many inexperienced programmers tha

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread PJ
Ashley Sheridan wrote: > On Tue, 2009-06-16 at 18:19 -0400, PJ wrote: > >> Ashley Sheridan wrote: >> >>> On Tue, 2009-06-16 at 15:48 -0400, PJ wrote: >>> >>> jenai tomaka wrote: > You can try like this, > > $row = stored data; > >

[PHP] sloppiness & stupidity

2009-06-16 Thread PJ
I'm sorry, guys, but I am really getting po'd. The irresponsible sloppiness and stupidity is just getting to me. In my quest for a way to populate a multiple option select box I have run across so many errors that it's beyond belief... such nonsense as "select for select or select="select" ( think

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread PJ
Ashley Sheridan wrote: > On Tue, 2009-06-16 at 18:19 -0400, PJ wrote: > >> Ashley Sheridan wrote: >> >>> On Tue, 2009-06-16 at 15:48 -0400, PJ wrote: >>> >>> jenai tomaka wrote: > You can try like this, > > $row = stored data; > >

[PHP] Re: Issues with APC, cache corruption?

2009-06-16 Thread James McLean
On Mon, Jun 15, 2009 at 9:42 AM, James McLean wrote: > Hi All, > > Over the weekend I setup a test of APC intending to benchmark a Moodle > installation with various APC settings to see how well I could get it > to perform. I successfully installed Moodle 1.9 and 2.0 under Apache > 2.2.3 (installed

Re: [PHP] PHP5 SOAP...

2009-06-16 Thread Tom Rogers
Hi, Wednesday, June 17, 2009, 1:21:47 AM, you wrote: RJ> I'm working on a project using SOAP and WS-Security in which I am failing RJ> miserably. RJ> Is there a way to inspect the actual XML, header, etc. that is actually RJ> being sent. I feel like I am constructing the call correctly, and I kno

Re: [PHP] Problems with apc extension on wamp server.

2009-06-16 Thread Jonathan Tapicer
Hi, Does the extension appear on a phpinfo()? Seems like the extension isn't loaded. Jonathan On Tue, Jun 16, 2009 at 5:20 PM, Valentinas Bakaitis wrote: > Hello! > > I am trying to track file upload progress using APC extension. > However, when trying to use, it gives > > Fatal error: Call to

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread Ashley Sheridan
On Tue, 2009-06-16 at 18:19 -0400, PJ wrote: > Ashley Sheridan wrote: > > On Tue, 2009-06-16 at 15:48 -0400, PJ wrote: > > > >> jenai tomaka wrote: > >> > >>> You can try like this, > >>> > >>> $row = stored data; > >>> > >>> and write the options like this > >>> > >>> > >>> > >>> Yu

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread PJ
Ashley Sheridan wrote: > On Tue, 2009-06-16 at 15:48 -0400, PJ wrote: > >> jenai tomaka wrote: >> >>> You can try like this, >>> >>> $row = stored data; >>> >>> and write the options like this >>> >>> >>> >>> Yuri Yarlei. >>> >>>

[PHP] Re: Form Process Question

2009-06-16 Thread Gary
Thanks to everyone for your help (again). I used the js script the Shawn had provided... (I was ascared of the one Daniel provided.:) Thanks again for all your help. Gary ""Gary"" wrote in message news:f3.0c.31180.f54b7...@pb1.pair.com... >I have a client that I have made some forms fo

Re: [PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Brian Dunning
Good idea, thanks. :-) On Jun 16, 2009, at 12:30 PM, Shawn McKenzie wrote: Use livehttpheaders or some other header capture utility and see what the difference in the headers are between the dl from the PHP page and direct download. -- PHP General Mailing List (http://www.php.net/) To uns

[PHP] Problems with apc extension on wamp server.

2009-06-16 Thread Valentinas Bakaitis
Hello! I am trying to track file upload progress using APC extension. However, when trying to use, it gives Fatal error: Call to undefined function apc_fetch() in C:\wamp\www\old\getprogress.php on line 3 I am using WAMP 2.0, with php 5.2.8 APC extension appear on extensions list and is enabled.

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread Ashley Sheridan
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote: > jenai tomaka wrote: > > You can try like this, > > > > $row = stored data; > > > > and write the options like this > > > > > > > > Yuri Yarlei. > > > >

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread PJ
jenai tomaka wrote: > You can try like this, > > $row = stored data; > > and write the options like this > > > > Yuri Yarlei. > > Yuri, I'm still "wet behind the ears" on this so I don

Re: [PHP] about locale settings

2009-06-16 Thread Daniel Brown
On Tue, Jun 16, 2009 at 15:33, Per Jessen wrote: > > Environment > > Variable => Value > LC_ALL => de_DE.utf8 > > Is that what you were after? Sure is. Unfortunately, that means it's not an environment-import issue as I had originally suspected. I'll take a look on one of my servers and see

Re: [PHP] about locale settings

2009-06-16 Thread Per Jessen
Daniel Brown wrote: > On Tue, Jun 16, 2009 at 12:51, Per Jessen wrote: >> >> Am I the only one to run into these oddball problems?  Doesn't anyone >> else use different locales?  I think the above is a bug - php >> _should_ respect the LC_ALL setting without being specifically poked. > > Per;

Re: [PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Shawn McKenzie
Brian Dunning wrote: > Don't think so, only when I download via the PHP code I posted: > > On Jun 16, 2009, at 10:40 AM, Brian Dunning wrote: > >> If you do a direct download, it mounts on the desktop perfectly, and >> there's all the stuff inside. > > > Use livehttpheaders or some other hea

Re: [PHP] Form Process Question

2009-06-16 Thread Shawn McKenzie
Daniel Brown wrote: > On Tue, Jun 16, 2009 at 12:34, Gary wrote: >> I was thinking/hoping there was some mechanism that would calculate the >> amount without hitting the submit button, something like a OnExit command. >> Something that I would not have to work around the validation feilds being >>

Re: [PHP] about locale settings

2009-06-16 Thread Daniel Brown
On Tue, Jun 16, 2009 at 12:51, Per Jessen wrote: > > Am I the only one to run into these oddball problems?  Doesn't anyone > else use different locales?  I think the above is a bug - php _should_ > respect the LC_ALL setting without being specifically poked. Per; Sorry, I meant to get bac

RE: [PHP] populate form input option dropdown box from existingdata

2009-06-16 Thread Dajve Green
Ack, yes - my bad. Missed the select name square brackets when I sent my example. And yeah, the only real difference between a multiple select and checkbox is which works best with the UI (and, more often than not, how confused the concept of multiple selects makes your end-user) -- for (thought

Re: [PHP] Form Process Question

2009-06-16 Thread Daniel Brown
On Tue, Jun 16, 2009 at 12:34, Gary wrote: > > I was thinking/hoping there was some mechanism that would calculate the > amount without hitting the submit button, something like a OnExit command. > Something that I would not have to work around the validation feilds being > lost and without having

Re: [PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Brian Dunning
Don't think so, only when I download via the PHP code I posted: On Jun 16, 2009, at 10:40 AM, Brian Dunning wrote: If you do a direct download, it mounts on the desktop perfectly, and there's all the stuff inside. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

[PHP] Re: Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread tedd
At 1:05 PM -0500 6/16/09, Shawn McKenzie wrote: > WTF? Sounds like a Mac / Safari "feature". Yeah, like the most recent Safari update that shows the contents of Safari as an open folder on my desktop. I have to put the folder away each time, but when I restart it's always there. I

Re: [PHP] Form Process Question

2009-06-16 Thread tedd
At 11:03 AM -0400 6/16/09, Gary wrote: I have a client that I have made some forms for. On one of the forms, their customers are to registar for a class. The cost of the class is 195 per person. She would like to have the people be able to have the total cost calculated for them before they su

Re: [PHP] populate form input option dropdown box from existingdata

2009-06-16 Thread tedd
At 10:42 AM -0500 6/16/09, Shawn McKenzie wrote: He has a multiple select, so the select has to be an array or you just get one value even if more than one was selected (you just get the last one). Okay, it's not that much different than using check-boxes -- here's the solution for that: htt

[PHP] Re: Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Shawn McKenzie
Brian Dunning wrote: > So I've added a product to my online store that's in .DMG format. Most > of the other files are ZIP or PDF. When someone completes a purchase, it > downloads the file to them, and this works great: > > header('Content-Type: application/octet-stream'); > header('Content-Dispo

[PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Brian Dunning
So I've added a product to my online store that's in .DMG format. Most of the other files are ZIP or PDF. When someone completes a purchase, it downloads the file to them, and this works great: header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename

Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Shawn McKenzie
Shawn McKenzie wrote: > Daniel Kolbo wrote: >> Hello, >> >> I've cleaned up my question a bit. >> >> I want the included file which is called within a method of a class to >> have the same scope as the instantiation of the class's object. That >> is, i want a class to include a file in the calling

Re: [PHP] Form Process Question

2009-06-16 Thread Shawn McKenzie
Gary wrote: > My my, someone woke up on the wrong side of the bracket > > Acutally, the silliness of the request has not been lost on me or the > client. And no, it is a simple 195 times number of people, which is usually > under 5, so, I understand your recent scratching of the head... >

Re: [PHP] about locale settings

2009-06-16 Thread Per Jessen
Per Jessen wrote: > When I've set LC_ALL before calling php, why do I need to call > setlocale() in the script too: > > LC_ALL=de_DE.utf8 php -r "print strftime('%B');" > June > > LC_ALL=de_DE.utf8 php -r "setlocale(LC_ALL,''); print strftime('%B');" > Juni > > What am I missing here? I have n

RE: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread Dajve Green
A *multiple* select control, as in Phil's initial request will return an array, however. > -Original Message- > From: tedd [mailto:tedd.sperl...@gmail.com] > Sent: 16 June 2009 15:58 > To: PJ; php-general@lists.php.net > Subject: Re: [PHP] populate form input option dropdown box from exis

RE: [PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Dajve Green
Also, if you're returning data from MySQL, there are a number of operations you can perform before it reaches your script: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html   From: Tom Chubb [mailto:tomch...@gmail.com] Sent: 16 June 200

RE: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread Dajve Green
Yeah, I used to write that way but found I and others in the team saved a lot more time troubleshooting and extending the code when returning 6 months later if it was more verbose. Horses for courses, I guess. Also, the selected attribute should be selected='selected' to validate correctly as xht

Re: [PHP] Form Process Question

2009-06-16 Thread Gary
My my, someone woke up on the wrong side of the bracket Acutally, the silliness of the request has not been lost on me or the client. And no, it is a simple 195 times number of people, which is usually under 5, so, I understand your recent scratching of the head... I was thinking/hoping th

[PHP] Re: Form Process Question

2009-06-16 Thread Gary
2. Yea, I was trying to avoid that. I am thinking about putting this one input form into a separate section, have the action file open in a separate window to keep the original (long with lots of required fields) intact, maybe even some behavior pop up. Thanks for your help. Gary "Shawn McK

Re: [PHP] Form Process Question

2009-06-16 Thread Gary
Thanks for your reply, I dont know js Gary "Matthew Giddings" wrote in message news:1497284708.356841245165474329.javamail.r...@vmailbox1.svsu.edu... > Have you thought about using JavaScript? > > Matt Giddings > Web Programmer > Information Technology Services > Saginaw Valley State Universit

Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Shawn McKenzie
Daniel Kolbo wrote: > Hello, > > I've cleaned up my question a bit. > > I want the included file which is called within a method of a class to > have the same scope as the instantiation of the class's object. That > is, i want a class to include a file in the calling object's scope. How > would

Re: [PHP] Form Process Question

2009-06-16 Thread Daniel Brown
On Tue, Jun 16, 2009 at 11:03, Gary wrote: > I have a client that I have made some forms for.  On one of the forms, their > customers are to registar for a class.  The cost of the class is 195 per > person.  She would like to have the people be able to have the total cost > calculated for them befo

[PHP] Re: Form Process Question

2009-06-16 Thread Shawn McKenzie
Gary wrote: > I have a client that I have made some forms for. On one of the forms, their > customers are to registar for a class. The cost of the class is 195 per > person. She would like to have the people be able to have the total cost > calculated for them before they submit the form. (I

Re: [PHP] Form Process Question

2009-06-16 Thread Matthew Giddings
Have you thought about using JavaScript? Matt Giddings Web Programmer Information Technology Services Saginaw Valley State University http://www.svsu.edu - Original Message - From: "Gary" To: php-general@lists.php.net Sent: Tuesday, June 16, 2009 11:03:38 AM GMT -05:00 US/Canad

Re: [PHP] populate form input option dropdown box from existingdata

2009-06-16 Thread Shawn McKenzie
tedd wrote: > At 6:09 PM -0400 6/15/09, PJ wrote: >> I am having difficulties figuring out how enter retrieved data into a >> dropdown box for editing. Here's a snippet: >> ...snip >> >> Civilization >> Monuments, Temples & Tombs >> Pharaohs and Queens... snip >> >> As I un

RE: [PHP] PHP5 SOAP...

2009-06-16 Thread bruce
hi russell... isn't the actual soap data/packet that's being sent over the wire viewable via an app like livehttpheaders... (at least from firefox) or are you looking for something in much more detail... -Original Message- From: rjon...@gmail.com [mailto:rjon...@gmail.com]on Behalf Of

Re: [PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Matthew Croud
Wonderful, thanks Ian for your function, and also thank you Tom for having a head scratch on my behalf ;) On 16 Jun 2009, at 16:20, Ian wrote: On 16 Jun 2009 at 14:05, Matthew Croud wrote: Hi Dajve and Tom, Thanks again, I totally didn't realise that this function is yet to be impleme

Re: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread PJ
Ford, Mike wrote: > On 15 June 2009 18:07, PJ advised: > > >> Is there an easier or simpler way to do this? >> code: >> >> $sql = "SELECT first_name, last_name, book_author.ordinal >> FROM author, book_author >> WHERE book_author.bookID = $idIN && book_author.authID = >> > autho

[PHP] PHP5 SOAP...

2009-06-16 Thread Russell Jones
I'm working on a project using SOAP and WS-Security in which I am failing miserably. Is there a way to inspect the actual XML, header, etc. that is actually being sent. I feel like I am constructing the call correctly, and I know exactly what needs to be sent, but I dont know how to see exactly wh

Re: [PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Ian
On 16 Jun 2009 at 14:05, Matthew Croud wrote: > Hi Dajve and Tom, > > Thanks again, I totally didn't realise that this function is yet to be > implemented in the mainstream PHP, > > So is there no function that exists in vanilla PHP that can take two > dates/times and supply the difference ?

[PHP] Form Process Question

2009-06-16 Thread Gary
I have a client that I have made some forms for. On one of the forms, their customers are to registar for a class. The cost of the class is 195 per person. She would like to have the people be able to have the total cost calculated for them before they submit the form. (I already have the cos

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread tedd
At 6:09 PM -0400 6/15/09, PJ wrote: I am having difficulties figuring out how enter retrieved data into a dropdown box for editing. Here's a snippet: ...snip Civilization Monuments, Temples & Tombs Pharaohs and Queens... snip As I understand it, I need to put an array (

RE: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread jenai tomaka
You can try like this, $row = stored data; and write the options like this Yuri Yarlei. > From: m...@dajve.co.uk > To: af.gour...@videotron.ca; php-general@lists.php.net > Date: Tue, 16 Jun 2009 09:33:49 +0100 > Subject: RE: [PHP] populate form input option dropdown box from existin

Re: [PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Tom Chubb
The first example here may help: http://us3.php.net/manual/en/function.time.php 2009/6/16 Matthew Croud > Hi Dajve and Tom, > > Thanks again, I totally didn't realise that this function is yet to be > implemented in the mainstream PHP, > > So is there no function that exists in vanilla PHP that

Re: [PHP] Link to .php page with session

2009-06-16 Thread Daniel Brown
On Tue, Jun 16, 2009 at 08:23, Stuart wrote: > > I may have interpreted your problem incorrectly, but I think your > problem is due to the session data not being saved until the script > has finished running, including the system call. To get around this > you can save and close the session before

RE: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread Ford, Mike
On 16 June 2009 13:58, PJ advised: > Ford, Mike wrote: >> On 15 June 2009 18:07, PJ advised: >> >> >>> Is there an easier or simpler way to do this? >>> code: >>> >>> $sql = "SELECT first_name, last_name, book_author.ordinal >>> FROM author, book_author >>> WHERE book_author.bookID

Re: [PHP] I2C and PHP

2009-06-16 Thread Daniel Brown
On Tue, Jun 16, 2009 at 01:02, Tobias Krieger wrote: > Hi, > > I'm working on a interface between the I2C Bus (Hardware) and PHP - to use > the PHP as webinterface to control an I2C Device. [snip!] Welcome to the list, Tobias. For future reference, please don't re-send the same email to the l

Re: [PHP] fopen() on a network share?

2009-06-16 Thread Martin Scotta
Hey, look, you can ask PHP what he think about slashes! var_dump( 'servername\\sharename\\folder\\file.xml' ); I think this should be a different problem On Tue, Jun 16, 2009 at 10:23 AM, Jan G.B. wrote: > 2009/6/16 Andrew Ballard > > > On Mon, Jun 15, 2009 at 7:24 PM, Shawn McKenzie > > w

Re: [PHP] fopen() on a network share?

2009-06-16 Thread Jan G.B.
2009/6/16 Andrew Ballard > On Mon, Jun 15, 2009 at 7:24 PM, Shawn McKenzie > wrote: > > Brian Dunning wrote: > >> Extra info, in case needed: my code says > >> > >> fopen('\\servername\sharename\folder\file.xml', 'w'); > >> > >> and it returns "Failed to open stream, no such file or directory". I

Re: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread Eddie Drapkin
And, assuming the same table (just got the new email, sorry) for the update: function makeUpdateQuery(array $authors, $bookId) { foreach($authors as &$author) { $author = mysql_real_escape_string($author); } if(!ctype_digit($bookId)) { return false; } $existing = array(); $getAuthors = 'SEL

Re: [PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Matthew Croud
Hi Dajve and Tom, Thanks again, I totally didn't realise that this function is yet to be implemented in the mainstream PHP, So is there no function that exists in vanilla PHP that can take two dates/times and supply the difference ? If there isn't I do apologise, i've been talking to my fri

Re: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread Eddie Drapkin
I'm going to assume that your table is setup to have the rows BookID and AuthorName, adjust accordinging: function makeInsertQuery(array $authors, $bookId) { $sql = "INSERT INTO book_authors (BookID, AuthorName) VALUES ('$bookId', '"; foreach($authors as &$author) { $author = mysql_real_esca

Re: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread PJ
Ford, Mike wrote: > On 15 June 2009 18:07, PJ advised: > > >> Is there an easier or simpler way to do this? >> code: >> >> $sql = "SELECT first_name, last_name, book_author.ordinal >> FROM author, book_author >> WHERE book_author.bookID = $idIN && book_author.authID = >> > autho

Re: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread PJ
Ashley Sheridan wrote: > On Mon, 2009-06-15 at 17:38 -0400, PJ wrote: > >> Jay Blanchard wrote: >> >>> [snip] >>> In what way would this simplify or ease my pain? >>> The difficulty, it seems to me, is not in retrieving the rows, but >>> rather how to pass the row data to the variables. And

Re: [PHP] Link to .php page with session

2009-06-16 Thread Stuart
2009/6/16 santel : > Hi, > > I have a .php page that use sessions and shows a file .FLV by > transcoding, on the fly, from any format video to > FLV using a shell command [ system("/usr/bin/ffmpeg -re -i ./file.wmv -f flv > -an -sameq -") ]. > > In a .php page: > case 1): if j put a link to any pag

RE: [PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Dajve Green
Hi Matthew, A quick note on the DateTime::diff() method - it's only available as from PHP 5.3, which is currently in release candidate stage, meaning unless you have your own server running PHP, it won't be available to use (hopefully - I would be sceptical of any webhost which rolls out RCs on p

Re: [PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Matthew Croud
Hi Tom, Thanks for the reply, I believe I have a fair understanding of functions, and I have followed the example on the PHP manual page ( http://uk3.php.net/manual/en/function.date-diff.php ), ideally I want to know how to use the class DateTime::diff, how can I use the DateTime::diff to

Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Daniel Kolbo
Hello, I've cleaned up my question a bit. I want the included file which is called within a method of a class to have the same scope as the instantiation of the class's object. That is, i want a class to include a file in the calling object's scope. How would one do this? 'test.php' cinclude()

Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Daniel Kolbo
Martin Scotta wrote: > Where is $vars? there is no $vars in your code... > > You can extract all the global space in the CScope method, it's quite > simple, but less performant. > > > class CScope { > >public $vars = 'class scope\n'; > >function cinclude($filename) { >

[PHP] Link to .php page with session

2009-06-16 Thread santel
Hi, I have a .php page that use sessions and shows a file .FLV by transcoding, on the fly, from any format video to FLV using a shell command [ system("/usr/bin/ffmpeg -re -i ./file.wmv -f flv -an -sameq -") ]. In a .php page: case 1): if j put a link to any page without session, all is ok; ca

RE: [PHP] fopen() on a network share?

2009-06-16 Thread jenai tomaka
Hi, wht dont you try it with IP, ex: fopen('http://11.12.13.14/sharename/folder/file.xml', 'w'); > Date: Mon, 15 Jun 2009 22:51:09 -0400 > From: aball...@gmail.com > To: nos...@mckenzies.net > CC: php-general@lists.php.net > Subject: Re: [PHP] fopen() on a network share? > > On Mon, Jun 15, 200

[PHP] Re: looking for source to pull data (price of oil)

2009-06-16 Thread O. Lavell
Kurrent wrote: > I am just simply looking for the price of nymex crude future ( see > http://www.bloomberg.com/energy/). > > Any sources or other idea would be much appreciated. Thanks! This seems to work: http://www.bloomberg.com/energy/";)); $search = "Nymex Crude Future"; $start = strpos($pa

[PHP] difference between two times? Date_diff and DateTime::diff

2009-06-16 Thread Matthew Croud
Hello, My journey of learning PHP is going well, so i've decided to make a small program which works out the difference between two times and records the data in a text file. I've searched the PHP manual for functions which can help me out, and I discovered the function Date_diff ( http:

Re: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread kranthi
the above post points to a 404 page any ways as suggested above in_array() will do the trick for you. i prefer using a template engine like smarty.. http://www.smarty.net/manual/en/language.function.html.options.php One line of code and you are done -- PHP General Mailing List (http://www.p

RE: [PHP] populate form input option dropdown box from existing data

2009-06-16 Thread Dajve Green
> -Original Message- > From: PJ [mailto:af.gour...@videotron.ca] > Sent: 15 June 2009 23:10 > To: php-general@lists.php.net > Subject: [PHP] populate form input option dropdown box from existing data > > I am having difficulties figuring out how enter retrieved data into a > dropdown box

Re: [PHP] I2C and PHP

2009-06-16 Thread Per Jessen
Tobias Krieger wrote: > So, what I need is a way to convert any value between 0 and 255 into a > string with one byte, e.g > > 0xff = (with strlen($data) == 1) > > I tried it with: > > chr(255) - not successfull > pack("H" and "h", 0xff) - not successfull > decbin(255) - without succe

RE: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread Ford, Mike
On 15 June 2009 18:07, PJ advised: > Is there an easier or simpler way to do this? > code: > > $sql = "SELECT first_name, last_name, book_author.ordinal > FROM author, book_author > WHERE book_author.bookID = $idIN && book_author.authID = author.id > ORDER BY ordinal"; > > $autho

Re: [PHP] how to extract fields from associative array into different variables

2009-06-16 Thread kranthi
you dont have an alternative. you will have to loop because mysql_fetch_* functions fetch only one row at a time. you can use variable variables to achieve the above result (you will not require this if u use list() or extract() functions) http://us.php.net/manual/en/language.variables.variable.ph