-BRAIDZ- Posted May 30, 2015 Share Posted May 30, 2015 (edited) This modification is for Ravan, not McCodes. staff_business.php: <?php require_once __DIR__ . '/sglobals.php'; if ($ir['user_level'] > 2) error("Access denied"); if(!function_exists('error')) { function error($msg) { global $h; echo "<strong>ERROR</strong>".$msg; exit($h->endpage()); } } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? $_GET['action'] : null; switch ($_GET['action']) { case "addclass": addClass($db); break; default: error("You didn't specify a valid action"); break; } function addClass($db) { echo "<div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Staff Business Management </h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br>" ?><h3>Business Management: Add Class</h3><?php if(!array_key_exists('submit', $_POST)) { ?><form action='staff_business.php?action=addclass' method='post'> <table class='table' width='75%'> <tr> <th width='25%'>Name</th> <td width='75%'><input type='text' name='name' required /></td> </tr> <tr> <th>Minimum members</th> <td><input type='number' name='members' placeholder='3' required /></td> </tr> <tr> <th>Description</th> <td><textarea name='desc' rows='2' cols='24' required></textarea></td> </tr> <tr> <th>Cost to start</th> <td><input type='number' name='cost' placeholder='100,000' required /></td> </tr> <tr> <td colspan='2' class='center'><input type='submit' name='submit' value='Add Business Class' /></td> </tr> </table> </form><?php } else { $strs = array('name', 'desc'); foreach($strs as $what) { $_POST[$what] = array_key_exists($what, $_POST) && is_string($_POST[$what]) ? $db->escape(trim($_POST[$what])) : null; if(empty($_POST[$what])) error("You didn't enter a valid ".($what == 'desc' ? 'description' : $what)); } $nums = array('members', 'cost'); foreach($nums as $what) { $_POST[$what] = array_key_exists($what, $_POST) && ctype_digit(str_replace(',', '', $_POST[$what])) ? str_replace(',', '', $_POST[$what]) : null; if(empty($_POST[$what])) error("You didn't enter a valid ".($what == 'members' ? 'amount of ' : '').$what); } $select = $db->query("SELECT classId FROM businesses_classes WHERE className = '".$_POST['name']."'"); if($db->num_rows($select)) error("A business class with that name already exists"); $db->query("INSERT INTO businesses_classes (className, classDesc, classMembers, classCost) VALUES ('".$_POST['name']."', '".$_POST['desc']."', ".$_POST['members'].", ".$_POST['cost'].")"); stafflog_add("Added business class: ".stripslashes(htmlspecialchars($_POST['name']))); ?>You've added the business class: <?php echo stripslashes(htmlspecialchars($_POST['name'])); } } $h->endpage(); Now add this into your smenu.php file: <a href="staff_business.php?action=addclass">Create a Business Class</a> I would like to say thank you to [MENTION=65371]sniko[/MENTION] and [MENTION=53425]Magictallguy[/MENTION] who helped me get this mod working properly. I made the original code, but I will no longer take full credit for the mod. Thank you guys, I appreciate it :) Edited June 4, 2015 by -BRAIDZ- Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 30, 2015 Share Posted May 30, 2015 Your code is showing blank due to the * in the code Quote Link to comment Share on other sites More sharing options...
Coly010 Posted May 30, 2015 Share Posted May 30, 2015 Think you need to get a new editor [MENTION=68406]-BRAIDZ-[/MENTION] Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted May 30, 2015 Share Posted May 30, 2015 yea * can be the prob Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted May 30, 2015 Share Posted May 30, 2015 here is a updated version http://privatepaste.com/beb0cbb16a code version: <?php require(__DIR__./'sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='staff_business.php?action=createbusiness' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created.<br /> <a href="staff_business.php?action=createbusiness">Back!</a>"; stafflog_add("Created the <span class="highlight">business</span>: {$_POST['className']}"); } $h->endpage(); Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 31, 2015 Author Share Posted May 31, 2015 here is a updated version http://privatepaste.com/beb0cbb16a code version: <?php require(__DIR__./'sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='staff_business.php?action=createbusiness' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created.<br /> <a href="staff_business.php?action=createbusiness">Back!</a>"; stafflog_add("Created the <span class="highlight">business</span>: {$_POST['className']}"); } $h->endpage(); Still returning a blank page Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 31, 2015 Share Posted May 31, 2015 (edited) <span class="highlight">business</span>: {$_POST['className']}"); } [MENTION=70347]NonStopCoding[/MENTION] has made a mistake you need to change the <span class="Highlight"> which is right at the end in stafflog_add to <span class='highlight'> Edited May 31, 2015 by adamhull Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 31, 2015 Author Share Posted May 31, 2015 <span class="highlight">business</span>: {$_POST['className']}"); } [MENTION=70347]NonStopCoding[/MENTION] has made a mistake you need to change the <span class="Highlight"> which is right at the end in stafflog_add to <span class='highlight'> Still returning a blank screen. Might just scrap the mod to be honest, can't seem to get it.working and I suck at coding haha Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 31, 2015 Share Posted May 31, 2015 (edited) <?php require(__DIR__.'/sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='staff_business.php?action=createbusiness' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created.<br /> <a href='staff_business.php?action=createbusiness'>Back!</a>"; stafflog_add("Created the <span class='highlight'>business</span>: {$_POST['className']}"); } $h->endpage(); ?> Just replace whole file with this! Edited May 31, 2015 by adamhull Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 31, 2015 Author Share Posted May 31, 2015 <?php require(__DIR__.'/sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='staff_business.php?action=createbusiness' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created.<br /> <a href='staff_business.php?action=createbusiness'>Back!</a>"; stafflog_add("Created the <span class='highlight'>business</span>: {$_POST['className']}"); } $h->endpage(); ?> Just replace whole file with this! And still nothing. Bugger knows what's wrong Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 31, 2015 Share Posted May 31, 2015 Your editor isn't putting stars in again is it as I have it on my mccodes game and the one I posted works Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 31, 2015 Author Share Posted May 31, 2015 Your editor isn't putting stars in again is it as I have it on my mccodes game and the one I posted works No I don't think it is, I'm just copying and pasting it to my cpanel file manager code editor Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 31, 2015 Share Posted May 31, 2015 error_reporting(E_ALL); ini_set('display_errors', 1); add this to the top of the file under the <?php and let us know what errors are shown Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 31, 2015 Author Share Posted May 31, 2015 error_reporting(E_ALL); ini_set('display_errors', 1); add this to the top of the file under the <?php and let us know what errors are shown No errors displayed. Still just a blank white screen.. This is annoying me. Unfortunately I am using Ravan's but it's virtually the same as mccodes 2, and all other v2 mods work for me.. Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 31, 2015 Share Posted May 31, 2015 I'll pm your now! Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 31, 2015 Author Share Posted May 31, 2015 I'll pm your now! Thanks mate I replied Quote Link to comment Share on other sites More sharing options...
Coly010 Posted May 31, 2015 Share Posted May 31, 2015 I suck at coding haha Everyone sucks at coding when they start off. You just need to stick to it. You get better by learning from the mistakes you've made in the past, for learning how to deal with the errors you're receiving in your code. Also, if your learning to code while working with mccodes / Ravens yours not doing yourself any favours. The coding techniques and structure used in those scripts are beyond outdated and stupid. Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted May 31, 2015 Author Share Posted May 31, 2015 Everyone sucks at coding when they start off. You just need to stick to it. You get better by learning from the mistakes you've made in the past, for learning how to deal with the errors you're receiving in your code. Also, if your learning to code while working with mccodes / Ravens yours not doing yourself any favours. The coding techniques and structure used in those scripts are beyond outdated and stupid. True, but I really don't have the money to afford a better engine or a custom engine at the moment. If I was good at coding I'd code my own game haha Quote Link to comment Share on other sites More sharing options...
AdamHull Posted May 31, 2015 Share Posted May 31, 2015 <?php require(__DIR__.'/sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='test.php?action=createbusinesssub' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created. <a href='staff_business.php?action=createbusiness'>Ba ck!</a>"; stafflog_add("Created the <span class='highlight'>business</span>: {$_POST['className']}"); } $h->endpage(); ?> This code is fully working and tested Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted June 1, 2015 Author Share Posted June 1, 2015 <?php require(__DIR__.'/sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='test.php?action=createbusinesssub' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created. <a href='staff_business.php?action=createbusiness'>Ba ck!</a>"; stafflog_add("Created the <span class='highlight'>business</span>: {$_POST['className']}"); } $h->endpage(); ?> This code is fully working and tested Still nothing. I haven't changed anything in my sglobals.php file. So I don't know what's going on. This is really starting to tick me off Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted June 2, 2015 Author Share Posted June 2, 2015 Does anyone have any ideas please? I would really like to have this mod working on my game. But unfortunately it's not, and everyone else seems to have no problem with it on their site... Maybe someone could code it their own way instead of using my code and just start from scratch? :confused: Quote Link to comment Share on other sites More sharing options...
sniko Posted June 2, 2015 Share Posted June 2, 2015 (edited) Does anyone have any ideas please? I would really like to have this mod working on my game. But unfortunately it's not, and everyone else seems to have no problem with it on their site... Maybe someone could code it their own way instead of using my code and just start from scratch? :confused: Depends. What issues/errors are you facing? What debugging processes have you adopted? Did you find anything out with debugging? Perhaps a server misconfiguration? When you did this, I don't believe you when you say it didn't bring back anything... In your original post you have some syntax errors which would be revealed with error reporting. Your code is hideous. Please look into PSR standards You don't need to global in the same scope. Line 9 functions shouldn't really echo/print anything, but return. Line 19 Your query is insecure. Line 61 Escape or change your quotes. This is a syntax error. Line 67 When you submit the form, you aren't going to the logic to process the form. Line 25 You've ended your function too early, I would assume. Line 59This die(); isn't needed it and should be handled in sglobals.php, IIRC. Most of these would have been shown to you with error_reporting. I hope now that you understand my frustration with you. Edited June 2, 2015 by sniko Quote Link to comment Share on other sites More sharing options...
Lithium Posted June 2, 2015 Share Posted June 2, 2015 Depends. What issues/errors are you facing? What debugging processes have you adopted? Did you find anything out with debugging? Perhaps a server misconfiguration? When you did this, I don't believe you when you say it didn't bring back anything... In your original post you have some syntax errors which would be revealed with error reporting. Your code is hideous. Please look into PSR standards You don't need to global in the same scope. Line 9 functions shouldn't really echo/print anything, but return. Line 19 Your query is insecure. Line 61 Escape or change your quotes. This is a syntax error. Line 67 When you submit the form, you aren't going to the logic to process the form. Line 25 You've ended your function too early, I would assume. Line 59This die(); isn't needed it and should be handled in sglobals.php, IIRC. Most of these would have been shown to you with error_reporting. I hope now that you understand my frustration with you. /me wonders if I should comment on sniko's coding style and skills from 6 years ago.... Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted June 2, 2015 Author Share Posted June 2, 2015 Depends. What issues/errors are you facing? What debugging processes have you adopted? Did you find anything out with debugging? Perhaps a server misconfiguration? When you did this, I don't believe you when you say it didn't bring back anything... In your original post you have some syntax errors which would be revealed with error reporting. Your code is hideous. Please look into PSR standards You don't need to global in the same scope. Line 9 functions shouldn't really echo/print anything, but return. Line 19 Your query is insecure. Line 61 Escape or change your quotes. This is a syntax error. Line 67 When you submit the form, you aren't going to the logic to process the form. Line 25 You've ended your function too early, I would assume. Line 59This die(); isn't needed it and should be handled in sglobals.php, IIRC. Most of these would have been shown to you with error_reporting. I hope now that you understand my frustration with you. Nothing shows up with error reporting on. (doesn't display errors) and as I stated this is my first mod, so in other words, I'm crap at coding and really have not much of an idea of what I'm doing haha Quote Link to comment Share on other sites More sharing options...
Lithium Posted June 2, 2015 Share Posted June 2, 2015 [MENTION=68406]-BRAIDZ-[/MENTION], at least you assume you're crap at coding, despite everyone already knows that (don't take it badly, it is not the intention), and sniko also knows we all started basically the same way... sucking at it. Despite sniko's post is correct, there are other ways (and he knows that) to say things, and looking back, you are not much different from him. And I don't think anyone "complained" that way about him, at least that I can recall, making an effort to learn is far better than most of the users that are/were floating around here, and the best way to actually learn. My suggestion, take your time learning, basic questions/doubts/whatever sure, but... only if you get stuck. Try to learn by yourself, resources are basically unlimited. 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.