php_network_getaddresses: getaddrinfo
copy() [function.copy]: php_network_getaddresses: getaddrinfo failed: When I use copy("http://example.com/simple.jpg",$target); that error occur. ...
copy() [function.copy]: php_network_getaddresses: getaddrinfo failed: When I use copy("http://example.com/simple.jpg",$target); that error occur. ...
Hey. I've always assumed that - in the absence of constructor parameters - the parenthesis (curly brackets) follow the class name when creating a class instance, were optional, and that you could include or exclude them at your own personal whim. That these two statements were equal: $foo = new bar; $foo = new bar(); Am I right? Or ...
I have starting dates and ending dates in my database (MySQL). How can I get the answer, how many weeks(or days) are inside of those 2 dates? (mysql or php) For example I have this kind of database: Started and | will_end 2009-12-17 | 2009-12-24 2009-12-12 | 2009-12-26 ... Update to the question: How to use DATEDIFF? How can I make ...
I'm not new to OOP, but new to PHP. I know Java, Objective-C and some other object oriented languages. So I'm looking for a comprehensive overview of how OOP looks like in PHP. ...
I have a string that might look like this $str = "<p>Me & Mrs Jones <br /> live in <strong style="color:#FFF;">España</strong></p>"; htmlentities($str,ENT_COMPAT,'UTF-8',false); How can I convert the text to HTML entities without converting the HTML tags? note: I need to keep the HTML intact ...
I am still searching for a search engine to be used on my webhosting-providers server (one.com) and still haven't found any. I have heard great things about Sphinx, what are the requirements to run it? I have read the manual, doesn't say much, seems like it should work... Just want to ask some professionals first. I dont have access t...
I'm using NetBeans and PHP. For example, I insert this code: <?php try { $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass); foreach($dbh->query('SELECT * from FOO') as $row) { print_r($row); } $dbh = null; } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } ?...
Hey i want to convert this date: 2009-12-21 10:38:07 To a more readable date, like: 22 December 2009 - 10:38. But i don't know how to convert it to that ? ...
I got this example from the php site: <?php try { $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass); foreach($dbh->query('SELECT * from FOO') as $row) { print_r($row); } $dbh = null; } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } ?> I use MAMP on the m...
hi, I am using the following mootools1.2 form check js. http://mootools.floor.ch/en/demos/formcheck/ For form check is working fine, its working fine with ajax form post. My problem is that when i post the form with AJAX with file upload. Then its not returning me the $_FILES array to PHP side. If i post the form normally (i.e. with...
Hi there, I was wondering if it's possible to store form data such as 'title' and 'description' in a javascript session? I'm using the uploadify script to have a flash uploader, but the script isn't passing the title and description. This is my code at the moment; <script type="text/javascript"> jQuery(document).ready(function() { ...
I'm consuming a web service in PHP. If the service returns 2 or more records the object comes back as an array. However, if I call the same service that returns 1 record, the object is not an array. This makes for some messy logic having to watch for both cases when one would think PHP could be smart enough to handle this appropriately a...
I have used TCPDF in the past to generate PDF's on-the-fly. Now I need to create a Form in PDF that would allow the user to enter data locally and then print/save the PDF locally. Which free PDF library should I look at? ...
I'm new to the MVC concept, and somewhat new to PHP. Question 1 Before every controller is loaded, I’d like to run a function which checks to see if a database-table exists. Is the proper way to do that with hooks? Question 2 Before every controller is loaded, I’d like to set a few variables which are determined by a call to the db. ...
As far as Kohana is concerned, can you give me a short sentence or two as to WHEN and WHY I need to use a constructor within my controller? After a LOT of reading, I can't seem to wrap my tiny little brain around the constructor concept. Looking for "layman's terms" here. =) Edit: Question pertains to Kohana v2.3.4 ...
While thinking about how to best combine search results from different resources on a site (e.g. blog software, forum software, pages etc.) it appeared to me that it would be pretty neat to have a standardized format (possibly XML) to return search results. This could consist of title, excerpt and more meta information like time, author ...
I'm new to PHP and PDO, and I try to use prepared statements here. After 1 hour of trying around I give up. Or my tutorial was just horribly bad. EDIT: This works perfectly without prepared statements: try { $dbh = new PDO('mysql:host=localhost;dbname=test', 'root', 'root'); $prepared = $dbh->prepare('SELECT * from sys_navigat...
Hi, i am just wondering if there is a way of setting up different "content-type" when downloading through php? like .mp3 AND .pdf etc.. instead of having to specify just one file type. My problem is that i have 2 file types to be downloaded, one type is pdf and the other type is mp3, but if i change the "content-type" to audio/mpeg, then...
How to use DATEDIFF? How can I make this to work? or should I use DATEDIFF completly differently? SELECT DATEDIFF('Started ','will_end') AS 'Duration' FROM my_table WHERE id = '110'; I try to get answer, how many days are inside of two dates. I would like to get an aswer like: Duration = 7 days; I have this kind of database: Start...
I wonder if those prepared statements of PDO really increase security, or if they are just a "cheap" text-replace in the query. The point of prepared statements actually is, that whatever gets inserted as parameter, will not be parsed by the DBMS as part of the instructions itself, so a parameter like "'; DROP TABLE foobar;" has no e...