Join us at IRC!
One mans freedom fighter, another's terrorist.
Friday, May 25, 2012
Navigation
Members Online
Total Online: 27
Web Spiders: 13
Guests Online: 26
Members Online: 1

Registered Members: 70208
Newest Member: andresuran
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

php

vinelander
Member

Posts: 42
Location: NJ
Joined: 25.11.07
Rank:
Hacker Level 2
Posted on 02-07-08 18:55
ok I am going to show you this scblockedript 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";)
{
setcookie("krystal", "krystal", time()+3600);
}
?>

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


In the days when there is only darkness I shine through the night



vinelander@hotmail.com rhymez4life@yahoo.com www.projectspeak.info
Author

RE: php

mastergamer
Member



Posts: 432
Location:
Joined: 07.02.06
Rank:
God
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 mastergamer on 02-07-08 19:00
mastergamer0168@gmail.com
Author

RE: php

Mephisto
Member

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




DON'T PANIC
Author

RE: php

mastergamer
Member



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


And is it called home.php?


mastergamer0168@gmail.com
Author

RE: php

vinelander
Member

Posts: 42
Location: NJ
Joined: 25.11.07
Rank:
Hacker Level 2
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.


In the days when there is only darkness I shine through the night



vinelander@hotmail.com rhymez4life@yahoo.com www.projectspeak.info
Author

RE: php

Feralas
Member



Posts: 301
Location: 127.0.0.1
Joined: 25.02.08
Rank:
HBH Guru
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.



/-- Ipsa Scientia Potestas Est --\



\-- Knowledge itself is power. --/


To fear death is to limit life.
google.com
Author

RE: php

themastersinner
Member

Posts: 27
Location:
Joined: 03.12.07
Rank:
God
Posted on 02-07-08 21:42
try

<?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 themastersinner on 02-07-08 21:46
Author

RE: php

c24lightning
Member

Posts: 41
Location: The infinite insanity of thought
Joined: 24.12.07
Rank:
Active User
Posted on 02-07-08 21:45
Just make sure it executes properly - make a page called test.php and put


<? 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).




I'm a little more known over at HackThisSite (my profile). (If it says "Bad Referer", click on the URL bar and press enter.)
I despised my rank of "Newbie."
Author

RE: php

fashizzlepop
Member



Posts: 482
Location: Old folks home.
Joined: 08.04.08
Rank:
Uber Elite
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~


fashizzlepop@gmail.com http://csullivan.codeinspire.net/
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.