Jump to content

[SOLVED] Cookie problem


blufish

Recommended Posts

It's still not working...

 

Heres some code,

 

This is the create account php file (accounts/make.php)

<?php
session_start();
?>
<?php
$name = strip_tags($_POST[name]);
if (file_exists($name))
{
echo "<h1 align=center>Account name already in use!</h1>";
}
if (!file_exists($name))
{
$layout = $_POST['layout'].".css";
$time = time()+3600*24*365;
$_SESSION['user'] = $_POST['name'];
$nc = strtolower($name);
$pass = strtolower($_POST['pass']);
$pass = str_replace("a","[1]",$pass);
$pass = str_replace("b","[2]",$pass);
$pass = str_replace("c","[3]",$pass);
$pass = str_replace("d","[4]",$pass);
$pass = str_replace("e","[5]",$pass);
$pass = str_replace("f","[6]",$pass);
$pass = str_replace("g","[7]",$pass);
$pass = str_replace("h","[8]",$pass);
$pass = str_replace("i","[9]",$pass);
$pass = str_replace("j","[10]",$pass);
$pass = str_replace("k","[11]",$pass);
$pass = str_replace("l","[12]",$pass);
$pass = str_replace("m","[13]",$pass);
$pass = str_replace("n","[14]",$pass);
$pass = str_replace("o","[15]",$pass);
$pass = str_replace("p","[16]",$pass);
$pass = str_replace("q","[17]",$pass);
$pass = str_replace("r","[18]",$pass);
$pass = str_replace("s","[19]",$pass);
$pass = str_replace("t","[20]",$pass);
$pass = str_replace("u","[21]",$pass);
$pass = str_replace("v","[22]",$pass);
$pass = str_replace("w","[23]",$pass);
$pass = str_replace("x","[24]",$pass);
$pass = str_replace("y","[25]",$pass);
$pass = str_replace("z","[26]",$pass);
fopen($pass."+%+".$nc,"x");
fopen("check".$nc,"x");
file_put_contents("check".$nc,$name);
}
?>

 

This is the file that reads it (index.php):

<?php
session_start();
?>
<html>
<head>
<?php
if ($_GET['where']=='jokes/blond')
{
echo "<TITLE>Frozenoven :: Jokes :: Dumb Blonde Jokes</TITLE>";
}
if ($_GET['where']=='home')
{
echo "<TITLE>Frozenoven :: Home</TITLE>";
}
if ($_GET['where']=='customize')
{
echo "<TITLE>Frozenoven :: Customization</TITLE>";
}
if ($_GET['where']=='jokes/yourmother')
{
echo "<TITLE>Frozenoven :: Jokes :: Your Mother Jokes</TITLE>";
}
if ($_GET['where']=='jokes/6yroldbacktalk')
{
echo "<TITLE>Frozenoven :: Jokes :: 6-Year-Old-Back-Talk</TITLE>";
}
if (isset($_SESSION["user"]))
{
echo '<link rel="stylesheet" type="text/css" href="'.$_SESSION["user"].'">';
}
else
{
echo '<link rel="stylesheet" type="text/css" href="white.css">';
}
?>
<script type="text/javascript">
function go(location)
{
parent.location = location
}
</script>
</head>
<body>
<?php
if (isset($_SESSION["user"]))
{
echo "Hey ".$_SESSION["user"]."! <a href='logout.php'>Logout</a>";
}
else
{
echo "Hey Guest! <a href='http://www.frozenoven.com/index.php?where=make'>wanna customize?</a>";
}
?>
<center>
<table>
<tr>
<td align=center>
<img src="http://www.frozenoven.com/images/logo.gif" width="500" height="53.7" alt="www.frozenoven.com">
</td></tr>
<tr>
<td><table><tr>
<td width=100 valign=top>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=account">Accounts</a></p></div>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=jokes/index">Jokes</a></p></div>
</td><td valign=top>
<div class="main"><p>
<?php
$mypage = $_GET['where'];
$mypage = $mypage.".fzp";
if ($mypage==".fzp")
{
echo "<script type='text/javascript'>parent.location='http://www.frozenoven.com/index.php?where=home';</script>";
}
if (file_exists($mypage))
{
echo file_get_contents($mypage);
}
if (!file_exists($mypage))
{
echo "<h1 align=center>404 File not Found!</h1><p>Either the file you are looking for does not exist or you typed the url wrong.</p><p align=center><a href='http://www.frozenoven.com'>Home</a>";
}
?></p></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td>
<div class="ad">
<script type="text/javascript"><!--
google_ad_client = "pub-2142734016668784";
/* 728x90, created 5/30/08 */
google_ad_slot = "1701812294";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
</tr>
</table>
</center>
</body>
</html>

 

Can anyone tell me why this doesn't work?

File that reads it:

