Extra fixes

All code and questions for Urban Realms, Forsaken Sanctum, ect...
Messi
Posts: 37
Joined: Fri May 21, 2010 8:01 am

Re: Extra fixes

Post by Messi »

I didn't change anything at all. I will download the source again to see if that will fix the problem.

EDIT:

Ok, that didn't work :(
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Extra fixes

Post by hallsofvallhalla »

okay i am looking into it...
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Extra fixes

Post by hallsofvallhalla »

try this, replace this with your current reguser.php

Code: Select all

<?php
include 'connect.php';
session_start();

?>

  <link href="style.css" rel="stylesheet" type="text/css" />
 
<div id="logo"><img src="../images/logo.jpg" width="500" height="120" /></div>


 
 


<div id="logintable">

  <?php
$player=$_POST['player'];
$password=$_POST['password'];
$pass2=$_POST['pass2'];
$player=strip_tags($player);
$email=$_POST['email'];
$email=strip_tags($email);
$prochoice=$_POST['prochoice'];
if ($password==$pass2)
{
  
  $isplayer="SELECT * from players where name='$player'";
  $isplayer2=mysql_query($isplayer) or die("Could not query players table");
  $isplayer3=mysql_fetch_array($isplayer2);
  if(!$_POST['password'] || !$_POST['pass2'])
  {
     print "You did not enter a password";
  }
  else if($isplayer3 || strlen($player)>15 || strlen($player)<1)
  {
     print "There is already a player of that name or the name you specified is over 16 letters or less than 1 letter";
  }
  else
  {
    $isaddress="SELECT * from players where email='$email'";
    $isaddress2=mysql_query($isaddress) or die("not able to query for password");
    $isaddress3=mysql_fetch_array($isaddress2);
    if($isaddress3)
    {
      print "There is already a player with that e-mail address";
    }
    else
    {
    $proquery="SELECT * from profession where proname='$prochoice'";
  $proquery2=mysql_query($proquery) or die("Could not query professions table");
  $proquery3=mysql_fetch_array($proquery2);
    $primskill = $proquery3['skill1'];
    $secskill = $proquery3['skill2'];
	 $learnskill = $proquery3['skill3'];
	 $primstat = $proquery3['stat1'];
    $secstat = $proquery3['stat2'];
	
	 //$primskill=strip_tags($primskill);  
	   //$secskill=strip_tags($secskill); 
	  //$learnskill=strip_tags($learnskill); 
	
	  $password=md5($password);
      $date=round(date("U")/1000);
      srand($date);
      $thekey=rand(1,100000000);
      $thekey=md5($thekey);
    if ($primstat != "body")   { $health = 10;}
	  if ($secstat != "endurance")   { $stamina = 30;}
   if ($primstat == "body")   { $health = 30;}
   if ($secstat == "body")   { $health = 20;}
    if ($primstat == "endurance")   { $stamina = 50;}
   if ($secstat == "endurance")   { $stamina = 40;}
   
  
 $SQL = "INSERT into players( hp,stamina,maxhp,maxstamina,backpackmax, mapr, mapc, name, proname, password, email, level, credits, expe, killer, lastattacked) VALUES ('$health','$stamina','$health','$stamina','6','15','4','4','$player','$prochoice','$password','$email','1','500','0','','')"; 
      mysql_query($SQL) or die("could not register");
      
   ?> 
     <?php
	$prquery="SELECT * from players where name='$player'";
  $prquery2=mysql_query($prquery) or die("Could not query players table");
  $prquery3=mysql_fetch_array($prquery2);
    $pid = $prquery3['id'];
	
	 
	//$SQL2 = "INSERT into skills( 2H Blade, Axe, Pole Arm, Bow, Blunt, Knife, Crossbow, Light Pistol, Heavy Pistol, 1H Blade, Energy Pistol, Energy Rifle, Light Rifle, Heavy Rifle, ShotGun, Light Armor, Medium Armor, Heavy Armor, Sheilds, First Aid, Identify Plants, Identify Drinks, Identify Items, Pick Pocket, Traps, Alchemy, Armor Craft, Weapon Craft, GunSmith, Identify Materials, Animal Training, Fishing, Hunting, Spelunking, Scroll Craft, Identify Weapons) VALUES('4','3','2','4','3','2','4','3','2','4','3','2','4','3','2','4','3','2','4','3','2','4','3','2','4','3','2','4','3','2','4','3','2','4','3','2')";
     // mysql_query($SQL2) or die("could not register skills");
	
	//$SQL2 = "INSERT into skills(id ,`$primskill`, `$secskill`, `$learnskill`) VALUES('$pid','4','3','2')";
     //mysql_query($SQL2) or die("could not register skills");
	 
	 $SQL2 = "INSERT into anticheat(id) VALUES('$pid')";
     mysql_query($SQL2) or die("could not register anticheat");
	  
	  for ($i = 1; $i <= 3; $i+= 1)
  {
  $randid4 = rand(10,900000);
	 $SQL = "INSERT into backpack(id, name, type, stats, modadd,price,level,randid,consumable) VALUES ('$pid','Tasty Power Pack','food','stamina','40','50','1','$randid4','1')"; 
      mysql_query($SQL) or die("could not add to backpack");
	 }
	$randid4 = rand(10,900000);
	$SQL = "INSERT into suit(id, name, type, durability, speed,rating,craft,lastcraft,randid,location) VALUES ('$pid','Light Chest Plate','Light_Armor','8','2','2','0','OdyssusForge','$randid4','chest')"; 
      mysql_query($SQL) or die("could not add to suit");
	  
	 $randid = rand(10,900000);
	$SQL = "INSERT into equip(id, name, type, durability, speed,rating,damage,craft,lastcraft,randid) VALUES ('$pid','Light Dagger','Blade','8','3','2','3','0','OddysusForge','$randid')"; 
      mysql_query($SQL) or die("could not add to equip");
	
	 print "Thank you for registering and playing Forsaken Sanctum. You may now Login.";
   
	 }
  }
}

