Jump to content

Show Variable


magie

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.