Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Sunday, April 20, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 22
Members Online: 1

Registered Members: 82843
Newest Member: hx47
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 18:55
ok I am going to show you this script that is from my site and the issue that I am having is the fact that when you go to the site and hit enter it actuially shows you its own source

<form>
<form action="home.php" method="GET">
<b>Username:</b><input type="text" name="username" id="username" />
<b>password:</b><input type="password" name="password" id="password" />
<input type="submit" value="submit" id="submit" />
</form>
<?php
if ($_GET['username'] == "krystal" && $_GET['password'] =="vineland"Wink
{
setcookie("krystal", "krystal", time()+3600);
}
?>

<?php
if (isset($_COOKIE["krystal"]))
echo "Welcome " . $_COOKIE["krystal"] . "!<br />";
else
echo "Welcome guest!<br />";
?>


Author

RE: php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 18:59
Is your webserver set up correctly to execute PHP?

Also, you might wanna look at using sessions for that kind of login, and using POST instead of GET for logins. Basing your authentication solely on whether a cookie is set is bad.




Edited by on 02-07-08 19:00
Author

RE: php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 19:02
Is the extension of the file .php?


Author

RE: php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 19:43
Mephisto wrote:
Is the extension of the file .php?


And is it called home.php?


Author

RE: php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 21:33
mastergamer wrote:
Is your webserver set up correctly to execute PHP?

Also, you might wanna look at using sessions for that kind of login, and using POST instead of GET for logins. Basing your authentication solely on whether a cookie is set is bad.


the php is executing fine the only issue i am having now is the fact that it is showing the source code.


Author

RE: php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 21:39
vinelander wrote:
the php is executing fine the only issue i am having now is the fact that it is showing the source code.


The PHP wouldn't be executing correctly if it is viewable in the source code.


Author

RE: php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 21:42
try

Code
<?php
if ($_GET['username'] == "krystal" && $_GET['password'] =="vineland")
{
setcookie("krystal", "krystal", time()+3600);
}
?>
<form action="home.php" method="GET">
<b>Username:</b><input type="text" name="username" id="username" />
<b>password:</b><input type="password" name="password" id="password" />
<input type="submit" value="submit" id="submit" />
</form>


<?php
if (isset($_COOKIE['krystal']))
echo "Welcome " . $_COOKIE['krystal'] . "!<br />";
else
echo "Welcome guest!<br />";
?>




Edited by on 02-07-08 21:46
Author

RE: php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-07-08 21:45
Just make sure it executes properly - make a page called test.php and put

Code

<? echo "testing"; ?>




as the source. If it doesn't show only the text testing, it isn't executing properly. If it's not executing properly, you need a new host, for example, the one in my sig (yes, it's free).


Author

RE: php

fashizzlepop
Member



Posts: 482
Location: Old folks home.
Joined: 08.04.08
Rank:
Moderate
Posted on 03-07-08 02:06
Possibly you are using Notepad?

When you save in notepad it auto saves as a .txt

So if you put the name index.php it will save as index.php.txt and you will see the source code.

So make sure that under FILE TYPE it says "All files" not " Text file *.txt"

That might be your problem.



"The definition of insanity is doing the same thing over and over again and expecting different results.
~Albert Einstein~


csullivan.codeinspire.net/images/boomsig2.png
fashizzlepop@gmail.com http://csullivan.codeinspire.net/