2,113 Posted Topics

Member Avatar for london-G

Hi! In addition to Dave's suggestion, having a div between rows is not really correct: <table> <tr> <td> <div class="img"> <tr> <td><img src="..." /> </div> <tr> <td> </table> Do: <table> <tr> <td> <tr> <td><div class="img"><img src="..." /></div> <tr> <td> </table> Or simply: <table> <tr> <td> <tr> <td><img class="img" src="..." /> …

Member Avatar for london-G
0
314
Member Avatar for punji

It happens because you're missing the quote for the previous values, this: ('60', 'Ng'wagindu), should be: ('60', 'Ng'wagindu'),

Member Avatar for punji
0
459
Member Avatar for phoenix254

**@phoenix** There are some errors here: echo work $sql ="UPDATE tea SET name = ' 8req' WHERE id = '3 ' "or die ("cant update" . mysql_error()); The echo statement needs quotes if you're trying to return a string, if that is a constant it's ok, but you have to …

Member Avatar for phoenix254
0
224
Member Avatar for Priti_P

Hi, the function `array_diff()` will return empty: 1. if the first array is smaller then the second; 2. and if the elements in the first array range are the same of the second. For example: $a = [1,2]; $b = [1,2,3]; print_r(array_diff($a, $b); Will return empty, instead: $a = [1,2]; …

Member Avatar for cereal
0
219
Member Avatar for Babu_1

Hi, the function `null2unknown()` is not a PHP function, it's a **user defined function** so there must be a file, included by payment_gateway.php or by a main file, which defines the above function. The GET variables, instead are usually set by form fields: <form method="get"> <input type="text" name="vpc_Amount"> ... </form> …

Member Avatar for cereal
0
182
Member Avatar for janicemurby

Hi! The problem is caused by the quotes, you need to escape them correctly, try: $pm_ui = '<button id="pmBtn" onclick="postPm(''.$u.'',''.$log_username.'','pmsubject','pmtext')">Send</button>'; In your case you're including PHP variables and your using single quotes, so you have to escape those to create the javascript arguments, and make the variables print their values. …

Member Avatar for janicemurby
0
207
Member Avatar for DaveAmour

Hi there, @Dave consider that points generated in March and April 2015 (in the range of 45 days if I'm not mistaken) are only estimated points and need to be reviewed by the team, those months are marked by an asterisk. I think there is a thread in which Dani …

Member Avatar for DaveAmour
0
448
Member Avatar for Kamal_6

Don't rely on the value returned by the $_FILES array because is set by the client, which can be altered or simply different from what expected. For example some executives will return `application/x-dosexec`. Use the **finfo** library: $finfo = new finfo(FILEINFO_MIME_TYPE); $type = $finfo->file($file); if(in_array($type, array('mime', 'blacklist'))) { # ... …

Member Avatar for cereal
0
138
Member Avatar for Kamal_6

Hi! Change also the value of `post_max_size`, this should be equal or larger than `upload_max_filesize`. Docs: http://php.net/manual/en/ini.core.php#ini.post-max-size

Member Avatar for cereal
0
170
Member Avatar for developer707

Hi, the code seems fine to me. But you can try this function which extends a bit the check: function get_ip_address() { $array = array( 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' ); foreach($array as $key) if(array_key_exists($key, $_SERVER) === true) foreach(explode(',', $_SERVER[$key]) as $ip) if(filter_var($ip, FILTER_VALIDATE_IP) !== false) return $ip; …

Member Avatar for cereal
0
360
Member Avatar for phoenix254

Hi, `getimagesize()` is a function to evaluate the pixels of an image, the type and the attibutes (a stringed version of height and width), it returns an array. For example: Array ( [0] => 20 [1] => 10 [2] => 2 [3] => width="20" height="10" [bits] => 8 [channels] => …

Member Avatar for cereal
0
660
Member Avatar for ramsiva

Hi, it seems fine to me, but you can use directly the object created by the `diff()` method, without formatting the output, as [in my previous example](https://www.daniweb.com/web-development/php/threads/493999/how-to-get-differenc-in-hours-and-minutes-#post2160993): $minutes = 0; $minutes += $diff->h * 60; $minutes += $diff->i; echo round($minutes / 4); Which outputs `23`, with floor `22`. If you …

Member Avatar for ramsiva
0
162
Member Avatar for mattyd

Hi, if you're using a prepared statement to insert the data, then submit the zipcode as a string, not as integer, this should solve the issue for you. The table column must be char or varchar, as you're already doing.

Member Avatar for mattyd
0
221
Member Avatar for ramsiva

Hi, use the DateTime library, in particular look at the `diff()` method. For example: <?php $one = '09:30AM'; $two = '06:30PM'; $dtime_1 = new Datetime($one); $dtime_2 = new Datetime($two); $diff = $dtime_1->diff($dtime_2); echo $diff->format('%H:%I'); Will print `09:00`. More info here: * http://php.net/manual/en/datetime.diff.php * http://php.net/manual/en/dateinterval.format.php

Member Avatar for ramsiva
0
265
Member Avatar for mattyd

To paste code I usually place the cursor in a new line and then I press TAB once, for example: /** * Sign Out * @return void */ public function getOut() { Auth::logout(); return Redirect::route('sign_in'); } Usually, it does not require any other adjustment because, in my editor, I always …

Member Avatar for Reverend Jim
0
352
Member Avatar for Wojciech_1

> I just tried Ctrl+tab and it jumped to the next browser tab. Same here on Chrome. In Ubuntu `Alt Tab` is used to switch the windows in the same workspace. Maybe `Shift Tab`? It seems free, at least in Ubuntu.

Member Avatar for cereal
-2
859
Member Avatar for James_43

Hi all, James you can send an email to Gmail SMTP, you don't need sendmail to do this because you're going to connect directly to the SMTP server. Check this example: * https://www.daniweb.com/web-development/php/threads/483301/cannot-send-email-from-server/2#post2117095 Which makes uses of **PHPMailer** library: * https://github.com/Synchro/PHPMailer * http://phpmailer.worxware.com/ You can do it without: you need …

Member Avatar for Kyle Wiering
0
479
Member Avatar for tqmd1

Hi, create a container for #box5, then you can use two methods. #Method 1# Move the text outside the opaque element and move it over, something like this: <div id="box"> <div id="box5"></div> <div id="box5-p"> This text is normat text over opacity background </div> </div> Styles: #box { position: relative; width:250px; …

Member Avatar for cereal
0
130
Member Avatar for mattyd

Hi, from the error message it seems the page includes PHP, if affirmative then check that the variables are correctly closed, for example here is missing the semicolon: <?php $a = 'hello' ?> <!DOCTYPE html> ... And will generate the same parse error, pointing the end of the file even …

Member Avatar for Albert Pinto
0
346
Member Avatar for uchejava

In addition, there is a small typo with quotes: $_POST['accommodation"] Use single quotes or double quotes, not both together: $_POST['accommodation'] # or $_POST["accommodation"] Bye!

Member Avatar for uchejava
0
123
Member Avatar for Prince_9

In addition: `$values['books']` is an array where the index key is the `book_id`, for example: [books] => Array ( [38] => Array ( [book_id] => 38 [title] => Alexander of Macedon, 356-323 B.C. : a historical biography. [author_lf] => Green, Peter [author_fl] => Peter Green [author_code] => greenpeter [ISBN] => …

Member Avatar for broj1
0
357
Member Avatar for jkon

Thanks for sharing! I tested your class and I like it, consider to add a passphrase to allow different results, it could be helpful. You may want to check Hashids, it's very similar to your concept: http://hashids.org/

Member Avatar for diafol
2
3K
Member Avatar for ggeoff

Hi, are you accessing the website through the IP? I ask this because the function that checks the path is this: // Since 2.0: security reason function check_direct_including($incln) { global $PHP_SELF; $Uri = '//'.dirname( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); if (strpos(getoption('http_script_dir'), $Uri) !== false && strpos($PHP_SELF, $incln) !== false) die(proc_tpl('help/manual/wrong_include', array('category' …

Member Avatar for ggeoff
0
322
Member Avatar for donz365

Hi, you need at least MySQL 5.1.5 to import XML, otherwise you have to check if a UDF (user defined function) was developed to support old versions. In the documentation you can find a comment (bottom of the page) that suggests a workaround, sincerly I wouldn't use it. If possible …

Member Avatar for DaveAmour
0
966
Member Avatar for mattyd
Member Avatar for diafol
0
261
Member Avatar for london-G

Hi, it could be the mime-type or the column table size, be sure to not truncate the input. If using a `blob` column type then this can support up to 65536 bytes. To save more data use `mediumblob` which supports up to 16MB or `longblob` which supports up to 4GB. …

Member Avatar for almostbob
0
3K
Member Avatar for davy_yg

If you write: onClick="parent.location='cadd_latihan/'" your link is relative to the page in which this is clicked, so if you open it in `/home/` the client asks for `/home/cadd_latihan/`, if you click it in `/contact/` the client asks for `/contact/cadd_latihan/`. To fix it, add a leading slash to the url and …

Member Avatar for cereal
0
970
Member Avatar for terryds

Hi, you actually get the result, just loop it: $result = $pdo->query("SELECT * FROM posts"); foreach ($result as $key => $value) echo $value['title']; echo 'Total: '. $result->rowCount(); It's not visible through `print_r()` because the statement is an iterable object, if you want the full array use `fetchAll()`: print_r($result->fetchAll()); As second …

Member Avatar for cereal
1
235
Member Avatar for ramsiva

Hi, use `trim()` to remove the pending comma: echo trim('a,b,c,', ','); The same can be done at query level: select trim(TRAILING ',' FROM 'a,b,c,'); Docs: * http://php.net/trim * http://dev.mysql.com/doc/refman/5.6/en/string-functions.html#function_trim

Member Avatar for ramsiva
0
93
Member Avatar for Ventech_IT

> the form gets posted it will only return the first variable that i place in the paranthesis like It happens because the `message()` method takes only one argument. In order to work correctly you should write something like this: $this->email->from('contact@domain.tld', 'From WebSite'); $this->email->reply_to($email, $name); $this->email->to('me@domain.tld'); $this->email->subject('Message from contact form'); …

Member Avatar for Ventech_IT
0
313
Member Avatar for protas

Hi, few questions: 1. which operative system? 2. can you use PHP or another scripting language? 3. you have the IP list, nameOFfile.txt is an arbitrary value or defined in the list?

Member Avatar for BobMCT
0
311
Member Avatar for london-G

You can remove `/usr/bin`. When not sure about the path of a command you can use `env`, e.g.: /usr/bin/env php script.php --attribute hello --import ../world.txt but not in case of `cd`, you don't need it. In any case I'm not sure the above script will work, because the `--file` attribute …

Member Avatar for london-G
0
432
Member Avatar for k_manimuthu

**@k_manimuthu** Hi, the `FROM` statement is not allowed in the update query, this is reason you get the error. This will work: UPDATE tb2,tb1 SET tb2.data = tb1.data WHERE tb1.id = tb2.id AND tb2.data IS NULL; Which is almost the same of your previous query with Reverend Jim fix to …

Member Avatar for k_manimuthu
0
317
Member Avatar for Simon_4

It seems all these arrays will have the same size, so you can loop them together, for example: # read size of one of these arrays $count = count($_REQUEST['gender']); # loop for($i = 0, $e = 1; $i < $count; $i++, $e++) { echo "Student #{$e}: Gender: $gender[$i] / Shoe-Size: …

Member Avatar for Simon_4
0
1K
Member Avatar for london-G
Member Avatar for rosario1990

Check also the Mozilla Developer Network: https://developer.mozilla.org/en-US/ In particular read their HTML[5], CSS and Javascript sections.

Member Avatar for fantyfiz
0
225
Member Avatar for SeanKann

Hi, set the default charset for the web server to UTF-8, you can do this by adding this directive into your .htaccess file: AddDefaultCharset utf-8 And be sure `default_charset`, in the php.ini file, is set correctly, otherwise set it dinamically: ini_set('default_charset', 'UTF-8');

Member Avatar for SeanKann
0
162
Member Avatar for AntonyRayan

I don't know if there is a ready PHP solution for this, but if you can install software in your hosting, then use LibreOffice in command line mode: <?php $file = 'something.doc'; $str = sprintf("libreoffice --headless --invisible --convert-to pdf %s", $file); $cmd = escapeshellcmd($str); exec($cmd); There are other solutions as …

Member Avatar for cereal
0
136
Member Avatar for SeanKann

Hi, regarding the ffmpeg execution in `$RF->newname` are you returning only the filename or also the path in which this file is located? Is the destination path writable? Regarding the execution of the controller from CLI, it seems you are autoloading the session library, this will give the kind of …

Member Avatar for cereal
0
3K
Member Avatar for OsaMasw

Also explain the reason, because you could simply use the [Alias directive](http://httpd.apache.org/docs/2.4/mod/mod_alias.html) to point the external directory to clients: Alias /uploads /etc/mnt/storage/uploads that way you don't have to alter your scripts, but if your boss decision was taken for security reasons, then Alias is the wrong solution.

Member Avatar for cereal
0
2K
Member Avatar for AntonyRayan

Hi, maybe you have multiple file type fields in your page? Try by identifying the field by the ID attribute, for example: // by default, submit is disabled $("#submit").attr("disabled", "true"); $("#upload").on('change', function(){ var val = $(this).val().toLowerCase(); if(!val) { alert('upload your photo'); $(this).focus(); $("#submit").attr("disabled", "true"); return false; } else { var …

Member Avatar for AntonyRayan
0
184
Member Avatar for kingwash

Hi, try: <?php class One{ public $a; } $b = 'Hello'; $test = new One; $test->a = $b; echo $test->a; For more information read about the **visibility** of class properties: * http://php.net/manual/en/language.oop5.visibility.php

Member Avatar for diafol
0
137
Member Avatar for Kyriakos_1

If you can use the command line then use ffmpeg with the `-vframes` option, example here: * https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video Through PHP you can use `exec()` or you can use this PHP-FFMpeg that supports `-vframes` * https://github.com/PHP-FFMpeg/PHP-FFMpeg * https://github.com/PHP-FFMpeg/PHP-FFMpeg/blob/6e3134e4ecc96852b1205e6c88ceffdb8cf17d34/src/FFMpeg/Media/Frame.php#L77

Member Avatar for cereal
0
104
Member Avatar for boney

`SUM()` is a function of the `GROUP BY` clause, so, in order to get correct results you have to add a *group by* statement to your query, otherwise: > If you use a group function in a statement containing no GROUP BY clause, it is equivalent to grouping on all …

Member Avatar for cereal
0
159
Member Avatar for ggeoff

Ok, there is an API key for **server applications** and another for **browser applications**, with the Javascript Google Maps API, you must use the browser applications API Key. Can you play the [example code](https://developers.google.com/maps/documentation/javascript/tutorial#HelloWorld) with your key? <!DOCTYPE html> <html> <head> <style type="text/css"> html, body, #map-canvas { height: 100%; margin: …

Member Avatar for ggeoff
0
2K
Member Avatar for gabrielcastillo

The function `array_walk_recursive` will set the index key as second argument of the mapped function, the third argument will be the third of the function, since `ltrim` takes only two arguments it's better to define a custom function. Now, the main problem is that `array_walk_*` cannot modify the structure of …

Member Avatar for gabrielcastillo
0
327
Member Avatar for shammi.khan.73
Member Avatar for pritaeas

Since there were suggested few solutions... here's mine :p Use CJS or GreaseMonkey (TamperMonkey in Firefox) extension to embed a tiny javascript: Target = document.getElementsByClassName("post-first")[0]; Target.className="margin-bottom clear"; It removes `.post-first` from the DOM and returns the standard styling for the first post. I find it really difficult to read all …

Member Avatar for diafol
4
851
Member Avatar for rhodoscoder

Seems fine, go to C:\xampp\htdocs\Bonfire-master\bonfire\codeigniter\database\drivers\mysql\mysql_driver.php Line `73`, method `db_connect()`, you find: return @mysql_connect($this->hostname, $this->username, $this->password, TRUE); change it, temporarly for this issue, to: return mysql_connect($this->hostname, $this->username, $this->password, TRUE) or die(mysql_error()); And then reload the page, you should see the real error that makes the connection fail. ## //EDIT ## By …

Member Avatar for cereal
0
443
Member Avatar for CaffeineCoder

Have you set the `DocumentRoot` with the correct path? Consider this must be an absolute path. More information here: * http://httpd.apache.org/docs/current/mod/core.html#documentroot

Member Avatar for CaffeineCoder
0
2K

The End.