else
{
  print "Your password didn't match or you did not enter a password";
}

?>
  <A href='login.php'>Login Page</a><br>
Messi
Posts: 37
Joined: Fri May 21, 2010 8:01 am

Re: Extra fixes

Post by Messi »

ok baseball435's fixes haved worked for me but when i just go to different pages theres different errors :oops: ive tryed fixing them aswell but i just can't semm to do it :cry:
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Extra fixes

Post by hallsofvallhalla »

give me the actual error not just that it is a error.

The fixes stated here are not fixes but work arounds. Guys this code is source from a web game. Not plug and play. You have to set it up to your own host.

Tell me the exact error and I will do what I can to get them fixed.
Messi
Posts: 37
Joined: Fri May 21, 2010 8:01 am

Re: Extra fixes

Post by Messi »

ok ive added the new code for reguser from above and still not working it comes up with :

could not register

i get this error at the top of every page and when i delete the line ALL the pictures go :

Notice: Undefined variable: QUERY_STRING in C:\wamp\www\game\connect.php on line 2

When i click Weapons, this error comes up :

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\game\equip.php on line 80

When i click Armour, this error comes up :

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\game\equiparmor.php on line 79

When i click Backpack, this error comes up :


Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\game\backpack.php on line 78


And thats about it for now i've tryed all my best but can't fix them :(
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Extra fixes

Post by hallsofvallhalla »

delete line 2 in connect.php

line 80 in equip.php
should be

Code: Select all

else {$selectbackpack3['equip'] = "<td><A href='equipped.php?randid= $selectbackpack3[randid]'>Equip</td>";} 
remove the single quotes, hence why i did not want to make changes to already working code

line 79 in equipped

Code: Select all

 else {$selectbackpack3['equip'] = "<td><A href='equippedarmor.php?randid= $selectbackpack3[randid]'>Equip</td>";}   
backpack line 78

Code: Select all

{ print "<tr><td>$selectbackpack3[name]</td><td>$selectbackpack3[stats]</td><td>$selectbackpack3[modadd]</td><td><A href='foodanddrink.php?randid= $selectbackpack3[randid]&modadd=$selectbackpack3[modadd]'>Consume</td></tr>";
User avatar
ier
Posts: 67
Joined: Sun Jan 10, 2010 7:32 pm

Re: Extra fixes

Post by ier »

I have a problem with my pictures I can not see them
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Extra fixes

Post by hallsofvallhalla »

do you have the directory pointing to the right location?
User avatar
ier
Posts: 67
Joined: Sun Jan 10, 2010 7:32 pm

Re: Extra fixes

Post by ier »

yea

Code: Select all

 <p><img src="http://localhost/Forsaken/img/homebutt.png" width="181" height="36" /><img src="http://localhost/Forsaken/img/marketbutt.png" width="181" height="36" /></p>
i tryt it this way ent this way

Code: Select all

 <p><img src="img/homebutt.png" width="181" height="36" /><img src=/img/marketbutt.png" width="181" height="36" /></p>
my picture map is calt img
Post Reply

Return to “Hall's Games”