428 Posted Topics
Re: If you want to do this yourself then I suggest using wkhtmltopdf and/or wkhtmltoimage ([url]http://code.google.com/p/wkhtmltopdf/[/url]). There is also a PHP library already developed to work with these libraries which can be had at [url]https://github.com/KnpLabs/snappy[/url] | |
Re: Why reinvent the wheel and try to create a code style guide from scratch when there are plenty of sensical, logical and well documented style guides out there already that are accepted and in use in lots of projects? All you'll do with such a non-standard design is create a … | |
Re: PDFTK ([url]http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/[/url]) could solve most if not all of your difficulty. The only caveat being its a command line utility so you have to interact with it in that fashion. Which would also require server access to install it. it sounds like your solution would be rather simple though, start … | |
Re: What are your datatypes for Open and Close? | |
Re: The curly brackets are called complex syntax. To use a an array item with a quoted identifier within a double quoted string is needs to be surrounded using { and }. [url]http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double[/url] A more complete description is about 1/4 of the way down the page. | |
Re: You could create a table that stores a log of changes to a table or tables. Your trigger would simply add a log entry to the table and then you could have a php script on a cron that is looking at your log table to see if it should … | |
Re: First, your class is mixing to many responsibilities. You should be passing an already established database into your quiz class if it is needed. Second, Your class should not be responsible for rendering the form as well, this is another responsibility that is mixed. Third, you could probably benefit from … | |
Re: [CODE] <?php function foo( $bar = null, $baz = null, $qux = null ){ //Check if variables are not null //Do something with the variables } [/CODE] Usage: [CODE] <?php foo(); foo( $bar ); foo( $bar, $baz ); foo( $bar, $baz, $qux ); foo( null, $baz ); foo( null, null, … ![]() | |
Re: This is why ajax and php are ill suited for a real-time chat solution. Because it has to make a new request every n seconds which means you're hitting the system fresh every time since php does not really maintain state between requests. You would really want to look at … | |
Re: If you have installed the SQL Server driver from Microsoft than you need to use the sqlsrv_* functions as demonstrated here: [url]http://social.technet.microsoft.com/wiki/contents/articles/accessing-sql-server-databases-from-php.aspx[/url] More specifically these functions [url]http://php.net/manual/en/book.sqlsrv.php[/url] | |
Re: This might give you some starting points ([url]https://github.com/fabpot/Twig/blob/master/lib/Twig/TokenParser/For.php[/url]) also take a look at the TokenParser classes at the bottom of this directory. ([url]https://github.com/fabpot/Twig/tree/master/lib/Twig[/url]) | |
Re: You would need two loops, one that would handle your conditional repetitions and one which handled the execution of your batch files. I would probably start with a [URL="http://php.net/manual/en/control-structures.for.php"]for[/URL] loop for the repetitions and a [URL="http://php.net/manual/en/control-structures.do.while.php"]do-while[/URL] loop for the batch statements. | |
Re: Your memory limit is set to 128MB not 13MB. In my experience with PHPExcel, you can expect between 1 - 10KB of memory usage on average per cell. Formulas and formatting causing even larger memory footprints. While it will require converting your workbook into 4 csv files, you will then … | |
Re: [code=html] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Test Page</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { //Listens for form id "frm" to be submitted //When submitted checks if 1 or more checkboxes are checked. $('#frm').submit( function() { //Look … | |
Re: I agree some further explanation is necessary. PHP is a server-side language so it is meant to run on a server. HTML5 introduces some client-side storage mechanisms, but their support is going to be relatively limited and I'd be hard pressed to use them unless you're targeting a specific platform … ![]() | |
Re: MySQL is not the same as MSSQL. You should not be using the mysql* functions to connect to a microsoft sql server.You want to be using the SQL Server driver ([url]http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx[/url]) | |
Re: Check out this object oriented session handler: [url]http://www.nateklaiber.com/blog/2006/05/10/custom-php-session-handler[/url] Also this procedural session handler: [url]http://phpsecurity.org/code/ch08-2[/url] The base64 encoding/decoding is superfluous because the data goes into a serialized array within the database. | |
Re: @utroda Looking at how your syntax works and what you're trying to accomplish, you should take a look at a package called Twig ([url]http://twig.sensiolabs.org/[/url]) It is a template engine that has the exact functionality you are trying to create. It is simple to implement, very well documented and very well … | |
Re: Hashing is not the same thing as encryption. Your examples are all hashing. If you need to be able to encrypt and decrypt the data than check out the php documentation for the mcrypt library. [url]http://php.net/manual/en/book.mcrypt.php[/url] | |
Re: hashing and encryption are two different things. hashes like MD5, SHA1, Whirlpool etc. are one way. There *should* NOT be a way to reverse them. Encryption however is two way. you can encrypt a string and when decrypted returns the same string. For hashes I agree with cwarn in the … | |
Re: In terms of an acl you often have the following entities, Users, Roles, Resources and Privileges. Of course everyone will have their own words for each thing but this is how I would define each for the rest of this post. User - The Person Role - The group 1 … | |
Re: You corrected the missing bracket, but removed one of the ending parentheses. [CODE] $ph = implode( ", ", array_map( 'mysql_real_escape_string', $_POST['phoneno'] ) ); [/CODE] ![]() | |
Re: vlowe, [edit] Err, I misread that initially [/edit] The PHP DateTime library would be my preferred method of doing what you want. [CODE] <?php //Only need to specify parameters if your timezone is not set. $now = new DateTime( 'now', new DateTimeZone( 'America/New_York' ) ); //1319061332 or 10/19/2011 @ 4:55pm … | |
Re: As of php 5.3 the mssql driver is not available on windows. [url]http://www.php.net/manual/en/intro.mssql.php[/url] There is an official mssql driver from Microsoft for windows now. [url]http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx[/url] | |
Re: Be careful when using code like that with large files. That relies on your entire file being first read into memory. The better way to do this would be to iterate over the file line by line. [CODE] <?php $it = new LimitIterator( new SplFileObject( 'sometextfile.txt' ), 57 ); foreach( … | |
Re: I don't think I would put much stock in a product that "generated" source code for me, scaffolding like controllers is one thing, but not a whole project. @ardav I have to disagree with your comment about frameworks. Frameworks will save you from writing lots of code as they supply … | |
Re: A quick look at the code you posted, and I see a few issues. 1. ) You are using php short tags. While this is not "wrong" it is not enabled by default in most php configurations and become a real headache if you're not looking for it. 2.) None … | |
![]() | Re: To my understanding hmac variations are substantially less prone to collisions than the standard hash functions. I know this is not directly related to your question, but have you considered using bcrypt for your passwords? Assuming your environment is 5.3+ [url]http://us2.php.net/crypt[/url] [url]http://yorickpeterse.com/articles/use-bcrypt-fool/[/url] [url]http://phpmaster.com/why-you-should-use-bcrypt-to-hash-stored-passwords/[/url] [url]http://chargen.matasano.com/chargen/2007/9/7/enough-with-the-rainbow-tables-what-you-need-to-know-about-s.html[/url] [url]http://gom-jabbar.org/articles/2008/12/03/why-you-should-use-bcrypt-to-store-your-passwords[/url] ![]() |
Re: Generally the templating functionality would be rolled into the "view" component of your MVC architecture, at least in some fashion. The code you have provided looks a lot more like a registry to me. However to better understand your design, I'd really like to see how you envision other classes … | |
Re: I'm not sure how your code is working in the first place. You can not echo out the value of a private or protected class member. So if your class does contain a private $no_of_items you can not display it directly. [CODE] <?php class bag{ private $no_of_items=0; private $sub_total; public … | |
Re: You are correct, this would need to be done with an .htaccess file. Essentially taking [url]www.example.com/####[/url] and mapping it to example.com/page.php?id=#### There are lots of examples and this has been covered quite a bit on these forums. | |
Re: date_format() was throwing an error because the first parameter being supplied was not an instance of a [URL="http://www.php.net/manual/en/class.datetime.php"]PHP DateTime[/URL] object. It has nothing to do with what the database column is set as. If you're receiving a 1970-01-01 that means strtotime received a null value, or a value outside of … | |
Re: [url]http://www.php.net/manual/en/language.types.array.php[/url] Your array keys are not included within quotes and there are not constants defined for username and passuser. | |
Re: @newprimitive Please post your entire Connect class. It appears you're missing a large portion of it, even if you're getting an error on one of the lines you posted, the fact that you're calling $this->set_session() and $this->get_session() and those functions are not presented it is impossible to debug your code … | |
Re: $imgDt is not an instance of an object. You also did not show any code where $imgDt is actually set. | |
Re: Yes this is absolutely possible. The only library that is coming to mind is Zend_Mail [url]http://framework.zend.com/manual/en/zend.mail.read.html[/url] Other examples exists such as: [url]http://garrettstjohn.com/entry/reading-emails-with-php/[/url] Googling will yield a lot of different examples. | |
Re: For starters this is not a PHP issue, this is a javascript issue. On that note it appears you are using jQuery already. So you can add a couple listeners for the escape key press, any mouse click, and also if the search loses focus. [CODE] $(document).keypress(function(e) { if (e.which … | |
Re: If you're opening a mysql connection for every method call you are definitely doing it inefficiently. The best way to handle the connection would be to setup one connection per request, since php's scope is limited pretty much to each request, and pass it into all of your different objects … | |
Re: [CODE] <a href="./path/to/some/file/to/download.pdf"><button name="" id="">Download</button></a> [/CODE] Am I missing anything about the complexity or functionality of this? ![]() | |
Re: [CODE] <?php $date = '140811 060632'; echo DateTime::createFromFormat('dmy his', $date)->format('Y-m-d H:i:s'); [/CODE] [url]http://php.net/manual/en/datetime.createfromformat.php[/url] | |
Re: If you spent even a fraction of a minute looking at their HTML you'd notice an ajax link like this: [url]http://tastykitchen.com/recipes/wp-content/plugins/wp-recipes/ajax.php[/url] If you use Firefox, Chrome or Safari, and opened the developer tools/firebug, and adjusted the servings you'd see that the site is using that to make an ajax request. … | |
Re: JpGraph is made specifically for php and is extremely powerful: [url]http://jpgraph.net/[/url] Open Flash Charts 2provides flash based charts that can be modified on the fly: [url]http://teethgrinder.co.uk/open-flash-chart-2/[/url] Google Chart API: [url]http://code.google.com/apis/chart/[/url] | |
Re: Symfony2's form component is completely standalone [url]http://symfony.com/doc/current/book/forms.html[/url] It is very well documented and extremely powerful. | |
Re: PHP is notoriously bad with UTF-8 characters. The only reasonable way I think you would accomplish this would be using the multi-byte functions. [url]http://www.php.net/manual/en/ref.mbstring.php[/url] [CODE] $str = č; if( mb_strpos( $_POST['tekst'], $str ) !== FALSE ) { echo 'Found String'; } else { echo 'No String'; } [/CODE] I haven't … | |
Re: Are you looking for a CRM or a Project Management system? Both of these can and have been built on both Drupal and Joomla. CiviCRM ([url]http://civicrm.org/[/url]) comes to mind as this integrates with both content management systems. As for project management there are a bunch of php project management systems. … | |
Re: [QUOTE=rv1990;1621204]if( isset($_POST['account_number']) && !empty($_POST['account_number']) ){ exit(); } Seriously this code is of no use. Just delete it and use javascript.[/QUOTE] [QUOTE=coolest_987;1621432]Just Use Javascript Validation and submit its value to the modify_data.php , make a connection in modify_data.php file and retrieve value from previous page using post method . Build a … | |
Re: Because on line 62 - 65 when you catch the error, you do nothing to stop the execution of your script. | |
Re: Well for starters, your file is technically delimited by the space character. Since your rows are not identified with a unique id, I will assume that the user name is a unique field and thus could be used as your key. When you build you table, link the usernames to … | |
Re: [CODE] $doc = new DOMDocument(); $doc->loadXML('Your XML string'); //Gets the SpecialParameter node value $specialParameter = $doc->getElementsByTagName('SpecialParameter')->item(0)->nodeValue; //Gets the SpecialInfo::someNumber attribute value $specialInfo = $doc->getElementsByTagName('SpecialInfo')->item(0)->getAttribute('someNumber'); [/CODE] This is untested but I believe this should get you in the right direction at the minimum. ![]() | |
![]() | Re: [B]1.[/B] For starters, anyone who has been around any form of serious web hosting environment will quickly tell you that there is NO such thing as unlimited hosting. There are no unlimited hard drives and there are no unlimited bandwidth connections. At some point there is a limit. Unlimited hosts … |
The End.