Jump to content

Can someone PLEASE help me?


Xyphon

Recommended Posts

Here is my top

 

<?php
include('Connect.php');
/* If logged out */
if (!isset($_COOKIE['UserID'])) {
echo "
<html>
<title> Pokemon Trainer's Challenge RPG </title>

<head>
<style type='text/css'>
A:link { color: #AFAFAF; text-decoration: underline; }
A:visited { color: #AFAFAF; text-decoration: underline; }
A:hover { color: #D0D0D0; text-decoration: none; } 

body 
{
background-color: #000000;
background-image: url('Url here if you have a background image');
scrollbar-face-color: #000000;
scrollbar-highlight-color: #000000;
scrollbar-shadow-color: #000000;
scrollbar-darkshadow-color: #545454;
scrollbar-3d-lightcolor: #545454;
scrollbar-arrow-color: #ffffff;
scrollbar-track-color: #545454;
}

.tables
{ border: 1px solid #252525; background-color: #313131;} 
.menus
{ width: 130px; border: 0px solid #575757; background-color: #313131;} 
.content
{ border: 0px solid #707070; background-color: #4F4F4F;} 
.disclaimer
{ border: 1px solid #252525; background-color: #313131;} 

</style>



</head>


<body>
<div align='center'>
<!--BANNER-->
<table class='tables' cellpadding='0' cellspacing='0' width='750' height='180'>
<tr><td>
<center>
<font face='verdana' color='#FFFFFF' size='6'><a href='index.php'>
<img border='0' src='http://i3.tinypic.com/7xaet08.jpg'>

</font>
</tr></td>
</table>
<!--END of BANNER-->

<!--LEFT MENU-->
<table class='tables' cellpadding='4' cellspacing='0' width='750' height='250'>
<tr><td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Main</b><br>
<a href='index.php'>Home</a><br>
<a href='register.php'>Register</a><br>
<a href='login.php'>Log in</a><br>
</CENTER>
</td>
<!--END of LEFT MENU-->


<!--CONTENT-->
<td class='content' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<div align='justify'>
<br>
";
}
if (isset($_COOKIE['UserID'])) {
echo "
<html>
<title> Pokemon Trainer's Challenge RPG </title>

<head>
<style type='text/css'>
A:link { color: #AFAFAF; text-decoration: underline; }
A:visited { color: #AFAFAF; text-decoration: underline; }
A:hover { color: #D0D0D0; text-decoration: none; } 

body 
{
background-color: #000000;
background-image: url('Url here if you have a background image');
scrollbar-face-color: #000000;
scrollbar-highlight-color: #000000;
scrollbar-shadow-color: #000000;
scrollbar-darkshadow-color: #545454;
scrollbar-3d-lightcolor: #545454;
scrollbar-arrow-color: #ffffff;
scrollbar-track-color: #545454;
}

.tables
{ border: 1px solid #252525; background-color: #313131;} 
.menus
{ width: 130px; border: 0px solid #575757; background-color: #313131;} 
.content
{ border: 0px solid #707070; background-color: #4F4F4F;} 
.disclaimer
{ border: 1px solid #252525; background-color: #313131;} 

</style>



</head>


<body>
<div align='center'>
<!--BANNER-->
<table class='tables' cellpadding='0' cellspacing='0' width='750' height=<tr><td>'180'>

<center>
<font face='verdana' color='#FFFFFF' size='6'><a href='index.php'>
<img border='0' src='http://i3.tinypic.com/7xaet08.jpg'>

</font>
</tr></td>
</table>
<!--END of BANNER-->

<!--LEFT MENU-->
<table class='tables' cellpadding='4' cellspacing='0' width='750' height='250'>
<tr><td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Main</b><br>
<a href='index.php'>Home</a><br>
<a href='logout.php'>Logout</a><br>
<a href=''>Link Here</a><br><br>

<b>Catergory</b><br>
<a href=''>Link Here</a><br>
<a href=''>Link Here</a><br>
<a href=''>Link Here</a><br>
<a href=''>Link Here</a><br><br>

<b>Catergory</b><br>
<a href=''>Link Here</a><br>
<a href=''>Link Here</a><br>
<a href=''>Link Here</a><br>
<a href=''>Link Here</a><br>
</CENTER>
</td>
<!--END of LEFT MENU-->


<!--CONTENT-->
<td class='content' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<div align='justify'>
<br>
";
}
$ID= $_COOKIE['UserID'];

$BannedResult= mysql_query("SELECT * FROM users WHERE id='$ID'");
$BannedRows= mysql_fetch_array($BannedResult);

if($BannedRows['Banned']=='Yes')
{
echo "Sorry, you are banned. You will now be logged out, please go <a href='index.php'>back</a>.";
$usercheck = addslashes($_POST['username']);
    $passcheck = md5(addslashes($_POST['password']));
$Result1 = mysql_query("SELECT * FROM users WHERE username='$usercheck' AND password='$passcheck'");
    $Rows1 = mysql_fetch_array($Result1);
    

    $UserID = $Rows1['ID'];
setcookie("UserID", "$UserID", time() - 9999999);

include("bottom.php");
exit;
}

?>

 

Here is my view party

 

<?php
include('Connect.php');
include('top.php');
$userID = $_COOKIE['UserID'];
$result = mysql_query("SELECT * FROM pokemon_info");
if($row = mysql_fetch_array($result))
{
echo "<table border='1' bgcolor='lightgrey'>";
echo "<th>UserID " . $row['user_id'] . "</th>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center>" . $row['pokemon_name'] .  "<br /><img border='0' src='" . $row['pokemon_image'] .  "'></center></tr></td>";
echo "<tr><td>Attack: " . $row['pokemon_attack'] . "</tr></td>";
echo "<tr><td>Defence: " . $row['pokemon_defence'] . "</tr></td>";
echo "<tr><td>Level: " . $row['pokemon_level'] . "</tr></td>";
echo "<tr><td>EXP: " . $row['pokemon_exp'] . "</tr></td>";
echo "<tr><td><b>Moves:</b> <br /> " . $row['attack1'] . "<br />"
. $row['attack2'] . "<br />"
. $row['attack3'] . "<br />"
. $row['attack4'] . "<br /></tr></td></table>";
}
include('bottom.php');
?>

 

How do I make a link in the top to viewparty.php?id=1 or W/E their ID is, then in view party make it say the page according to their ID?

 

Can someone edit those into the way I want it and tell me what they did for future reference? Or can you tell me what and where to put it? Thank you.

Link to comment
https://forums.phpfreaks.com/topic/81927-can-someone-please-help-me/
Share on other sites

I'm not wading through all that code. A simple example.

 

list.php

<a href="view.php?id=1">view 1</a>
<a href="view.php?id=2">view 2</a>
<a href="view.php?id=3">view 3</a>

 

view.php

<?php

 if (isset($_GET['id'])) {
   $id = mysql_real_escape_string($_GET['id']);
   $sql = "SELECT * FROM users WHERE id = '$id';";
   echo $sql;
 }

?>

 

You should be able to work it out from there.

I dont get what you are saying.. I dont understand the whole process... I go to w3schools, they dont tell me how to link a get, and they dont tell me how to get User_id.. Its really confusing, and I dont know what to do on the viewparty....

 

 

thrope: Im not making a link for every member, thats just stupid, what about when I ahve 1K mems? That makes no sence..

 

And what to I put in the $_get[id] Do I put the Cookie name?

I have no clue what you guys are saying!

 

1. How do I link it

 

2. What do you mean when you say $_GET['id']?

 

Im really confused.

 

 

When you have a url like "Http://www.coolPokemons.com/?pokemon_id=1"

 

You use a $_GET, to get the value of "pokemon_id", which is 1.

 

$_GET['pokemon_id'];

I have no clue what you guys are saying!

 

1. How do I link it

 

2. What do you mean when you say $_GET['id']?

 

Im really confused.

 

 

When you have a url like "Http://www.coolPokemons.com/?pokemon_id=1"

 

You use a $_GET, to get the value of "pokemon_id", which is 1.

 

$_GET['pokemon_id'];

 

I used $_REQUEST for the URL name and it works, but I dont know how to display things according to the URL name.

So why does

 

<a href="viewparty?userID=<?php echo
$_REQUEST['UserID']; ?>">Link text</a>
<?php
include('Connect.php');
include('top.php');
$userID = $_COOKIE['UserID'];
if (isset($_REQUEST['UserID'])) {
    $id = mysql_real_escape_string($_REQUEST['UserID']);
$result = mysql_query("SELECT * FROM pokemon_info WHERE user_id = '$id'");
if($row = mysql_fetch_array($result))
{
echo "<table border='1' bgcolor='lightgrey'> ";
echo "<th>UserID " . $row['user_id'] . "</th>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center>" . $row['pokemon_name'] .  "<br /><img border='0' src='" . $row['pokemon_image'] .  "'></center></tr></td>";
echo "<tr><td>Attack: " . $row['pokemon_attack'] . "</tr></td>";
echo "<tr><td>Defence: " . $row['pokemon_defence'] . "</tr></td>";
echo "<tr><td>Level: " . $row['pokemon_level'] . "</tr></td>";
echo "<tr><td>EXP: " . $row['pokemon_exp'] . "</tr></td>";
echo "<tr><td><b>Moves:</b> <br /> " . $row['attack1'] . "<br />"
. $row['attack2'] . "<br />"
. $row['attack3'] . "<br />"
. $row['attack4'] . "<br /></tr></td></table>";
}
include('bottom.php'); 
?>

 

Give me an unexpected $ error?

<a href="viewparty?userID=<?php echo $_REQUEST['UserID']; ?>">Link text</a>
<?php
include('Connect.php');
include('top.php');
$userID = $_COOKIE['UserID'];
if (isset($_REQUEST['UserID'])) {
    $id = mysql_real_escape_string($_REQUEST['UserID']);
$result = mysql_query("SELECT * FROM pokemon_info WHERE user_id = '$id'");

if($result){
$row = mysql_fetch_array($result);
echo "<table border='1' bgcolor='lightgrey'> ";
echo "<th>UserID " . $row['user_id'] . "</th>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center>" . $row['pokemon_name'] .  "<br /><img border='0' src='" . $row['pokemon_image'] .  "'></center></tr></td>";
echo "<tr><td>Attack: " . $row['pokemon_attack'] . "</tr></td>";
echo "<tr><td>Defence: " . $row['pokemon_defence'] . "</tr></td>";
echo "<tr><td>Level: " . $row['pokemon_level'] . "</tr></td>";
echo "<tr><td>EXP: " . $row['pokemon_exp'] . "</tr></td>";
echo "<tr><td><b>Moves:</b> <br /> " . $row['attack1'] . "<br />"
. $row['attack2'] . "<br />"
. $row['attack3'] . "<br />"
. $row['attack4'] . "<br /></tr></td></table>";
}
include('bottom.php'); 
?>

try

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.