Printing string with submit<

liunx

Guest
Hi, I was wondering how would I go about printing out a variable that you would type in a text box then on submit it would print it.

I am just doing to to play around with and to learn PHP.

Here is the code I am trying
<form>
<input type="text" name="$name">
<input name="$crypt" type="submit" value="Submit">
</form>
<?php
$crypt = md5("$name");
print ("$crypt");

?>you shouldn't place a $ in the name in the form
so
<form method="GET">
<input type="text" name="name">
<input name="crypt" type="submit" value="Submit">
</form>
<?php
echo md5($name); // or echo md5($_GET['name']);
?>hey all, it's been awhile since i last posted, i guess that web development hasnt been interesting me lately, but im starting to get back into it :) anyway, heres a little thing i wrote while i was into it. I used this when I was developing a script with login, I would forget the passwords while i was testing multiple users, so i made this so i could just replace it manually through phpmyadmin, anyway, here it is.

<html>
<head><title>md5 it!</title>
</head>
<body>
<?php

echo "<font color=\"#FF0000\">You <b>MUST</b> press <i>MD5IT!</i> for the encryption to work....</font>\n" .
"<form action=\"md5it!.php\" method=\"post\">\n" .
"<input type=\"text\" name=\"string\">\n" .
"<input type=\"submit\" name=\"submit\" value=\"MD5IT!\">\n" .
"<form><br><hr>\n";

if (isset($_POST['submit'])) {
if (empty($_POST['string'])) {
echo "String has no value";
} else {
$md5string = md5($_POST['string']);
echo "Original Password: " . $_POST['string'] . "<br>\n" .
"md5'd Password: " . $md5string . "<br>\n";
}
}
?>
</body>
</html>

hope this helps you :)
Jacobxxnfg618xx: read your pm's.
 
Top