<?php
ini_set("error_reporting",E_ALL);
session_start();
?>
<html>
<head>
<?php
if ($_GET['where']=='jokes/blond')
{
echo "<TITLE>Frozenoven :: Jokes :: Dumb Blonde Jokes</TITLE>";
}
if ($_GET['where']=='home')
{
echo "<TITLE>Frozenoven :: Home</TITLE>";
}
if ($_GET['where']=='customize')
{
echo "<TITLE>Frozenoven :: Customization</TITLE>";
}
if ($_GET['where']=='jokes/yourmother')
{
echo "<TITLE>Frozenoven :: Jokes :: Your Mother Jokes</TITLE>";
}
if ($_GET['where']=='jokes/6yroldbacktalk')
{
echo "<TITLE>Frozenoven :: Jokes :: 6-Year-Old-Back-Talk</TITLE>";
}
if (isset($_SESSION["user"]))
{
echo '<link rel="stylesheet" type="text/css" href="'.$_SESSION["user"].'">';
}
else
{
echo '<link rel="stylesheet" type="text/css" href="white.css">';
}
?>
<script type="text/javascript">
function go(location)
{
parent.location = location
}
</script>
</head>
<body>
<?php
if (isset($_SESSION["user"]))
{
echo "Hey ".$_SESSION["user"]."! <a href='logout.php'>Logout</a>";
}
else
{
echo "Hey Guest! <a href='http://www.frozenoven.com/index.php?where=make'>wanna customize?</a>";
}
?>
<center>
<table>
<tr>
<td align=center>
<img src="http://www.frozenoven.com/images/logo.gif" width="500" height="53.7" alt="www.frozenoven.com">
</td></tr>
<tr>
<td><table><tr>
<td width=100 valign=top>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=account">Accounts</a></p></div>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=jokes/index">Jokes</a></p></div>
</td><td valign=top>
<div class="main"><p>
<?php
$mypage = $_GET['where'];
$mypage = $mypage.".fzp";
if ($mypage==".fzp")
{
echo "<script type='text/javascript'>parent.location='http://www.frozenoven.com/index.php?where=home';</script>";
}
if (file_exists($mypage))
{
echo file_get_contents($mypage);
}
if (!file_exists($mypage))
{
echo "<h1 align=center>404 File not Found!</h1><p>Either the file you are looking for does not exist or you typed the url wrong.</p><p align=center><a href='http://www.frozenoven.com'>Home</a>";
}
?></p></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td>
<div class="ad">
<script type="text/javascript"><!--
google_ad_client = "pub-2142734016668784";
/* 728x90, created 5/30/08 */
google_ad_slot = "1701812294";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
</tr>
</table>
</center>
</body>
</html>
<?php
ini_set("error_reporting",E_ALL);
?>

 

code that writes it:

<?php
ini_set("error_reporting",E_ALL);
session_start();
?>
<?php
$name = strip_tags($_POST[name]);
if (file_exists($name))
{
echo "<h1 align=center>Account name already in use!</h1>";
}
if (!file_exists($name))
{
$layout = $_POST['layout'].".css";
$time = time()+3600*24*365;
$_SESSION['user']= $_REQUEST['name'];
$nc = strtolower($name);
$pass = strtolower($_POST['pass']);
$pass = str_replace("a","[1]",$pass);
$pass = str_replace("b","[2]",$pass);
$pass = str_replace("c","[3]",$pass);
$pass = str_replace("d","[4]",$pass);
$pass = str_replace("e","[5]",$pass);
$pass = str_replace("f","[6]",$pass);
$pass = str_replace("g","[7]",$pass);
$pass = str_replace("h","[8]",$pass);
$pass = str_replace("i","[9]",$pass);
$pass = str_replace("j","[10]",$pass);
$pass = str_replace("k","[11]",$pass);
$pass = str_replace("l","[12]",$pass);
$pass = str_replace("m","[13]",$pass);
$pass = str_replace("n","[14]",$pass);
$pass = str_replace("o","[15]",$pass);
$pass = str_replace("p","[16]",$pass);
$pass = str_replace("q","[17]",$pass);
$pass = str_replace("r","[18]",$pass);
$pass = str_replace("s","[19]",$pass);
$pass = str_replace("t","[20]",$pass);
$pass = str_replace("u","[21]",$pass);
$pass = str_replace("v","[22]",$pass);
$pass = str_replace("w","[23]",$pass);
$pass = str_replace("x","[24]",$pass);
$pass = str_replace("y","[25]",$pass);
$pass = str_replace("z","[26]",$pass);
fopen($pass."+%+".$nc,"x");
fopen("check".$nc,"x");
file_put_contents("check".$nc,$name);
}
?>

code:

 

