PowlFruit Posted June 23, 2011 Share Posted June 23, 2011 (edited) Hey My Problem is: Parse error: syntax error, unexpected T_STRING in /var/www/virtual/XXXXXXX/htdocs/itemmarket.php on line 94 URL LINK REMOVED this is my Itemmarket.php Please help me Edited June 23, 2011 by illusions Removed Download Link Quote Link to comment Share on other sites More sharing options...
Danny696 Posted June 23, 2011 Share Posted June 23, 2011 Not going to download a rar file thanks. Theres a var on line 94 that either shouldnt be there, or the line before wasnt 'finished' Post up like 92-96 Quote Link to comment Share on other sites More sharing options...
Rory_M Posted June 23, 2011 Share Posted June 23, 2011 The chances are you are missing a ; in the previous line. Quote Link to comment Share on other sites More sharing options...
PowlFruit Posted June 23, 2011 Author Share Posted June 23, 2011 (edited) if($curr=="money") { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> kaufte dein {$r['itmname']} item von markt für \$".number_format($r['imPRICE']).".",$c); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for \${$r['imPRICE']} from user ID {$r['imADDER']}')"); print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich \$".number_format($r['imPRICE'])."."; } else { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought your {$r['itmname']} item from the market for ".number_format($r['imPRICE'])." crystals.",$c); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for {$r['imPRICE']} crystals from user ID {$r['imADDER']}')"); print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich ".number_format($r['imPRICE'])." Crystals gekostet.."; } Edited June 23, 2011 by illusions Removed download link added BBCODE Quote Link to comment Share on other sites More sharing options...
Uridium Posted June 23, 2011 Share Posted June 23, 2011 Change Line 94 from print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich \$".number_format($r['imPRICE']) gekostet."."; to print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich \$".number_format($r['imPRICE'])."."; Quote Link to comment Share on other sites More sharing options...
PowlFruit Posted June 23, 2011 Author Share Posted June 23, 2011 Not work.. Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted June 23, 2011 Share Posted June 23, 2011 This is why people are asking you to post the code. I for one will not download a zip or rar file to see what the problem is. Quote Link to comment Share on other sites More sharing options...
PowlFruit Posted June 23, 2011 Author Share Posted June 23, 2011 http://pastie.org/private/lufl3pvfrjhackkcykcw Line 90-101 Quote Link to comment Share on other sites More sharing options...
Uridium Posted June 23, 2011 Share Posted June 23, 2011 Ive compared yours to the original of the v2 and those lines from 90-101 seem to be ok so you error must be either above line 90 or below line 101 Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted June 23, 2011 Share Posted June 23, 2011 Sheesh dont know why you have a problem posting the code here. Quote Link to comment Share on other sites More sharing options...
PowlFruit Posted June 24, 2011 Author Share Posted June 24, 2011 <?php include "globals.php"; print "<h3>Item Markt</h3>"; switch($_GET['action']) { case "buy": item_buy(); break; case "gift1": item_gift1(); break; case "gift2": item_gift2(); break; case "remove": itemm_remove(); break; default: imarket_index(); break; } function imarket_index() { global $db,$ir,$c,$userid,$h; print "Sie sehen alle Inserate... <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th>Verkäufer</th> <th>Item</th> <th>Preis</th> <th>Links</th> </tr>"; $q=$db->query("SELECT im.*, i.*, u.*,it.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid LEFT JOIN users u ON u.userid=im.imADDER LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid ORDER BY i.itmtype, i.itmname ASC"); $lt=""; while($r=$db->fetch_row($q)) { if($lt!=$r['itmtypename']) { $lt=$r['itmtypename']; print "\n<tr style='background: gray;'><th colspan=4>{$lt}</th></tr>"; } if($r['imCURRENCY']=="money") { $price="\$".number_format($r['imPRICE']); } else { $price=number_format($r['imPRICE'])." crystals"; } if($r['imADDER'] == $userid) { $link = "[<a href='itemmarket.php?action=remove&ID={$r['imID']}'>Entfernen</a>]"; } else { $link = "[<a href='itemmarket.php?action=buy&ID={$r['imID']}'>Kaufen</a>] [<a href='itemmarket.php?action=gift1&ID={$r['imID']}'>Geschenk</a>]"; } print "\n<tr> <td><a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a> [{$r['userid']}]</td> <td>{$r['itmname']}</td> <td>$price</td> <td>[<a href='iteminfo.php?ID={$r['itmid']}'>Info</a>] $link</td> </tr>"; } print "</table>"; } function itemm_remove() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT im.*,i.* FROM itemmarket im LEFT JOIN items i ON im.imITEM=i.itmid WHERE imID={$_GET['ID']} AND imADDER=$userid"); if(!$db->num_rows($q)) { print "Error, either this item does not exist, or you are not the owner.<br /> <a href='itemmarket.php'>> Zurück</a>"; $h->endpage(); exit; } $r=$db->fetch_row($q); item_add($userid, $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}"); $db->query("INSERT INTO imremovelogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} removed a {$r['itmname']} from the item market.')"); print "Item wurde von Mart entfernt.<br /> <a href='itemmarket.php'>> Zurück</a>"; } function item_buy() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM itemmarket im LEFT JOIN items i ON i.itmid=im.imITEM WHERE imID={$_GET['ID']}",$c); if(!$db->num_rows($q)) { print "Fehler, entweder dieses Item existiert nicht, oder es wurde bereits gekauft.<br /> <a href='itemmarket.php'>> Zurück</a>"; $h->endpage(); exit; } $r=$db->fetch_row($q); $curr=$r['imCURRENCY']; if($r['imPRICE'] > $ir[$curr]) { print "Fehler, sie verfügen nicht über die nötigen mittel um dieses Items zu kaufen.<br /> <a href='itemmarket.php'>> Zurück</a>"; $h->endpage(); exit; } item_add($userid, $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_GET['ID']}"); $db->query("UPDATE users SET $curr=$curr-{$r['imPRICE']} where userid=$userid"); $db->query("UPDATE users SET $curr=$curr+{$r['imPRICE']} where userid={$r['imADDER']}"); if($curr=="money") { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> kaufte dein {$r['itmname']} item von markt für \$".number_format($r['imPRICE']).".",$c); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for \${$r['imPRICE']} from user ID {$r['imADDER']}')"); print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich \$".number_format($r['imPRICE']) gekostet."."; } else { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> bought your {$r['itmname']} item from the market for ".number_format($r['imPRICE'])." crystals.",$c); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for {$r['imPRICE']} crystals from user ID {$r['imADDER']}')"); print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich ".number_format($r['imPRICE'])." Crystals gekostet.."; } } function item_gift1() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM itemmarket im LEFT JOIN items i ON i.itmid=im.imITEM WHERE imID={$_GET['ID']}"); if(!$db->num_rows($q)) { print "Fehler, entweder dieses Item existiert nicht, oder es wurde bereits gekauft.<br /> <a href='itemmarket.php'>> Zurück</a>"; $h->endpage(); exit; } $r=$db->fetch_row($q); $curr=$r['imCURRENCY']; if($r['imPRICE'] > $ir[$curr]) { print "Fehler, sie verfügen nicht über die nötigen mittel um dieses Items zu kaufen.<br /> <a href='itemmarket.php'>> Zurück</a>"; $h->endpage(); exit; } if($curr=="money") { print "Kaufe <b>{$r['itmname']}</b> für \$".number_format($r['imPRICE'])." und lass es als Geschenk einpacken...<br /> <form action='itemmarket.php?action=gift2' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> Geschenk senden an: ".user_dropdown($c,'user')."<br /> <input type='submit' value='Kaufe Es und Verschenke es' /></form>"; } else { print "Kaufe <b>{$r['itmname']}</b> für ".number_format($r['imPRICE'])." crystals und lass es als Geschenk einpacken...<br /> <form action='itemmarket.php?action=gift2' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> Geschenk senden an: ".user_dropdown($c,'user')."<br /> <input type='submit' value='Kaufe Es und Verschenke es' /></form>"; } } function item_gift2() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM itemmarket im LEFT JOIN items i ON i.itmid=im.imITEM WHERE imID={$_POST['ID']}"); if(!$db->num_rows($q)) { print "Fehler, entweder dieses Item existiert nicht, oder es wurde bereits gekauft.<br /> <a href='itemmarket.php'>> Zurück</a>"; $h->endpage(); exit; } $r=$db->fetch_row($q); $curr=$r['imCURRENCY']; if($r['imPRICE'] > $ir[$curr]) { print "Fehler, sie verfügen nicht über die nötigen mittel um dieses Items zu kaufen.<br /> <a href='itemmarket.php'>> Zurück</a>"; $h->endpage(); exit; } item_add($_POST['user'], $r['imITEM'], 1); $i=($db->insert_id()) ? $db->insert_id() : 99999; $db->query("DELETE FROM itemmarket WHERE imID={$_POST['ID']}"); $db->query("UPDATE users SET $curr=$curr-{$r['imPRICE']} where userid=$userid"); $db->query("UPDATE users SET $curr=$curr+{$r['imPRICE']} where userid={$r['imADDER']}"); if($curr=="money") { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> kaufte dein {$r['itmname']} item von markt für \$".number_format($r['imPRICE']).".",$c); event_add($_POST['user'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> kaufte dir {$r['itmname']} von markt und packte es dir als Geschnek ein.",$c); $u=$db->query("SELECT username FROM users WHERE userid={$_POST['user']}"); $uname=$db->fetch_single($u); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for \${$r['imPRICE']} from user ID {$r['imADDER']} as a gift for $uname [{$_POST['user']}]')"); print "Du hast {$r['itmname']} von Markt gekauft. Es kostete \$".number_format($r['imPRICE'])." und du hast es $uname als Geschenk geschickt."; } else { event_add($r['imADDER'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> kaufte dein {$r['itmname']} item von markt für \$".number_format($r['imPRICE'])." crystals.",$c); event_add($_POST['user'], "<a href='viewuser.php?u=$userid'>{$ir['username']}</a> kaufte dir {$r['itmname']} von markt und packte es dir als Geschnek ein.",$c); $u=$db->query("SELECT username FROM users WHERE userid={$_POST['user']}"); $uname=$db->fetch_single($u); $db->query("INSERT INTO imbuylogs VALUES ('', {$r['imITEM']}, {$r['imADDER']}, $userid, {$r['imPRICE']}, {$r['imID']}, $i, unix_timestamp(), '{$ir['username']} bought a {$r['itmname']} from the item market for {$r['imPRICE']} crystals from user ID {$r['imADDER']} as a gift for $uname [{$_POST['user']}]')"); print "Du hast {$r['itmname']} von Markt gekauft. Es kostete \$".number_format($r['imPRICE'])." Crysrtals und du hast es $uname als Geschenk geschickt.";"; } } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
Uridium Posted June 24, 2011 Share Posted June 24, 2011 (edited) On line 94 remove the word gekostet On line 184 remove the extra "; on Line 111 join it to line 110 ( Not Sure if your use of a Carriage Return would cause an error but better to alter it for now ) And apart from them theres nothing else i can see wrong with it. Edited June 24, 2011 by illusions Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted June 24, 2011 Share Posted June 24, 2011 (edited) This worked but did not test it fully because i did not add the sqls to my database. REMOVED BBCODE REASON ILLUSIONS COMMENT PowlFruit has already had an explanation as to why there are problems with his script if you view that source above and view page 1 of this topic you will see i have already explained that to him. My reason for Removing your BBCODE Lucky is that I dont want him thinking we are going to do all the work for him he has to learn to understand Instructions set out by others Especially when the advice given is correct.. END OF ILLUSIONS COMMENT The errors were... on line 94 and the very last print statement of your script. print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich \$".number_format($r['imPRICE']) gekostet."."; changed it to print "Du hast {$r['itmname']} vom Markt gekauft. Es hat dich \$".number_format($r['imPRICE']) ."gekostet."; print "Du hast {$r['itmname']} von Markt gekauft. Es kostete \$".number_format($r['imPRICE'])." Crysrtals und du hast es $uname als Geschenk geschickt.";"; changed it to print "Du hast {$r['itmname']} von Markt gekauft. Es kostete \$".number_format($r['imPRICE'])." Crysrtals und du hast es $uname als Geschenk geschickt."; Edited June 24, 2011 by illusions Added a comment Quote Link to comment Share on other sites More sharing options...
PowlFruit Posted June 25, 2011 Author Share Posted June 25, 2011 Thanx it works Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.