2,113 Posted Topics
Re: Hi, at line `10` use `mysqli_error()`: if ( ! $result = mysqli_query($con, $query)) { printf("Errormessage: %s\n", mysqli_error($con)); } It should explain the reason that makes the query return boolean `FALSE`. Docs: http://php.net/manual/en/mysqli.error.php | |
Re: In particular search for **autocomplete** scripts, for example this: * http://jqueryui.com/autocomplete/ * http://api.jqueryui.com/autocomplete/ bye! | |
Re: Create a script, for example **display.php**: $f = $_GET['image']; header("Content-type: image/jpeg"); echo base64_decode($f); Now your link becomes: <a href="display.php?image=<?php echo $img_str; ?>"> <img src="data:image/jpeg;base64,<?php echo $img_str; ?>" width=150 height=150 /> </a> | |
Re: It could be line `3` instead of the `json_decode` function, `print_r` requires brackets, so change it to: print_r($data); | |
![]() | Re: The stable version is 2.2.0, which is a security upgrade. Version 3.0 is not stable: * http://ellislab.com/blog/entry/codeigniter-2.2.0-released * https://github.com/EllisLab/CodeIgniter/tree/release/3.0 I will try it, however I would wait a stable release before using it in production, bye! :) |
Re: What if two or more images are the largest? Anyway, here's an example with `glob()`: <?php $f = glob('./path/*.{jpg,png,gif}', GLOB_BRACE); $r = array(); foreach($f as $file) { list($w, $h) = getimagesize($file); $r[$w*$h][] = array( 'name' => $file, 'width' => $w, 'height' => $h ); } $keys = array_keys($r); # all … | |
Re: Create a unique key in your table scheme and then use a raw query: $row = array( $row['Category Id'], $row['Category Name'] ); $sql = "INSERT IGNORE INTO tablename SET cat_id = ?, name = ?"; $this->db->query($sql, $row); By using `INSERT IGNORE` when a duplicate key is found, it will continue … | |
Re: Regarding PHP try this: <?php $url = $_SERVER['QUERY_STRING']; if($_GET) { if(filter_var($url, FILTER_VALIDATE_URL) !== FALSE) { header('Location: ' . $url); } } Save it, for example, as **noref.php**, then use a link like this: http://yourwebiste.tld/noref.php?http://otherwerbsite.tld I'm not sure it's enough, but I've made few tests and seems to work. | |
Re: Hi, define the error you get on line **42** and add `mysql_error()` to this query and to the previous. | |
Re: It seems possible, check their documentation: * http://support.hostgator.com/articles/specialized-help/technical/php-email-from-header If you still have problems then paste your code here. Bye! | |
Re: @davy read carefully your script, you have at: line 5: $post_id = isset($_POST['post_id']) ? $_POST['post_id'] : ''; line 14 & 15: if (!empty($_GET['post_id'])){ $result = mysql_query("SELECT * FROM static_page WHERE post_id =".$_GET['post_id']) or die(mysql_error()); line 17: $post_id = $data['post_ID']; line 35: if ( $_POST['post_id'] !=0) line 41: $sqlstr = "UPDATE … | |
Re: Try to use the `row()` method: $row = $cnt->row(); $new_cnt = $row->Counter_field + 1; But you could also run a single query: $this->db->query("UPDATE Job_Description SET Counter_field = Counter_field + 1 WHERE id = ?", array($id)); Docs: * http://ellislab.com/codeigniter/user-guide/database/results.html * http://ellislab.com/codeigniter/user-guide/database/queries.html | |
Re: At line `17` you're closing the paranthesis of the `while` loop, so add another one: } // close while loop } // close if else { | |
Re: Hi, there are few errors here: $query = "SELECT arCompanyname, arAddress FROM ar WHERE $dropdown like'$search'" or die (mysql_error()); $result = mysql_query($query) or die (mysql_error()); $num=mysql_numrows($result); `$query` is a string, so do not include `or die(mysql_error())` otherwise the `mysql_query()` will return `FALSE`. Then, `mysql_numrows()` does not exists, the correct function … | |
Re: Maybe some of those browsers are in quirk mode (a.k.a standard mode). These links are for IE9/10, but it should be similar for IE11 too: * http://windows.microsoft.com/en-us/internet-explorer/products/ie-9/features/compatibility-view * https://www.cs.tut.fi/~jkorpela/quirks-mode.html | |
Re: Hi, you can use `substr()`: <?php $reportID = 'MPS141'; echo substr($reportID, 5); Will return all the characters after `MPS14`, but you can also create a function to return an array of all the elements of the `reportID`, an example: function reportToArray($id) { $data['CompanyName'] = substr($id, 0, 2); $data['Article'] = substr($id, … | |
Re: It seems you want to search and replace a string in a json encoded array, correct? If yes, then each element is probably surrounded by quotes, example: $a['blog'] = 'blogtitle'; echo json_encode($a); // outputs {"blog":"blogtitle"} Which is different from `{blog:blogtitle}`, the correct code should be: if($blogname != "") { $r … | |
![]() | Re: Have you created separated **virtualhosts** directives for each sub-website? * http://httpd.apache.org/docs/current/vhosts/examples.html * http://httpd.apache.org/docs/current/vhosts/index.html * http://httpd.apache.org/docs/current/mod/core.html#virtualhost ![]() |
![]() | Re: >The only thing I have really found is that a master page is like a template? Yes, but **master page** is a definition for ASP.Net and Visual Studio (I think), in PHP we (or at least, I would) simply talk about templates. * [ASP.NET Master Pages](http://msdn.microsoft.com/en-us/library/vstudio/wtxbf3hh(v=vs.100).aspx) |
Re: It seems possible, check their documentation: * https://developers.google.com/analytics/devguides/reporting/core/v2/gdataReferenceDataFeed | |
![]() | Re: You could create a library and use it to pull the constants from the database, for example, here the table: CREATE TABLE `constants` ( `name` varchar(255) NOT NULL, `value` varchar(255) DEFAULT NULL ) ENGINE=MyISAM; insert into constants(name, value) values('blue', '#0000ff'); insert into constants(name, value) values('dodger blue', '#1e90ff'); insert into constants(name, … ![]() |
Re: The parameters order is: * host * username * password * database name * port * socket Last two are optional, so: mysqli_connect("host","username","password","db_name"); Docs: * http://www.php.net/manual/en/mysqli.construct.php | |
Re: I see it in the right side of the page, not to the left. Anyway you could add an `id` to the `td` tag containing the menu, declare it as `position:relative` and then set `top` and `left` for `ul.MenuBarHorizontal` basing on the parent position, so: #mymenu001 { position:relative; } ul.MenuBarHorizontal … | |
![]() | Re: Hi, I don't understand the scheme, how it works the relation between id and parent? |
Re: And search in the forum: http://www.daniweb.com/web-development/php/threads/398419/domain-availability-check | |
Re: PDO supports many databases, where MySQLi is limited only to MySQL and his forks. MySQLi instead has a better support for MySQL features and it can be used also in procedural style. For more information read the documentation & the comments: * https://php.net/manual/en/mysqlinfo.api.choosing.php | |
Re: Hello, use this format: data-validation-length="45-60" Example: http://jsfiddle.net/3XYA4/ & docs: http://formvalidator.net/#default-validators_length | |
Re: Hi, the problem is given by this: $abc=mysqli_query($con, $s) or die('cannot show tables'); if($abc) print_r($s); The function `mysqli_query()` returns `FALSE` on wrong queries, then it returns an `OBJECT` for *SELECT, SHOW, DESCRIBE* or *EXPLAIN* queries, and `TRUE` for other successful queries, like for example an *ALTER* query: $sql = "alter … | |
Re: Hi, have you tried these instructions? * http://www.oracle.com/technetwork/java/javase/download-142937.html You must read the **setup instructions** link in the above document. If it still doesn't work for you, please explain the reason, provide the error codes you get, otherwise we cannot help much. | |
Re: Yes, you can use multiple submit buttons in your forms: > submit buttons: When activated, a submit button submits a form. A form may contain more than one submit button. and: > If a form contains more than one submit button, only the activated submit button is successful. source: http://www.w3.org/TR/html401/interact/forms.html … ![]() | |
Re: Hello, the *Unexpected value translate(NaN,0)* problem seems to be generated by the `range` value: {"range":"0 - 5","percentage":12,"qty":1326} which is used to set the `x` attribute of the `rect` tag: <g transform="translate(37.5,0)"> <rect y="0" x="NaN" height="300" width="36.5"></rect> <text x="1" y="-15.78947368421052" dy=".75em">38%</text> </g> If you change all the values of your array … | |
Re: Hi, assuming you're using method **GET** for your form, you need to read the value assigned to `$_GET['grupa_select']` and to use it as condition in your select query. So, something like: $values = array( $_GET['grupa_select'] ); $sql = "SELECT * FROM concerts WHERE groupnaziv = ?"; $query = $pdo->prepare($sql); $query->execute($values); … | |
Re: Have you tried **datepicker** from the JQueryUI package? * http://jqueryui.com/datepicker/ * http://api.jqueryui.com/datepicker/ | |
Re: Hi, actually they seem to use the post ID as **local part** of the poster email address. So, they receive an email from a user on their servers and, then, they redirect it to the original email address. It works as a relay. But they also create unique aliases for … | |
Re: Hi, You can use the `required` attribute: <form method="post" action=""> <label for="fruits">Choose an option:</label> <select name="fruits" required> <option value="">------</option> <option value="fujiapple">Apple</option> <option value="vanillaorange">Orange</option> <option value="pandoracherry">Cherries</option> </select> <input type="submit" name="submit" value="submit" /> </form> By adding an empty option the form will not be submitted. You could also add a javascript check, … | |
Re: Hello, try with: .dropdown-menu { max-height: 450px; overflow-y: auto; overflow-x: hidden; } Source: * https://github.com/twbs/bootstrap/issues/1989 | |
Re: Hello, I think the problem is in the `cents` variable, this is modified after each IF statement, but doing: cents = cents%0.25; Will return `0.065` which means `0`, so the other statements will return empty. Try: var calculate_click = function () { var cents = $("cents").value; if (cents > 24){ … | |
Re: Regarding the 500 error, check the error log of your server, an external redirect cannot generate an error like that, unless your server config is accepting some headers set from remote. A part that, if you look at `f`, `c` and `ch` values, these are base64 strings, concatenated by `-` … | |
Re: The reason is probably given by their PDO library, check lines `266`, `320` and `323`: * https://github.com/zendframework/zf2/blob/a1085b769953be15296c3a4976e026927b5b9584/library/Zend/Db/Adapter/Driver/Pdo/Connection.php#L266 The `$options`, created by the `resources.db.params.driver_options.1002` variable is used as 4th argument in the PDO connection string, for the character set. The `$charset` variable instead is used at line 323: $this->resource->exec('SET NAMES ' … | |
Re: Hello, note that you are already overwriting the `$ids` variable on line 18: echo $ids = implode(',', $ids); So, when you try to perform the same action on line 19, you should get a warning like `implode(): Invalid arguments passed...` because it expects an array, and instead it gets a … | |
Re: Since in `.htaccess` the rules have a cascading order, for a simple "manual" solution you could save this .htaccess file into the download directory: <Files "*"> order allow,deny deny from all </Files> <Files "Myxmlfilename.xml"> order allow,deny allow from all </Files> This would deny the direct access to all the files, … | |
Re: You can use their **test mode**: * https://stripe.com/docs/testing bye! | |
Re: Hi, is the URL helper automatically loaded? By enabling the log in CI you should be able to get more information about the error, just check into `application/logs/`. Try also to prefix the redirect link with a slash, for example: redirect('/login'); | |
Re: In addition, you could try with a UDF. For example: * http://www.xaprb.com/blog/2007/10/30/how-i-built-the-now_usec-udf-for-mysql/ * http://stackoverflow.com/a/8986802 But if you want to save it, you have to use `varchar` instead of a `datetime` column. | |
Re: Hello, have you followed the suggestions you have received in your precedent request? http://www.daniweb.com/hardware-and-software/linux-and-unix/threads/474312/compile-windwos-netcat-under-linux If yes, then give us more information about your issue. | |
Re: Hello, you probably want something like this: <?php $temps = range(0, 100); ?> <table> <thead> <tr> <th>Fahrenheit</th> <th>Celsius</th> </tr> </thead> <tbody> <?php if(count($temps) > 0) { foreach($temps as $F) { $C = ($F - 32) * 0.55; echo " <tr> <td>{$F}</td> <td>{$C}</td> </tr> "; } } else { echo " … | |
Re: Hi, the `prepare()` method requires `execute()` not `query()`, so this: $sql = "SELECT * FROM user_right WHERE login_id = '$username' and password = '$password'"; $stmt = $dbh->prepare($sql); $stmt->setFetchMode(PDO::FETCH_ASSOC); if($stmt = $dbh->query($sql)){ ... Should be: $values = array( $username, $password ); $sql = "SELECT * FROM user_right WHERE login_id = ? … | |
![]() | Re: You can check the session in the constructor method, for example: class Test extends CI_Controller { public function __construct() { parent::__construct(); # Check the session if($this->session->userdata('is_valid') !== TRUE) { # unset session ... # redirect out redirect('/logout'); } } # other methods public function index() { return 'hello'; } } … |
Re: Hi, drop the table and retry. If it does not work check the status: show engine innodb status\G And verify if there are errors, you could also perform `check table infracom_admin` but this can stop the server, read the documentation before you try. Your issue can happen if you move … |
The End.