2,113 Posted Topics

Member Avatar for diafol

That drop of Duncan Weir at the last minute still hurts here... but it was well deserved. I can already see the whitewash coming to us. > England and Ireland giving everything for the full 80 minutes Beautiful game, indeed. Ireland and England performances are stellar right now.

Member Avatar for diafol
0
278
Member Avatar for ponedelnik

Hi, you could also use a regular expression, for example: if(/^rgb\(0,\s*0,\s*255\)$/i.test(document.getElementById(id).style.backgroundColor)) Docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

Member Avatar for ponedelnik
0
163
Member Avatar for davy_yg

Check the **.htaccess** file, there is probably a rewrite to match the switch cases in **header.inc.php**. Also check the code of the `getCurrentFilename()` function, that should give some hints about the url manipulation.

Member Avatar for davy_yg
0
219
Member Avatar for polarpandabear

Did you solved the problem? Looking at the linked page, it seems all fine now. An evident error, in the above code is this: $q="select count(*) \"total\" from comments"; Because with the aliases and the column names you have to use the backticks not the quotes. So: $q = "select …

Member Avatar for cereal
0
483
Member Avatar for mydreamgirl

Hi, show your query, the table structure and the output of `explain` over the query. Otherwise it is difficult to give correct suggestions.

Member Avatar for cereal
0
78
Member Avatar for network18

Hi, check the Apache error log, you should find an extended error message, if you have doubts post the errors here.

Member Avatar for network18
0
524
Member Avatar for dukumanis

If you're referring to the datepicker then yes, use `dateFormat`: $("#datepicker").datepicker({ dateFormat: 'dd-mm-yy' }); Documentation: * http://api.jqueryui.com/datepicker/#option-dateFormat * http://api.jqueryui.com/datepicker/#utility-formatDate

Member Avatar for dukumanis
0
203
Member Avatar for waqas_2

Hi, if you're using Apache and you can use the **.htaccess** file, then you can apply these rules: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^site1.tld RewriteCond %{REQUEST_URI} logo.png RewriteRule ^logo\.png$ logo1.png [L] RewriteCond %{HTTP_HOST} ^site2.tld RewriteCond %{REQUEST_URI} logo.png RewriteRule ^logo\.png$ logo2.png [L] RewriteRule ^ - [PT] </IfModule> So …

Member Avatar for cereal
0
609
Member Avatar for lukwagomedia
Member Avatar for lukwagomedia
0
176
Member Avatar for zobadof

Hi, I'm not sure this is the best solution, but if you open the file **jquery.poptrox.js**, at line `253` you will find: _caption .on('update', function(e, s) { if (!s || s.length == 0) s = settings.popupBlankCaptionText; _caption.html(s); }); Change it to: _caption .on('update', function(e, s) { if (!s || s.length …

Member Avatar for cereal
0
193
Member Avatar for ethan.david.376

Hi, in this case `IFNULL()` is not useful, because `count()` will return `0` in case the value you submit is NULL, and `1` if you submit a string or a boolean: select count(null); +-------------+ | count(null) | +-------------+ | 0 | +-------------+ 1 row in set (0.00 sec) -- with …

Member Avatar for cereal
0
1K
Member Avatar for LRNPHP

Hi, please can you explain better the relations between these three tables and the conditions that you want to use to insert the data? Right now I do not understand much.

Member Avatar for diafol
0
224
Member Avatar for anita_86

Hi, check if this thread helps with your issue: * http://www.daniweb.com/web-development/databases/mysql/threads/473216/alternative-way-of-an-insert-with-where-clause

Member Avatar for EvolutionFallen
0
417
Member Avatar for Nilesh_2

Hi, this: $zip = $_['zip']; Must be: $zip = $_POST['zip']; Then, if you still get an error, post the details of the error, otherwise it becomes difficult to help.

Member Avatar for Nilesh_2
0
730
Member Avatar for sallaudin

