Jump to content

MasterACE14

Members
  • Posts

    2,687
  • Joined

  • Last visited

Everything posted by MasterACE14

  1. That works fine too, it's really just a matter of preference.
  2. why not pass the field name to the method as an argument? function fetchData($table_name, $argument, $linebreak, $end_linebreak, $field){ $result = mysql_query("select * from $table_name where status='$argument'"); while($row=mysql_fetch_assoc($result)){ echo $linebreak.$row[1]."<input type='checkbox' name='option' id='checkbox' value=$row[$field] />".$end_linebreak; //$row[$field] is 'job_id' from database } } you just have to change $row[1] to $row['fieldname'] and that'd work great. Also note I changed mysql_fetch_row() to mysql_fetch_assoc().
  3. Like PHMaBiSmAd said, if someone is able to access the files on your server, most likely over FTP. Then you should change your FTP password. As far as people working out a password stored in a variable in a PHP script goes... it simply doesn't happen and you're greatly over thinking it.
  4. If you're checking that the form has been submitted, then you can do what chris11 mentioned. However if you're checking that there is anything in the actual textarea field, then you can use the strlen() function to check the length of the string.
  5. Valid points, except there is one config file for one website in one development area and one production area, so things would never get confused. (My "config" file isn't something that 20 websites use, like maybe is true for you.) Why ask for advice if you already know you're right? You have an attitude problem. If you can't be pleasant them post somewhere else... Volunteer staff and members are helping you out of their own precious free time, no one here HAS to help you. A little respect goes a long way. Anyway after having my mind explode by the time I had read up to page 2....... You could use this: define('BASEPATH', array_pop(explode(DIRECTORY_SEPARATOR,realpath(dirname(__FILE__))))); echo BASEPATH; place that in your top level index.php file. So with this... 05_Debbie components body_footer.inc.php body_header.inc.php css _layout.css _main.css components.css top_menu.css index.php // goes in here pages article_index.php howto_index.php BASEPATH would hold the value '05_Debbie' You can include files like so... // include body_footer.inc.php from article_index.php include_once(BASEPATH . '/body_footer.inc.php'); // include body_header.inc.php from howto_index.php include_once(BASEPATH . '/body_header.inc.php'); // etc etc May need to be tweaked depending on your setup.
  6. So I don't have to read a 1,000 page manual, care to be a little more specific?! Debbie Naming Conventions one click and you would of been there.........
  7. if $uid or $appid is not set, then that would stop your queries from producing any results. Add or die(mysql_error()); at the end of the queries while debugging to see what's going on.
  8. I'll be honest, I haven't read the entire script. But you do have a typo near the start which is probably the issue: $_SESSION['quanity']=array(); //if there are no quantities selected, the array is empty should be $_SESSION['quantity']=array(); //if there are no quantities selected, the array is empty missing the first 't' in 'quantity'
  9. I've only ever seen this technique used with Mani Admin Plugin or Source Mod on Source game servers. If you're talking about PHP, then you don't even have to go to the trouble of placing the file outside the root directory. This is an acceptable use: public_html/password.php: <?php $my_password = "password"; ?> public_html/myscript.php: <?php require_once("password.php"); echo $my_password; ?>
  10. What QuickOldCar posted should of fixed it. Post your latest code.
  11. that's done the trick, thanks for your help guys! Appreciated. Kind Regards, Ace
  12. I'm ranking users on... SELECT `username` FROM `accounts` ORDER BY `strike`+`defence`+`covert` ASC Now that's fine for generating a list of users and simply using a counter in PHP to assign each user a number, but how can I find the rank for 1 user in particular? Thanks, Ace
  13. I don't see you echo'ing any data. Need to add... echo $data['column_name']; after... $data = mysql_fetch_assoc($result);
  14. Yes. Any kind of user input must be validated and filtered. Always assume people will be on your website to do nasty things to it.
  15. errr.... what? Who told you that. Of course you can have a user level field in your database to determine who has what access to parts of your website.
  16. select the table and it should be under the structure tab as relations view.
  17. actually if you use prepared statement you don't need at all to use stripslashed or mysql_rea_escape_string or others functions. prepared statement allow you to define what is the value and what is not==>no sql injection And that value has come from a form, hence it does require filtering.
  18. $_SERVER['PHP_SELF'] gets you the current file being accessed.
  19. does $user_input also contain 'mypassword' ?
  20. Terrible idea. As phporcaffeine said, we need to know more about what you're trying to achieve. It sounds like you may want to look into cron.
  21. 'countof' is simply an alias for the value that count(*) returns.
  22. You might want to read some PHP tutorials or pay someone to do it for you. This isn't very hard to accomplish, you just need an text input field in your page's template and the mail() function in your code using that fields value as the email, and of course the appropriate validation.
×
×
  • 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.