Jump to content


  • Posts

  • Joined

  • Last visited

Beffic's Achievements


Newbie (1/7)



  1. So I am building a website for a client and I am down to my last couple days to work on it and now I am trying to get webcam chat within the website. Where the client is not obligated to download something and can just click a link to the video chat but no one else can access that chat at that time other than the counselor and the client that should be getting their session..www.gqcounseling.com is the counseling website.So any ideas? Or links to help me out?Like I said it's my last couple days.Thanks.
  2. Okay, so I figured out this isn't a JavaScript problem I think.... but for some reason I cannot get the data from the mysql to show up when I have JavaScript try and load the file but it works when I go to the file directly.Any idea why it would do this?This is the code that loads the content into a div. var refreshId = setInterval(function(){ $('#inventory').load('inventory.php').fadeIn("slow");}, 5000);
  3. Ahh yes, Mr. Firebug. I have tried using this little guy before but I still cannot seem to get an error and I can't really test it in FF because it's not showing the items I have from the mysql query... Any help with that part. Cause everything looks fine on the query to me but if it was fine then it would display the items...
  4. Maybe try something like $sql = "SELECT * FROM `NEW ORLEANS MARRIOTT`"; because there is three words in your mysql database name.
  5. Beffic

    Mysql Update

    So I have a stat point distributor for my game and I cannot seem to get it to work.It keeps returning the value to 0 every time I try to increase my stat points.I have maneuvered this code so much and I cannot figure out why... <?phpinclude("../../connect.php");include("head.php");?><center><table class="content"> <tr><td> <?php $Player=$_COOKIE['player_id']; if(isset($_POST['distribute'])){ $use=$_POST['use']; $ammount=$_POST['ammount']; if($User['StatPoint']<$ammount){ print"You do not have <font color=red>".number_format($ammount)."</font> Stat Points!"; }elseif($use=="health"){ $ammount2=$ammount*2; mysql_query("UPDATE `Users` SET MaxHealth=MaxHealth+'$ammount2', StatPoint=StatPoint-'$ammount' WHERE ID='$Player'")or die(mysql_error()); print"You raised your Max Health by ".$ammount2."!"; }elseif($use=="energy"){ $ammount2=$ammount*2; mysql_query("UPDATE `Users` SET MaxEnergy=MaxEnergy+'$ammount2', StatPoint=StatPoint-'$ammount' WHERE ID='$Player'"); print"You raised your Max Energy by ".$ammount2."!"; }elseif($use=="strength"){ mysql_query("UPDATE `Users` SET Strength=Strength+'$ammount', StatPoint=StatPoint-'$ammount' WHERE ID='$Player'"); print"You raised your Strength by ".$ammount."!"; }elseif($use=="wisdom"){ mysql_query("UPDATE `Users` SET Wisdom=Wisdom+'$ammount', StatPoint=StatPoint-'$ammount' WHERE ID='$Player'"); print"You raised your Wisdom by ".$ammount."!"; }elseif($use=="defence"){ mysql_query("UPDATE `Users` SET Defence=Defence+'$ammount', StatPoint=StatPoint-'$ammount' WHERE ID='$Player'"); print"You raised your Defence by ".$ammount."!"; }elseif($use=="dexterity"){ mysql_query("UPDATE `Users` SET Dexterity=Dexterity+'$ammount', StatPoint=StatPoint-'$ammount' WHERE ID='$Player'"); print"You raised your Dexterity by ".$ammount."!"; }elseif($use=="accuracy"){ mysql_query("UPDATE `Users` SET Accuracy=Accuracy+'$ammount', StatPoint=StatPoint-'$ammount' WHERE ID='$Player'"); print"You raised your Accuracy by ".$ammount."!"; }else{ print"No use selected!"; } } ?> <h1>Distribute Stat Points!</h1><br><br> <p>Here you can distribute your Stat Points gained from Leveling to your User Stats so not everyone will have the same stats all the time. Distribute your way!<br><br> <?php print"You have ".number_format($User['StatPoint'])." Stat Points to spend!<br>"; print"<form method=\"post\" action=\"statpointdistributer.php\">Stat Points to use: <input type=\"text\" name\"ammount\"> Use: <select name=\"use\"><option value=\"health\">Max Health X 2</option><option value=\"energy\">Max Energy X 2</option><option value=\"strength\">Strength</option><option value=\"wisdiom\">Wisdom</option><option value=\"defence\">Defence</option><option value=\"dexterity\">Dexterity</option><option value=\"accuracy\">Accuracy</option></select><input type=submit value=\"Distribute\" name=distribute></form>"; ?><br><br> Would you like to return to your adventure? <a href="index.php">Yes</a> </p> </td></tr></table></center>
  6. So I am trying to get this project done as soon as possible for my client. I am having problems with it and I do not understand.So I am here. To you lovely people! =)So I have an inventory when when ever you hit equip or unequip it will go through the JavaScript function and process the MySql query in a separate PHP file. And for some reason I get a delayed effect or a bugged effect to where it does not process or it takes forever to make the change/ delayed showing effect.Also in IE it will show the table of all my equipment but in FF it wont...I am using JQuery library file found at www.jquery.comindex.php <tr><td> <h3>Inventory</h3> <div id="inventory"></div></td><td><script src="http://code.jquery.com/jquery-latest.js"></script><script>var refreshId = setInterval(function(){ $('#inventory').load('inventory.php').fadeIn("slow");}, 5000);</script> inventory.php <?php include("../../connect.php");if(!isset($_COOKIE['player_id'])) die('Please login.<br><a href=../../index.php>Go back</a>.');$Player=$_COOKIE['player_id'];$Query="SELECT * from Users where ID='$Player'";$Query2=mysql_query($Query) or die("Could not get user stats.");$User=mysql_fetch_array($Query2);if($_COOKIE['password'] !=md5($User['Password'])) die('Your Password doesnt seem right for this account. <a href=../../index.php>go back</a>');?><script type="text/javascript" src="jquery-1.3.2.min.js"></script><script src="http://code.jquery.com/jquery-latest.js"></script><script type=text/javascript>$(document).ready(function(){ $("form#UNEquip").submit(function() { var id = $('#id').attr('value'); $.ajax({ type: "POST", url: "unequip.php", data: "id="+ id, success: function(){ $('div.success').fadeIn().fadeOut(); } }); return false; });});$(document).ready(function(){ $("form#Equip").submit(function() { var id2 = $('#id2').attr('value'); $.ajax({ type: "POST", url: "equip.php", data: "id="+ id2, success: function(){ $('div.success').fadeIn().fadeOut(); } }); return false; });});</script><table border=\"1px\"><tr><td><b><u>Equipped</u></b></td><td><b><u>Class</u></b></td><td><b><u>Action</u></b></td></tr><tr><?php $start="SELECT * FROM `Inventory` WHERE Owner='$Player' AND Equipped='Yes'"; $start2=mysql_query($start); print"<form id=\"UNEquip\" method=\"post\">"; while($Equipped=mysql_fetch_array($start2)){ $Class=mysql_fetch_array(mysql_query("SELECT Class FROM Items WHERE Name='".$Equipped['Name']."'")); print"<td><i><input type=\"hidden\" id=\"id\" value=\"".$Equipped['ID']."\">".$Equipped['Name']."</i></td><td><i>".$Class['Class']."</i></td><td><input type=\"submit\" value=\"Unequip\"></td>"; } print"</form>";?></tr><tr><td><b><u>Inventory</u></b></td><td><b><u>Class</u></b></td><td><b><u>Action</u></b></td></tr><tr><?php $starter="SELECT * FROM `Inventory` WHERE Owner='$Player' AND Equipped='No'"; $starter2=mysql_query($starter); print"<form id=\"Equip\" method=\"post\">"; while($UNEquipped=mysql_fetch_array($starter2)){ $Class=mysql_fetch_array(mysql_query("SELECT Class FROM Items WHERE Name='".$UNEquipped['Name']."'")); print"<td><i><input type=\"hidden\" id=\"id2\" value=\"".$UNEquipped['ID']."\">".$UNEquipped['Name']."</i></td><td><i>".$Class['Class']."</i></td><td><input type=\"submit\" value=\"Equip\"></td>"; } print"</form>";?></tr></table><div class="success" style="display:none;">Item changed!</div> equip.php <?php // where is your config file stored? include ("../connect.php"); // CLIENT INFORMATION $id = htmlspecialchars(trim($_POST['id'])); $addClient = "UPDATE `Inventory` SET Equipped='Yes' WHERE ID='$id'"; mysql_query($addClient) or die(mysql_error()); ?> unequip.php <?php // where is your config file stored? include ("../connect.php"); // CLIENT INFORMATION $id = htmlspecialchars(trim($_POST['id'])); $addClient = "UPDATE `Inventory` SET Equipped='No' WHERE ID='$id'"; mysql_query($addClient) or die(mysql_error()); ?> I am new to this forum and I am glad to be a part of this new community. I have used w3 tutorials for all my years of scripting and have never been underestimated.Thanks for looking,Beffic
  • Create New...