Jump to content

Attila

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Everything posted by Attila

  1. I hade the same problem with what you are trying to do a little more detail would help but they said my problem was this: session_start(); ob_start(); //Don't remember what this was for but I beleive this helped it.
  2. I would suggest to make the form a PHP code and have it echo to the screen and chance your action to this: action=\"$_SERVER[php_SELF]\"> Here is an example of a form I use on my website to search through the database and display what it found on the same page: <php $top_form = "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}\"> <table border=\"2\" cellpadding=\"2\" cellspacing=\"2\" bordercolor=\"#333333\" bgcolor=\"#CCCCCC\"> <tr align=\"center\" valign=\"middle\"> <td colspan=\"1\">"; $bottom_form = "</td> </tr> <tr> <td>Enter your search word, name, or phrase</td> <td><input type=\"text\" value=\"{$_POST['search']}\" name=\"search\" /></td> </tr> <tr align=\"center\" valign=\"middle\"> <td colspan=\"2\"> <input type=\"hidden\" name=\"op\" value=\"ds\"> <input type=\"submit\" name=\"Submit\" value=\"Search\"></td> </tr> </table> </form>"; if ($_POST['op'] != "ds") { echo "$top_form"."$bottom_form"; } else { echo "$top_form"."$bottom_form"; $item = $_POST['search']; $sql = "SELECT * FROM ddoitems WHERE ItemDescription LIKE '%$item%' OR ItemName LIKE '%$item%' OR ItemType LIKE '%$item%' OR QuestName LiKE '%$item%' ORDER BY ItemName ASC"; echo '</table>'; echo '<table>'; include ('includes/tindex.php'); database_connect(); tables($sql); echo '</table>'; } php>
  3. Thanks for all your help that fixed it a pesky ">"
  4. My bad I am sorry here you go: <title>DDO Items</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="CSS/style.css" rel="stylesheet" type="text/css"> <body class="body"> <div align="center"> <link href="../CSS/style.css" rel="stylesheet" type="text/css" /> <table> <tr class="headertable"> <td class="style2"> <p align="center" class="style2"><strong><font size="+3"><em>DDO Items</em></font></strong></p> <div align="center"><font color="#FFFFFF" size="2"> | <a href="index.php">Thaco Home</a> | <a href="items.php">DDO Items Home</a> | <a href="weapons.php">Weapons</a> | <a href="armor.php">Armor</a> | <a href="shields.php">Shields</a> | <a href="bracers.php">Bracers</a> | <a href="gloves.php">Gloves</a> | <a href="boots.php">Boots</a> | <a href="helm.php">Helm</a> | <a href="trinkets.php">Trinkets</a> | <a href="rings.php">Rings</a> | <a href="belts.php">Belts</a> | <a href="cloak.php">Cloak</a> | <a href="goggles.php">Goggles</a> | <a href="necklace.php">Necklace</a> | <a href="arrows.php">Arrows / Bolts</a> | <a href="robe.php">Robe</a> | <a href="misc.php">Misc</a> | <a href="search.php">Search</a> | <a href="../forum/index.php">Forums</a> | </font> </div> </td> </tr> </tr> <link href="../CSS/style.css" rel="stylesheet" type="text/css" /> <tr> <td align="left" valign="top"> <table> <tr class="style2"> <td><div align="center">Item Name </div></td> <td><div align="center">Item Description </div></td> <td><div align="center">Type</div></td> <td><div align="center">Quest Name</div></td> <td><div align="center">LVL</div></td> <td><div align="left">Notes</div></td> </tr><tr class="cellbg1"><div align="center"><td>Accomplice</td><td> <div align="left">Move Silently +10, Hide +10, Charisma -1</div></td><td>Reward</td><td>(Threnal Series)</td><td></td><td>End Reward Choice</td></div> </tr><tr class="cellbg2"><div align="center"><td>Banner Cloak</td><td> <div align="left">Charisma +6</div></td><td>Quest</td><td>Litany of the Dead</td><td>15</td><td>Vol's Chest</td></div></tr><tr class="cellbg1"><div align="center"><td> <a href="http://i153.photobucket.com/albums/s220/jgould2005/DDO/Items/Cloaks/BardsCloak.jpg"target="_blank">Bards Cloak</a></td><td> <div align="left"Greater Command (CL:9, 2/Day), Charisma +6, Perform +15</div></td><td>Raid</td><td>A Vision of Destruction</td><td>18</td><td>Raid Warded Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td>Black Wolfskin Cloak</td><td> <div align="left">Lesser Cold Resistance, Resistance +2</div></td><td>Reward</td><td>Assualt on Splinterskull (TR Series)</td><td></td><td>End Reward Choice</td></div></tr><tr class="cellbg1"><div align="center"><td>Bronkarzs Cloak</td><td> <div align="left">Will Save +1</div></td><td>Quest</td><td>The Kobolds' New Ringleader</td><td>2</td><td>Bronkarz's Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td> <a href="http://thaczero.com/Pictures/itempics/CapeoftheRoc.jpg"target="_blank">Cape of the Roc</a></td><td> <div align="left"Roc's Strength (CL:8, 3/rest), Feather Falling</div></td><td>Quest</td><td>Chains of Flame</td><td>12</td><td>End Chest</td></div> </tr><tr class="cellbg1"><div align="center"><td>Cloak of Curses</td><td> <div align="left">Chaotic Curse, Enchantment Focus</div></td><td>Quest</td><td>The Cursed Crypt</td><td>11</td><td>?</td></div> </tr><tr class="cellbg2"><div align="center"><td>Cloak of Ice</td><td> <div align="left">Exclusive, Fireshield (cold version) (CL:7, 3/rest)</div></td><td>Quest</td><td>Ghosts of Perdition</td><td>14</td><td></td></div></tr><tr class="cellbg1"><div align="center"><td>Cloak of Invisibility</td><td> <div align="left">Invisibility (CL:3, 1/rest), Invisibility</div></td><td>Quest</td><td>Tempest Spine</td><td>10</td><td>A'tchkar's Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td>Cloak of Protection</td><td> <div align="left">Spell Resistance (17), Protection +3</div></td><td>Quest</td><td>Shadow Crypt</td><td>9</td><td>Big Chest Room</td></div></tr><tr class="cellbg1"><div align="center"><td>Cloak of Shadows</td><td> <div align="left">Hdie +7, Move Silently +7, Protection +2</div></td><td>Quest</td><td>The Church and the Cult</td><td>9</td><td>End Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td>Cloak of Silence</td><td> <div align="left">+5 Move Silently</div></td><td>Quest</td><td>Redwillow's Ruins</td><td>6</td><td>Drow Chest</td></div></tr><tr class="cellbg1"><div align="center"><td>Cloak of the Asylum</td><td> <div align="left">Will Save +2, Wisdom +1</div></td><td>Reward</td><td>Archbishops Daughet (Catacomb Series)</td><td></td><td>End Reward Choice</td></div> </tr><tr class="cellbg2"><div align="center"><td>Cloak of the Silver Concord</td><td> <div align="left">Charisma +2, Haggle +10, Diplomacy +10, Persuasion</div></td><td>Raid</td><td>Plane of Night</td><td>10</td><td>Raid Warded Chest</td></div></tr><tr class="cellbg1"><div align="center"><td>Cloak of the Zephyr</td><td> <div align="left">Blurry, Invisibilty 1/day</div></td><td>Raid</td><td>Zawabi's Revenge</td><td>12</td><td>Raid Warded Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td>Cloak of Troll's Resistance</td><td> <div align="left">Lesser Cold Resistance, Lesser Lightning Resistance, Lesser Sonic Resistance</div></td><td>Quest</td><td>Redwillow's Ruins</td><td>6</td><td>?</td></div></tr><tr class="cellbg1"><div align="center"><td>Dream Cloak</td><td> <div align="left">Deep Slumber (CL:5, 3/rest), Enchantment Focus, Charisma +3</div></td><td>Quest</td><td>Twilight Forge</td><td>12</td><td>End Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td>Furor's Hide</td><td> <div align="left">Lesser Axeblock</div></td><td>Quest</td><td>Garrison's Missing Pack</td><td>2</td><td>Furor's Chest</td></div></tr><tr class="cellbg1"><div align="center"><td>Ghost-Waking Cloak</td><td> <div align="left">Charisma +3, Resistance +3</div></td><td>Quest</td><td>The Crucible</td><td>14</td><td>?</td></div> </tr><tr class="cellbg2"><div align="center"><td>Hellfire Cloak</td><td> <div align="left">Lesser Fire Resistance, Lesser Acid Resistance, Lesser Sonic Resistance</div></td><td>Reward</td><td>Return to Deleras Tomb (Deleras Series)</td><td></td><td>End Reward Choice</td></div></tr><tr class="cellbg1"><div align="center"><td>Jungle Cloak</td><td> <div align="left">Regrowth (CL:1, 1/rest), Hide +10</div></td><td>Raid</td><td>The Titan Awakes</td><td>12</td><td>Raid Warded Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td>Mantle of Stria</td><td> <div align="left">Axeblock</div></td><td>Quest</td><td>The Bloody Crypt</td><td>6</td><td>?</td></div></tr><tr class="cellbg1"><div align="center"><td>Mantle of the Dragonfriend</td><td> <div align="left">Charisma +5, Diplomacy +7</div></td><td>Quest</td><td>Gianthold Tor</td><td>14</td><td>?</td></div> </tr><tr class="cellbg2"><div align="center"><td>Moss Weave Cloak</td><td> <div align="left">Fortitude Save +2, Constitution +1</div></td><td>Reward</td><td>The Lost Seekers (WW Series)</td><td></td><td>End Reward Choice</td></div></tr><tr class="cellbg1"><div align="center"><td>Quilted Cape</td><td> <div align="left">Sonic Resistance, Move Silently +7, Resistance +2</div></td><td>Reward</td><td>Cult of the Six (CO6 Series)</td><td></td><td>End Reward Choice</td></div> </tr><tr class="cellbg2"><div align="center"><td>Scurvys Cloak</td><td> <div align="left">Lesser Fire Resistance</div></td><td>Quest</td><td>Irestone Inlet</td><td>4</td><td>Scurvy</td></div></tr><tr class="cellbg1"><div align="center"><td>Stormreaver's Napkin</td><td> <div align="left">Intelligence +6, Spell Focus Mastery +1</div></td><td>Raid</td><td>The Reaver's Fate</td><td>14</td><td>Raid Warded Chest</td></div> </tr><tr class="cellbg2"><div align="center"><td>Widow Weave Cloak</td><td> <div align="left">Acid Resistance, Lesser Spearblock, Web Immunity, Proof against Poison</div></td><td>Reward</td><td>The Spawn of Whisperdoom Collectables</td><td></td><td>End Reward Choice (Goblet)</td></div></tr><tr class="cellbg1"><div align="center"><td>Witchdoctors Mantle</td><td> <div align="left">Will Save +2, Power II</div></td><td>Reward</td><td>Seal of Shan-to-Kor</td><td></td><td>End Reward Choice</td></div> </tr><tr class="cellbg2"><div align="center"><td>Wretched Twilight</td><td> <div align="left">Ghostly, Superior Nullification VI, Stealth Strike</div></td><td>Raid</td><td>Ascension Chamber</td><td>15</td><td>Raid Warded Chest</td></div></tr> </table> </td> </tr> <td align="center" valign="bottom"><link href="../CSS/style.css" rel="stylesheet" type="text/css" /> <div align="left" class="style2"><font size="-1">Web Design by <a href="mailto:tarman@thaczero.com">Tarman Thaco</a> <br> Copyright © 2008-2009 DDO Items. All Rights Reserved. </font><br> </div> </td> </table> </div> </html>
  5. It is doing it in 2 spots so I will post both of them: echo '<tr class="cellbg1"><div align="center">'; echo '<td> <a href="'.$row['hyperlink'].'"target="_blank">'.$row['ItemName'].'</a></td>'; echo '<td> <div align="left"'.$row['ItemDescription'].'</div></td>'; echo '<td>'.$row['Type'].'</td>'; echo '<td>'.$row['QuestName'].'</td>'; echo '<td>'.$row['lvl'].'</td>'; echo '<td>'.$row['Notes'].'</td>'; echo '</div> </tr>'; $count = "B"; echo '<tr class="cellbg2"><div align="center">'; echo '<td> <a href="'.$row['hyperlink'].'"target="_blank">'.$row['ItemName'].'</a></td>'; echo '<td> <div align="left"'.$row['ItemDescription'].'</div></td>'; echo '<td>'.$row['Type'].'</td>'; echo '<td>'.$row['QuestName'].'</td>'; echo '<td>'.$row['lvl'].'</td>'; echo '<td>'.$row['Notes'].'</td>'; echo '</div> </tr>'; $count = "A"; THe only diference between the two above is that the colum is formated diferently because of its class. This one works without the hyperlink echo '<tr class="cellbg2"><div align="center">'; echo '<td>'.$row['ItemName'].'</td>'; echo '<td> <div align="left">'.$row['ItemDescription'].'</div></td>'; echo '<td>'.$row['Type'].'</td>'; echo '<td>'.$row['QuestName'].'</td>'; echo '<td>'.$row['lvl'].'</td>'; echo '<td>'.$row['Notes'].'</td>'; echo '</div></tr>'; $count = "A";
  6. I did what you asked thanks nice thought, and the items are being pulled out of the database. So what next? Here is the example of what it is printing for the Bards Cloak: Array ( [0] => 346 [iD] => 346 [1] => Bards Cloak [itemName] => Bards Cloak [2] => Cloak [itemType] => Cloak [3] => Greater Command (CL:9, 2/Day), Charisma +6, Perform +15 [itemDescription] => Greater Command (CL:9, 2/Day), Charisma +6, Perform +15 [4] => Raid [Type] => Raid [5] => A Vision of Destruction [QuestName] => A Vision of Destruction [6] => 18 [lvl] => 18 [7] => Raid Warded Chest [Notes] => Raid Warded Chest [8] => http://i153.photobucket.com/albums/s220/jgould2005/DDO/Items/Cloaks/BardsCloak.jpg [hyperlink] => http://i153.photobucket.com/albums/s220/jgould2005/DDO/Items/Cloaks/BardsCloak.jpg )
  7. I do a lot of tinkering with PHP and MYSQL and this is how I got my mail function to work when somone was regristiring at my site. <? include ('includes/thacoheader.php'); //Create Form $top_form = "<form method=\"post\" action=\"$_SERVER[php_SELF]\"> <br> <table width=\"45%\" border=\"2\" cellspacing=\"2\" cellpadding=\"2\" bordercolor=\"#000000\" bgcolor=\"#CCCCCC\"> <tr> <td colspan=\"2\">"; $form_block = "</td> </tr> <tr class=\"cellbg1\"> <td><strong>Character Name:</strong></td> <td><input type=\"text\" name=\"Cname\" value=\"$_POST[Cname]\" size=30></td> </tr> <tr class=\"cellbg1\"> <td><strong>Who recomended you:</strong></td> <td><input type=\"text\" name=\"recomend\" value=\"$_POST[recomend]\" size=30></td> </tr> <tr class=\"cellbg1\"> <td><strong>Email Address:</strong></td> <td><input type=\"text\" name=\"email\" value=\"$_POST[email]\" size=30></td> </tr> <tr class=\"cellbg1\"> <td><strong>Email Address Confirm:</strong></td> <td><input type=\"text\" name=\"email1\" value=\"$_POST[email1]\" size=30></td> </tr> <tr class=\"cellbg1\"> <td><strong>Why do you want to join THACO:</strong></td> <td><input type=\"textarea\" name=\"wjoin\" value=\"$_POST[wjoin]\" size=60></td> </tr> <tr class=\"cellbg1\"> <td><strong>User Name:</strong></td> <td><input type=\"text\" name=\"login\" value=\"$_POST[login]\" size=30></td> </tr> <tr align=\"center\" valign=\"middle\" class=\"cellbg1\"> <td colspan=\"2\"> <input type=\"submit\" name=\"submit\" value=\"Send this form\"> <input type=\"hidden\" name=\"op\" value=\"ds\"> <input type=\"reset\" name=\"reset\" value=\"Reset\"> </td> </tr> </table> </form>"; if ($_POST[op] != "ds") { // they need to see the form echo "$top_form"."$form_block"; } else if ($_POST[op] == "ds") { //********************************Check to see if the form has been filled out not blank and if the fields match.*************************** if (($_POST['email']) != ($_POST['email1'])) { $result = "$result"." <font color=red>Your emails do not match.</font><br>"; $complete = "no"; } if(empty($_POST['Cname'])) { $result = "$result"." <font color=red>You must enter a character name so we can find you in game.</font><br>"; $complete = "no"; } if(empty($_POST['recomend'])) { $result = "$result"." <font color=red>You must enter who recomended you to apply or NA</font><br>"; $complete = "no"; } if(empty($_POST['email'])) { $result = "$result"." <font color=red>You left your email address blank.</font><br>"; $complete = "no"; } if(empty($_POST['wjoin'])) { $result = "$result"." <font color=red>Please enter why you would like to join THACO</font><br>"; $complete = "no"; } if ($complete != "no") { $custip = $_SERVER['REMOTE_ADDR']; $additional_headers = "From: newapplicant@thaczero.com\n"; $toaddress = $_POST['email']; $subject = "Your Thaco application at thaczero.com"; $mailcontent = "Here is the information that you provided our new application officer\n\r" ."Character Name: " . $_POST['Cname'] . "\n\r" ."Who recomended you: " . $_POST['recomend'] . "\n\r" ."Email address: " . $_POST['email'] . "\n\r" ."Why do you want to join THACO: " . $_POST['wjoin'] . "\n\r" . "\n\r" ."Helpfull Tips.\n\r" ."1. Go to http://thaczero.com/forum/ and register with the same user name you applid with.\n" . "\n\r" . "\n\r" ."2. Be patient as or new applicant processor has real life to deal with as well. He or she will get in contact with you with in 72 hours.\n" ."3. Thank you for applying at Thaczero.com Please do not reply to this email as it is an email bot.\n"; mail($toaddress, $subject, $mailcontent, $additional_headers); $custip = $_SERVER['REMOTE_ADDR']; $additional_headers = "From: newapplicant@thaczero.com\n"; $toaddress = "sawchukg@cox.net"; $subject = "A new Thaco Applicant!"; $mailcontent = "Here is the information that was provided by the applicant\n\r" ."Character Name: " . $_POST['Cname'] . "\n\r" ."Who recomended you: " . $_POST['recomend'] . "\n\r" ."Email address: " . $_POST['email'] . "\n\r" ."Why do you want to join THACO: " . $_POST['email'] . "\n\r" . "\n\r"; mail($toaddress, $subject, $mailcontent, $additional_headers); ob_end_clean(); header ("Location:applied.php"); } else if ($complete == "no") echo "$top_form"."$result"."$form_block"; } ?> If I am way off base with this sorry just thoguth I would try and help so many others have helped me. I also can not take credit for this mail function as I pieced it together with other online content to make it work. I wish you the best.
  8. Let me show you what the problem is please go to this link http://thaczero.com/cloak.php you will notice that under Item Name the Bards Cloak and the Cape of the Rock have hyperlinks. If you click on the link it brings up a picture of the item. But if you notice next to the name is an item description field and that has dissapeared nothing is there. If you look in the table the information exist but it is not being posted. Here is the page you are viewing <? // start the session session_start(); ob_start(); include ('includes/allfunctions.php'); header("Cache-control: private"); //IE 6 Fix ?> <title>DDO Items</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="CSS/style.css" rel="stylesheet" type="text/css"> <body class="body"> <div align="center"> <? include ('includes/header.php'); include ('includes/tindex.php'); //Connect to the database all fields are good so far $sql = 'SELECT * FROM `ddoitems` WHERE `ItemType` LIKE \'%Cloak%\' ORDER BY ItemName ASC'; database_connect(); tables($sql); ?> </table> </td> </tr> <td align="center" valign="bottom"><? include ('includes/footer.php')?> </td> </table> </div> </html> here is the code for tables($sql) function tables($sql) { database_connect(); $result = mysql_query($sql) or die(mysql_error()); $count = "A"; while($row = mysql_fetch_array($result)) { if ($count == "A" ) { //start if if ($row['hyperlink'] == NULL) { //start if has an end echo '<tr class="cellbg1"><div align="center">'; echo '<td>'.$row['ItemName'].'</td>'; echo '<td> <div align="left">'.$row['ItemDescription'].'</div></td>'; echo '<td>'.$row['Type'].'</td>'; echo '<td>'.$row['QuestName'].'</td>'; echo '<td>'.$row['lvl'].'</td>'; echo '<td>'.$row['Notes'].'</td>'; echo '</div> </tr>'; $count = "B"; } else { //end if start else else has end echo '<tr class="cellbg1"><div align="center">'; echo '<td> <a href="'.$row['hyperlink'].'"target="_blank">'.$row['ItemName'].'</a></td>'; echo '<td> <div align="left"'.$row['ItemDescription'].'</div></td>'; echo '<td>'.$row['Type'].'</td>'; echo '<td>'.$row['QuestName'].'</td>'; echo '<td>'.$row['lvl'].'</td>'; echo '<td>'.$row['Notes'].'</td>'; echo '</div> </tr>'; $count = "B"; } // end else } else { if ($row['hyperlink'] == NULL) { echo '<tr class="cellbg2"><div align="center">'; echo '<td>'.$row['ItemName'].'</td>'; echo '<td> <div align="left">'.$row['ItemDescription'].'</div></td>'; echo '<td>'.$row['Type'].'</td>'; echo '<td>'.$row['QuestName'].'</td>'; echo '<td>'.$row['lvl'].'</td>'; echo '<td>'.$row['Notes'].'</td>'; echo '</div></tr>'; $count = "A"; } else { echo '<tr class="cellbg2"><div align="center">'; echo '<td> <a href="'.$row['hyperlink'].'"target="_blank">'.$row['ItemName'].'</a></td>'; echo '<td> <div align="left"'.$row['ItemDescription'].'</div></td>'; echo '<td>'.$row['Type'].'</td>'; echo '<td>'.$row['QuestName'].'</td>'; echo '<td>'.$row['lvl'].'</td>'; echo '<td>'.$row['Notes'].'</td>'; echo '</div> </tr>'; $count = "A"; } } } } My database is set up in this order: ID Item Name Item Description Type Quest Name LVL Notes Hyperlink I am not sure as to why the link picture is working but why the name link is not working. Any suggestions....And yes I am a self taught PHP and Mysql so I am sure there could have been better ways to do this code. Thanks,
  9. OK thanks for the ascending thing that worked still having problems with the forum and grabbing data from the database. Here is the coding again....I did do the name fix on the forum though. $sql = 'SELECT * FROM `ddoitems` WHERE `ItemDescription` LIKE \'%$item%\''; The $item is what I get from the form. I know it is getting it's info because I can echo it back to me. Just no mater how I put the $item I get an error. I beleive my syntax is wrong can someone show me the propper syntax? Thanks,
  10. Question 1: I have been trying to get the PHP $Post to work on a single page and it is not working....I have Echo statements to see what part of the if I am in and I go from the if to the else but no data is being pulled out of the database. I have added that code below. What am I missing or doing wrong? <? // start the session session_start(); ob_start(); include ('includes/allfunctions.php'); header("Cache-control: private"); //IE 6 Fix ?> <title>DDO Items</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="CSS/style.css" rel="stylesheet" type="text/css"> <body> <table width="100%" border="1" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC"> <tr> <? include ('includes/header.php'); ?> </tr> <tr> <td height="500" align="center" valign="top"><map name="WeaponsMap"> <area shape="rect" coords="84,22,135,67" href="goggles.php" target="_self" alt="Goggles"> </map> <table width="160" border="1" cellspacing="1" cellpadding="2"> <tr> <td width="150"><img src="Pictures/EquipmentScreen.jpg" alt="DDO Items" width="348" height="251" border="0" usemap="#Weapons"></td> </tr> <tr> <td><div align="center"> <p>Just click on an area above to search for that type of item. <span class="style1">**Note the second weapon slot is for shields.**. </span></p> </div></td> </tr> <tr> <td><div align="center">In the search box below you can search for specific named items or you can search for something like "potency, wounding, dagger, etc". </div></td> </tr> <tr> <td> <? $top_form = "<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}\"> <table border=\"2\" cellpadding=\"2\" cellspacing=\"2\" bordercolor=\"#333333\" bgcolor=\"#CCCCCC\"> <tr align=\"center\" valign=\"middle\"> <td colspan=\"1\">"; $bottom_form = "</td> </tr> <tr> <td>Enter your search word, name, or phrase</td> <td><input type=\"text\" value=\"{$_POST['search']}\"></td> </tr> <tr align=\"center\" valign=\"middle\"> <td colspan=\"2\"> <input type=\"hidden\" name=\"op\" value=\"ds\"> <input type=\"submit\" name=\"Submit\" value=\"Search\"></td> </tr> </table> </form>"; if ($_POST['op'] != "ds") { echo "In the if"; echo "$top_form"."$bottom_form"; } else { echo "in the else"; $item = $_POST['search']; echo "$item"; // $sql = 'SELECT * FROM `ddoitems` WHERE `ItemDescription` LIKE "%$item%"'; $sql = 'SELECT * FROM `ddoitems` WHERE `ItemDescription` LIKE "%$item%"'; database_connect(); $result = mysql_query($sql/*, $dbconnection check php.net for the right syntax */) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td><div align="center" class="style1">'.$row['ItemName'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['ItemDescription'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Type'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['QuestName'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['lvl'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Notes'].'</div></td>'; echo '</tr>'; } } ?> </table> <p>I am still working on this page the search function is not operational yet. </p></td> </tr> <td align="center" valign="bottom"><? include ('includes/footer.php')?> </td> </table> <map name="Weapons"> <area shape="rect" coords="287,187,338,232" href="rings.php" target="_self" alt="Rings"> <area shape="rect" coords="287,133,338,178" href="belts.php" target="_self" alt="Belt"> <area shape="rect" coords="287,75,338,120" href="cloak.php" target="_self" alt="Cloak"> <area shape="rect" coords="287,20,338,65" href="trinkets.php" target="_self" alt="Trinkets"> <area shape="rect" coords="216,202,267,247" href="gloves.php" target="_self" alt="Gloves"> <area shape="rect" coords="148,202,199,247" href="boots.php" target="_self" alt="Boots"> <area shape="rect" coords="216,8,267,53" href="necklace.php" target="_self" alt="Necklace"> <area shape="rect" coords="147,7,198,52" href="helm.php" target="_self" alt="Helm"> <area shape="rect" coords="84,188,135,233" href="rings.php" target="_self" alt="Rings"> <area shape="rect" coords="84,131,135,176" href="gloves.php" target="_self" alt="Gloves"> <area shape="rect" coords="83,76,134,121" href="armor.php" target="_self" alt="Armor"> <area shape="rect" coords="8,53,60,93" href="weapons.php" target="_self" alt="Weapons"> <area shape="rect" coords="8,108,59,150" href="shields.php" target="_self" alt="Shields"> <area shape="rect" coords="8,167,59,209" href="arrows.php" target="_self" alt="Arrows / Bolts"><area shape="rect" coords="84,22,135,67" href="goggles.php" target="_self" alt="Goggles"> </map> </html> Question 2 What so I have to adjust on the following code to get it to display all the items it pulls out of the database in ascending alphetabical order by the ItemName? Code provided below. $sql = 'SELECT * FROM `ddoitems` WHERE `ItemType` LIKE \'%Cloak%\''; database_connect(); $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)) { if ($row['hyperlink'] == NULL) { echo '<tr>'; echo '<td><div align="center" class="style1">'.$row['ItemName'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['ItemDescription'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Type'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['QuestName'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['lvl'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Notes'].'</div></td>'; echo '</tr>'; } else { echo '<tr>'; echo '<td><div align="center" class="style1"><a href="'.$row['hyperlink'].'"target="_blank">'.$row['ItemName'].'</a></div></td>'; echo '<td><div align="center" class="style1">'.$row['ItemDescription'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Type'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['QuestName'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['lvl'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Notes'].'</div></td>'; echo '</tr>'; } } ?> Thanks for all your help.
  11. That helped a lot but it does not apear to be getting what I type into the text block? So what is wrong with that portion of the code. Do I need the page to reload to post that into the $_POST['search']; Thanks,
  12. Hello I am trying to have someone enter somthing into a text block and submit it and have the results found in the database be shown. I am not sure what I am doing wrong here. You can see my site at: http://thaczero.com/search.php My coding is like this: <? $top_form = "<form method=\"post\" action=\"$_SERVER[php_SELF]\"> <table border=\"2\" cellpadding=\"2\" cellspacing=\"2\" bordercolor=\"#333333\" bgcolor=\"#CCCCCC\"> <tr align=\"center\" valign=\"middle\"> <td colspan=\"1\">"; $bottom_form = "</td> </tr> <tr> <td>Enter your search word, name, or phrase</td> <td><input type=\"text\" value=\"$_POST[search]\"></td> </tr> <tr align=\"center\" valign=\"middle\"> <td colspan=\"2\"> <input type=\"hidden\" name=\"op\" value=\"ds\"> <input type=\"submit\" name=\"Submit\" value=\"Search\"></td> </tr> </table> </form>"; if ($_POST[op] != "ds") { echo "In the if"; echo "$top_form"."$bottom_form"; } else { echo "in the else"; echo "$_POST[search]"; $item = $_POST[search]; echo "$item"; $sql = 'SELECT * FROM `ddoitems` WHERE `ItemDescription` LIKE "$item"'; database_connect(); $result = mysql_query($sql) or die(mysql_error()); echo "$top_form"."$bottom_form"; while($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td><div align="center" class="style1">'.$row['ItemName'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['ItemDescription'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Type'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['QuestName'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['lvl'].'</div></td>'; echo '<td><div align="center" class="style1">'.$row['Notes'].'</div></td>'; echo '</tr>'; } } ?>
  13. Thank you so much for all your help I got it to work....Now I am just working on the formating and I can hande that. I realy do appreciate all your help.....My next undertaking will be a very simple PHP form but I have all my old data with a form already done hopefull I can get that to work..... Thanks Again, Attila
  14. OK I think I figured out my problem but I am not sure how to fix it. My database name is DDO Items If I use this script: $sql = "SELECT * FROM DDO Items WHERE 1"; $result = mysql_query($sql) or die(mysql_error()); I get this error: Table 'a1863106_items.DDO' doesn't exist I know my problem is that the name of my database is DDO Items how do I keep this as a string to look in that table? Or could I change my database name with phpmyadmin to ddoitems? If so how do I do that? Thanks for all your help.
  15. Sorry it is still not working. Not sure what is wrong. My Host is: http://www.000webhost.com/ (Only free host I could find with PHP and MYSQL) Any other suggestions? Thanks so much.
  16. Still no luck so lets try this. Here is my database layout: Database Name is: a1863106_items (This is a free website with PHP and MYSQL sorry) Field Type Null Default Comments ID int(11) No ItemName text No ItemType text No ItemDescription text No Quest text No QuestLevel text No Notes text No Here is the error I am getting: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/a1863106/public_html/gloves.php on line 22 Here is the full coding on the page <? // start the session session_start(); ob_start(); include ('includes/AllFunctions.php'); header("Cache-control: private"); //IE 6 Fix ?> <title>DDO Items</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <body> <table width="100%" border="1" cellspacing="1" cellpadding="1"> <tr> <? include ('includes/header.php'); ?> </tr> <tr> <td height="500"> <? //Connect to the database all fields are good so far database_connect(); $sql = "SELECT * FROM a1863106_items WHERE 1"; while($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td>'.$row['ItemName'].'</td>'; echo '</tr>'; } ?> </td> </tr> <td align="center" valign="bottom"><? include ('includes/footer.php')?> </td> </table> </html> Thank you so much for your help. Attila
  17. LMAO.....I hope I have given you a good laugh...I have fixed back what you pointed out. Although I beleive where I am messing up now is my: $sql = bla bla bla......from what I remember this is what I am looking for in the table. In the exaple I have provided like gloves in each field. Can you see what is wrong on that part? Thanks so much, Attila
  18. Thank you all for such quick replies. This is where I am at now. <?php //Connect to the database all fields are good so far database_connect(); $sql = 'SELECT * FROM `a1863106_items`.`DDO Items` WHERE (`ID` LIKE \'%Gloves%\' OR `Item Name` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Specific Item Type`LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Item Dexcription` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Quest` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Quest Level` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Notes` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1)COLLATE latin1_general_ci)'; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td>Item info</td><td>'.$row['itemname'].'</td>'; echo '</tr>'; } ?> I know this is not everything yet I just wanted to see if I can get it to work....I did change my database $row['itemname'] to itemname instead of Item Name. But now I beleive my $sql queary is all messed up. and I am also getting the following error and I beleive it is because of my $sql search. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/......../............/gloves.php on line 29 Thanks again all....I would rather be messing with this then playiing the game. Attila
  19. The database contains information like this: ID Item Name Item Type Item Description......etc 1 Speed Gloves Gloves Speed Gloves - Improves your speed by +1 2 Damage Gloves Gloves Damage Gloves - Improves your damage By +1 etc I would like to be able to search the databes for all gloves then show the person the gloves that are in the database minus the ID number in a clean looking table. So each ID number is a diferent item with diferent description. Thanks, Attila
  20. OK here is what I got. I have created a data base already and I can connect to the database now I am trying to pull stuff out of the database and display it on a webpage. For this example I am going to a php page that is a constant and it will always pull the same information. Because I haven't done PHP in so long I am cheating and using the phpmyadmin to generate this code. $sql = 'SELECT * FROM `a1863106_items`.`DDO Items` WHERE (`ID` LIKE \'%Gloves%\' OR `Item Name` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Specific Item Type` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Item Dexcription` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Quest` LIKE CONVERT(_utf8 \'% Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Quest Level` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci OR `Notes` LIKE CONVERT(_utf8 \'%Gloves%\' USING latin1) COLLATE latin1_general_ci)'; From what I remember I need to count to see how many instances are found. Then I want to be able to display those in a table. In order to display them in a table I need to put the data I got from the table into an array and then echo that array inside my html and loop that till count = 0. Sorry I know I am asking alot for someone to help out with this it has just been a year or so since I have messed with PHP and I do not remember how to do it. Please help a tinker bot. P.S. The website I am making is cheesy in itself....I play DDO an online video game. I want to put all the unique items into a data base so people can look to see what quest they need to do to get these items and so forth. Thanks, Attila
×
×
  • 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.