ossukoss Posted July 8, 2013 Posted July 8, 2013 (edited) <?php if(file_exist("config.php")) { include("config.php"); } else { ### UPDATE IF USING v1 ### $_CONFIG['username'] = ""; $_CONFIG['password'] = ""; $_CONFIG['database'] = ""; } mysql_connect('',$_CONFIG['username'],$_CONFIG['password']); mysql_select_db($_CONFIG['database']); if($_POST['email']) { $_POST['email'] = htmlentities($_POST['email']); $_POST['username'] = htmlentities($_POST['username']); if($_GET['username']) { $search_users = mysql_query("SELECT * FROM users WHERE login_name='".$_POST['username']."'") or die(mysql_error()); if(mysql_num_rows($search_users) == 0) { echo 'There is no user\'s with that login name.'; exit; } } $search_email = mysql_query("SELECT * FROM users WHERE email='".$_POST['email']."'") or die(mysql_error()); if(mysql_num_rows($search_email) == 0) { echo 'No user\'s with this email.'; exit; } $password = rand(10000,20000); $fetch_data = mysql_fetch_assoc($search_email); $username = $fetch_data['username']; $body = "Welcome to Rapid - Riot automated email.\n\nYour password is: ".$password."\nYour login name is: ".$fetch_data['login_name']."\n\nPlease login at <a href="http://www.rapid-riot.com" target="_blank">"; $subject = "Your Forgotten Password"; $email = $fetch_data['email']; $from = "From: Rapid - Riot Automated Email <[email protected]>"; mail($email, $subject, $body, $from); mysql_query("UPDATE users SET userpass='".md5($password)."' WHERE login_name='".$_POST['username']."' AND email='".$_POST['email']."'") or die(mysql_error()); echo 'Mail has been sent. Please check your spam box also.'; exit; } echo '<form action="?act=FPass" method="post"> Email: <input type="text" name="email"> Login Name: <input type="text" name="username"> <input type="submit" value="Submit"> </form>'; ?> Parse error: syntax error, unexpected T_STRING in /home/a1448143/public_html/forgot.php on line 38 Edited July 8, 2013 by Dominion Removed DB password etc Quote
Jaaaacccckkk Posted July 8, 2013 Posted July 8, 2013 Use single quotes in your anchor on line 38: $body = "Welcome to Rapid - Riot automated email.\n\nYour password is: ".$password."\nYour login name is: ".$fetch_data['login_name']."\n\nPlease login at <a href='http://www.rapid-riot.com' target='_blank'>"; Quote
Guest Posted July 8, 2013 Posted July 8, 2013 Might want to send the correct headers with your mail as well. Quote
KyleMassacre Posted July 8, 2013 Posted July 8, 2013 Might want to send the correct headers with your mail as well. that would be good since html is being used in the email. you can maybe take a look at this to get some ideas: http://css-tricks.com/sending-nice-html-email-with-php/ Quote
Dominion Posted July 8, 2013 Posted July 8, 2013 I removed them earlier, however in future please ensure you remove all passwords/usernames from files that hold them. Quote
jcvenom Posted July 8, 2013 Posted July 8, 2013 line 38 should be $body = "Welcome to Rapid - Riot automated email.\n\nYour password is: '.$password.'\nYour login name is: '.$fetch_data['login_name'].'\n\nPlease login at <a href='http://www.rapid-riot.com' target='_blank'>"; Quote
ossukoss Posted July 10, 2013 Author Posted July 10, 2013 Fatal error: Call to a member function fetchrow() on a non-object in /home/a1448143/public_html/market.php on line 89 <?php /****************************************/ /* ezRPG script */ /* Written by Zeggy */ /* http://code.google.com/p/ezrpg */ /* http://www.bbgamezone.com/ */ /* Mod: market.php */ /* Written by MasterTester */ /* http://www.yourcounty4sale.com/king/ */ /****************************************/ include("lib.php"); define("PAGENAME", "Turg"); $player = check_user($secret_key, $db); $limit = (!$_GET['limit'])?30:intval($_GET['limit']); //Use user-selected limit of players to list $begin = (!$_GET['begin'])?$player->id-intval($limit / 2):intval($_GET['begin']); //List players with the current player in the middle of the list $begin = ($begin < 0)?0:$begin; //Can't list negative players :) $total_items = $db->getone("select count(market_id) as `count` from `market`"); $begin = ($begin >= $total_items)?$total_items - $limit:$begin; //Can't list players don't don't exist yet either $begin = ($begin < 0)?0:$begin; //Can't list negative players :) $lastpage = (($total_items - $limit) < 0)?0:$total_items - $limit; //Get the starting point if the user has browsed to the last page $order=$_GET['order']; $abc=$_GET['abc']; if($order=="item"){$orderby="item_name";} elseif($order=="price"){$orderby="price";} elseif($order=="qty"){$orderby="qty";} elseif($order=="cost"){$orderby="total_cost";} elseif($order=="seller"){$orderby="seller";} else{$orderby="item_id"; $abc="asc";} switch($_GET['act']) { case "remove": { $market_id=$_GET['item']; include("templates/private_header.php"); echo "Oled sa kindel? Sa tahad võtta ära oma asjad.<br /><br />"; echo "<a href=\"market.php?act=confirm&item=" . $market_id . "\"><b>Jah</b></a> <a href=\"market.php\"><b>EI</b></a>"; include("templates/private_footer.php"); break; } case "confirm": { $market_id=$_GET['item']; //marks item as sold instead of deleting it all together. $query_sold=$db->execute("update `market` set `sold`=? where `market_id`=?", array(t, $market_id)); include("templates/private_header.php"); echo "Sinu asjad eemaldati.<br /><br />"; echo "<a href=\"market.php\"><b>Tagasi turule</b></a>"; include("templates/private_footer.php"); break; } Default: include("templates/private_header.php"); ?> <a href="market.php?begin=<?=($begin - $limit)?>&limit=<?=$limit?>">Previous Page</a> | <a href="market.php?begin=<?=($begin + $limit)?>&limit=<?=$limit?>">Next Page</a> <br /><br /> Näita <a href="market.php?begin=<?=$begin?>&limit=5">5</a> | <a href="market.php?begin=<?=$begin?>&limit=10">10</a> | <a href="market.php?begin=<?=$begin?>&limit=20">20</a> | <a href="market.php?begin=<?=$begin?>&limit=30">30</a> | <a href="market.php?begin=<?=$begin?>&limit=40">40</a> | <a href="market.php?begin=<?=$begin?>&limit=50">50</a> | <a href="market.php?begin=<?=$begin?>&limit=100">100</a> asja lehel. <br /><br /> <a href="market_sell.php">Müü oma asju.</a> <br /><br /> <table width="100%" border="0"> <tr> <th><b><a href="market.php?order=item&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Asi</a></b></td> <th><b><a href="market.php?order=price&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Ühe hind</a></b></td> <th><b><a href="market.php?order=qty&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Tk</a></b></td> <th><b><a href="market.php?order=cost&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Hind kokku</a></b></td> <th><b><a href="market.php?order=seller&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Müüja</a></b></td> <th><b>Tegevused</b></td> </tr> <?php //Query the market db $query_market = $db->execute("select `market_id`, `item_id`, `item_name`, `qty`, `price`, `total_cost`,`seller_id`,`seller`, `sold` from `market` where `sold`='f' order by $orderby $abc limit ?,?", array($begin, $limit)); while($market = $query_market->fetchrow()) { echo "<tr>\n"; echo "<td>" . $market['item_name'] . "</td>"; echo "<td>" . $market['price'] . "</td>"; echo "<td>" . $market['qty'] . "</td>"; echo "<td>" . $market['total_cost'] . "</td>"; echo "<td>" . $market['seller'] . "</td>"; if($market['seller']==$player->username){ echo "</td><td><a href=\"market.php?act=remove&item=" . $market['market_id'] . "\">Eemalda</a></td>\n"; }else{ echo "</td><td><a href=\"market_buy.php?act=buy&item=" . $market['market_id'] . "\">Osta</a></td>\n"; } } ?> </table> <?php include("templates/private_footer.php"); } ?> Quote
HauntedDawg Posted July 10, 2013 Posted July 10, 2013 (edited) Fatal error: Call to a member function fetchrow() on a non-object in /home/a1448143/public_html/market.php on line 89 <?php /****************************************/ /* ezRPG script */ /* Written by Zeggy */ /* http://code.google.com/p/ezrpg */ /* http://www.bbgamezone.com/ */ /* Mod: market.php */ /* Written by MasterTester */ /* http://www.yourcounty4sale.com/king/ */ /****************************************/ include("lib.php"); define("PAGENAME", "Turg"); $player = check_user($secret_key, $db); $limit = (!$_GET['limit'])?30:intval($_GET['limit']); //Use user-selected limit of players to list $begin = (!$_GET['begin'])?$player->id-intval($limit / 2):intval($_GET['begin']); //List players with the current player in the middle of the list $begin = ($begin < 0)?0:$begin; //Can't list negative players :) $total_items = $db->getone("select count(market_id) as `count` from `market`"); $begin = ($begin >= $total_items)?$total_items - $limit:$begin; //Can't list players don't don't exist yet either $begin = ($begin < 0)?0:$begin; //Can't list negative players :) $lastpage = (($total_items - $limit) < 0)?0:$total_items - $limit; //Get the starting point if the user has browsed to the last page $order=$_GET['order']; $abc=$_GET['abc']; if($order=="item"){$orderby="item_name";} elseif($order=="price"){$orderby="price";} elseif($order=="qty"){$orderby="qty";} elseif($order=="cost"){$orderby="total_cost";} elseif($order=="seller"){$orderby="seller";} else{$orderby="item_id"; $abc="asc";} switch($_GET['act']) { case "remove": { $market_id=$_GET['item']; include("templates/private_header.php"); echo "Oled sa kindel? Sa tahad võtta ära oma asjad.<br /><br />"; echo "<a href=\"market.php?act=confirm&item=" . $market_id . "\"><b>Jah</b></a>******<a href=\"market.php\"><b>EI</b></a>"; include("templates/private_footer.php"); break; } case "confirm": { $market_id=$_GET['item']; //marks item as sold instead of deleting it all together. $query_sold=$db->execute("update `market` set `sold`=? where `market_id`=?", array(t, $market_id)); include("templates/private_header.php"); echo "Sinu asjad eemaldati.<br /><br />"; echo "<a href=\"market.php\"><b>Tagasi turule</b></a>"; include("templates/private_footer.php"); break; } Default: include("templates/private_header.php"); ?> <a href="market.php?begin=<?=($begin - $limit)?>&limit=<?=$limit?>">Previous Page</a> | <a href="market.php?begin=<?=($begin + $limit)?>&limit=<?=$limit?>">Next Page</a> <br /><br /> Näita <a href="market.php?begin=<?=$begin?>&limit=5">5</a> | <a href="market.php?begin=<?=$begin?>&limit=10">10</a> | <a href="market.php?begin=<?=$begin?>&limit=20">20</a> | <a href="market.php?begin=<?=$begin?>&limit=30">30</a> | <a href="market.php?begin=<?=$begin?>&limit=40">40</a> | <a href="market.php?begin=<?=$begin?>&limit=50">50</a> | <a href="market.php?begin=<?=$begin?>&limit=100">100</a> asja lehel. <br /><br /> <a href="market_sell.php">Müü oma asju.</a> <br /><br /> <table width="100%" border="0"> <tr> <th><b><a href="market.php?order=item&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Asi</a></b></td> <th><b><a href="market.php?order=price&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Ühe hind</a></b></td> <th><b><a href="market.php?order=qty&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Tk</a></b></td> <th><b><a href="market.php?order=cost&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Hind kokku</a></b></td> <th><b><a href="market.php?order=seller&abc=<?php if($abc=="desc"){echo "asc";}elseif($abc=="asc"){echo "desc";}else {echo "asc";}?>">Müüja</a></b></td> <th><b>Tegevused</b></td> </tr> <?php //Query the market db $query_market = $db->execute("select `market_id`, `item_id`, `item_name`, `qty`, `price`, `total_cost`,`seller_id`,`seller`, `sold` from `market` where `sold`='f' order by $orderby $abc limit ?,?", array($begin, $limit)); while($market = $query_market->fetchRow()) { echo "<tr>\n"; echo "<td>" . $market['item_name'] . "</td>"; echo "<td>" . $market['price'] . "</td>"; echo "<td>" . $market['qty'] . "</td>"; echo "<td>" . $market['total_cost'] . "</td>"; echo "<td>" . $market['seller'] . "</td>"; if($market['seller']==$player->username){ echo "</td><td><a href=\"market.php?act=remove&item=" . $market['market_id'] . "\">Eemalda</a></td>\n"; }else{ echo "</td><td><a href=\"market_buy.php?act=buy&item=" . $market['market_id'] . "\">Osta</a></td>\n"; } } ?> </table> <?php include("templates/private_footer.php"); } ?> Have you tried changing fetchrow to fetch_row? As far as I'm aware, most programmers would add an "_" or have a capital after first word as such: firstWord, however, take that with a pinch of salt, as I have never seen ezRPG's source. ---- EDIT ---- After taking a look at ezRPG db class, it's fetchRow and not fetchrow http://code.google.com/p/ezrpg/source/browse/lib/db.mysql.php Edited July 10, 2013 by HauntedDawg Quote
ossukoss Posted July 10, 2013 Author Posted July 10, 2013 Have you tried changing fetchrow to fetch_row? As far as I'm aware, most programmers would add an "_" or have a capital after first word as such: firstWord, however, take that with a pinch of salt, as I have never seen ezRPG's source. ---- EDIT ---- After taking a look at ezRPG db class, it's fetchRow and not fetchrow http://code.google.com/p/ezrpg/source/browse/lib/db.mysql.php i tryed this but it isint work :( Quote
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.