<html>
<head>
<?php
ini_set('error_reporting',E_ALL); //error reporting
if ($_GET['where']=='jokes/blond')
{
echo "<TITLE>Frozenoven :: Jokes :: Dumb Blonde Jokes</TITLE>";
}
if ($_GET['where']=='home')
{
echo "<TITLE>Frozenoven :: Home</TITLE>";
}
if ($_GET['where']=='customize')
{
echo "<TITLE>Frozenoven :: Customization</TITLE>";
}
if ($_GET['where']=='jokes/yourmother')
{
echo "<TITLE>Frozenoven :: Jokes :: Your Mother Jokes</TITLE>";
}
if ($_GET['where']=='jokes/6yroldbacktalk')
{
echo "<TITLE>Frozenoven :: Jokes :: 6-Year-Old-Back-Talk</TITLE>";
}
if (isset($_SESSION['user']))
{
echo '<link rel="stylesheet" type="text/css" href="'.$_SESSION['user'].'">';
}
else
{
echo '<link rel="stylesheet" type="text/css" href="white.css">';
}
?>
<script type="text/javascript">
function go(location)
{
parent.location = location
}
</script>
</head>
<body>
<?php
if (isset($_SESSION['user']))
{
echo "Hey ".$_SESSION['user']."! <a href='logout.php'>Logout</a>";
}
else
{
echo "Hey Guest! <a href='http://www.frozenoven.com/index.php?where=make'>wanna customize?</a>";
}
?>
<center>
<table>
<tr>
<td align=center>
<img src="http://www.frozenoven.com/images/logo.gif" width="500" height="53.7" alt="www.frozenoven.com">
</td></tr>
<tr>
<td><table><tr>
<td width=100 valign=top>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=account">Accounts</a></p></div>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=jokes/index">Jokes</a></p></div>
</td><td valign=top>
<div class="main"><p>
<?php
$mypage = $_GET['where'];
$mypage = $mypage.".fzp";
if ($mypage==".fzp")
{
echo "<script type='text/javascript'>parent.location='http://www.frozenoven.com/index.php?where=home';</script>";
}
if (file_exists($mypage))
{
echo file_get_contents($mypage);
}
if (!file_exists($mypage))
{
echo "<h1 align=center>404 File not Found!</h1><p>Either the file you are looking for does not exist or you typed the url wrong.</p><p align=center><a href='http://www.frozenoven.com'>Home</a>";
}
?></p></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td>
<div class="ad">
<script type="text/javascript"><!--
google_ad_client = "pub-2142734016668784";
/* 728x90, created 5/30/08 */
google_ad_slot = "1701812294";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
</tr>
</table>
</center>
</body>
</html>

request should work fine to my knowledge. it should request the name field and retrieve it from the database. :P

 

 

code:

 

<html>
<head>
<?php
ini_set('error_reporting',E_ALL); //error reporting
if ($_GET['where']=='jokes/blond')
{
echo "<TITLE>Frozenoven :: Jokes :: Dumb Blonde Jokes</TITLE>";
}
if ($_GET['where']=='home')
{
echo "<TITLE>Frozenoven :: Home</TITLE>";
}
if ($_GET['where']=='customize')
{
echo "<TITLE>Frozenoven :: Customization</TITLE>";
}
if ($_GET['where']=='jokes/yourmother')
{
echo "<TITLE>Frozenoven :: Jokes :: Your Mother Jokes</TITLE>";
}
if ($_GET['where']=='jokes/6yroldbacktalk')
{
echo "<TITLE>Frozenoven :: Jokes :: 6-Year-Old-Back-Talk</TITLE>";
}
if (isset($_SESSION['user']))
{
echo '<link rel="stylesheet" type="text/css" href="'.$_SESSION['user'].'">';
}
else
{
echo '<link rel="stylesheet" type="text/css" href="white.css">';
}
?>
<script type="text/javascript">
function go(location)
{
parent.location = location
}
</script>
</head>
<body>
<?php
if (isset($_SESSION['user']))
{
echo 'Hey "'.$_SESSION['user'].'"! <a href=logout.php>Logout</a>';
}
else
{
echo "Hey Guest! <a href='http://www.frozenoven.com/index.php?where=make'>wanna customize?</a>";
}
?>
<center>
<table>
<tr>
<td align=center>
<img src="http://www.frozenoven.com/images/logo.gif" width="500" height="53.7" alt="www.frozenoven.com">
</td></tr>
<tr>
<td><table><tr>
<td width=100 valign=top>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=account">Accounts</a></p></div>
<div class="side"><p class="option"><a href="http://www.frozenoven.com/index.php?where=jokes/index">Jokes</a></p></div>
</td><td valign=top>
<div class="main"><p>
<?php
$mypage = $_GET['where'];
$mypage = $mypage.".fzp";
if ($mypage==".fzp")
{
echo "<script type='text/javascript'>parent.location='http://www.frozenoven.com/index.php?where=home';</script>";
}
if (file_exists($mypage))
{
echo file_get_contents($mypage);
}
if (!file_exists($mypage))
{
echo "<h1 align=center>404 File not Found!</h1><p>Either the file you are looking for does not exist or you typed the url wrong.</p><p align=center><a href='http://www.frozenoven.com'>Home</a>";
}
?></p></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td>
<div class="ad">
<script type="text/javascript"><!--
google_ad_client = "pub-2142734016668784";
/* 728x90, created 5/30/08 */
google_ad_slot = "1701812294";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
</tr>
</table>
</center>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.