Jump to content

boompa

Members
  • Posts

    305
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boompa

  1. Nope, that's not JSON. Looks like a serialized array. You would use unserialize to get the PHP array out of it.
  2. Just a brief bit of research on my part, i.e., going to the URL in the text file you attached and poking around led me to a comments area for this person's themes. Perhaps you should look around in there.
  3. The first thing to do here is to view the source being generated by your PHP. What does the HTML for that link look like?
  4. You are missing the PHP tags around the closing } in your loop.
  5. Please use code tags when posting code. public function daftar_akaun() { $query = $this->db->select('no_staf')->from('akaun')->where('no_staf',$noStaf)->get(); if( $query->num_rows() > 0 ){ return TRUE; } else { return FALSE; } $query = $this->modeluser->ciptaAkaun(); $this->session->set_flashdata('mesej', '<span class="label label-info">Account created</span> '); redirect(base_url().'admin/daftar'); } You're returning from the method (which may not even be the right thing to in a controller method, but there's not enough context) as soon as you check the number of rows. You never reach the point of setting the flash method and redirecting.
  6. Braces mismatch is the cause of this error. PHP was expecting at least one } that didn't occur. But you're also missing a ; in your third line of code.
  7. Perhaps you should try checking your query's CASE syntax against the documentation
  8. What is with people's fascination with watching people write code on a screen via video tutorials?
  9. Maybe you should give it a shot.
  10. Don't you want quotes around the message you're inserting?
  11. static public function init ( ){ self::$_appConfig = APPPATH . DS . 'Config' . DS . 'Main.php'; require self::$_appConfig; var_dump($appOptions); } Are you mixing and matching variable names in using appConfig and appOptions, or is appOptions somehow set elsewhere (like in the file required through $appConfig)? I see it dumped and used for operations, but I don't see it being set. If it is, then the scope of the included file would appear to be limited to the scope of the init() function.
  12. Totally guessing because of the dearth of code, but I suspect it has to do with your pagination logic, which you do not show. Why are you suppressing errors on your mysqli_fetch_assoc? Why aren't you using prepared statements? Are you sanitizing your conditional input?
  13. $handle = fopen($myfile, “a+”) Those quotation marks look wrong in your code. If you're not using a regular text editor (i.e., *not* a word processor or Notepad), you need to switch to one. If you are using a regular text editor, you may have copied and pasted this code from somewhere using funky quotes and this formatting was saved in your document. Try changing those quotation marks to regular " " or ' '.
  14. No. There's something extra in your new query. Details matter.
  15. https://www.github.com
  16. Please use code tags (not quote tags) and indent your code. <?php session_start(); // if session variable not set, redirect to login page if (!isset($_SESSION['authenticated'])) { header('Location: http://crm.autorolle...er/index.php'); exit; } // Old code //include("dbinfo.inc.php"); //mysql_connect("localhost","$username","$password") or die("Error: ".mysqlerror()); //mysql_select_db("$database"); // End Old code // New mysqli code // connect to the database include('connect-db.php'); // End new code //get the variables we transmitted from the form $refno = $_POST[refno]; $sql = "DELETE FROM customer WHERE refno = ".$refno; // New code for mysqli delete // delete record from database if ($stmt = $mysqli->prepare("DELETE FROM customer WHERE refno = ? LIMIT 1")) { $stmt->bind_param("i",$refno); $stmt->execute(); if ($stmt->affected_rows > 0) { $deleted = true; } else { $deleted = false; if ($stmt->errno == 1451) { $error = ' has dependent project records and cannot be deleted.'; } else { $error = 'There was a problem deleting the client.'; } } $stmt->close(); } else { echo "ERROR: could not prepare SQL statement."; } $mysqli->close(); // redirect user after delete is successful // Old code //mysql_query($sql) or die ("Error: ".mysql_error()); // End Old code if ($deleted == true) { echo "Client " .$refno . " deleted." ?> <a href='view_customers.php'>Return to View/Edit customer</a> <? ; } else { echo "Client " .$refno . $error ?> <a href='view_customers.php'>Return to View/Edit customer</a> <? ; } ?> The syntax here if ($deleted == true) { echo "Client " .$refno . " deleted." ?> <a href='view_customers.php'>Return to View/Edit customer</a> <? ; } else { echo "Client " .$refno . $error ?> <a href='view_customers.php'>Return to View/Edit customer</a> <? ; } is a bit bizarre, and I'm guessing the problem may be that short_tags are not enabled, so the <? is not recognized.
  17. Try printing the string you're sending to the database.
  18. The answer is no different from the one in your other thread. If you want to pass a variable through GET, it must be in the URL. The difference is the URL is in the form's action.
  19. Read about strings here, including using quotes.
  20. You don't learn anything by just copying and pasting (or poorly transcribing) code then running to experts for help you know. http://pastebin.com/Fn1HMtsS The error is right there. The webserver runs as a restricted user and generally does not have write permissions to the filesystem unless you specifically allow it those permissions.
  21. Read this, it's from the README: PHP Resources and FAQs which is pinned at the top of the forum.
  22. You should really take the time to learn how to use the cURL library to make your http requests. In any event, just telling us it doesn't work without more detail into how it is not meeting your needs is sort of useless.
  23. This is completely, totally incorrect. Filter extension, along with validation filters.
  24. If you want to do all these things without reloading the page, then you will need to look into using JavaScript and AJAX to submit the data to a server-side PHP script for validation.
  25. boompa

    PKCS7

    Again, going to their support forum (found by clicking the button marked Get Support on the main SourceForge page) and searching for pkcs7 I find this topic, which appears relevant. Support for specific products is often best sought in forums/mailing lists specific to said products.
×
×
  • 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.