[PHP] html forms and php

2006-01-31 Thread Philippe Reynolds


Greetings all,

Currently I have a form that has two lists that contain options.
I use javacript to dynamically move options from one select list to another.
All this works fine...


this is the select:

select name=trucklist size=12 style=width: 150px multiple
 option value=LT680LT680/option
 option value=LT685LT685/option
 option value=LT690LT690/option
 option value=LT695LT695/option
 option value=LT700LT700/option
 option value=LT705LT705/option
 /select

Now I wish to post all the options from one list to another page.  So I 
select all the options in that list and hit the submit button.


Obviously, a select list, will return each value with the same name to the 
second web page.  Therefore we can only capture the last option posted.


To resolve this we have to create an array out of our select name:
select name=trucklist[] size=12 style=width: 150px multiple

I added the square brakets to the name...now when I select all the options 
on the list I can read all values individually.


Here is problem...my javascripts have stopped working, I can't move options 
from one list to the next.  Here is the javascript I use currently...I would 
like help in modifing it so that it may work while using the brakets on the 
name of the select:


Thanks a bunch for the help!!  Always appreciated

First the two list that transmit the options back and forth: (javascript 
below)

select name=trucklist size=12 style=width: 150px multiple
 option value=LT680LT680/option
 option value=LT685LT685/option
 option value=LT690LT690/option
 option value=LT695LT695/option
 option value=LT700LT700/option
 option value=LT705LT705/option
 /select
/td
td
  input type=button name=SelectAll value= All style=width: 
100px; onClick=MoveAll(fleetForm.trucklist, fleetForm.reportinglist)br
  input type=button name=Select value= style=width: 100px; 
onClick=Move(fleetForm.trucklist, fleetForm.reportinglist)brbr
  input type=button name=Unselect value= style=width: 100px; 
onClick=Move(fleetForm.reportinglist, fleetForm.trucklist)br
   input type=button name=UnselectAll value= All style=width: 
100px; onClick=MoveAll(fleetForm.reportinglist, fleetForm.trucklist)

/td
td
 select name=reportinglist[] size=12 style=width: 150px multiple


here is the javascript:
function Move(fromList, toList){
   var tempArray = new Array();
   var x = 0;

   //looping through source element to find selected options
   for (var i = 0; i  fromList.length; i++) {
   if (fromList.options[i].selected) {
   //need to move this option to the 'to' list
   var selectionLen = toList.length++;
   toList.options[selectionLen].text = 
fromList.options[i].text;
   toList.options[selectionLen].value = 
fromList.options[i].value;

   }
else {
//storing options that stay to recreate selected trucks
var tempValues = new Object();
tempValues.text = fromList.options[i].text;
tempValues.value = fromList.options[i].value;
tempArray[y] = tempValues;
y++;
   }

   }
   //resetting length of 'from' list
   fromList.length = tempArray.length;
   //looping through temp array to recreate intial selection
   for (var i = 0; i  tempArray.length; i++) {
   fromList.options[i].text = tempArray[i].text;
   fromList.options[i].value = tempArray[i].value;
   fromList.options[i].selected = false;
   }
}
function MoveAll(from, to){
selectAll(from);
Move(from, to);
}
function selectAll(trucklist) {
if (!hasTruck(trucklist)) { return; }
for (var i=0; itrucklist.options.length; i++)
trucklist.options[i].selected = true;

}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] html forms and php

2006-01-31 Thread Philippe Reynolds

Awesome...that solved it!!
Thanks a bunch to everyone who contributed!!

Cheers
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] html forms in php

2005-09-15 Thread Philippe Reynolds


Good day all,

I have a problem for you all..
I have a form that has has the ability to delete a lot of information from 
my MySQL database.


I would like to create a bit of security, in case the user hits the button 
by accident.
I would like to create an additionnal window that would appear that would 
ask:
Are you sure? and then a yes and no buttons to confirm the deletion or 
to cancel the command.


Any thougts??

Thanks for the assistance
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] date parsing

2005-09-13 Thread Philippe Reynolds


Greetings all,

I am trying to find a function or a way to parse a date that has the 
following format 2005124 or 20051204.


When I have a date that has a single digit (ie month, day) all the date/time 
function seem to go bizarre.


When it is a full 8 digit string everything is fine.
When there are delimiters between year month day (ie 2005-4-23) everything 
is fine.


I tried strtotime(%Y/%m/%d, 2005124) and this is the result:
1970/01/23.

Any thoughts?

Thanks for the aid!!
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date parsing

2005-09-13 Thread Philippe Reynolds

