Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

[HELP!] Php testing page!

Hello guys,

When I pop up this code I have just written,
I get some syntax with numbers in the front of my text! - why is that. :(...

I can't figure that out. I was wondering if it has some to do with my FORM input's ??
Hope you guys can help me out 🤝 Thanks! 😈

Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Susp3cT Testing ZONE!</title>
    <meta http-equiv="content-type"
        content="text/html;charset=utf-8" />
</head>
<SCRIPT language=JavaScript>
    var message = "Copyright - Susp3cT";
    function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){     alert(message); return false; }
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {     alert(message);     return false; } }
    document.onmousedown = rtclickcheck;
</SCRIPT>


<body [b]onload=[/b]"type_text()" ; bgColor=black text=#4d5e49><center>
<div align="center"><img src="http://dl.dropbox.com/u/66529409/susp3cth4x2.png" >
<div style="width: 900px;height: 100px;" align="center">


<form method="POST" action="news.php">
<input type="text" name="UserName"><br>
<input type="password" name="PassWord" value="password"><br>
<input type="submit" value="Submit" name="SubmitLogin"><br>
</form><br><hr>


<form method="POST" action="news.php">
<input type="test" name="Recover Password!">
<input type="submit" value="Recover Password!" name="RecoverPass"><br>
<a href="./forgotpass.php">Forgot password?</a>


<?php

$username = "Susp3cT";
$recover = 'RecoverPass';
if (isset($_POST['SubmitLogin'])){
    $username = $_POST['UserName'];
    $password = $_POST['PassWord'];
    echo "You are the best, " . $username || " This is NOT, the right username!";
}else{
    echo "<br>You need to enter something buddy!";
}

if (isset($_POST['Submitlogin'])){
    $recover = $_POST['RecoverPass'];
    echo "You\'re password is: " .$recover;


}else{
    echo "<br>You did not enter a correct username buddy!<br>" or die;
} if (isset($username ['Susp3cT'])){
    echo "<br><strong>You entered the right username!</strong> " or die;
}else{
    echo "This is not the correct username buddy";
}

?>
</body>
</html>


Do not comment on this, if you got some negative to say, about my code, well then you are welcome to FUCK OFF! - I do not tolerate people telling " Hey you did not wrote that code" - Listen, this is my own damn code, so Don't try it skid! 😈
It would help if you would tell us WHERE it is saying it. and WHAT it is saying . . .
(Apr 15, 2012 02:06 PM)Susp3cT Wrote:  Hello guys,

When I pop up this code I have just written,
I get some syntax with numbers in the front of my text! - why is that. :(...

I can't figure that out. I was wondering if it has some to do with my FORM input's ??
Hope you guys can help me out 🤝 Thanks! 😈

Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Susp3cT Testing ZONE!</title>
    <meta http-equiv="content-type"
        content="text/html;charset=utf-8" />
</head>
<SCRIPT language=JavaScript>
    var message = "Copyright - Susp3cT";
    function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){  alert(message); return false; }
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {  alert(message);  return false; } }
    document.onmousedown = rtclickcheck;
</SCRIPT>

<body [b]onload=[/b]"type_text()" ; bgColor=black text=#4d5e49><center>
<div align="center"><img src="http://dl.dropbox.com/u/66529409/susp3cth4x2.png" >
<div style="width: 900px;height: 100px;" align="center">

<form method="POST" action="news.php">
<input type="text" name="UserName"><br>
<input type="password" name="PassWord" value="password"><br>
<input type="submit" value="Submit" name="SubmitLogin"><br>
</form><br><hr>

<form method="POST" action="news.php">
<input type="test" name="Recover Password!">
<input type="submit" value="Recover Password!" name="RecoverPass"><br>
<a href="./forgotpass.php">Forgot password?</a>

<?php

$username = "Susp3cT";
$recover = 'RecoverPass';
if (isset($_POST['SubmitLogin'])){
    $username = $_POST['UserName'];
    $password = $_POST['PassWord'];
    echo "You are the best, " . $username || " This is NOT, the right username!";
}else{
    echo "<br>You need to enter something buddy!";
}

if (isset($_POST['Submitlogin'])){
    $recover = $_POST['RecoverPass'];
    echo "You\'re password is: " .$recover;

}else{
    echo "<br>You did not enter a correct username buddy!<br>" or die;
} if (isset($username ['Susp3cT'])){
    echo "<br><strong>You entered the right username!</strong> " or die;
}else{
    echo "This is not the correct username buddy";
}

?>
</body>
</html>

