boompa
Members-
Posts
305 -
Joined
-
Last visited
-
Days Won
1
Everything posted by boompa
-
Nope, that's not JSON. Looks like a serialized array. You would use unserialize to get the PHP array out of it.
-
[WordPress] I'm completely New and having a tough time
boompa replied to mittymit6's topic in Applications
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. -
Url field output to display as image with affiliate link
boompa replied to judah's topic in PHP Coding Help
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? -
You are missing the PHP tags around the closing } in your loop.
-
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.
-
Parse error: syntax error, unexpected end of file
boompa replied to moisesbr's topic in PHP Coding Help
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. -
Perhaps you should try checking your query's CASE syntax against the documentation
-
What is with people's fascination with watching people write code on a screen via video tutorials?
-
Maybe you should give it a shot.
-
Don't you want quotes around the message you're inserting?
-
Requesting a little help in my bootstrap code
boompa replied to criostage's topic in PHP Coding Help
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. -
PHP MySqli does not fetch last row from the table.
boompa replied to angel1987's topic in PHP Coding Help
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? -
PHP Parse error: syntax error, unexpected T_VARIABLE
boompa replied to phpnewbieca's topic in PHP Coding Help
$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 ' '. -
No. There's something extra in your new query. Details matter.
-
https://www.github.com
-
code not working in v 5.4.16 works in v 5.3.8
boompa replied to groengoen's topic in PHP Coding Help
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. -
MySQL Select x FROM y WHERE z="a", b="c", d="e";
boompa replied to SteelyDan's topic in PHP Coding Help
Try printing the string you're sending to the database. -
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.
-
Read about strings here, including using quotes.
-
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.
-
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.
-
This is completely, totally incorrect. Filter extension, along with validation filters.
- 7 replies
-
- php
- validation
-
(and 1 more)
Tagged with:
-
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.
- 7 replies
-
- php
- validation
-
(and 1 more)
Tagged with:
-
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.