thanx Im going to rather submit the same file and use validation to display the bottom in the same page ( part of the same page)
-----Original Message----- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Monday, February 16, 2004 4:07 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] include a file Angelo Zanetti wrote: > Hi, > > is it possible to include a file from when a select's onChange is called ie: > > <select name="prospects" onChange="include(editBottom.inc);"> > > if its possible what would be the best way to do this?? > > thanx > It is, but you have to reload the page and pass the filename as request variable: <?php $allowed_files = array('editBottom.inc' => 'Bottom', 'editTop.inc' => 'Top'); ?> <form action="script.php"> <select name="prospects" onChange="this.form.submit();"> <?php foreach($allowed_files as $key => $name) echo "<option value=\"$key\">$name</option>\n"; ?> </select> <input type="submit" value=">>"><!-- for nonjavascript brobsers --> </form> <?php if(array_key_exists($_GET['prospects'], $allowed_files)) { include($_GET['prospects']); } ?> HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -------------------------------------------------------------------- Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php