trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
All you need do is.... echo json_encode($_POST); then. The array is already how you need it.
-
What does.... echo '<pre>'; print_r($_POST); echo '</pre>'; look like?
-
This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313826.0
-
Both of these designs stink. You would be best having a table for users, a table for questions, then another table that joins users with questions and answers.
-
One thing in particular I hate. When new windows are opened at a fixed size. If people have the 'open new windows in tabs' option enabled in firefox, it makes the entire browser shrink to this fixed size. Use overlays instead of popup windows. Better looking, and they don't break browsers.
-
It is highly unlikely that 'danny' is within the OS's file system root which is where you are trying to include it from. You will likely need to prepend the servers root path to this as well, using $_SERVER['DOCUMENT_ROOT'].
-
simple if() statements to toggle animate effect
trq replied to shortysbest's topic in Javascript Help
Sorry, its not like I test code I post here. It was a simple mistake. $(document).ready(function() { $('.productphoto').toggle( function() {$(this).animate({width: "711px", height: "400px"},100)}, function() {$(this).animate({width: "355px", height: "200px"},100)} ); }); -
simple if() statements to toggle animate effect
trq replied to shortysbest's topic in Javascript Help
Did you look at the link I gave you? $(document).ready(function() { $('.productphoto').toggle({ function() {$(this).animate({width: "711px", height: "400px"},100)}, function() {$(this).animate({width: "355px", height: "200px"},100)} }); }); -
There are ways of doing it, but it requires I little bit of work. I assume this is so you can have Ajax functionality while still being able to bookmark. The way I have done it in the paste is to use a simple MVC pattern. You need a controller function which is called on every click, this then checks the url and executes a function accordingly.
-
simple if() statements to toggle animate effect
trq replied to shortysbest's topic in Javascript Help
http://api.jquery.com/toggle -
If your using php5 just set the recursive argument to true. See mkdir.
-
That function is floored. You only need to escape special characters (addslashes or preferably mysql_real_escape_string) on the way into a database. htmlspecialchars should be used when using data for display, and strip_tags would only be used dependent on the situation and the data involved.
-
What exactly is a ctp file?
-
find /var/www/test -name test.php -exec rsync -av --dry-run {} /var/www/test2/ \;
-
This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=313804.0
-
Just for the record, it only effects namespaced classes. Classes not under a namespace (i.e. in the "global namespace") can still use constructors named after their class. That said, class-name-based constructors went out of fashion years and years ago with __construct() being much more preferred. Finally, the namespace separator is the backslash character (\) and not the solidus (forward slash, /) as thorpe used. In other words, Foo\IO\Http. I'm on fire today.
-
Most people who write allot of OOP in PHP use a form of psuedo namespacing anyway, but now it can be done more convenietly with 5.3. Given the directory structure of part of a simple framework. [pre] └── Foo ├── IO │ ├── Http │ │ ├── Header.php │ │ ├── Request.php │ │ └── Response.php │ ├── Request │ │ └── RequestAbstract.php │ └── Response │ └── ResponseAbstract.php ├── Loader │ └── Exception.php └── Loader.php [/pre] The Dispatch class (within the Foo/Controller/Dispatch.php file) would generally be defined by.... class Foo_IO_Http_Request extends Foo_IO_Request_RequestAbstract {} and called by .... $r = new Foo_IO_Http_Request; With 5.3 and namespaces you can now do. namespace Foo/IO/Http; use Foo/IO; class Request extends Request/RequestAbstract {} namespace Foo/IO/Http; $r = new Request;
-
The data you have is just a string at the moment, not an object. You'll need to convert it into an object first.
-
Should be a green button in the bottom left corner (or maybe top right, its bottom left for me - needless to see, its big and green).
-
It only effects non-namespaced classes.