428 Posted Topics

Member Avatar for degroundshaker

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]

Member Avatar for mschroeder
0
154
Member Avatar for phorce

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 …

Member Avatar for phorce
0
200
Member Avatar for raphie

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 …

Member Avatar for dean8710
0
2K
Member Avatar for ptara1
Member Avatar for lewisbraid

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.

Member Avatar for mschroeder
0
133
Member Avatar for Will Gresham

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 …

Member Avatar for mschroeder
0
221
Member Avatar for azdonald

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 …

Member Avatar for mschroeder
0
127
Member Avatar for aru211285

[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, …

Member Avatar for diafol
0
5K
Member Avatar for narekm

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 …

Member Avatar for narekm
0
199
Member Avatar for varoluscu_prens

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]

Member Avatar for varoluscu_prens
0
298
Member Avatar for Stefano Mtangoo

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])

Member Avatar for Stefano Mtangoo
0
166
Member Avatar for scamquist

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.

Member Avatar for scamquist
0
258
Member Avatar for 54uydf

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 …

Member Avatar for digital-ether
0
3K
Member Avatar for smartness

[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 …

Member Avatar for Troy III
0
3K
Member Avatar for wolfgangcs

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 …

Member Avatar for diafol
0
137
Member Avatar for deucalion0

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])

Member Avatar for Biiim
0
281
Member Avatar for mt2009

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.

Member Avatar for tolinho
0
752
Member Avatar for utroda

@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 …

Member Avatar for utroda
0
358
Member Avatar for dean8710

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]

Member Avatar for dean8710
0
173
Member Avatar for OmniX

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 …

Member Avatar for Stefano Mtangoo
2
2K
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
228
Member Avatar for mehargags

You corrected the missing bracket, but removed one of the ending parentheses. [CODE] $ph = implode( ", ", array_map( 'mysql_real_escape_string', $_POST['phoneno'] ) ); [/CODE]

Member Avatar for diafol
0
363
Member Avatar for vlowe

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 …

Member Avatar for mschroeder
0
17K
Member Avatar for Farhad.idrees

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]

Member Avatar for Stefano Mtangoo
0
277
Member Avatar for kgizo

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( …

Member Avatar for kgizo
0
183
Member Avatar for Jones_nash

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 …

Member Avatar for Ezzaral
1
190
Member Avatar for ajbest

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 …

Member Avatar for ajbest
0
215
Member Avatar for diafol

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]

Member Avatar for diafol
0
271
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
307
Member Avatar for shg234

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 …

Member Avatar for broj1
0
166
Member Avatar for Joshua Kidd

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.

Member Avatar for Joshua Kidd
0
141
Member Avatar for ebanbury

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 …

Member Avatar for mschroeder
0
217
Member Avatar for davy_yg

[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.

Member Avatar for mschroeder
0
2K
Member Avatar for newprimitive

@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 …

Member Avatar for mschroeder
0
425
Member Avatar for davy_yg

$imgDt is not an instance of an object. You also did not show any code where $imgDt is actually set.

Member Avatar for mschroeder
0
426
Member Avatar for calebcook

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.

Member Avatar for mschroeder
0
184
Member Avatar for vizz

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 …

Member Avatar for mschroeder
0
267
Member Avatar for aldm

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 …

Member Avatar for mschroeder
0
195
Member Avatar for KillingKiller

[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?

Member Avatar for diafol
0
235
Member Avatar for ankit.pandey3

[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]

Member Avatar for mschroeder
0
316
Member Avatar for calebcook

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. …

Member Avatar for calebcook
0
1K
Member Avatar for garymae14

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]

Member Avatar for masterjiraya
0
108
Member Avatar for bubbafunk1

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.

Member Avatar for mschroeder
0
316
Member Avatar for ivan3510

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 …

Member Avatar for ivan3510
0
262
Member Avatar for AmieCutie

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. …

Member Avatar for ddymacek
0
164
Member Avatar for heshanm

[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 …

Member Avatar for rv1990
0
201
Member Avatar for kaizokupuffball

Because on line 62 - 65 when you catch the error, you do nothing to stop the execution of your script.

Member Avatar for kaizokupuffball
0
468
Member Avatar for tarmer

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 …

Member Avatar for rv1990
0
127
Member Avatar for ppetree

[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.

Member Avatar for iamthwee
0
194
Member Avatar for megachip04

[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 …

Member Avatar for mschroeder
0
203

The End.