2,113 Posted Topics

Member Avatar for arjani10

Hi, I haven't tested this but I think you could use `mod_actions` with `X-Frame-Options SAMEORIGIN`, this header is used to define if an external website can include your pages through an iframe. It has three statements: * `SAMEORIGIN` * `DENY` * `ALLOW-FROM http://url.tld/` The third option would be perfect for …

Member Avatar for cereal
0
349
Member Avatar for ayesha789

**@chandrama** At the moment you are not [escaping](http://php.net/manual/en/language.types.string.php) the third backslash in the sequence: `\\server\printer`. So, if the dll is correctly loaded as the pecl package, try: $handle = printer_open("\\\\server\\Brother MFC-J430W Printer"); Or with single quotes: $handle = printer_open('\\server\Brother MFC-J430W Printer'); Else, I'm not sure Microsoft Windows supports the IPP …

Member Avatar for cereal
0
3K
Member Avatar for basketmen

Hi, have you considered `preg_replace()`? Basic example: <?php $s = 'google googler'; echo preg_replace('/\bgoogle\b/i', 'go*gle', $s); # outputs: go*gle googler With arrays it gets tricky because you have to write the pattern for each word to filter, but you can use an anonymous function to fix it, for example: <?php …

Member Avatar for almostbob
0
241
Member Avatar for janicemurby

Hi, when the query fails MySQLi will return FALSE, so add [mysqli_error()](http://php.net/manual/en/mysqli.error.php) to get some information about it. I think there is an ambiguous column error, which means the two tables have at least a column with the same name, for example `postdate`.

Member Avatar for janicemurby
0
245
Member Avatar for Kevin_17

Hi, did you considered the `fping` command? With the `-g` option you can define a range: fping -c 1 -g 192.168.129.1 192.168.129.20 fping -c 1 -g 192.168.129.0/24 And to get just the active IPs do: fping -c 1 -g 192.168.129.1 192.168.129.20 2> /dev/null

Member Avatar for cereal
0
307
Member Avatar for phoenix254
Re: Html

> btw can they use in php ? Yes, if you set the `asp_tags` directive to TRUE, but this will be removed from PHP version 7.*, so it's better to not use it. More information here: * http://php.net/manual/en/ini.core.php#ini.asp-tags * http://php.net/manual/en/language.basic-syntax.phptags.php

Member Avatar for cereal
0
96
Member Avatar for Vivek_13

You could use `xpath()` to match only the selected questions: $xpath = $xml->xpath('//main[@select="selected"]'); So you can remove the IF statement: if($main['select'] == "selected") Then count to get the total and create a simple pagination system: $count = count($xpath); $page = isset($_GET['page']) && $_GET['page'] > 0 ? $_GET['page'] : 1; $numbr …

Member Avatar for Vivek_13
0
1K
Member Avatar for Vivek_13

Hi, you could [count](http://php.net/manual/en/simplexmlelement.count.php) the nodes, create a [range](http://php.net/range) array and then [shuffle](http://php.net/manual/en/function.shuffle.php) the range, finally you return the node, for example: <?php $xml = <<<EOD <?xml version="1.0" encoding="UTF-8"?> <main> <articles> <article> <title>Title 001</title> <content>Content 001</content> </article> <article> <title>Title 002</title> <content>Content 002</content> </article> <article> <title>Title 003</title> <content>Content 003</content> </article> </articles> …

Member Avatar for Vivek_13
0
270
Member Avatar for xathlon2

Hi, you could use the **get_json.php** end point to get the data array. For example: $u = 'http://api.hostip.info/get_json.php'; $r = json_decode(file_get_contents($u)); echo $r->country_name;

Member Avatar for cereal
0
64
Member Avatar for pritaeas
Member Avatar for Dani
1
530
Member Avatar for duchaine

Hi, are you using MySQL on Windows? Is this a new installation? Which version? Could you paste the specific message and code error?

Member Avatar for bugz313
0
97
Member Avatar for infoitmanoj

Hi, there are two possible reasons: 1. the url helper is not loaded 2. missing trailing slash in *application/config/config.php* `$config['base_url']`: $config['base_url'] = 'http://domain.tld'; # <- missing final /

Member Avatar for infoitmanoj
0
1K
Member Avatar for network18

Try if it works fine from the mysql client, because it returns this error to me: ERROR 1414 (42000): OUT or INOUT argument 2 for routine dbase.test_proc is not a variable or NEW pseudo-variable in BEFORE trigger You can try to bypass the error by setting a variable before calling …

Member Avatar for cereal
0
4K
Member Avatar for punji

Hi, remove the `WHERE` condition and add `GROUP BY student_code` to the **select** statement and it should work fine, but consider that you could use a view, otherwise when you add something else to the `results` table you have to check and update the `totals` table. Examples: INSERT INTO `results`(`student_code`, …

Member Avatar for punji
0
294
Member Avatar for shaqib

There are two problems here: $query = $query1." ".UNION." ".$query2; $resultID = mysql_query($query); First: UNION will be evaluated by PHP as a constant, not as a string part of a query, the correct syntax would be: $query = "$query1 UNION $query2"; Second: the last query will connect to the last …

Member Avatar for shaqib
0
3K
Member Avatar for donz365
Member Avatar for anitg

It could be the link, the above would work only in the intranet. To connect to an external remote server, you must point the server to use the public IP. Anyway to get some extra information add: curl_setopt($curl_handle, CURLOPT_VERBOSE, true); That will print the requests and responses of both sides.

Member Avatar for anitg
0
551
Member Avatar for phoenix254

Hi all! **@phoenix** I suppose you have a form with an input field like this: <input type="text" name="ITEM" id="ITEM"> From which you set the `$ITEM` variable, so try to send something different from the expected value, you expect an integer. Send this instead: 1 OR 1=1 It will probably return …

Member Avatar for cereal
0
235
Member Avatar for janicemurby

The `date_diff()` function requires two arguments, also both must be resources of the *DateTimeInterface*, if you pass a string, as in your example, the function will fail. So, you must write: <?php $date_a = '2015-04-01'; $date_b = '2015-03-25'; $dt_a = new Datetime($date_a); $dt_b = new Datetime($date_b); $interval = date_diff($dt_a, $dt_b); …

Member Avatar for janicemurby
0
331
Member Avatar for younes.keraressi

Hi, have you tried the solution offered in their forum? Here's the link: * http://forum.uniformserver.com/index.php?showtopic=2961&hl=%2Bcrash+%2Bevent

Member Avatar for younes.keraressi
0
328
Member Avatar for dtpp

Hi, read this: https://www.daniweb.com/community/syntax#quotes The syntax help is accessible by clicking on the `?` icon in the text editor.

Member Avatar for Dani
0
270
Member Avatar for cristian.stilpeanu.1_1

> Erorare reference : This email was looking for a about is sent without authentication It means that the SMTP server used to send the email requires the authentication for the email defined here: $emailFrom ="contact@yoursite.com"; i.e. it requires the password. With `mail()` you can do this only by editing …

Member Avatar for cristian.stilpeanu.1_1
0
528
Member Avatar for Sophia_1

@Sophia hi, could you show us the **form** used to submit the POST values to your script?

Member Avatar for cereal
0
589
Member Avatar for Sutarusu

Ok, here there are two errors on this line: `newmessage`int(4) unsigned NOT NULL DEFAULT `0`, The space between the column name and the type is missing, and the default value is defined with backticks instead of quotes, so: `newmessage` int(4) unsigned NOT NULL DEFAULT '0', But there is also another …

Member Avatar for Sutarusu
0
2K
Member Avatar for fonzali

Hi! If using Ubuntu then open the terminal and type: locate java.desktop It should find few entries under `/usr/share/app-install/desktop/`, these are the files used to generate the desktop entries. If you don't get results try to update the mlocate database through the command **updatedb**. If you get some results the …

Member Avatar for fonzali
0
604
Member Avatar for Prince_9

Try to change the header to: curl_setopt($curl, CURLOPT_HTTPHEADER, array( "Authorization: Token token=$token" )); Then it should work fine. To debug the request add: curl_setopt($curl, CURLINFO_HEADER_OUT, true); And: $info = curl_getinfo($curl, CURLINFO_HEADER_OUT); Which prints: GET /api/v1/items/8568ccd0-c614-012f-1d74-58d385a7bc34.json HTTP/1.1 Host: api.repo.nypl.org Accept: */* Authorization: Token token=YOUR_TOKEN

Member Avatar for cereal
0
770
Member Avatar for phoenix254

Hi, in this case you can use `header()`, you could setup actions.php like an hub and define specific redirect links: switch($_GET['action']): { case 'send': # run insert query $redirectTo = "http://website.tld/pageY.php"; break; case 'update': # run code here $redirectTo = "http://website.tld/pageX.php"; break; default: $redirectTo = "http://website.tld/pageA.php"; } header("Location: $redirectTo"); Also …

Member Avatar for phoenix254
0
260
Member Avatar for Hitesh_2

Hi, check the data models in the Education section at: * http://www.databaseanswers.org/data_models/ If it does not help, write about your project, try to define the basic information you would need to create such application. This should help you to shed some light and then you can ask more specific help, …

Member Avatar for cereal
0
233
Member Avatar for davy_yg

Hi, open the Developer Tools console in Google Chrome, then click on the smartphone icon, it allows to test some device resolutions, here's a screenshot: http://i.imgur.com/cs3ZeA7.png

Member Avatar for cereal
0
74
Member Avatar for Driton_1

Hi, you're defining the variables after the binding, this will lead to an error, try: $nm = $_POST['nm']; $nm = $_POST['ln']; $gd = $_POST['gd']; $tl = $_POST['tl']; $ar = $_POST['ar']; $stmt->bind_param('ssss', $nm, $ln, $gd, $tl, $ar);

Member Avatar for Driton_1
0
4K
Member Avatar for Priti_P

In addition, if you're using Laravel, then you can use the `asset()` helper: $link = asset("/images/Work_Anniversary.png"); This will prepend the application url.

Member Avatar for pritaeas
0
210
Member Avatar for edbr

In addition, you could use `mysqli_fetch_all()` to retrieve all the rows: $result = mysqli_fetch_all($query, MYSQLI_ASSOC); foreach($result as $key => $row) { echo $row['title'].'<br>'; } But it requires Mysqlnd (the native driver): * http://php.net/manual/en/mysqli-result.fetch-all.php * http://php.net/manual/en/book.mysqlnd.php

Member Avatar for edbr
0
965
Member Avatar for riwakawd

Hi, I haven't tested this but try to set the subquery in the `select()` method: $this->db->distinct(); # select $this->db->select("*, (SELECT GROUP_CONCAT(cd1.name ORDER BY level SEPARATOR '&nbsp;&nbsp;&gt;&nbsp;&nbsp;') FROM " . $this->db->dbprefix . "category_path cp LEFT JOIN " . $this->db->dbprefix . " category_description cd1 ON (cp.path_id = cd1.category_id AND cp.category_id != cp.path_id) …

Member Avatar for cereal
0
237
Member Avatar for Виктор_6

It happens because `$connect` is defined out of the scope of the function, to fix it do: <?php include 'config.php'; function findProducts($connect) { $query = mysqli_query($connect, "SELECT * FROM cart"); while($row = mysqli_fetch_assoc($query)){ echo $row['title'].'<br>'; } } echo findProducts($connect)

Member Avatar for cereal
0
201
Member Avatar for lewashby

In these cases you should hear some beeps from the motherboard, the sequence can help you to understand the issue, in the documentation you should find the meaning of each sequence. Anyway, make sure everything is well connected to the motherboard, including jumpers and connectors. If it does not solve …

Member Avatar for Gribouillis
0
163
Member Avatar for Niloofar24
Member Avatar for SoMa_2

Once you get through the IF statement the new value, for the **$level** variable, will be valid for the remaining code: $level = 0; echo $level; # outputs: 0 # for the example, random choice $a = rand(1, 2); if($a == 1) $level = 1; else $level = 2; echo …

Member Avatar for cereal
0
153
Member Avatar for ramsiva

Hi, this is an intended behaviour of the browser, a website cannot define the file to upload from a client system, otherwise it could be used to steal anything. In any case, the browser works in a sandbox, so you cannot access directly to local resources.

Member Avatar for cereal
0
197
Member Avatar for cereal

Hi all! I don't know if this occurs only to me but in the forum list view the **read** text icon wraps to a new line, like this: ![read_gif.jpg](/attachments/small/0/9fe408e01220f3a9086241a5f936c486.jpg) Here's a larger screenshot: http://i.imgur.com/k9w09hn.jpg I noticed this few days ago. I don't have extensions on. I tested the zoom, but …

Member Avatar for cereal
0
259
Member Avatar for uettttt

Hi, it is possible, read these articles: * https://developers.google.com/maps/articles/phpsqlajax_v3 * https://developers.google.com/maps/articles/phpsqlsearch_v3 but your question is a bit vague. If you offer more details, maybe we can suggest you better. Bye!

Member Avatar for cereal
0
31
Member Avatar for phoenix254

Hi! That's the format supported by the database, save it like this, then when your get the result set format as you prefer. You can do it directly at query level with the `format_date()` function: * https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format or in PHP with the `IntlDateFormatter` class: * http://php.net/manual/en/intldateformatter.format.php For this task I …

Member Avatar for cereal
0
420
Member Avatar for SimonIoa

The function `mysql_result()` returns one of the rows of the result set, so if you get a total of 10 rows, you can decide to get one of those: $query = mysql_query('SELECT * FROM tablename'); $row = mysql_result($query, 2); the count starts from `0`. To get a single row, instead, …

Member Avatar for SimonIoa
0
281
Member Avatar for Makara

Hi, if I'm not wrong, this script is creating database tables and procedures, I suppose for MS SQL, so all you need is to convert them to queries that you would run in a database client. For example with the PDO API you can do: try { # connect to …

Member Avatar for cereal
0
253
Member Avatar for fireburner29

Hi, just a note: the `mcrypt_ecb()` function is deprecated since PHP 5.5, it means this is going to be removed. You should use `mcrypt_generic()`and `mdecrypt_generic()` as explained in the documentation: * http://php.net/manual/en/function.mcrypt-ecb.php * http://php.net/manual/en/migration55.deprecated.php For some information about the encryption modes check those available: * http://php.net/manual/en/mcrypt.constants.php I would use CBC …

Member Avatar for fireburner29
0
266
Member Avatar for Niloofar24

Hi, add a space after `LIMIT`, at the moment when executed it will print `LIMIT20, 3` instead of `LIMIT 20, 3`. But validate and sanitize the number. For example: $number = trim($_POST['number']); $number = filter_var($number, FILTER_VALIDATE_INT, $options); $sql = "SELECT ID, Title, Author, Content FROM Posts LIMIT $number, 3"; Otherwise …

Member Avatar for Niloofar24
0
588
Member Avatar for 88dbsakthi

Use `base64_decode()`: http://php.net/manual/en/function.base64-decode.php For example, this: eval($OOO0000O0('JE8wMDBPME8wMD0kT09...hbCgkT08wME8wME8wKTs=')); equals to: eval($OOO0000O0( $O000O0O00 = $OOO000O00($OOO0O0O00,'rb'); $O0O00OO00($O000O0O00,0x4fa); $OO00O00O0 = $OOO0000O0($OOO00000O($O0O00OO00($O000O0O00, 0x368), '3C4hHR7yEoKBnvWimqfuSGt56bd2DkYzMjL+rVNZslFxgUIpX9aPT/cOewQJ081A=', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')); eval($OO00O00O0); )); The string `3C4hHR7yEoKBnvWimqfuSGt56bd2DkYzMjL+rVNZslFxgUIpX9aPT/cOewQJ081A=` converts into binary data, it could be part of an image, music file or something else... the other string: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ is probably the key to …

Member Avatar for KaSHihaXor
0
557
Member Avatar for phoenix254

A problem is this: $sql ="UPDATE login SET firstname = '$newfirstname' WHERE ID=$dbid" or die ("cant update " . mysqli_error($con)); Do only: $sql = "UPDATE login SET firstname = '$newfirstname' WHERE ID=$dbid"; Otherwise `mysqli_query()` will return false.

Member Avatar for cereal
0
103
Member Avatar for xvadias

Hi, why don't you contact the developer? You can find his name and email address in the first bits of each file.

Member Avatar for cereal
0
34
Member Avatar for janicemurby

It returns boolean (`FALSE` in this case) because the query will generate an error, due to a quote placed in the wrong place `s.type='c)'`, so change this: $sql = "SELECT s.*, u.avatar FROM status AS s LEFT JOIN users AS u ON u.username = s.author WHERE (s.account_name = '$u' AND …

Member Avatar for cereal
0
213
Member Avatar for slowlearner2010

Hi all, @slowlearner2010 just for the log, it seems you don't need the `array_push()` neither the loop, use `trim()` to remove extra spaces and then use `implode()`, then you should be done: $a = array_map('trim', $_POST['a']); $b = implode(',', $a); At least, looking at your example, this seems to work …

Member Avatar for slowlearner2010
0
160

The End.