HellgY
01-20-2006, 07:08 AM
OK, I use the following syntax to extract a standard message from the DB
and convert the variables in it to their values:
$query="SELECT * FROM messages WHERE shortcut='registration'";
$result=mysql_query($query, $link);
$row=mysql_fetch_array($result, MYSQL_ASSOC);
$activekey=rand_string();
eval("\$row['body']=\"$row['body']\";");
The content that stored in the 'body' column of the selected row is:
Hello!,$_POST['name'] .
Thanks for singing on to our site!,
Please follow the link bellow within 24 hours since this notification was issued,
otherwise it will void, and you will have to register all over again.
regards,
Total NBA Team team.
Active registration:
http://www.opendD4U.net/active.php?ID=$userid&code=$activekey
This variable will later be used as the E-mail validation message content!.
I receive the following error for the line in which the eval() function placed:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/nitay/domains/opend4u.net/public_html/Oleg/Register.php on line 92
------
I also get the following error for the line masked with '//' in the code in the bottom of the page.
Error:
Parse error: syntax error, unexpected T_ELSE in /home/nitay/domains/opend4u.net/public_html/Oleg/login.php on line 68
This code meant to verify that the user is authorized to view the page, and it
included in all the pages of the site, using internal server path, after the defination of $clearance for every page.
Code:
<?php
if(isset($_COOKIE['name']) and isset($_COOKIE['password']))
{
$query="SELECT name, password, status FROM users WHERE name='".$_COOKIE['name']."' AND password='"
.$_COOKIE['password']."'";
$result=mysql_query($query, $link) or die(mysql_error()."--".$query);
if(@mysql_num_rows($result)==0)
{
print("you have illegal cookies<br><a target=\"_self\" href=\"login.php?do=disconnect\">Erase the cookies</a>");
die();
}
$row=mysql_fetch_array($result, MYSQL_ASSOC);
mysql_free_result($result);
if($clearance==0)
{
if($row['status']==3)
{
print("You are banned and cannot access any of this site's pages");
die();
}
}
else
{
if($row['clearance']<$clearance)
{
switch($clearance)
{
case '1':
print("You must activate your account before accessing this page");
break;
case '2':
print("This page is not available for your user group");
break;
case '3':
print("This page is not available for your user group");
break;
case '4':
print("This is not available for you user group");
break;
case '5';
print("Only the site owner can access this page");
$distenation=referred();
include('Redirect.php');
die();
}
}
}
}
else
{
if($clearance!=0)
{
print("you must login before you can access this page<br>click <a target\"_SELF\" href=".
$_SERVER['PHP_SELF']."?do=login>here</a>");
die();
}
}
?>
and convert the variables in it to their values:
$query="SELECT * FROM messages WHERE shortcut='registration'";
$result=mysql_query($query, $link);
$row=mysql_fetch_array($result, MYSQL_ASSOC);
$activekey=rand_string();
eval("\$row['body']=\"$row['body']\";");
The content that stored in the 'body' column of the selected row is:
Hello!,$_POST['name'] .
Thanks for singing on to our site!,
Please follow the link bellow within 24 hours since this notification was issued,
otherwise it will void, and you will have to register all over again.
regards,
Total NBA Team team.
Active registration:
http://www.opendD4U.net/active.php?ID=$userid&code=$activekey
This variable will later be used as the E-mail validation message content!.
I receive the following error for the line in which the eval() function placed:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/nitay/domains/opend4u.net/public_html/Oleg/Register.php on line 92
------
I also get the following error for the line masked with '//' in the code in the bottom of the page.
Error:
Parse error: syntax error, unexpected T_ELSE in /home/nitay/domains/opend4u.net/public_html/Oleg/login.php on line 68
This code meant to verify that the user is authorized to view the page, and it
included in all the pages of the site, using internal server path, after the defination of $clearance for every page.
Code:
<?php
if(isset($_COOKIE['name']) and isset($_COOKIE['password']))
{
$query="SELECT name, password, status FROM users WHERE name='".$_COOKIE['name']."' AND password='"
.$_COOKIE['password']."'";
$result=mysql_query($query, $link) or die(mysql_error()."--".$query);
if(@mysql_num_rows($result)==0)
{
print("you have illegal cookies<br><a target=\"_self\" href=\"login.php?do=disconnect\">Erase the cookies</a>");
die();
}
$row=mysql_fetch_array($result, MYSQL_ASSOC);
mysql_free_result($result);
if($clearance==0)
{
if($row['status']==3)
{
print("You are banned and cannot access any of this site's pages");
die();
}
}
else
{
if($row['clearance']<$clearance)
{
switch($clearance)
{
case '1':
print("You must activate your account before accessing this page");
break;
case '2':
print("This page is not available for your user group");
break;
case '3':
print("This page is not available for your user group");
break;
case '4':
print("This is not available for you user group");
break;
case '5';
print("Only the site owner can access this page");
$distenation=referred();
include('Redirect.php');
die();
}
}
}
}
else
{
if($clearance!=0)
{
print("you must login before you can access this page<br>click <a target\"_SELF\" href=".
$_SERVER['PHP_SELF']."?do=login>here</a>");
die();
}
}
?>