At 20.04.2002 15:06, you wrote: > >Hi, >I'm new to php, I want to do the foll: in my code: >display an array of names to the user, >up, down, top and bottom buttons are provided so that the user can change >the order of the names (e.g. if original array: "a, b, c, d, e and user >selects e and presses top array should become e, a, b..... > >I am able to achieve this functionality however since the whole script is >executed each time the array gets redefined after each button press thus >it remains a, b, c,d ... > >Finally I've a submit button, if this is pressed user should be able to go >back and do whatever he was doing with the names. > >my code looks like this: >define array >html for presentation (form which goes to function changelayerorder()) >function changelayerorder (this func. detects which button and name was >selected and changes order) > >I tried a while loop (while submit button not pressed) {do ...} >but it results in the page never being able to load. >CAN ANYONE ADVISE ME HOW TO AVOID REDEFINING THE ARRAY. THANKS, > > >-Pushkar S. Pradhan Just think, you send the page to the clients browser, you (PHP) donīt have control what happens on the clients side! Maybe you can split the functionality in separate, so if the client sends some vars, only a part depending on if, else or switch is done by php. Or (as last option) use JavaScript, which is client side but not always available.
Best is to redesign your software, pages to avoid such conflicts. And, if you want to include all users just use html-code wich will work on most browsers. HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php