Hello, can you explain the issue? Currently I see few errors in the first method, as you are not declaring the variables checked by the `IF` statement. Also the second method, i.e. `addLeads_duplicate()`, seems to be truncated. This in particular: $result=$res->result_array();enter code here Will generate an error because `enter code …

Member Avatar for iamthwee
0
116
Member Avatar for ngonix

An alternative to avoid the extra query, is to inject the user session with a variable that will log out the user as soon he performs an action. So, when you go to **logoutuser.php**, submit the **session id** of the user instead of the **user id**, for example: /logoutuser.php?sid=2ehks4jp50u6s5isv4713l6uk1 And, …

Member Avatar for iamthwee
0
3K
Member Avatar for davy_yg

Hi, before the undefined index notice there is: > unable to select dataid is empty but this is no where in the above code, it could be related to the error. Also, do not mix backslash and slash as here: c:\xampp\xampp\htdocs\rustoleum/photocms/ And if you want to use it, at least …

Member Avatar for davy_yg
0
292
Member Avatar for rpv_sen

A suggestion: this does not solve the problem if the client disables javascript. The suggestion of **network18** is correct, in your server side you should check if the index key exists. So instead of: if($_POST['wdays1']=='') echo $wdays1v = 0; else echo $wdays1v = 1; It should be: # default $wdays1v …

Member Avatar for cereal
0
735
Member Avatar for chan6212

Hi, from the **psql** client you can use `\dt`, it will list something like this: \dt List of relations Schema | Name | Type | Owner --------+-----------+-------+---------- public | cities | table | cereal public | provinces | table | cereal public | weather | table | cereal (3 rows) …

Member Avatar for cereal
0
105
Member Avatar for zobadof

Hi, you cannot submit javascript as recipient, so this: $recipient = "jadon.mayhew@me.com<script type="text/javascript"> /* <![CDATA[ */ (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); /* ]]> */ </script>"; must be: $recipient = "jadon.mayhew@me.com"; check the available formats for the first argument of the `mail()` function: * http://www.php.net/manual/en/function.mail.php

Member Avatar for zobadof
0
499
Member Avatar for mattyd

In addition: the `eregi()` function is weak, an attacker can submit extra code by using a **null byte** character. For example: <?php $email = $_GET['email']; if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { echo "<strong>$email</strong> is correct"; } else { echo "<strong>$email</strong> is wrong"; } And submit these links: # first http://localhost/test.php?email=my@mail.co # second http://localhost/test.php?email=my@mail.co%20,another@mail.co …

Member Avatar for cereal
0
236
Member Avatar for everton.retweets

Try with the **DateTime** class: <?php $minute = 45; $second = 01; # value to test $test = new DateTime(); $time = $test->setTime(0, $minute, $second); # match this $minDate = new DateTime(); $min = $minDate->setTime(0, 45, 0); if($min->diff($time)->i == 0 && $minute == 45 && $min->diff($time)->s > 0) { echo …

Member Avatar for everton.retweets
0
147
Member Avatar for RascelleGrepo

> So another problem, when the student request on tuesday, the expected date of release is next tuesday. etc. So, a delay of 4 working days? In MySQL you can create a function based on `WEEKDAY()` which: > Returns the weekday index for date (0 = Monday, 1 = Tuesday, …

Member Avatar for cereal
0
655
Member Avatar for Francis Gyabaa

Hi, use the `coalesce()` function: select id, coalesce(c1, 0) + coalesce(c2, 0) + coalesce(c3, 0) ... In practice, if the value of `cN` is null it will output `0`. Docs: * https://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_coalesce Bye!

Member Avatar for cereal
0
229
Member Avatar for Fiorentino01^

You are missing the dot after `echo "Name:"`, the same happens for each line. So starting from the top, the first should be: echo "Name: " . $xml->name . "\n"; Also, by enabling the error reporting at the top of the file: error_reporting(E_ALL); ini_set("display_errors", 1); You should be able to …

Member Avatar for cereal
0
189
Member Avatar for Binoy_1

Hi, maybe your problem is related to the recently privacy changes made by Gmail. They are now caching HTML emails and so, the included images are not pulled directly from your server but from their proxy servers. It seems that only the first request can be tracked because they have …

Member Avatar for Binoy_1
0
391
Member Avatar for ebanbury

Hi! Try to print the mime type received by the `$_FILES` array. Sometimes the `.doc` files are not correctly detected. So try: print_r($_FILES['pdf_main']['type']); You can also use the Finfo library to check the mime: $mimes = array( 'application/msword', 'application/pdf' ); $finfo = new Finfo(FILEINFO_MIME_TYPE); if( ! empty($_FILES['pdf_main']['name']) && ! in_array($finfo->file($_FILES['pdf_main']['type']), …

Member Avatar for cereal
0
191
Member Avatar for Владимир_1

Hi, do you want to compare this: array(2) { [0]=> string(16) "anna lukaševica" [1]=> string(17) "anna lukashevicha" } between themselves, i.e. `array[0] != array[1]`, or against the other resulting arrays? And once you get a match, which result you want to achieve? Also, by showing how you generate this array, …

Member Avatar for cereal
0
322
Member Avatar for fiddler80

> What do I need to add or change so that any backups older than the 5 newest gets pruned? In the local or in the backup server? In addition: try to avoid the use of spaces in name constants, otherwise you have to use the `constant()` function, I'm referring …

Member Avatar for fiddler80
0
498
Member Avatar for satbir4

Yes, if you browse a page without `session_start()` you cannot load the related data that you want to destroy. Check the example: http://www.php.net/session_destroy

Member Avatar for cereal
0
58
Member Avatar for sikander123

Not simple. Check out **CMUSphinx** and **Julius** projects: * http://cmusphinx.sourceforge.net/ * http://julius.sourceforge.jp/en_index.php Both are open source and provide a **C** API, Sphinx4 provides also a **Java** API. So if you want to make them work along with PHP you can create CGI scripts: * http://httpd.apache.org/docs/current/howto/cgi.html Or write a PHP extension: …

Member Avatar for veedeoo
0
1K
Member Avatar for XIMLabz

Hi, in my opinion, it is better to save the images in directories and the names in a database, mainly because you can serve the images as static content, without involving the PHP engine and the database in this output process.

Member Avatar for cereal
0
424
Member Avatar for jacob21

Hi, in this case you can use a subquery to return all the rows from `user_status`: selecting their `max(status_type)` and `max(status_value)` and grouping by the `user_id`. Then you need a *row constructor*: select id, name from user, (select user_id, max(status_type) as status_type, max(status_value) as status_value from user_status group by user_id) …

Member Avatar for rch1231
0
159
Member Avatar for reshma.patil

Do you mean you want to select a specific row from a result set? Which API are you using: MySQLi, PDO, MySQL? * http://www.php.net/manual/en/mysqlinfo.api.choosing.php

Member Avatar for cereal
0
43
Member Avatar for daniel.conlinjr.1

Check out for Sequel Pro or MySQL Workbench: * http://www.sequelpro.com/ * http://dev.mysql.com/downloads/tools/workbench Or you can always use the command line client. Note: if, from Firefox, you were using PHPMyAdmin to connect to a remote database, make sure you can directly connect to it from your IP, sometimes remote connections are …

Member Avatar for Mark_3
0
359
Member Avatar for shaqib

Hi, you could explode by the spaces between the names: $names = explode(' ', $row['name']); echo $names[0]; echo $names[1]; BUT you cannot distinguish between name, middlename and lastname. The correct solution would be to normalize this information during the collection step. Which means: firstname: <input type="text" name="firstname" /><br /> middlename: …

Member Avatar for shaqib
0
183
Member Avatar for sundeep.gurroby

Hi, if you using this query in PHP then this value: $_SESSION (['MM_Username']) Must be: {$_SESSION['MM_Username']} Full query: "SELECT transactions.UserName, transactions.transactionDate, transactions.transactionType, transactions.transactionAmount, transactions.OpeningBalance, transactions.EndBalance, users.FirstName, transactions.transactionID FROM transactions, users WHERE users.UserName = transactions.UserName AND users.UserName = {$_SESSION['MM_Username']} ORDER BY transactions.UserName, transactions.transactionID DESC" Documentation: * http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing.complex

Member Avatar for cereal
0
325
Member Avatar for savedlema

Hi! You can use `concat_ws()` to add content to a string, for example: update table1 set color = concat_ws(',', color, 'green') where id = XX; Full example: > create table table1 ( id int unsigned auto_increment primary key not null, color varchar(255) not null, food varchar(255) not null); > insert …

Member Avatar for savedlema
0
519
Member Avatar for neha05

Hi, I think the OP wants to check if a given image matches the minimum print sizes at a defined DPI: <?php $image = 'img1.jpg'; list($w, $h) = getimagesize($image); $dpi = 150; # current sizes in inches $inW = round($w / $dpi, 2); $inH = round($h / $dpi, 2); # …

Member Avatar for neha05
0
1K
Member Avatar for james.lu.75491856

The correct solution would be to serve web.py as fastcgi together with PHP and ASP, this should be managed by a server as Apache or Nginx. But if you want to try the built in server you could do something like this: #!/usr/bin/env python import web from subprocess import check_output …

Member Avatar for cereal
0
377
Member Avatar for balutalk

Hi, You can use **Gparted** to create or resize the partitions, but you have to start linux from a liveCD or an USB so you can change the partition without corrupting the operative system. For more information check these links: * https://help.ubuntu.com/community/GParted * http://ubuntuguide.org/wiki/Multiple_OS_Installation

Member Avatar for Sirajhyd
0
406
Member Avatar for nitos

If the undefined index message is related to the `$_POST` variables it is because when you normally open a page you execute a GET request, when you submit the form, instead, you perform a POST request and only in this case the `$_POST` array is populated. So from: $name = …

Member Avatar for nitos
0
566
Member Avatar for rajendher

Look at the ZipArchive class: * http://www.php.net/manual/en/class.ziparchive.php An example: <?php # array of files $files = array( 'feh.jpg', 'img1.jpg' ); # name $zipname = 'archive.zip'; # create the archive $zip = new ZipArchive; $res = $zip->open($zipname, ZipArchive::CREATE); if($res === TRUE) { foreach($files as $file) { $zip->addFile($file); } $zip->close(); } # …

Member Avatar for cereal
0
222
Member Avatar for chaitu11

I've used this a couple of times: * http://dev.umpirsky.com/list-of-all-countries-in-all-languages-and-all-data-formats/

Member Avatar for chaitu11
0
251
Member Avatar for iamthwee

I'm not sure I've understood but you can use both at the same time. For example you have a method like this one: public function activation($id) { $data = array( 'id' => $id, 'code' => $this->input->get('code', true) ); $this->load->view('signup/activation', $data); } And call the url in this format: http://localhost/signup/activation/1?code=random_string_123 The …

Member Avatar for iamthwee
0
7K
Member Avatar for Linddha

Hi, if you're using MySQL then there is the `timestampdiff()` function, for example: select id, title, date from article where timestampdiff(hour, date, now()) =< 10; Docs: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff

Member Avatar for effu
0
219
Member Avatar for youvi

You need a GSM modem connected to your server or you need to use an external service. If you can connect a GSM modem you can use an SMS gateway server like this one: [url]http://code.google.com/p/sms-gateway-server/[/url] bye.

Member Avatar for gabrielcastillo
0
298
Member Avatar for bibiki

Look at `valid_elements`: * http://www.tinymce.com/wiki.php/configuration:valid_elements

Member Avatar for bibiki
0
984
Member Avatar for kharthikeyan

Or the DateTime library: $dt = new DateTime(); $dt->setTimezone(new DateTimeZone('Asia/Kolkata')); echo $dt->format('d/m/Y h:i:s a'); Docs: http://www.php.net/manual/en/class.datetime.php

Member Avatar for cereal
0
47
Member Avatar for davidjennings

Hi, by "word document" are you referring to Microsoft Word file? `doc` or `docx`? Or it is just a plain-text file?

Member Avatar for davidjennings
0
303

The End.