Jump to content

chevys

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chevys's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have listed below the script I am having issues with. The form loads within the facebox but when I submit the form I need it to display the results within the Facebox also. Thanks in advance! <?php include "globals1.php"; $_GET['ID'] = abs((int) $_GET['ID']); $id=$db->query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1"); if($db->num_rows($id)==0) { print "Invalid item ID"; $h->endpage(); exit; } else { $r=$db->fetch_row($id); } if(!$r['armor']) { print "This item cannot be equipped to this slot."; $h->endpage(); exit; } if($_GET['type']) { if(!in_array($_GET['type'], array("equip_armor"))) { print "This slot ID is not valid."; $h->endpage(); exit; } if($ir[$_GET['type']]) { item_add($userid, $ir[$_GET['type']], 1); } item_remove($userid, $r['itmid'], 1); $db->query("UPDATE users SET {$_GET['type']} = {$r['itmid']} WHERE userid={$userid}"); print "Item {$r['itmname']} equipped successfully.";'); <-------This is what I need it to print in the FaceBox } else { print "<h3>Equip Armor</h3><hr /> <form method='get' id='pokeform' name='pokeform' action='equip_armor.php'> <input type='hidden' name='ID' id='poke_1' value=''{$_GET['ID']}'' /> Click Equip Armor to equip {$r['itmname']} as your armor, if you currently have any armor equipped it will be removed back to your inventory.<br /> <input type='hidden' name='type' value='equip_armor' onClick='ajaxpost('')' /></form>"; } $h->endpage(); ?>
  2. I am new to all of this and I am not sure how to add the AND statement to seperate the 2. Your advice makes complete since, I just dont know what to do with it.
  3. I am trying to insert more than one javascript in a .php file is there a proper way to do this? They seem to cancel each other out?? <link rel="SHORTCUT ICON" href="favicon.ico" /> <link href="/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/> <script src="scripts/jquery-1.2.3.min.js"> <script src="facebox/facebox.js"> </script> <script> // When the document loads do everything inside here ... $(document).ready(function(){ // When a link is clicked $("a.tab").click(function () { // switch all tabs off $(".active").removeClass("active"); // switch this tab on $(this).addClass("active"); // slide all content up $(".content").slideUp(); // slide this content up var content_show = $(this).attr("title"); $("#"+content_show).slideDown(); }); }); </script> <script> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox({ loading_image : 'loading.gif', close_image : 'closelabel.gif' }) }) </script> <style type="text/css">
  4. I am trying to pull a scecific ID from a table so I did: ORDER BY i.itmtype WHERE i.itmtype={$2} ASC"); Is this even close? Original here: $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC"); Thanks,
  5. Here is the actual file if that helps, Thanks [attachment deleted by admin]
  6. I have having some issues with the following Query. I am going to post my Mysql tables as well for assistance. The issue is there are 3 different itemtypes and it appears to be pulling them all in a list format, I need it to only pull 1 itemtype? The item types are [weapon] [armor] [medicine] --Table for Item Types-- Full Texts itmtypeid itmtypename Edit Delete 4 Medicine Edit Delete 2 Armor Edit Delete 3 Weapon print "<div id='content_2' class='content'> <ul>"; } $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC"); if ($db->num_rows($inv) == 0) { print "<b>You have no items!</b>"; } else { print "<table width=100% border=\'0\' align='center' cellspacing=\'1\' class=\'table\'>"; $lt=""; while($i=$db->fetch_row($inv)) { if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; print "\n<tr><td colspan=4></td></tr>"; } if($i['armor']) { $i['itmname']="".$i['itmname']; } print "<tr><td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { print " x{$i['inv_qty']}"; } print "</td><td>[<a href=iteminfo.php?ID={$i['itmid]}'>Info</a>]"; if($i['armor']) { print " [<a href=equip_armor.php?ID={$i['inv_id]}'>Equip as Armor</a>]"; } print "</td></tr>"; } print "</table>"; } print "</ul></div>"; If anyone can assist me i would greatly appreciate it! Thanks,
  7. When you add: time()+0 You have to attempt to log in several times so if you set it to 1 it will alow you to log in then if you close the browser you cannot log back in. I guess it only makes it valid for 1 second. Thanks, Guys
  8. I have a site that sets 2 cookies the first one is: setcookie("trupimp",$user[2]); The second is the following: setcookie("trupimpn",$player[1]); How do i format these 2 cookies to expire if the browser is ever closed? Thanks to anyone that can assist me. [Player1] inserts the cookie into the database table [user2] inserts the cookie into another table on the database
  9. That worked thank you so much I have been trying this for the past 5hrs
  10. It came back as nothing when I tried that one. Am I missing a line above print telling it what to do?
  11. Dont laugh lol I tried date($PAYP[0]) I tried <?=date('F j, Y', $PAYP[0])?> I just cant figure it out I scrolled down that page you suggested and I cannot figure out which one will compare to what I am tring to do. Thanks
  12. I tried several different combination i am new to all this PHP coding can you be alittle more specific please Thx
  13. I have a question regarding a Print Fuction I have posted the code below. print("<tr>"); print("<td height=\"20\"class=\"row1\"align=\"left\">$PAYP[0]</td>"); print("<td height=\"20\"class=\"row1\"align=\"left\">$user[1]</td>"); print("<td height=\"20\"class=\"row1\"align=\"left\">$credits</td>"); print("<td height=\"20\"class=\"row1\"align=\"left\">$PAYP[2]</td>"); print("</tr>"); The line that consist of $PAYP[0] returns the date when the user made a purchase but it is in this format - 1239333028 - I need it to display in the format for example 4/11/09 can anyone help? Thanks
×
×
  • 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.