[PHP] retrieving form checkbox values
I have a form which I want to post multiple values from one function to another using checkboxes. Having one value is simple- the form submits the value $File and is then retrieved in the target function via $_Request['File'] So far so good. Now I want to have multiple values for $File, because $File is a value assigned to a dynamically generated list of files in a folder (which will change from folder to folder). If I have multiple then only the last value is posted to the next function and retrieved by $_Request['File'] How can I post and retrieve all values of $File or am I going about this the wrong way? Thanks
RE: [PHP] Moving Files/ Temporary Names
Thanks for everyones help -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] Sent: 15 July 2003 10:19 To: 'caspar kennerdale'; Php-General Subject: RE: [PHP] Moving Files/ Temporary Names > -Original Message- > From: caspar kennerdale [mailto:[EMAIL PROTECTED] > Sent: 14 July 2003 21:05 > > > If you want the file to go into a holding location until your > administrator > can approve it and move it to its real final location, then > the holding > location should be the target of the move_uploaded_file(). > This makes it up > to you to decide what you want the structure of your holding > location to be, > and how you want to keep track of any files currently populating it. > > - I'm a little confused. The files are already in there real > location. Ah -- this wasn't clear before. Then these are no longer uploaded files -- only the temp file created by the original form submission is truly an uploaded file in the sense that is_uploaded_file() will be true and you can move_uploaded_file() it. Once you have used move_uploaded_file() on it, the new file is just a regular file, not an uploaded one. > It is > just that someone may want to change that location at a later date. > e.g. they upload an image to a folder and two months later > decide it is > better placed in a different folder. Then you just want rename() -- http://www.php.net/rename Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] Moving Files/ Temporary Names
In your application code ... you can implement a move() function that can either call the unix (mv) or windows (move) commands to move the file to another location (same permission restrictions apply). The thing about move is, its a copy + delete function in one, so you have to be careful about permissions. You might have permissions to copy, but not delete. -- If move is essentially a copy and delete- then this seems to be my best approach rather than using move_uploaded_file () as I do not have the tmp names. Want I want to do is to allow the user the option to upload a file, rename a file, delete a file and finally to move a file. move_uploaded_file() seems relevant at the time of uploading, but in my scenario this has happened long before and no the user wishes to change the permanant location of the file. Like any file/ directory handler. The final script could be on 'nix or windows so I want all funtions to be platform independent Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Moving Files/ Temporary Names
> > I am trying to crate the function that will allow the > administrator to Move a selected file to a different folder. > I have looked at move_uploaded_file () and it seems that > the source file to move needs to actually be the file's temp name. > If the file has recently been uploaded then the temp name is > accessible via $_Files[] array, but if the file was uploaded say a > week before I assume that the temp name is no longer there. Not only is the temp name no longer there, nor is the file! When you upload a file, the temporary place where PHP puts it is only valid for the life of the script which processes the file upload -- it is automatically deleted upon completion of that script. - This is how I understood it. If you want the file to go into a holding location until your administrator can approve it and move it to its real final location, then the holding location should be the target of the move_uploaded_file(). This makes it up to you to decide what you want the structure of your holding location to be, and how you want to keep track of any files currently populating it. - I'm a little confused. The files are already in there real location. It is just that someone may want to change that location at a later date. e.g. they upload an image to a folder and two months later decide it is better placed in a different folder. Or am I missing something really obvious. The other solution I can see is to copy the file to the new location and delete the original Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Moving Files/ Temporary Names
I was hoping someone might clarify what may seem like a basic point. I looked in the archives but didnt seem to get my answer. I am creating a basic set of functions that will form the back bone of an image gallery and a directory handler. I am trying to crate the function that will allow the administrator to Move a selected file to a different folder. I have looked at move_uploaded_file () and it seems that the source file to move needs to actually be the file's temp name. If the file has recently been uploaded then the temp name is accessible via $_Files[] array, but if the file was uploaded say a week before I assume that the temp name is no longer there. If I am incorrect, how do I get the temp name for a file uploaded a while ago? Or is it simpler to copy() the file to its new location and delete the original? Many Thanks
[PHP] Multiple queries
Sorry If this is the wrong list for this topic, I hope someone can shed some light onto my problem. I am building a php/ Mysql web site for a client which is a picture gallery. The web site has 3 frames (required by the designer so that the whole thing doesnt refresh all the time). Frame 1- Navigation Frame 2- Info on selected artworks and other related projects Frame 3- The artworks/ jpegs I have one table, with a name and info about the project and upto 5 urls of where the jpeg lies. When a project is selected in the navigation I request the record from the database, I create an array which contains the location of the jpegs and then display them in Frame 3. Now, I then have a piece of javascript which tells frame 2 to update itself. So I have parsed the record ID to it and it then open a query to the database and outputs the relevant information about the artworks. Lastly a third query is also sent to the database to see if there are any other projects in the gallery by the same artist- and then create a list of related links. So I have 3 database queries over two pages. I'm wondering if there is a more efficient way of doing this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP editor for windows
www.editplus.com -Original Message- From: Scott St. John [mailto:[EMAIL PROTECTED]] Sent: 22 April 2002 06:26 To: .ben Cc: PHP Subject: Re: [PHP] PHP editor for windows Macromedia/Allaire Home Site 5.0 has PHP color coding, not auto-complete, but you can customize it for auto-complete if you want. You can also make it tab 2 instead of 4 :) It's been my editor since the free version 1.0 and it's a work horse. And Home Site has Ultra Dev/Dream Weaver integration. PS-- This is MY opinion and NOT intended to start any Holy Wars. -Scott On Mon, 22 Apr 2002, .ben wrote: > Other than notepad, interdev, ultraedit, etc (which i currently use for > editing), does anyone know of a good editor for PHP for Windows, ideally > with syntax colouring, etc? > > Cheers, > > .ben > > > -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] functions
function firstfunction(){ code; code; code; secondfunction(); } -Original Message- From: Alia Mikati [mailto:[EMAIL PROTECTED]] Sent: 12 April 2002 06:38 To: [EMAIL PROTECTED] Subject: [PHP] functions hi i would like now how can we call a function within another function in php? thx a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: editors
www.editplus.com -Original Message- From: Andrew Chase [mailto:[EMAIL PROTECTED]] Sent: 11 April 2002 09:08 To: [EMAIL PROTECTED] Subject: [PHP] RE: editors I like emacs - freely available for Windows and Linux, and if you use php-mode for font locking you get nice automatic indentation, and (in Xwindows - not sure about WinNT/XP/9X) syntax highlighting. http://www.gnu.org/software/emacs/emacs.html http://sourceforge.net/projects/php-mode/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] while() query
Thanks to all -Original Message- From: Christoph Starkmann [mailto:[EMAIL PROTECTED]] Sent: 11 April 2002 07:22 To: 'Caspar Kennerdale'; '[EMAIL PROTECTED]' Subject: RE: [PHP] while() query Hi Caspar! $counter = -1; while(++$counter <50) { if ($counter != 39) { do a task on all between 1 and 50 except on 39 } } This should do... Cheers, Kiko -- It's not a bug, it's a feature. christoph starkmann mailto:[EMAIL PROTECTED] http://www.gruppe-69.com/ ICQ: 100601600 -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] while() query
This may be a baisc programming query, to which I dont have the ansa, but can you do a while () loop, but set a condition so that it misses one ie $counter = -1; while(++$counter <50){ do a task on all between 1 and 50 except on 39 } Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] declaring properties
Is declaring properties at the beginning of a class imperative or good programming practice. All the documentation I have seen states that you must do this,however if the properties I am setting in each function are listede in the parenthesis i.e function test($var1,$var2){ } then my classes still work. Am I destined for trouble art later stages? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: oh no
and what of it -Original Message- From: Vincent Kruger [mailto:[EMAIL PROTECTED]] Sent: 30 March 2002 14:08 To: caspar kennerdale Subject: oh no you a fucking pommy. god dam
RE: [PHP] SPAM
And a message for bvr and caspe kennerdale. You are obviousely Americans setting the record straight- this is a huge assumption- and I'm not american, and you didnt even spell my name correctly! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Qmail Question
after your last two spams I'd be surprised if anyone would be will to answer your questions -Original Message- From: Vins [mailto:[EMAIL PROTECTED]] Sent: 30 March 2002 10:15 To: [EMAIL PROTECTED] Subject: [PHP] Qmail Question I have qmail on my server. I've set up and email address to send all incoming mail to a php script. How would I break down the message and read the to field and the from field etc. where can i find information on that ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] class extends
can you use class extends feature to refernce more than one class- so a class called contnet could call functions fromone called html and one called db? thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] classes- getting their slowly but surely I think
just a quick query, hopefully someone can help (sorry for these repeat schooboy questions) re classes- Can you create an instance of a class and use its 'value' within an instance of another instance of the same class? For example I have created two classes- html.class and db.class I am creating an instance of the db.class to give an array containing the rows from a table. I would like to create a table using my HTML.class and using a while loop create a using the date collected from each row in my db.class. This all works fine. However when I embed this newly created table into a cell of another table created with html.class, the table is still created but it does not appear in the cell, but outside of the desired table- so I have two tables side by side instead of one table embedded within the cell of another? Is this a code/ syntax issue or have I misunderstood the scope of classes? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class/ DB Question
I'm in the slow process of transferring my contetn management system over to full object oreinted code. I have a function within a class which gets the field name and type information from a mysql table, puts this into an array and then returns a table with a form field for each field. I specify switch case in my index.php where the form contents are posted to. Within this case is another function holding my INSERT query. The problem is that the value from my form do not seem to carry over. normally whatever my form field is named eg- Name is then posted as a variable $Name. $Name can then be Inserted into the database. In this case my field name is actually an array value (as the form is created in a 'while' loop)- ie $row[$a][1] My form is created correctly- (viewing source in a browser shows this) If I hard code values into my INSERT function (ie no variables) then the record inserts, but my variable values are lost. I have tried declaring the variable names as global variables within my insert function- and this doesnt work. Ideally I like to post these variables, perhaps to an array that can then be picked up by any instance of my class? Any ideas? Cheers Caspar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] class question 2
Sorry Another question- Do instances of classes remain in 'communication' with each other if declared my different functions in a case switch statement. At present I have an admin.php which is one long swtich statement. Wihin each is a list iof functions which created the elements of the page Each of these functions are defined in anither file and are instances of classes. If I create an instance of a DB class for exapmle- can I refer to it thoughout the visit to the website- ie does it maintaoin its values and variables even if different functions freom the main index.php page are called sorry if this is really confusing any ideas much appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql fetch field
Actually I've alreasdy worked it out- sorry -Original Message- From: caspar kennerdale [mailto:[EMAIL PROTECTED]] Sent: 17 March 2002 10:31 To: [EMAIL PROTECTED] Subject: [PHP] mysql fetch field I seem to be getting unexpected information from a mysql fetch field query. My table has three fields- here is the schema- CREATE TABLE template ( id smallint(6) NOT NULL auto_increment, name mediumtext NOT NULL, multiple tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (id), UNIQUE id (id) ); Using the samplecode on php.net to output an object containing the properties of eacj field I have been able to output the following Blob - 0 MaxLength - 1 Multiple Key - 0 Name - id Not Null - 1 Numeric - 1 Primary Key - 1 Table - template Type - int Unique Key - 1 Unsigned - 0 ZeroFill - 0 Blob - 1 MaxLength - 7 Multiple Key - 0 Name - name Not Null - 1 Numeric - 0 Primary Key - 0 Table - template Type - blob Unique Key - 0 Unsigned - 0 ZeroFill - 0 Blob - 0 MaxLength - 1 Multiple Key - 0 Name - multiple Not Null - 1 Numeric - 1 Primary Key - 0 Table - template Type - unknown Unique Key - 0 Unsigned - 0 ZeroFill - 0 Which strange as the first field is specified as having a max length of 1 yet it is a small int with a length of 6. Likewise the second field is specified as a blob with a maximum length of 7- yet in my schema it is a medium text. And again my third field is listed as havingan unkniwn typeyet in the schema it is a tinyint Here is my code $TableInfo = new DB; $TableInfoArray = $TableInfo ->MySqlGetTableInfo('SELECT * FROM template'); $a =-1; $b = -1; while (++$a < count($TableInfoArray)){ $Content[++$b] = "Blob - ".$TableInfoArray[$a][0].""; $Content[++$b] = "MaxLength - ".$TableInfoArray[$a][1].""; $Content[++$b] = "Multiple Key - ".$TableInfoArray[$a][2].""; $Content[++$b] = "Name - ".$TableInfoArray[$a][3].""; $Content[++$b] = "Not Null - ".$TableInfoArray[$a][4].""; $Content[++$b] = "Numeric - ".$TableInfoArray[$a][5].""; $Content[++$b] = "Primary Key - ".$TableInfoArray[$a][6].""; $Content[++$b] = "Table - ".$TableInfoArray[$a][7].""; $Content[++$b] = "Type - ".$TableInfoArray[$a][8].""; $Content[++$b] = "Unique Key - ".$TableInfoArray[$a][9].""; $Content[++$b] = "Unsigned - ".$TableInfoArray[$a][10].""; $Content[++$b] = "ZeroFill - ".$TableInfoArray[$a][11].""; $Content[++$b] = ""; } $Content = join('', $Content); return $Content; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql fetch field
I seem to be getting unexpected information from a mysql fetch field query. My table has three fields- here is the schema- CREATE TABLE template ( id smallint(6) NOT NULL auto_increment, name mediumtext NOT NULL, multiple tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (id), UNIQUE id (id) ); Using the samplecode on php.net to output an object containing the properties of eacj field I have been able to output the following Blob - 0 MaxLength - 1 Multiple Key - 0 Name - id Not Null - 1 Numeric - 1 Primary Key - 1 Table - template Type - int Unique Key - 1 Unsigned - 0 ZeroFill - 0 Blob - 1 MaxLength - 7 Multiple Key - 0 Name - name Not Null - 1 Numeric - 0 Primary Key - 0 Table - template Type - blob Unique Key - 0 Unsigned - 0 ZeroFill - 0 Blob - 0 MaxLength - 1 Multiple Key - 0 Name - multiple Not Null - 1 Numeric - 1 Primary Key - 0 Table - template Type - unknown Unique Key - 0 Unsigned - 0 ZeroFill - 0 Which strange as the first field is specified as having a max length of 1 yet it is a small int with a length of 6. Likewise the second field is specified as a blob with a maximum length of 7- yet in my schema it is a medium text. And again my third field is listed as havingan unkniwn typeyet in the schema it is a tinyint Here is my code $TableInfo = new DB; $TableInfoArray = $TableInfo ->MySqlGetTableInfo('SELECT * FROM template'); $a =-1; $b = -1; while (++$a < count($TableInfoArray)){ $Content[++$b] = "Blob - ".$TableInfoArray[$a][0].""; $Content[++$b] = "MaxLength - ".$TableInfoArray[$a][1].""; $Content[++$b] = "Multiple Key - ".$TableInfoArray[$a][2].""; $Content[++$b] = "Name - ".$TableInfoArray[$a][3].""; $Content[++$b] = "Not Null - ".$TableInfoArray[$a][4].""; $Content[++$b] = "Numeric - ".$TableInfoArray[$a][5].""; $Content[++$b] = "Primary Key - ".$TableInfoArray[$a][6].""; $Content[++$b] = "Table - ".$TableInfoArray[$a][7].""; $Content[++$b] = "Type - ".$TableInfoArray[$a][8].""; $Content[++$b] = "Unique Key - ".$TableInfoArray[$a][9].""; $Content[++$b] = "Unsigned - ".$TableInfoArray[$a][10].""; $Content[++$b] = "ZeroFill - ".$TableInfoArray[$a][11].""; $Content[++$b] = ""; } $Content = join('', $Content); return $Content; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] server load
I am thinking of using a documentation parser such as javadoc (called phpdoc) which will create a separate html document on the functions and feastures of the classes I am writing,as well as examples and tutorial info. I am just considering whether or no I have two versions - a no comments version which goes live and a commented version which I compile the html fromand also distribute. Does anyone here have experience with phpdoc? -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: 16 March 2002 17:29 To: caspar kennerdale Cc: [EMAIL PROTECTED] Subject: Re: [PHP] server load However write short but meaningful comments. Keep in mind that the scripts has to be loaded in the memory from the disk. Although after first request it is in some cache. Andrey - Original Message - From: "caspar kennerdale" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, March 16, 2002 7:24 PM Subject: RE: [PHP] server load > So you could have as much commented text without any detriment to the pages > performance? > > great > > > > -Original Message- > From: Andrey Hristov [mailto:[EMAIL PROTECTED]] > Sent: 16 March 2002 17:17 > To: caspar kennerdale > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] server load > > > Flex - the tools that parses the code skips everything between /* and */ and > for this no token is given back. Of course if you don't > have 5kb comments Flex will be a little faster but possibly few %. > > Regards, > Andrey > > - Original Message - > From: "caspar kennerdale" <[EMAIL PROTECTED]> > To: "PHP General" <[EMAIL PROTECTED]> > Sent: Saturday, March 16, 2002 7:13 PM > Subject: [PHP] server load > > > > Would a 10kb file which has 5kb of comments take longer to process in php > > than the same file wihout the comments which is 5kb? > > > > Or are the comments ignored as far as server load and speed to delivery > are > > concerned? > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] server load
So you could have as much commented text without any detriment to the pages performance? great -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: 16 March 2002 17:17 To: caspar kennerdale Cc: [EMAIL PROTECTED] Subject: Re: [PHP] server load Flex - the tools that parses the code skips everything between /* and */ and for this no token is given back. Of course if you don't have 5kb comments Flex will be a little faster but possibly few %. Regards, Andrey - Original Message - From: "caspar kennerdale" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Saturday, March 16, 2002 7:13 PM Subject: [PHP] server load > Would a 10kb file which has 5kb of comments take longer to process in php > than the same file wihout the comments which is 5kb? > > Or are the comments ignored as far as server load and speed to delivery are > concerned? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] server load
Would a 10kb file which has 5kb of comments take longer to process in php than the same file wihout the comments which is 5kb? Or are the comments ignored as far as server load and speed to delivery are concerned? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] array within an array (one more query)
can you therefore have $array[0][9][2][3] if you had an array within an array within an array within an array. (not sure i'd want to, but you never know) $array[0][1] is how you access multi-dimensional arrays. Niklas -Original Message- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] Sent: 15. maaliskuuta 2002 15:18 To: [EMAIL PROTECTED] Subject: [PHP] array within an array I have an sql query which calls * rows from a table. Each row is an array of table field values. This is how I understand the heirachy $table_row_array[0] = $field_row_array[] $table_row_array[1] = $field_row_array[] $table_row_array[2] = $field_row_array[] Now $table_row_array is being drawn from the database via a while loop and an $a++, thus I do not have a name for $field_row_array- I just know that the value of each in $table_row_array is an array. How can I access the values within $filed_row_array[]? I want to do something like $table_row_array[0 [1]]; (the second value from the array that is the first of $table_row_array) I know this isnt the syntax Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] array within an array
Thanks all I knew it was something simple, but my brain was in twists. (no change there ha ! ha !) -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 13:24 To: Php-General Subject: RE: [PHP] array within an array $array[0][1] is how you access multi-dimensional arrays. Niklas -Original Message- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] Sent: 15. maaliskuuta 2002 15:18 To: [EMAIL PROTECTED] Subject: [PHP] array within an array I have an sql query which calls * rows from a table. Each row is an array of table field values. This is how I understand the heirachy $table_row_array[0] = $field_row_array[] $table_row_array[1] = $field_row_array[] $table_row_array[2] = $field_row_array[] Now $table_row_array is being drawn from the database via a while loop and an $a++, thus I do not have a name for $field_row_array- I just know that the value of each in $table_row_array is an array. How can I access the values within $filed_row_array[]? I want to do something like $table_row_array[0 [1]]; (the second value from the array that is the first of $table_row_array) I know this isnt the syntax Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array within an array
I have an sql query which calls * rows from a table. Each row is an array of table field values. This is how I understand the heirachy $table_row_array[0] = $field_row_array[] $table_row_array[1] = $field_row_array[] $table_row_array[2] = $field_row_array[] Now $table_row_array is being drawn from the database via a while loop and an $a++, thus I do not have a name for $field_row_array- I just know that the value of each in $table_row_array is an array. How can I access the values within $filed_row_array[]? I want to do something like $table_row_array[0 [1]]; (the second value from the array that is the first of $table_row_array) I know this isnt the syntax Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Update File Woe (Maybe OT!)
This is not truly a php programming question but a problem I have when programming php on which I was hoping someone would shed some light. When I write php code I generally upload directly to a server via ftp. As I am on a pretty fast adsl line I have never seen toi the need to have a sever setup locally. The problem is that the pages I upload seem to cache and therefore unless I rename the file I have edited on the server (and there request a new file) I do not see the changes I have just made- which is problematic when I am trying new things and changes comer thick and fast. The cache on my browser is set to clear itself on every file request. I also manually clear it. However no matter what I seem to have to rename the the file on the server and request it that way. This is an issue in both IE and NS so it is not a browser specific problem. Likewise I do not see to have this same trouble with html or javascript files- only php. Any ideas? I thought it might be to do with some sort of server side cacheing script? Does anyone have any ideas of a few lines of code I could insert at the top of a file that would overcome this? It is really annoying more than anything Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Opening new browser window.
embed the javascript within the php using echo or print -Original Message- From: Way, Paul [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 16:26 To: '[EMAIL PROTECTED]' Subject: [PHP] Opening new browser window. Is there anyway that I can open a new browser window in php, like you are able to do in JavaScript (window.open()). I have had a look around and can't find any information on how this can be done. Many thanks. PW.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] accessing data from classes
I am just getting my head around classes, so forgive me if this is a schoolboy error! In order to learn I am re-writing my content management system and am in the process of writing an HTML.class and a MYSQL.class. so far so good. I spawn new instances of a table for example, sending parameter,and a table is output. now in my MYSQL.class- I want to send a query to my class which then returns an array- my database row or rows. the problem is that whilst my array is created- I only seem to be able to manipulate it within my MYSQL class. This is not satisfactory as I really want to be able to send it on to my HTML.class for formatting etc. I obvioulsy do not want to format any 'echoed' output from within my databasee class. Here is a bit of sample code- Once my database is open I call my query like this- $TemplateTable = new DB; $TemplateTable->mysql_query('SELECT * FROM template ORDER BY name ASC LIMIT 10'); This is the function within my MYSQL.class function mysql_query($query){ $a= 0; while($row=mysql_fetch_row($SQL)) { $new_row = join('***',$row); $result[] = $new_row; echo $result[$a].""; $a++; } } So here I am creating a string with each row in my database which is delimted by *** -> $new_row.and am placing each row in anew array called $result. I can evaluate and format either $new_row or $result from within mysql_query() but I really want to do is to send it on to another funtion or even better another class- or access the values glabbally as variables. Any ideas or am I missing something really obvious? Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cron test
-Original Message- Sorry this is offtopic I have set up a cron job and this is the message I havereceived Your terminal lacks the ability to clear the screen or position the cursor. any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mail attachment query
so i have a mail script which allows people to send attachments. This is activated by an htmlform, which allows users to select the file from their hard drive and post to the recipient. The problem I have is this- The file attachment is sent via email as a .dat file. If I specify the name of the file and its attachment in a variable called mail title all is well and good - $mail_body .= "Content-type:$mime_type; name=\"$mail_title This is of course if $mail_title is spomething likle "mypicture.jpeg", if I leave the extension out then it os sent as a dat file. Now firstly the mime type might change depending onthe typeoffile the user wishes to send- it may be an swf or a doc. If the user specifies the type of file it is then this is fine. If the user doesnt specify the typeoffile being sent then all I have to go on is the name of the file uploaded which appears as a temp name such as- /tmp/phpHy3WIj so is their any way of auto detecting thje mime type of a file from simply the 'file' inpuit box on the form or at any other stgae-- or does the user have to declare the type of file they are sending? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] folver view options
I have just installed mandrake something that is annoying me with KDE is that the default view within the file manager is with icons. Is is possible to have the tree or detailed view as the default. I briefly looked at the prefences and could find it anywhere Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] fresh install woes
I've insatlled mandrake 8.1 from the ISO's I downloaded frrom their site. Everything seems fine, but when I try to execute any software ie startx or even pico from the command line then I get a cannot be found message As I navigate through the directoires it seems that they have not been installed- despite electing to install pretty much every package in my install options. I have reinstalled several times to the same effect. I have a 3 gig partision on my hard drive for mandrake0 and have treid various format attempts on installation as well Any ideas anyone thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] email info
The thing is that you can send and receive attachments perfectly if you send directly from an email client such as outlook or webbased mail such as hotmail. I have attached my script below "; $mail_boundary = md5(uniqid(time())); $mail_headers .= "From: [EMAIL PROTECTED] \n"; $mail_headers .= "MIME-Version: 1.0\r\n"; $mail_headers .= "Content-type: multipart/mixed;"; $mail_headers .= "boundary= \"$mail_boundary\""; $mail_headers .= "\r\n\r\n"; $new_mail_body .= "--$mail_boundary\n"; $new_mail_body .= "Content-type: text/plain; charset=us-ascii\r\n"; $new_mail_body .= "Content-transfer-encoding: 7bit\r\n\r\n"; $new_mail_body .= "Name ".$mail_name; $new_mail_body .= "\r\n"; $new_mail_body .= "Email ".$mail_email; $new_mail_body .= "\r\n"; $new_mail_body .= "Title ".$mail_title; $new_mail_body .= "\r\n"; $new_mail_body .= "Description ".$mail_description; $new_mail_body .= "\r\n"; if (!$attachment_size){ NULL; }else{ $new_mail_body .= "--$mail_boundary\n"; $fp = fopen($attachment, "r"); $file = fread ($fp, filesize ($attachment)); $file = chunk_split(base64_encode($file)); $mime_type ="image/gif"; $new_mail_body .= "Content-type:$mime_type; name=\"$mail_title\"\r\n"; $new_mail_body .= "Content-transfer-encoding:base64\r\n\r\n"; $new_mail_body .= $file; $new_mail_body .= "\r\n\r\n"; } $new_mail_body .= "--$mail_boundary--"; return mail($mail_to , $mail_subject, $new_mail_body, $mail_headers); ?> -Original Message- From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]] Sent: Monday, November 26, 2001 14:42 To: Caspar Kennerdale; Php-General Subject: Re: [PHP] email info looks like your email client at work is not capable of handling the image (.gif) attachments. check in the help secion of your email client. HTH - Original Message - From: "Caspar Kennerdale" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Monday, November 26, 2001 8:16 AM Subject: [PHP] email info > can anyone recommend a site or discussion list relating to email > > I have a form to mail script which sends attachments - it all works if I > have my private email address as the recipient, > > however if I use my work email address the mail comes out with no attachment > but displays gobbledigook like- > > "Content-type: multipart/mixed;boundary= "cd3b0ec60c75e8454ec2d36d9db1b16e" > Message-Id: <[EMAIL PROTECTED]>Date: Mon, 26 Nov 2001 > 12:25:31 + (GMT)--cd3b0ec60c75e8454ec2d36d9db1b16eContent-type: > text/plain; charset=us-ascii Content-transfer-encoding: 7bit Name caspar > [EMAIL PROTECTED] Title text submit Description test > submit --cd3b0ec60c75e8454ec2d36d9db1b16eContent-type:image/gif; name="text > submit" > Content-transfer-encod > > If i forward my work email to my private email then the emaiul is fine- > > is this a script error, a mail server/ isp error, local mail server error > > any ideas thanks in advance > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] email info
can anyone recommend a site or discussion list relating to email I have a form to mail script which sends attachments - it all works if I have my private email address as the recipient, however if I use my work email address the mail comes out with no attachment but displays gobbledigook like- "Content-type: multipart/mixed;boundary= "cd3b0ec60c75e8454ec2d36d9db1b16e" Message-Id: <[EMAIL PROTECTED]>Date: Mon, 26 Nov 2001 12:25:31 + (GMT)--cd3b0ec60c75e8454ec2d36d9db1b16eContent-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Name caspar [EMAIL PROTECTED] Title text submit Description test submit --cd3b0ec60c75e8454ec2d36d9db1b16eContent-type:image/gif; name="text submit" Content-transfer-encod If i forward my work email to my private email then the emaiul is fine- is this a script error, a mail server/ isp error, local mail server error any ideas thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Flash programming
I was under the impression you could only edit flash within proprietary products like flash itself, livemotion especially if the file has already been exported to swf -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 02:32 To: [EMAIL PROTECTED] Subject: [PHP] Flash programming Anyone know how one can "import" a flash file into PHP for use with "ming" or something similar? It's an easy to make a flash animation with ming, but I'd like to be able to modify an existing flash file. thnx Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php- cgi
Thanks I'll give it a go -Original Message- From: Brian Clark [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 16:26 To: PHP is not a drug. Subject: Re: [PHP] php- cgi Hi Caspar, @ 11:11:25 AM on 11/21/01, Caspar Kennerdale wrote: > yes ideally with cron- I know nothing about it really other than a > little bit i've read- but my isp says they can execute a perl file > and not a php file via cron. ISP's can be strange about that stuff, but it's understandable sometimes. Try compiling a php executable for yourself in your home directory and running it from cron and see if that gets around it. (If the sysadmin finds out he might give you the boot though.) man 5 crontab (if you have shell access) Might not work that way either, depending on the sysadmin. -- -Brian Clark | PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php- cgi
yes ideally with cron- I know nothing about it really other than a little bit i've read- but my isp says they can execute a perl file and not a php file via cron. I was interested to see whether or not compliing as a cgo would circumnavigate this- but i'm as much in the dark about that. I have tried executing my script via autmotaing windows which didnt work really as it was reliiant on the internet connection as opposed to the servers connection- and timing out problems occurred. I am rewriting parts to include fsockopen instead of file which will help but doesnt solve the automation issue thanks -Original Message- From: Brian Clark [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 16:04 To: PHP is not a drug. Subject: Re: [PHP] php- cgi Hi Caspar, @ 10:54:13 AM on 11/21/01, Caspar Kennerdale wrote: > I have a script that when I execute via a browser retrieves information. > Ultimately I want this automated. There has been mention on these lists > about compliling php as cgi, which I think may help By automated do you mean with something like cron? ./configure php without using apxs or apache. That will build it as a stand alone executable which you can call from a shell or from cron. If you need it as a cgi also, you'd configure it pretty much the same way you'd configure a cgi-bin for perl-cgi scripts, but I don't know if running php as an apache module AND as a cgi is going to fly. > This also may help out with some timeout issues that arise. Search this page for max_execution_time: <http://www.php.net/manual/en/configuration.php> -- -Brian Clark | PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php- cgi
I have a script that when I execute via a browser retrieves information. Ultimately I want this automated. There has been mention on these lists about compliling php as cgi, which I think may help This also may help out with some timeout issues that arise. can anyone point me in the right direction to a tutoria; or something about this subject Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] quick friday query
ahh write permission the folder- duh- not thinkingtoday thank alot -Original Message- From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]] Sent: 16 November 2001 18:14 To: Caspar Kennerdale; Php-General Subject: Re: [PHP] quick friday query check under what user Apache is running ( mostly nobody ). You have to give write permission on the directory where you want the files to be to that user. For security reasons, just don't give write access on your document_root, instead create a directory outside ( or within) your document_root and give write access on it to nobody ( Apache user id) and write your file there. - Original Message ----- From: "Caspar Kennerdale" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Friday, November 16, 2001 12:49 PM Subject: [PHP] quick friday query > I am writing files to my server using > > $fp = fopen("myfile.txt", "w"); > > this all works. However in the php manual it says that by using the "w" > switch that php will create the file if it doesn exist > > However this does not seem to work > > I can only write to a file that already exists and has CHMOD 777 > > Is this a school boy error or do I need my server re configured? > > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] quick friday query
I am writing files to my server using $fp = fopen("myfile.txt", "w"); this all works. However in the php manual it says that by using the "w" switch that php will create the file if it doesn exist However this does not seem to work I can only write to a file that already exists and has CHMOD 777 Is this a school boy error or do I need my server re configured? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] timing
unfortunaelty its not in php- but director -Original Message- From: Matthew Luchak [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 16:03 To: Php-General Subject: RE: [PHP] timing If the other application is written in PHP you can use "flock". Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] -Original Message----- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 11:00 AM To: Php-General Subject: [PHP] timing I have a script that when is executed parses and html file and writes the contents to a text file. I need to then read this text file from another apllication Is there a way of timing this operation, so that my other app does not try to access the file before being written? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] timing
I have a script that when is executed parses and html file and writes the contents to a text file. I need to then read this text file from another apllication Is there a way of timing this operation, so that my other app does not try to access the file before being written? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cron not allowed
thanks for the ideas -Original Message- From: Jack Dempsey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 15:23 To: Jon Haworth; [EMAIL PROTECTED] Subject: RE: [PHP] cron not allowed thanks jonwas more of a 'how are you going to' rather than 'how is it possible' :-) either way, from lynx or from php being a cgi a simple shell script or perl script should be able to make the appropriate call... jack -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 9:29 AM To: 'Jack Dempsey'; [EMAIL PROTECTED] Subject: RE: [PHP] cron not allowed > how did you plan on running php from cron? Well, this works for me: 0 3 * * * lynx -dump http://mysite.com/mypage.php > /dev/null HTH Jon ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] cron not allowed
I have a php script I'd like to run at regular intervals, but my isp will not set a cron job for it but will for a perl script Is there anyway round tis, or does anyone one know of a perl script that might then execute the php script if I can get that to be automated? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] url extracting
I am yrying to read free urls from a moreover.com to a director app which will be a news reader without a browser 'm using php top extrat the headlines each headline looks similar to this ("http://c.moreover.com/click/here.pl?l27536670";) If a browser goes to this page then it is redirected to the appropriate page ie www.newssite.com/etc/etc/etc Director does not interpret the redirection. Can anyone think of a way for a script to go the to the moreover link and then return the 'real url as a variable or as an array of links (if multiple headlines are required thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Attachments again
On the attachment subject, does anyone know how to specify multiple mime types? I have my attachment script, however people may be using it to send gifs, swfs, or text files I am specifyinmg the mime types like this $type = "image/gif"; $header .= "Content-Type: $type; wuld I do something like turn $type into an array or do something like $type = "image/gif | mimetype/2 | mimetype/3 | mimetype/4"; THis doesnt seem to work (obviously mimetype/ * = a specified mime type) Thanks in advance for any suggestions Caspar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]