Jump to content

MasterACE14

Members
  • Posts

    2,687
  • Joined

  • Last visited

Everything posted by MasterACE14

  1. I am recieving a parse error, it says: line 28: if($userrow['charname'] == "$userrow['charname'] ~SS~"){ full code: <?php function donate1() { global $userrow; if($userrow['charname'] == "$userrow['charname'] ~SS~"){ $redd = ""; } elseif($userrow['charname'] !== "$userrow['charname'] ~SS~"){ $redd = " ~SS~"; } $charn = "$userrow['charname']"; $bank = "$userrow['bank']"; $maxmp = "$userrow['maxmp']"; $maxtp = "$userrow['maxtp']"; $maxhp = "$userrow['maxhp']"; $strengthh = "$userrow['strength']"; $dexterityy = "$userrow['dexterity']"; $experiencee = "$userrow['experience']"; if ($userrow['verify'] == 1) { $charn = $userrow['charname'] . $redd; $bank = ceil($userrow['bank']+2500); $maxmp = ceil($userrow['maxmp']+25); $maxtp = ceil($userrow['maxtp']+25); $maxhp = ceil($userrow['maxhp']+25); $strengthh = ceil($userrow['strength']+25); $dexterityy = ceil($userrow['dexterity']+25); $experiencee = ceil($userrow['experience']+100); //echo("Transaction Successful!"); } elseif ($userrow['verify'] !== 1) { die("This Page is restricted to people that have verified their accounts"); } $con = mysql_connect("localhost","ace_ACE","******"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ace_sl", $con); mysql_query("UPDATE `sl_users` SET `charname`='$charn' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `bank`='$bank' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `maxmp`='$maxmp' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `maxtp`='$maxtp' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `maxhp`='$maxhp' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `strength`='$strengthh' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `dexterity`='$dexterityy' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `experience`='$experiencee' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); mysql_query("UPDATE `sl_users` SET `authlevel`='3' WHERE id='".$userrow['id']."'") or die ("MYSQL ERROR: ".mysql_error().""); }; donate1(); ?>
  2. ok, thanks AndyB and MemphiS. Much appreciated Regards ACE
  3. I already know about that one, but i'm wondering if you can make it say "success" or something if the query executes without errors. Regards ACE
  4. ok, thats working now, but how can I echo the results of the query? that would be really helpful in debugging Regards ACE
  5. I believe I've missed out a comma or haven't put a variable into the query correctly. Heres the error I am getting: Heres the query(line 58): mysql_query("UPDATE `sl_users` SET bank=`$bank` WHERE id='".$userrow["id"]."'"); Regards ACE
  6. I am using a IPN script I found after awhile of google searching, and it works perfectly, except I have one problem, I have a function that runs on success of a paypal payment, and it is suppose to run once the IPN script has confirmed the payment has been made. The function that runs on success of a paypal payment, updates information in a user table in my database. I had it working earlier, when I was testing this on paypal sandbox, but now for some reason it doesn't do the function, or atleast doesn't do the queries in the function. would anyone be able to identify a problem in my function? Keeping in mind that the IPN script 'Does' work. just the function doesn't. here is the IPN script with the function near the top called donate1() : <?php if (file_exists('install.php')) { die("Please delete <b>install.php</b> from your Shadow Lords directory before continuing."); } include('lib.php'); include('cookies.php'); $link = opendb(); $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); $controlrow = mysql_fetch_array($controlquery); // Login (or verify) if not logged in. $userrow = checkcookies(); if ($userrow == false) { if (isset($_GET["do"])) { if ($_GET["do"] == "verify") { header("Location: users.php?do=verify"); die(); } } header("Location: login.php?do=login"); die(); } // Close game. if ($controlrow["gameopen"] == 0) { display("The game is currently closed for maintanence. Please check back later.","Game Closed"); die(); } // Force verify if the user isn't verified yet. if ($controlrow["verifyemail"] == 1 && $userrow["verify"] != 1) { header("Location: users.php?do=verify"); die(); } // Block user if he/she has been banned. if ($userrow["authlevel"] == 2) { die("Your account has been blocked. Please try back later."); } ?> <?php //SS Account Updating function donate1() { global $userrow; if($userrow["charname"] == '$userrow["charname"] ~SS~'){ $redd = ''; } elseif($userrow["charname"] !== '$userrow["charname"] ~SS~'){ $redd = ' ~SS~'; } $charn = '$userrow["charname"]'; $bank = '$userrow["bank"]'; $maxmp = '$userrow["maxmp"]'; $maxtp = '$userrow["maxtp"]'; $maxhp = '$userrow["maxhp"]'; $strengthh = '$userrow["strength"]'; $dexterityy = '$userrow["dexterity"]'; $experiencee = '$userrow["experience"]'; if ($userrow["verify"] == 1) { $charn = $userrow["charname"] . $redd; $bank = ceil($userrow["bank"]+2500); $maxmp = ceil($userrow["maxmp"]+25); $maxtp = ceil($userrow["maxtp"]+25); $maxhp = ceil($userrow["maxhp"]+25); $strengthh = ceil($userrow["strength"]+25); $dexterityy = ceil($userrow["dexterity"]+25); $experiencee = ceil($userrow["experience"]+100); //echo("Transaction Successful!"); } elseif ($userrow["verify"] !== 1) { die("This Page is restricted to people that have verified their accounts"); } doquery("UPDATE {{table}} SET charname='$charn' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET bank='$bank' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET maxmp='$maxmp' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET maxtp='$maxtp' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET maxhp='$maxhp' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET strength='$strengthh' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET dexterity='$dexterityy' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET experience='$experiencee' WHERE id='".$userrow["id"]."' ", "users"); doquery("UPDATE {{table}} SET authlevel='3' WHERE id='".$userrow["id"]."' ", "users"); }; ?> <?php /* PHP Paypal IPN Integration Class Demonstration File * 4.16.2005 - Micah Carrick, email@micahcarrick.com * * This file demonstrates the usage of paypal.class.php, a class designed * to aid in the interfacing between your website, paypal, and the instant * payment notification (IPN) interface. This single file serves as 4 * virtual pages depending on the "action" varialble passed in the URL. It's * the processing page which processes form data being submitted to paypal, it * is the page paypal returns a user to upon success, it's the page paypal * returns a user to upon canceling an order, and finally, it's the page that * handles the IPN request from Paypal. * * I tried to comment this file, aswell as the acutall class file, as well as * I possibly could. Please email me with questions, comments, and suggestions. * See the header of paypal.class.php for additional resources and information. */ // Setup class require_once('paypal.class.php'); // include the class file $p = new paypal_class; // initiate an instance of the class $p->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // testing paypal url //$p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; // paypal url <--- UNCOMMENT THIS ONE //$p->paypal_url = 'https://www.paypal.com/au/au/cgi-bin/webscr'; // aussie paypal url // setup a variable for this script (ie: 'http://www.micahcarrick.com/paypal.php') //$this_script = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; $this_script = 'http://www.crikeygames.com.au/shadowlords/purchase.php'; // if there is not action variable, set the default action of 'process' if (empty($_GET['action'])) $_GET['action'] = 'process'; switch ($_GET['action']) { case 'process': // Process and order... // There should be no output at this point. To process the POST data, // the submit_paypal_post() function will output all the HTML tags which // contains a FORM which is submited instantaneously using the BODY onload // attribute. In other words, don't echo or printf anything when you're // going to be calling the submit_paypal_post() function. // This is where you would have your form validation and all that jazz. // You would take your POST vars and load them into the class like below, // only using the POST values instead of constant string expressions. // For example, after ensureing all the POST variables from your custom // order form are valid, you might have: // // $p->add_field('first_name', $_POST['first_name']); // $p->add_field('last_name', $_POST['last_name']); $p->add_field('business', 'crikeygames@unwired.com.au'); $p->add_field('return', $this_script.'?action=success'); $p->add_field('cancel_return', $this_script.'?action=cancel'); $p->add_field('notify_url', $this_script.'?action=ipn'); $p->add_field('item_name', '$20 Shadow Lords Supporter Status'); $p->add_field('amount', '20.00'); $p->add_field('currency_code', 'AUD'); $p->submit_paypal_post(); // submit the fields to paypal //$p->dump_fields(); // for debugging, output a table of all the fields break; case 'success': // Order was successful... // This is where you would probably want to thank the user for their order // or what have you. The order information at this point is in POST // variables. However, you don't want to "process" the order until you // get validation from the IPN. That's where you would have the code to // email an admin, update the database with payment status, activate a // membership, etc. $returntogame = "/shadowlords/"; echo "<html><head><title>Success</title></head><body><h3>Thank you for purchasing Supporter Status for Shadow Lords.</h3><br /><br /><a href=".$returntogame.">Return to Shadow Lords</a><br />"; foreach ($_POST as $key => $value) //{ echo "$key: $value<br>"; } echo "</body></html>"; // You could also simply re-direct them to another page, or your own // order status page which presents the user with the status of their // order based on a database (which can be modified with the IPN code // below). break; case 'cancel': // Order was canceled... // The order was canceled before being completed. echo "<html><head><title>Canceled</title></head><body><h3>The payment was canceled.</h3><br /><br /><a href=".$returntogame.">Return to Shadow Lords</a><br />"; echo "</body></html>"; break; case 'ipn': // Paypal is calling page for IPN validation... // It's important to remember that paypal calling this script. There // is no output here. This is where you validate the IPN data and if it's // valid, update your database to signify that the user has payed. If // you try and use an echo or printf function here it's not going to do you // a bit of good. This is on the "backend". That is why, by default, the // class logs all IPN data to a text file. if ($p->validate_ipn()) { // Payment has been recieved and IPN is verified. This is where you // update your database to activate or process the order, or setup // the database with the user's order details, email an administrator, // etc. You can access a slew of information via the ipn_data() array. // Check the paypal documentation for specifics on what information // is available in the IPN POST variables. Basically, all the POST vars // which paypal sends, which we send back for validation, are now stored // in the ipn_data() array. donate1(); // For this example, we'll just email ourselves ALL the data. /* $subject = 'Shadow Lords - Instant Payment Notification - Recieved Payment'; $to = 'crikeygames@unwired.com.au'; // your email $body = "An instant payment notification was successfully recieved\n"; $body .= "from ".$p->ipn_data['payer_email']." on ".date('m/d/Y'); $body .= " at ".date('g:i A')."\n\nDetails:\n"; foreach ($p->ipn_data as $key => $value) { $body .= "\n$key: $value"; } mail($to, $subject, $body); */ } break; } ?> Regards ACE
  7. after a few adjustments to my pages, heres the source for index.php index.php source (browser source) : <html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" > <title>Conflicting Forces - Modern Combat - Online MMORPG</title> </head> <body> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <div id = "hdr">Conflicting Forces - Modern Combat</div> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <div id = "nav">Navigational Panel</div> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <div id = "ads">Supplemental Panel</div> <div id = "txt"> <center> Conflicting Forces is Currently in the process of being created, <b>Alpha Testing</b> will begin in a few months. Keep checking back often for updates. </center> </div> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <div id = "ftr"><I>Brought to you by Crikey Games</I></div> </body> </html> Still the colors aren't right, just black and white. heres the link to the page. www.crikeygames.com.au/conflictingforces any ideas? Regards ACE
  8. woah, I see what you mean, the source tells you alot more! Source: <html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" > <title>Conflicting Forces - Modern Combat - Online MMORPG</title> </head> <body> <html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" ><title>Conflicting Forces - Modern Combat</title> </head> <body> <div id = "hdr">Conflicting Forces - Modern Combat</div> </body> </html><html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" ><title>Conflicting Forces - Modern Combat</title> </head> <body> <div id = "nav">Navigational Panel</div> </body> </html><html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" ><title>Conflicting Forces - Modern Combat</title> </head> <body> <div id = "ads">Supplemental Panel</div> </body> </html><div id = "txt"> <center> <meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" >Conflicting Forces is Currently in the process of being created, <b>Alpha Testing</b> will begin in a few months. Keep checking back often for updates. </center> </div> <html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" ><title>Conflicting Forces - Modern Combat</title> </head> <body> <div id = "ftr"><I>Brought to you by Crikey Games</I></div> </body> </html></body> </html> Regards ACE
  9. I'm new to CSS and I've made a template, but I've made separate PHP pages for each section of the template, footer, header, leftnav, rightnav etc. for each PHP page, I have linked them to the CSS file that does the whole page layout, but i'm guessing that I should just make separate CSS files for each section. here is my current CSS file that I have linked in every PHP file. /* set margins, padding, and inline-level alignment */ body,div { color: white; margin: 0; padding: 0; text-align: center } /* set widths and float nav & ads div content boxes */ #nav { float: left; width: 100px } #ads { float: right; width: 100px } /* set side txt margins 5px > nav & ads widths */ #txt { margin-left: 105px; margin-right: 105px } /* ensure footer stays at the bottom */ #ftr { clear: both } /* show boundaries and set image sizes - for clarity */ #hdr, #ftr { background: red } #nav, #ads { background: yellow } #txt { background: green } #hdr img { width: 250px; height: 25px } #ads img { width: 75px; height: 100px } #txt img { width: 150px; height: 200px } heres the index.php page: <html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <?php // Include's include('variables.php'); ?> <title><?=$gamename?> - Online MMORPG</title> </head> <body> <?php include('head.php'); ?> <?php include('leftnav.php'); ?> <?php include('rightnav.php'); ?> <div id = "txt"> <center> <?php switch ($_GET['page']) { default: case "home": require_once ("lib/home.php"); break; case "page2": require_once ("lib/page2.php"); break; case "page3": require_once ("lib/page3.php"); break; case "page4": require_once ("lib/page4.php"); break; }// end switch ?> </center> </div> <?php include('footer.php'); ?> </body> </html> I get everything showing up where it should, but the page is black and white, and the text is the same color as the background of the appropriate section. any ideas? Regards ACE
  10. ok, I got that working, But my template is a little whacked :-\ I'm new to CSS and I've made a template, but I've made separate PHP pages for each section of the template, footer, header, leftnav, rightnav etc. for each PHP page, I have linked them to the CSS file that does the whole page layout, but i'm guessing that I should just make separate CSS files for each section. here is my current CSS file that I have linked in every PHP file. /* set margins, padding, and inline-level alignment */ body,div { color: white; margin: 0; padding: 0; text-align: center } /* set widths and float nav & ads div content boxes */ #nav { float: left; width: 100px } #ads { float: right; width: 100px } /* set side txt margins 5px > nav & ads widths */ #txt { margin-left: 105px; margin-right: 105px } /* ensure footer stays at the bottom */ #ftr { clear: both } /* show boundaries and set image sizes - for clarity */ #hdr, #ftr { background: red } #nav, #ads { background: yellow } #txt { background: green } #hdr img { width: 250px; height: 25px } #ads img { width: 75px; height: 100px } #txt img { width: 150px; height: 200px } heres the index.php page: <html> <head> <link rel = "stylesheet" title = "CF Layout" type = "text/css" href = "css/page-layout.css" > <?php // Include's include('variables.php'); ?> <title><?=$gamename?> - Online MMORPG</title> </head> <body> <?php include('head.php'); ?> <?php include('leftnav.php'); ?> <?php include('rightnav.php'); ?> <div id = "txt"> <center> <?php switch ($_GET['page']) { default: case "home": require_once ("lib/home.php"); break; case "page2": require_once ("lib/page2.php"); break; case "page3": require_once ("lib/page3.php"); break; case "page4": require_once ("lib/page4.php"); break; }// end switch ?> </center> </div> <?php include('footer.php'); ?> </body> </html> I get everything showing up where it should, but the page is black and white, and the text is the same color as the background of the appropriate section. any ideas? Regards ACE
  11. I want to create a template for my website, but I don't want to include, header, left nav, bottom, right nav, etc etc on every single new page I make, is their a way to include all them on 1 page, and just call it template.php but make it so that I can display all the other pages content in the center of the page, without using frames. A template similar to PHP-Nuke, has left nav, header, right nav, bottom, and the content in the center, how can I go about doing this? Regards ACE
  12. Excellant! Thanks Regards ACE
  13. Can you create a meta tag and put it in a variable like this: <?php $meta = '<meta name = "creator" content = "ACE" > <meta name = "keywords" content = "Online,MMORPG,game,fun,crazy,roleplay" > <meta name = "description" content = "Conflicting Forces is a MMORPG" > <meta http-equiv = "Content-Type" content = "text/html; charset = ISO-8859-1" > <style type = "text/css" > body { background-color: black; color:white } </style>'; ?> and then on another page include("metatag.php"); and will that set the pages meta tag on that page? Regards ACE
  14. yeah, its certainly an eye opener. don't know about writing a tutorial though lol. still working it out Regards ACE
  15. Does Mod_Rewrite break links, say you have a link to www.yourwebsite.com/folder/index.php?do=3hf3 or whatever, if you use mod_rewrite, will that stop the link from working anymore??? Regards ACE
  16. is their a way to encrypt the URL of a page? using something like the header() function, except one that, when you put header("Location: http://www.mywebsite.com/"); instead of redirecting to that page, it changes the Page's URL to that. ??? Regards ACE
  17. yeah, looks like i'm going to have to use mod_rewrite then. Thanks. Regards ACE
  18. Is their a way to secure a page so someone can't simply type in www.yourwebsite.com/yourpage.php , without using mod_rewrite? Regards ACE
×
×
  • 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.