Much appreciated all,

I was kindda hopping that I missed something, some mysterious function...

My solution to this is: if a value like 2005416 to ignore it and only look 
for 2005/4/16 or 20050416.


Cheers
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Socket functions

2005-08-30 Thread Philippe Reynolds

WOW...so much simpler..thank you very much!!

Cheers
Phil

BLOCKQUOTE style='PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #A0C6E5 
2px solid; MARGIN-RIGHT: 0px'font 
style='FONT-SIZE:11px;FONT-FAMILY:tahoma,sans-serif'hr color=#A0C6E5 
size=1
From:  iBurhan Khalid lt;[EMAIL PROTECTED]gt;/ibrTo:  iPhilippe 
Reynolds lt;[EMAIL PROTECTED]gt;/ibrCC:  
iphp-general@lists.php.net/ibrSubject:  iRe: [PHP] Socket 
functions/ibrDate:  iTue, 30 Aug 2005 09:49:22 
+0300/ibrgt;Philippe Reynolds 
wrote:brgt;gt;Greetings,brgt;gt;brgt;gt;When I do an ifconfig in 
unix, I see the the IP address for the my brgt;gt;ethernet.  It follows 
something called inet.brgt;gt;brgt;gt;Would anyone know who to 
manipulate the socket functions to be able brgt;gt;to extract the inet 
IP address fromt the eth0 section??brgt;brgt;lt;?phpbrgt;brgt;  
 exec('ifconfig eth0 | grep 
inet',$output);brgt;preg_match(quot;|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|quot;,$output[0],$matches);brgt; 
  echo $matches[0];brgt;brgt;?gt;br/font/BLOCKQUOTE


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] LAN IP address

2005-08-29 Thread Philippe Reynolds

Hi all,

I would like to find a way to get my computers LAN IP address through PHP.  
I tried using the gethostbyname(HOSTNAME) function, however I only got 
back the 127.0.0.1 address.


Any help is always appreciated
Cheers
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LAN IP address

2005-08-29 Thread Philippe Reynolds
Yes, I would hard code my IP address but when the computer crashs the server 
assigns it a different IP address, so I have to make my code a tad more 
dynamic...


I havn't touched Java in a while, would you know the function for that?

Thanks again

I think you want to get the internal IP adress which computer uses? Am I 
right?
If yes, that is not possible with PHP directly, but it is possible with 
Java and PHP


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Socket functions

2005-08-29 Thread Philippe Reynolds

Greetings,

When I do an ifconfig in unix, I see the the IP address for the my ethernet. 
 It follows something called inet.


Would anyone know who to manipulate the socket functions to be able to 
extract the inet IP address fromt the eth0 section??


Cheers
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] problem with IE and php

2005-06-08 Thread Philippe Reynolds

Hi all,

I running two php web page...therefore the page name has the .php on the 
end.
The first page contains a form with a submit button at the botton.  That 
submit button actions the second .php page.


When I use my firefox browser everything works fine.
When I use Internet Explorer, the submit button does not work.

the button is the following:
trtd
input type=submit name=submit value=Commit
/td/tr

Could the html be treated differently when there is php around it or maybe 
when we use .php could the html be treated differently?


Oh yeah, I created a duplicate of the pages with no php and had the two 
pages marked as .html and the button worked fine.


Any help would be great.

CHeers
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] problem between IE and PHP

2005-06-08 Thread Philippe Reynolds

Hi all,

I'm having a little problem with the interaction between php and IE.

I have two .php pages.

The first contains a form with the standard submit button.  However when I 
come to push the button, I get a ding sound (standard error sound) and it 
seems like the button is deactivated.  However when I try with my firefox 
browser, everything works fine.


I then created a duplicate of the page, with no php and saved it as a 
.html file.

With internet explorer and firefox, everything worked fine.

I do not understand how this can be.  Is Internet Explorer treated the php 
differently?


Any help would be greatly appreciated.

Cheers
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with IE and php

2005-06-08 Thread Philippe Reynolds

Hey,

yeah I do have form tags.  They are the following:
form name=NAME method=GET action=Secondpage.php

input...
/form

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with IE and php

2005-06-08 Thread Philippe Reynolds

Acutally, I have just resolved my problem.

I was using method=get in my form (which contains at least a hundred 
values to be passed back).  This overloaded the address length and therefore 
could not and would not action the second page.


I switch to method=post in my form (which does not pass everything to the 
address line, and therefore allowing the second page to be actionned..


That to all you, who had input in this problem.

Cheers
Phil

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php