Do not comment on this, if you got some negative to say, about my code, well then you are welcome to FUCK OFF! - I do not tolerate people telling " Hey you did not wrote that code" - Listen, this is my own damn code, so Don't try it skid! 😈

If you were to have written it, than you would know what the error came from.
You dont know how to program, you just copy and pasted some shit together and it doesn't work.

Than you blandly spout out that you MADE it yourself, and expect us to help you?
Sorry, but if you're a liar from the start I aint gonna support that.

His original thread: https://hackforums.net/showthread.php?tid=2405924
Writing the code that you wrote there isn't much of an accomplishment... It would help if you told us the error...
internet tough guy.

try and hack me, my ip is 127.0.0.1

"say that to my face and not online and see what happens" - you
Did figure out the flaw my self...
I needed to add a or die;
Code
if (isset($user['Susp3cT'])){
    echo "<br><strong>You entered the right username!</strong> " or die;

This is solved my problem...
(Apr 16, 2012 12:36 AM)Susp3cT Wrote:  Did figure out the flaw my self...
I needed to add a or die;
Code
if (isset($user['Susp3cT'])){
    echo "<br><strong>You entered the right username!</strong> " or die;

This is solved my problem...

And the award for the most useless and misunderstood logic goes to.... Susp3cT! Congrats mate, this made me laugh irl ;)
PHP Code

<?php 
echo "text output..." or die(); 
@Susp3ct, acting childish and making frivolous remarks is not helping your situation. You are a novice asking for help and you should do so courteously if you would like serious answers.

Lets take your code out of the code tags and highlight it with the following key to see three things:
  • Things you've done wrong.

  • Things you can improve on.

  • Things you've done correctly.


I am only highlighting your PHP code, though for the record your HTML is far from decent. Also ignore the hiphens; they are used to indent your code for better legibility.

<?php

$username = "Susp3cT";
$recover = 'RecoverPass';
if (isset($_POST['SubmitLogin']))
{
- - -$username = $_POST['UserName'];
- - -$password = $_POST['PassWord'];
- - -echo "You are the best, ".$username || " This is NOT, the right username!";
}
else
{

- - -echo "<br>You need to enter something buddy!";
}

if (isset($_POST['Submitlogin']))
{
- - -$recover = $_POST['RecoverPass'];
- - -echo "You\'re password is: ".$recover;
}
else
{

- - -echo "<br>You did not enter a correct username buddy!<br>" or die;
}

if (isset($username['Susp3cT']))
{
- - -echo "<br><strong>You entered the right username!</strong> " or die;
}
else
{

- - -echo "This is not the correct username buddy";
}

?>


Right, now that i have showed you where you have gone wrong and where you need to/should improve upon, lets see how you would correct the above. I'm doing this to benefit your learning instead of me just telling you the answer.

Side Note: That is being lenient with the above highlighting. In reality the above code does not work at all because you haven't added checks, such as seeing if your $_POST associative array data has values.
PHP internals developer
(Apr 16, 2012 01:44 AM)Haxalot Wrote:  @Susp3ct, acting childish and making frivolous remarks is not helping your situation. You are a novice asking for help and you should do so courteously if you would like serious answers.

Lets take your code out of the code tags and highlight it with the following key to see three things:
  • Things you've done wrong.

  • Things you can improve on.

  • Things you've done correctly.


I am only highlighting your PHP code, though for the record your HTML is far from decent. Also ignore the hiphens; they are used to indent your code for better legibility.

<?php

$username = "Susp3cT";
$recover = 'RecoverPass';
if (isset($_POST['SubmitLogin']))
{
- - -$username = $_POST['UserName'];
- - -$password = $_POST['PassWord'];
- - -echo "You are the best, ".$username || " This is NOT, the right username!";
}
else
{

- - -echo "<br>You need to enter something buddy!";
}

if (isset($_POST['Submitlogin']))
{
- - -$recover = $_POST['RecoverPass'];
- - -echo "You\'re password is: ".$recover;
}
else
{

- - -echo "<br>You did not enter a correct username buddy!<br>" or die;
}

if (isset($username['Susp3cT']))
{
- - -echo "<br><strong>You entered the right username!</strong> " or die;
}
else
{

- - -echo "This is not the correct username buddy";
}

?>


Right, now that i have showed you where you have gone wrong and where you need to/should improve upon, lets see how you would correct the above. I'm doing this to benefit your learning instead of me just telling you the answer.

Side Note: That is being lenient with the above highlighting. In reality the above code does not work at all because you haven't added checks, such as seeing if your $_POST associative array data has values.

Don't worry I fixed it.. .It's working perfectly..
I did remove the RecoverPass, since I did not use it.

This is for testing purposes. Like SQLi, XSS and so on I'm going to develop it furthermore. There will be functions to enumerate information on how to secure a site against SQLi, XSS, LFI, RFI. Like tab functions 😈
Its funny that you've managed to go from 0 to -27 rep in a day, and still think that you're smart.
If we look at your code, anyone can tell that its written by someone who just started programming.
First: Your*

Second:
If your knowledge includes coding shit in formats like:
Code
echo "You are the best, ".$username || " This is NOT, the right username!";
That you can better say that you dont have a knowledge at all.

I suppose that you wanted to use a one line if statement.
Than the correct format would be:

Code
if($_POST['username'] == $user) ? "You are the best".$user : "This is NOT, the right username!";
(Apr 16, 2012 04:42 AM)Susp3cT Wrote:  Rep is not my life, you little fag.. It might be you're life. But at least, I get what I need. You guys are just jaloux cause things in life are not going as it should. 😈

You might want to take a break behind the PC, and start dating you fag.
I really do not give a damn if people is minus repping me. I am not asking for rep or anything. I got my knowledge, and I'm proud of it. 🤫 ... So GTFO you little skid, which only spend his life on farming rep on a forum.

lmfao, you would of been better off telling us you DID copy and paste that code because it's absolute garbage.

get out of here with your elitist view, your work doesn't match your ego
(Apr 16, 2012 04:45 AM)[H]ell Wrote:  First: Your*

Second:
If your knowledge includes coding shit in formats like:
Code
echo "You are the best, ".$username || " This is NOT, the right username!";
That you can better say that you dont have a knowledge at all.

I suppose that you wanted to use a one line if statement.
Than the correct format would be:

Code
if($_POST['username'] == $user) ? "You are the best".$user : "This is NOT, the right username!";

Actually that's not correct either [H]ell.
Use either the ternary operator or the if-statement, not both.

Ternary operator:

PHP Code

<?php 
echo ($_POST['username'] == $user) ? "You are the best {$user}" : "This is NOT, the right username!"; 

If-statement:

PHP Code

<?php 
if ($_POST['username'] == $user) echo "You are the best {$user}";
else echo 
"This is NOT, the right username!"; 
Hashable.io - crowd-sourced hash cracking

"Ooh and our gods and heroes,
are only ones and zeroes.
Join hands and sing along.
Everything we know is wrong."
(Apr 16, 2012 03:11 PM)AntiPaste Wrote:  Actually that's not correct either [H]ell.
Use either the ternary operator or the if-statement, not both.

Ternary operator:

PHP Code

<?php 
echo ($_POST['username'] == $user) ? "You are the best {$user}" : "This is NOT, the right username!"; 

If-statement:

PHP Code

<?php 
if ($_POST['username'] == $user) echo "You are the best {$user}";
else echo 
"This is NOT, the right username!"; 

Wrong... This is the right way.

[code]
PHP Code

<?php 
if ($_POST['username'] == $user) echo "You are the best .$user"{
return 
true;
}else {
echo 
"This is NOT, the right username!";
} 
(Apr 16, 2012 03:11 PM)AntiPaste Wrote:  Actually that's not correct either [H]ell.
Use either the ternary operator or the if-statement, not both.

Ternary operator:

PHP Code

<?php 
echo ($_POST['username'] == $user) ? "You are the best {$user}" : "This is NOT, the right username!"; 

If-statement:

PHP Code

<?php 
if ($_POST['username'] == $user) echo "You are the best {$user}";
else echo 
"This is NOT, the right username!"; 

yeahh, thats my bad. was typing it while on the train.
Sorry for the mistake.

(Apr 16, 2012 03:36 PM)Susp3cT Wrote:  Wrong... This is the right way.

[code]
PHP Code

<?php 
if ($_POST['username'] == $user) echo "You are the best .$user"{
return 
true;
}else {
echo 
"This is NOT, the right username!";
} 

Alright, now you're just trolling.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by stuped200Aug 4, 2012 06:07 AM 5 191 Aug 4, 2012 06:07 AM
Last Post: stuped200
[PHP] by CrazerMay 13, 2012 11:26 AM 6 170 May 13, 2012 11:26 AM
Last Post: YERANUK
[PHP] by tommaydpDec 15, 2011 04:35 AM 3 179 Dec 15, 2011 04:35 AM
Last Post: UnBoRn_HaCkEr