1,003 Posted Topics
Re: here is an image manipulator class I just wrote for this question. Save as image.class.php <?php ## this image manipulator class was written by veedeoo or poorboy 2012 ## feel free to modify, extend this clas as you wish. ## does not have any warranty of any kind class ReduceImage{ … | |
Re: Hi, [Here](http://veedeoo.com/formtest/form3.php) is the demo I created. Feel free to copy the source code, but make sure to download and save this [file](http://veedeoo.com/formtest/jquery.chained.js) as jquery.chained.js. DO NOT hot link the js file from my server that's all I am asking. I will always know if it is hot linked by … | |
Re: HI, When you say "mp3 file not going to database? do you mean you want to save the actual mp3 file in your database as blob?, or you just want to save the information unique to the mp3 file such as title, duration, and others? If that is what you … | |
Re: Hi, Here is simplest way of doing this (it is too simple that my comments out numbered my actual codes :)). Of course, you must search more on how to improve this. I am in the assumption here that file you are trying to cached is in your server. If … | |
Re: Hi, You can also use php filter_var function. I keep on forgetting about this function. You can use this function in your helper method. Something like this.. private function verifyEmail($email) { ## returns true or false return filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match('/@.+\./', $email); } private function sanitizeString($tstring){ ## this method will … | |
Re: I assume, it would be something like this? Average wait = (time service is provided) minus (time listed on the waiting list ) | |
Re: If mysql import fails, there is another option I called this force directory import, or copy and paste import. In your source system, open xampp directory. Open mysql/data directory. Look for the database directory you want to import, copy and save this to flash drive. On the reciever system, open … | |
Re: Hi, Try, copy, save as anyNameYouWant.php, upload to your server, and direct your browser to this file <?php phpinfo(); ?> On this page, look for **Server API** value. Like most servers, I am hoping for your server to have a value of fast CGI or anything bearing the acronym CGI. … | |
Re: Hi, This problem can be associated with your php time out limit.. there should be no reason for duplicates unless your php timed out and lost its communication with the mysql server(shared hosting only). Otherwise, you can try LOAD DATA INFILE function as described [here](http://dev.mysql.com/doc/refman/5.0/en/load-data.html). This can take a text … | |
Re: Hi, The very first thing to look for is the error log if there is any. Secondly, do you mind posting an example or the actual problem itself? | |
Re: Hi, Is it possible for you to just install xampp or something similar like easyphp? By going this route, you save yourself a million times of troubles, and you can focus more on coding in php than focusing on what are the missing dll files in your operating system. Either … | |
Re: Hi, One of many ways of doing this is to write script following the simple guidelines. 1. First check if the user is logged in. YES? NO?. If NO?, this is not allowed.. 2. Yes?-> provide a link or form to change the password. 3. Let the user type in … | |
Re: Hi, Did you try to add a simple fall back to flash player codes? The reason is that some browser does not support other video formats in html5 player. For example, chrome does support mp4/h264 videos, while some browsers can only support Ogg, and other support only webm. So, my … | |
Re: Hi, Try searching for wordpress plugin first. You might not find the exact functionalities you are looking for, but I don't see any problem in finding a similar one. Then modify the plugin to meet your needs. Writing your own plugin in wordpress requires some time to get yourself familiar … | |
Re: you can also give[ this ](http://www.bambalam.se/bamcompile/)a try. Just use your command prompt type in the options, the location of the php files or project, type the output file e.g. file.exe , and you are good to go. You can also add an icon for your converted executable php.. Downside? The … | |
Re: Hi, I thought 1 minute is equal to 60,000 milliseconds, so your equation can be something like this. list($get_minutes, $get_seconds,$m_seconds) = explode(':', '1:27:04'); ## approximate the milliseconds for some hour $minutes = ( $get_minutes * (60* 60000)); ## approximate the milliseconds for some minute $seconds = $get_seconds * 60000; ## … ![]() | |
![]() | Re: Hi, Let me write a demo first then, I will post it here after I tested it a couple of times.. This is the same method I was using, because I was pretty lazy using the ftp. So, all my php files are generated from my website. At least, I … |
Re: Make sure your server or localhost can parse php. try this, save as anyNameYouWant.php, upload to your server or save to your localhost public directory. <?php echo "Hello World"; ?> Direct your browser to this file..The above should be printing "Hello World on your browser. If not, then your server … | |
Re: Hi, Honestly, the best way to bring it back to its working condition is to use the back-up files instead of the updated files. | |
Re: Disclaimer! A well written form processor class can survive pretty much all of the exploits and tricks that the hackers use. NOT ALL THOUGH... Hi, $_REQUEST is one dangerous thing if you don't protect your script pretty well.. I mean extremely well. There have been debates and many disagreements about … | |
Re: DISCLAIMER! This is just an opinion from a 19yo. I don't see the necessity of using return $this->myname;.. if this is going to be use by other methods below it.Otherwise, when it is needed to be somewhere else without the hello. Most coders use the same style, but ONLY for … | |
Re: Hi, Try reading my recommendation [here](http://www.daniweb.com/web-development/php/threads/421980/redirecting-to-a-mobile-site#post1800982) | |
Re: Hi, Try this... this will be your common.php and must be included in all pages needing a translation.. <?php session_start(); ## detect browser's language $language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ## set that language into session $_SESSION['lang'] = $language; ## include translation file depending on the language in the session. switch … ![]() | |
Re: Hi, You can try reading [this ](http://www.lunawebs.com/blog/2010/03/11/php-substring-without-breaking-a-word/). The author wrote a function as shown below... function truncate_str($str, $maxlen) { if ( strlen($str) <= $maxlen ) return $str; $newstr = substr($str, 0, $maxlen); if ( substr($newstr,-1,1) != ' ' ) $newstr = substr($newstr, 0, strrpos($newstr, " ")); return $newstr; } and … | |
Re: This type of topic has already been asked and answered gazilion times already. Please take a look at my sample implementation [ Here](http://www.daniweb.com/web-development/php/threads/422363/enabledisable-multiple-redirects-based-on-cookie#post1803478). Pretty much the same as what you are trying to achieve, included is a thumb generator with proportioning function in it.. Feel free to adjust the script … | |
Re: Does the smarty compile the header.html? Anything inside the directory themes_c? Can you turn on the debug to true? | |
Re: Hi, I know it is kind of silly to ask, you probably know it. What do you see if you do this?? $out = base64_decode('iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAACA0lEQVR4nO3cwUsUYRzG8UdhKa0oEREpCjoUSOlJgiAWIbp26FZQt+iS2CH0ImwGXj2IWiePhnSo6L5/2nQoqFmVRvd93+edfb+f8/B7vzDsLDvzzkoAAAAAAAAAAAAAAAAAAPxrU11tquvOwG8P1VOlnipJHyR9dAeV6rDBMfvRKyBJmjzj8QdRKjC0BXfAqOkEmLERYAYkvQ0466KksYDzinMn0tzxSHMxhNvugLbZSbBGrE8ghjDnDmiDp+4AAANm3QG5emNc+7NxbZzinjsgJ4vuANS9cAf88dwdgONuuQPcrrkDBhR/E3LFHXCCLXcAICnvy4Pzd5FNjperos27A/7jujsAdQ/cASjYd3dAQ8vugFTuugMaeuUOQIFCbIBL4+/G7pH2zh3QWCEn5LE74Ix23QGo++QOQN2qOyCml+6Ac3jtDoijvV+Q6+6AONp7Qr64A2KacgecQ8h3VbJzwR0AAKNrzx2Aupw3YhSn+F2MubnpDkhhwh3Q0CV3QCpt2VpzxR2QypI7oIFtd0BKI30ru41+uANQl/O1Obd3VYp2wx2AnvrqqS/pqjvF7Zs7QFKbH5gFl8P/Vh25A3LzyLRuRzwky8aaOyBrlVRVSnIN/5pgjfaLfEI6kp5Eml2EZwFmTIs7AcG9lzTT8NjLkn5Kuh8vBwAAAAAAAACAJn4Bse83Wq3XeMoAAAAASUVORK5CYII'); echo $out; That should give you something on the screen... I think :) UPDATED LATER: The above should give you something like this <div id="page" … | |
Re: Yes, the report is true.. daniweb is crashing in firefox 13.0 beta. Users should be advice not to use firefox 13.0 beta, if they are part of the Beta channel users from April 26, 2012 and on. Users must use firefox stable release, regardless of OS they currently have on … | |
Re: HI, This question is pretty much about javascript. Why not just do it like this, instead of struggling on the ajax? <?php $sayHello = "hello"; $pop = ""; $pop .='<div style="color:red;">'.$sayHello.' Testing</div><br/><a href="http://daniweb.com">Visit Daniweb</a>'; $pop .='<p>Lorem ipsum dolor sit amet, usu facilisi adipisci mandamus an, mel eu convenire torquatos sadipscing. … ![]() | |
Re: Hi, you can try ... $userAgent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'; ## add these items to your curl curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $post_array = array( "Email"=>$email, "Passwd"=>$password ); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array); | |
Re: **Disclaimer!** I really don't know how to code in cold fusion. I was never and will probably not learn it. However, besides PHP, I know how to code in C++, C#, C, python, ruby, a little of PERL, and some robotics programming in ROM. I spent most of my time … | |
Re: Hi, Try changing this $query = "SELECT type, name, location, landmark FROM table1"; to this $query = "SELECT id, type, name, location, landmark FROM table1"; reason? because you have id in here.. $resultlink = "\n\t<li><a href=\"posts.php?ID={$arr['id']}+{$arr['type']}+{$arr['name']}\">{$arr['name']} {$arr['location']}</a></li>"; $end_result .= '<li>' . $resultlink . '</li>'; and then add this on top … ![]() | |
![]() | Re: There is no guarantee that your data will remain encrypted. The reason is that if you distribute these encrypted data, the decryption must be supported by the browser and without internet connection. That leaves you to only one type of encryption method, the javascript encryption. This type encryption can be … ![]() |
Re: @HiWorld, Deleting entries in mysqli is sometimes problematic. This is the first one I used before I learned how to use PDO.. you will have to go by its proper syntax. prepare->execute->close(), and then finally closing the database connection. So, if I will be using a mysqli class on my … | |
Re: The benefits is that you can build a core where all of the classes needed by your applications are included. In this core, you would have : database CRUD class, content management class, javascript class, templating class, form generator class, and many other classes that are known to be reusable … | |
Re: This is just my personal opinion. I think it is a bad practice and convention to forcefully redirect your mobile users to the minimum version of the site. Most iphones are able to take on the regular site. What would I do if I am in your shoes, I would … | |
Re: Hi, The first thing you need to do is create a simple html page ( stand alone). This html page should have all the items you want on your modification. For example, if you are planning to have a form, place the form in this html page including the css. … | |
Re: the query can be something like this. SET product_InInventory = CountBeforeThePurchase - 'ItemPurchasedByYourClient' Then you send another query to get the updated count.. Say, you only have 10 items remaining, and your client type in 11.. On your controller file, you should alert the client that they cannot select more … | |
Re: we can also do it by finding the ip of the host machine..open command prompt on windows and type ipconfig The local machine ip should be something like IPv4 or something in this pattern 192.xxx.xx.x . This ip can be access by other machines via browser using this http://192.xxx.xx.x/project/ as … | |
Re: Have you tried using a using NetBeans IDE? It literally comes with everything you need I think.. | |
Re: Hi, I think there is a problem in the validation class of the script. I felt so guilty recommending this script. The earlier version I tested it, but their latest one, I have not do any testing at all. I should have test it first, before extending any recommendation. I … | |
Re: The closest thing I could find is http://groceryguide.com/ . To build a site such as this, you need to learn how to parse webpages, rss feed, and maybe xml file. For example, you can send your parsing spider to Albertson's to get the weekly sale, you can then save the … | |
Re: Hi, You don't escaped double quotes inside a single quotes.. echo ' </select> <input type="submit" value="Search" class="button" /> </form> </div> <div id="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> </ul> </div> '; The best way to do it is to close the php tag and … | |
Re: Hi, Before jumping into possible solution, may I have more info. about your database? class and the instructor tables. The reason I am asking is because of this $class = $result[0]; and this $instructor = $result[1]; Both will return ONE.. | |
Re: Hi, I believe Windows is blocking the script from writing on C drive. Possible reason is that the location where the script is trying to write the file is outside of its working space, and the script do not have permission to do so. Try changing the target location for … | |
![]() | Re: Hi, Please read this one [Here](http://book.cakephp.org/1.3/view/1047/Joining-tables). You need table join. In your case, code below 'conditions' => array( 'Channel.id = Item.channel_id', ) can be modified to 'conditions' => array( 'word.user_id = user.id', ) I can't write any sample for this question, because the response is pretty lengthy... please update us … ![]() |
Re: @hwoarang69; Here is a sample just to help you out.. ## first you need to take the form out of the echo zone.. else { ## it is ok to close PHP below ?> <!-- codes below can be pure html.. Don't let your php parser to parse something that … | |
Re: Hi, Is this the [PHP/SDK](https://github.com/facebook/php-sdk/blob/master/src/base_facebook.php) you are currently using? if so, then additional cURL configuration can be added like this public static $CURL_OPTS = array( CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60, ## lets add proxy type CURLOPT_PROXYTYPE => CURLPROXY_HTTP; ## lets add the proxy ip CURLOPT_PROXY => … | |
Re: Hi, If you want to use base_64, then you can try $item_no = base64_encode (4); ## the above gives a this value NA== Thus, making your url as shown below http://www.dev.xxxxxxxxxxxxxxxxxxxxxxxx.com/findanagent_details.php?recordID=<?php echo $item_no;?> and visible to the browser as http://www.dev.xxxxxxxxxxxxxxxxxxxxxxxx.com/findanagent_details.php?recordID=NA== we cannot encode this recordID to base 64, unless you … | |
Re: Hi, You should go by Ardav's suggestion.. (I mean diafol :) ). That should get the job done, but if want to do some simple xml parsing, then you can try codes below. Not the best one, but can also get the job done ( I hope :)).. Here we … ![]() |
The End.