trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
filling in a form from jquery autocomplete
trq replied to ScrewLooseSalad's topic in Javascript Help
It would be no different to how you already have it working. I don't understand where you could be stuck.- 3 replies
-
- jquery
- autocomplete
-
(and 1 more)
Tagged with:
-
You inject it into your object on instantiation. class DatabaseObject {} class SomeClassWithDBDependency { protected $db; public function __construct($db) { { $this->db = $db; } public function foo() { return $this->db->query(); } } $obj = new SomeClassWithDBDependency(new DatabaseObject); This code is still missing a few important OOP principals, but it should explain what I meen by my last comment.
-
How to access website on web-space ?
trq replied to Pawan_Agarwal's topic in Other Web Server Software
I have provided you with links explaining this already. Do not double post. -
Then your class depends on your DatabaseObject class, it doesn't need to extend it. Pass it in to your class and use it from there. Sorry, I'm still very new to OOP so I wouldn't know why. Seems still viable to me, and to the person who's tutorial I've been watching. I'm all ears though, the tutorials I've been watching are aged and I don't want to start any bad habits early. Classes are meant to encapsulate data. Pulling data in from the global scope breaks that encapsulation.
-
apt-get update && apt-get install php5-rar Done.
-
My first question: Why does this class extend a DatabaseObject class yet you keep talking about form validation? What is this class actually meant to represent?
-
What distro are you using? Have you tried using it's package manager instead?
-
Nginx example: http://wiki.nginx.org/ServerBlockExample Apache Httpd example: http://httpd.apache.org/docs/current/vhosts/examples.html
- 1 reply
-
- hosting
- webhosting
-
(and 2 more)
Tagged with:
-
Yeah, they have all changed. You need to click the "beta" link at the top to see the new stuff.
-
It's nice that they made the effort. Still, it looks dated already.
-
This isn't exactly a difficult task, what have you actually tried?
-
$_POST['submit'] will never be set using an onChange to submit the form. Use a hidden input instead.
-
2 & 3 will never happen using vim's autocompletion. And 1, well, vim gets its context from a few different locations depending on the keystroke you use to start completion. Generally, I only ever use the context of the current buffer. This meens variables will only be completed if they already exist in the current buffer. Not that I use completion often anyway.
-
fsockopen is probably all your going to need.
-
So use a loop. See http://php.net/foreach
-
$filenames[0] refers to the first element in the array.
-
Migrating PHP 5.3.26 to 5.4 on OSX 10.6 using MacPorts
trq replied to rwhite35's topic in PHP Installation and Configuration
Personally, I prefer Homebrew over MacPorts, but thats just my preference. There are however instructions for installing PEAR on the page you linked to. -
Get a better host.
-
There are all sorts of ways of doing this dependant on the protocol the server speaks. If it's simply http then you can use curl though I prefer to use higher level libraries like Guzzle. But yeah, the first thing you need to figure out is what does the server expect these requests to look like.
-
How do I add to a template then save the template as another name
trq replied to HeyAwesomePeople's topic in PHP Coding Help
Not all user speak English natively. Your comment is not at all constructive. -
Create a phpinfo page so you can actually see what php.ini file to edit.
-
<label>Gallery On <input type="radio" name="SiteGallery" value="1" <?php echo ($sitegallery == 1 ? 'checked="checked"' : ''); ?> /> </label> <label>Gallery Off <input type="radio" name="SiteGallery" value="1" <?php echo ($sitegallery == 0 ? 'checked="checked"' : ''); ?> /> </label>
-
You logic would be telling you incorrectly. $_category is an object, you will need to call a method or a property of said object. Also, it is common place to use != rather than <> in PHP. Your end result might look something like: if ($_category->getIsActive() && $_category->name != '.') { // rest of code }