Possible Duplicate:
PHP PDO vs normal mysql_connect
So in my application, I accessed the database via a function named db_connect();. Quite simply, it fed the requisite login information and opened a database connection via mysql_connect and mysql_select_db.
Now that I'm working, I have found that the lead programmer uses PDO...
My background is asp.net development and I took part in several projects where developer team was free to choose server-side programming technology (PHP, ASP.NET[Web Forms/MVC], JSP) & free to buy any CMS.
Looking backward I realize technology & approach we chose often wasn't the best one. I'll enumerate some projects:
One web portal ...
hello i have a problem that's maybe difficult to descripe,
i have an application, that simulates a pizza store. i have a page "bestellungen" ("orders")
in which i have some javascript.(the head,javascript and body i declare in page.php, from which the other ("sub")pages "extends".
right now, everything works, but now, i want to add to ...
conn = httplib.HTTPConnection("www.encodable.com/uploaddemo/")
conn.request("POST",path, chunk,headers)
Above is the site "www.encodable.com/uploaddemo/" where I want to upload an image. Now problem which I am facing is I am tyro in php so I am unbale to understand the meaning of path and headers in above code, chunk is an object t...
I need to extract the first URL from some content. The content may be like this
({items:[{url:"http://cincinnati.ebayclassifieds.com/",name:"Cincinnati"},{url:"http://dayton.ebayclassifieds.com/",name:"Dayton"}],error:null});
or may contain only a link
({items:[{url:"http://portlandor.ebayclassifieds.com/",name:"Portland (OR)"}],er...
Hi,
I am using a flash player to play some mp3 files. At firefox it loads them normally but at IE it doesn't. When i go to the url of the .mp3 file it shows the source code of the mp3 (instead of offering eg to download). So i used a small script to fix it:
$url = $_GET['url'];
header('Content-type: application/force-download');
header(...
Hope my question is correct to the post.
<form action="process.php?id=<?php echo intval($order['id']);?>" method="post">
<ul>
<?php
$sd = 'SELECT * FROM download WHERE pid IN ('.$order['pid'].') ORDER BY pid ASC'; // pid IN (3,4,5)
$qd = $db->rq($sd);
$no = 1; while($download = $db->fetch($qd)) {
?>
<li>
<?php echo $no...
how make special random array. i have array(1=>35,2=>25,3=>40). how make possibility that array show special elements. Ex.
If i want get 100 elements from array. it will be
35/100 +-10 - must bee 1 element,
25/100 +-10 = must be 2 element,
40/100 +-10 - must be 3 element.
Elements must be random, but most elements +-10. i know its pos...
Hello everyone,
I'm testing the twitter API (with OAuth) and I have a little problem, I wonder if anyone knows how to fix it, the situation is that at the time I do this (in my redirect.php):
$ Url = $ connection-> getAuthorizeURL ($ token);
header ("Location: $ url");
The request go to twitter, and it's authenticated, but I this ret...
This function doesn't work:
function remove_ul($ul) {
$ul = preg_replace('/<ul id="general-nav">/', '<ul class="nav">', $ul, 1);
$ul = preg_replace('/</ul>/', '<li class="blank"></li></ul>', $ul, 1);
return $ul;
}
I think because of repeating / on line with </ul>
Any idea?
Thanks.
...
Hey all,
I was wondering if its possible to call the parents __construct(), before the child's __construct() with inheritance in PHP.
Example:
class Tag {
__construct() {
// Called first.
}
}
class Form extends Tag {
__construct() {
// Called second.
}
}
new Form();
Ideally, I would be able t...
Hi, I'm writing a unit test for a class method that calls another class's method using a mock, only the method that needs to be called is declared as final, so PHPUnit is unable to mock it. Is there a different approach I can take?
example:
class to be mocked
class Class_To_Mock
{
final public function needsToBeCalled($options)
...
Looking for a simple way to show a welcome message to first time visitors on my website.
What's the best approach?
...
Hi, in my php script that sends a push notification to iPhone, I have the below code.
The SSL certificate requires a password. From the command line, it just asks you for it and you can enter it, but how do I get this script to run automatically without asking for the password? I am happy to have the password hardcoded into my script he...
hello,
pls i want to convert this 06-29-2010 04:00PM to this format Y-m-d h:i:s in php
thanks
...
Hi everybody,
i'm using RecursiveIteratorIterator() to explore subfolders of my current path, but in this way all trhe tree is explored, instead i want just the direct childern of my fodler to be explored for files. How can i say to RecursiveIteratorIterator() to not go much further and stop to the first subfodlers of the current folder...
hi,
i need to implement a simple project using PHP and MySql in which i need to push data to the user's UI when some one else is updating the database, and i need to periodically do this too, so when some one else accessing the same table and modify it, another person who uses the UI can see the updates, sorry if i'm being silly but up ...
Hello,
What is the best way to deal with config / directory / OS differences using SVN to develop and deploy on 2 different platforms?
I am developing in Windows and deploying to Linux.
I'd like to use my home PC to test the files before using commit, I'm using a web framework and you must specify the paths to your system and applicat...
Is it possible to integrate Zend Framework with already existing legacy web application? The application is written horribly using so called spaghetti code (no separation between presentation and application logic, PHP, HTML and SQL are all together). It is a very large application with hundreds of pages and forms.
Does it make sense to...
Hello,
In my future website, i'll have parteners and i want them to receive a certain percentage of money according to how much the visitors they sent me bought items.
So this is a simple question :
How to know where the visitor comes from when he decide to purchase a thing on my website so i give the correct amount to the partener wh...