Currently I've got the following working just fine without any problems (yet).
header ("Content-type: image/png");
$string = $_REQUEST['text'];
$font = 15;
$width = 300;
$height = 350;
$image = imagecreate($width, $height);
$back = ImageColorAllocate($image, 255, 255, 255);
$border = ImageColorAllocate($image, 0, 0, 0);
ImageFilledR...
What are the best practices for NoSQL Databases, OODBs or whatever other acronyms may exist for them?
For example, I've often seen a field "type" being used for deciding how the DB document (in couchDB/mongoDB terms) should be interpreted by the client, the application.
Where applicable, use PHP as a reference language. Read: I'm also ...
I'm trying to get data from a class in php5, where the data in the class is private and the calling function is requesting a piece of data from the class. I want to be able to gain that specific piece of data from the private variables without using a case statement.
I want to do something to the effect of:
public function get_data($f...
Greetings,
I am writing some code inside a framework for PHP 5.3, and I am trying to catch all errors in a way that will allow me to gracefully crash on client side and add some log entry at the same time. To be sure to also catch parse errors, I am using register_shutdown_function to specifically catch parse errors.
Here is the functi...
Hai all
i have a big problem right now
i have this sample code:
preg_match_all("/\[BLOG\=\[(.*)]](.*)\[\/BLOG]/U", $this->soruces , $match_list );
and i don't know why its not will working, its print this out to me
Array ( [0] => GROUPID=23|CATID=28|SORT=ASE [1] => GROUPID=23|CATID=29|SORT=ASE [2] => GROUPID=23|CATID=30|SORT=ASE ) ...
Essentially I have been trying to think of a PHP-based solution to do the following:
The player needs a link ie:
"http://yourdomain.com/xspf_player.swf?playlist_url=http://yourdomain.com/yourplaylistlist.xspf">
I could easily put the XSPF information in a PHP file and replace the artist name / song name with variables that retrieve th...
I am trying to design a web application(using php and mysql) in which I will ask my clients to pay via paypal subscription, which detects money from the clients paypal account automatically and transfers it to my paypal account.
Now when a client logs into my web application after 3 months of time, is there a way my web application to k...
I am using CURL to check for the existence of a URL (HEAD request) but when I test it with www.google.com, it redirects me to www.google.co.uk - probably because my server is UK-based.
Is there a way you can stop this from happening? I don't want to remove the CURLOPT_FOLLOWLOCATION option as this is useful for 301 redirects etc.
Part...
Ok say I have a code base that is contained in a folder /myProgram/ and has various folders such as /myProgram/lib/, /myProgram/docs/ and so on...
How, in PHP, can I go about detecting any folders before /myProgram/ and creating a base variable so my includes and require's can be written relative to the base directory /myProgram/ allowi...
I am a lone developer most of my time, working on a number of big, mainly PHP-based projects. I want to professionalize and automate how changes to the code base are handled, and create a Continuous Integration process that makes the transition to work in a team possible without having to make fundamental changes.
What I am doing right...
I have a script that returns the following in a variable called $content
<body>
<p><span class=\"c-sc\">dgdfgdf</span></p>
</body>
I however need to place everything between the body tag inside an array called matches
I do the following to match the stuff between the body tag
preg_match('/<body>(.*)<\/body>/',$content,$matches);
b...
In PHP what is the difference between
getcwd()
dirname(__FILE__)
They both return the same result when I echo from CLI
echo getcwd()."\n";
echo dirname(__FILE__)."\n";
Returns:
/home/user/Desktop/testing/
/home/user/Desktop/testing/
Which is the best one to use? Does it matter? What to the more advanced PHP developers prefer?
...
I have a script which I want to run on windows under Cygwin and on Linux. I have to make distinction between the two running environment for some purposes. What is the best way to do it?
...
I am using a framework called qcodo (which forked as qcubed) and is a PHP framework.
I want to do a very simple popup using the Facebox jquery plugin.
When someone clicks on the link and shown below in line 47.
Here is the file: http://github.com/allyforce/AF-upload/blob/master/Templates/profile_activity.tpl.php
<a href="complete_pr...
I'm trying to build an error class and a lot of error classes I've looked at in the past use FILE and LINE to show where the error occurred, but they use them in the function so they're always the same, which is highly useless information. Aside from sending an array of containing FILE and LINE with every function (which would get to be ...
All,
I am using JQuery UI Nested tabs. Consider the structure like this:
There are 2 Main tabs: Animals, Birds. Under Animals, there are two tabs "Cats", "Dogs". Both the tabs "Cats" and "Dogs" should be loaded via AJAX when clicked.. So, the code for them is something like this:
<div id="fragment-1">
<ul>
<li><a href="/pub...
All,
I am using JQuery UI Nested tabs. Consider the structure like this: There are 2 Main tabs: Animals, Birds. Under Animals, there are two tabs "Cats", "Dogs". Both the tabs "Cats" and "Dogs" should be loaded via AJAX when clicked.. So, the code for them is something like this:
<div id="fragment-1">
<ul>
<li><a href="/publ...
Hi!
I'm just learning to use PDO, and I want to bind params to a delete statement using a loop.
I'm using a code like this that definitely doesn't works:
public function delete_user ($post, $table='mytable')
{
$delete = $this->conn->prepare("DELETE FROM $table WHERE id IN (:id) "); ...
All,
My PHP Zend MVC Application structure is like this:
billingsystem
-application
-design
-public
--index.php
--.htaccess
-library
-- Zend
whenever the application loads, it goes to index.php in public folder and it gets rerouted from there.. I want to make sure users to access the system by going http://billingsyste...
I have a MySQL table of "people" as part of a web site, for example:
| people_id | firstname | lastname |
-----------------------------------------
| 1 | John | Lennon |
| 2 | Paul | McCartney |
| 3 | George | Harrison |
| 4 | Ringo | Starr |
| . | ....