magie Posted February 4, 2009 Share Posted February 4, 2009 Hi, i have a variable like this, with this array. Now i just wannt my result instead of a Echo, i wannt it in my HTML form. Like when i press Show it writes the result from my php file in the form field. <?php srand((float) microtime() * 10000000); $input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); $rand_keys = array_rand($input, 2); echo $input[$rand_keys[0]] . "\n"; echo $input[$rand_keys[1]] . "\n"; ?> Link to comment https://forums.phpfreaks.com/topic/143724-show-variable/ Share on other sites More sharing options...
Maq Posted February 4, 2009 Share Posted February 4, 2009 It's unclear what you want but if I had to guess, try this: if(isset($_POST['submit'])) { echo ""; } srand((float) microtime() * 10000000); $input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); $rand_keys = array_rand($input, 2); ?> </pre> <form method="POST" action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>"> < Link to comment https://forums.phpfreaks.com/topic/143724-show-variable/#findComment-754122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.