I'm running some tests with the Gmail SMTP, for some reason my script is hanging at this point:
fwrite($smtp, 'DATA' . "\n");
$result[7] = trim(fgets($smtp));
$result[7] = substr($result[7], 0, 3); // 354
// the script starts hanging here
fwrite($smtp, 'From: "Alix Axel" <[email protected]>' . "\n");;
fwrite($smtp, 'To: "Alix Axel" <x...
Ok, I'm reading through a file now, line by line. I know each functions name in the file, since it is defined elsewhere in an XML document. That is what should be this:
function function_name
Where function_name is the name of the function.
I get all of the function definitions from an XML document that I already have put into an a...
Hello !
I am working right now with Zend Framework and I've created a Model_User_Row in app\models\User\Row.php.
When I try to create an instance of that class in IndexController I get an error:
Fatal error: Cannot redeclare class Model_User_Row in
F:\Projekty\www\inz\app\models\User\Row.php on line 14
14th line is a close brace.
<...
I would like a php framework that:
Is simple and lightweight
It work in shared hosting (free hosting)
I'll be nice if it saves the preferred language using cookies (not necessary)
I'll be nicer if it detects user's preferred language from the browser (not necessary)
I want to build a page that displays 3 different languages. I came o...
I have a page with 2 frames. In the top frame is a form called invoice.php. In it you type in an invoice number and then post it. I am wanting this post to be sent to 2 pages that will open in both the top and bottom frames. The top page is called invoicelab.php and the bottom is called invoice2.php. The information that I am posting is ...
Hello. Is it possible to create a plugin that, when active, would add a new "function" to the XMLRPC interface and handle its calling?
...
I have a read a number of excellent questions and answers today about dealing with user input. I am now using htmlspecialchars() to display user data in the create/edit forms (but accepting the raw input via prepared PDO statements into my database).
The main question I know have is, what do you do when you are allowing the user to subm...
I write
mysql_query("SET AUTOCOMMIT=0");
mysql_query("START TRANSACTION");
before I write all queries. Then check if all of them are true and then write:
mysql_query("COMMIT");
But if one of query fails, I just pass COMMIT query. So do I really need ROLLBACK function if one of the queries fail? Because without ROLLBACK it also works....
I'm just venturing into the world of OOP so forgive me if this is a n00bish question.
This is what I have on index.php:
$dbObj = new Database();
$rsObj = new RS($dbObj);
This is the Database class:
class Database
{
private $dbHost;
private $dbUser;
private $dbPasswd;
private $dbName;
private $sqlCount;
funct...
Disclaimer, I'm not a PHP programmer, so you might find this question trivial. That's why I'm asking you!
I've got this kind of timestamp: 2010-05-10T22:00:00 (That's Y-m-d)
I would like to subtract, say, 10 days (or months, whatever) from this, and have my result be in the same format, i.e. 2010-04-30T22:00:00.
What function(s) do I ...
Hey Guys,
I configured PHP myself, included all of the libraries I needed... but then realized I forgot the freetype library.
So I went back to my php-5.3.2 directory and ran ./configure '--with-free-type=/usr/local/lib'
PHP did the configure fine, no errors.
But when I run make:
collect2: ld returned 1 exit status
make: *** [sapi/c...
I'm trying to get the value of a hidden form with xpath,
there are several input fields
$dom = new DOMDocument();
@$dom->loadHTML($html);
// grab all the page
$x = new DOMXPath($dom);
$nodes = $x->query('/html/body/div/div[4]/div[2]/input');
foreach ($nodes as $node) {
ech...
Hey.. my question is how to prevent someone upload a virus or some malicious code with the extension you pretend for example i have a pdf file uploader, anyone can upload a binary with pdf camouflage there are lots of programs to do that.
...
/* Errors exist, have user correct them */
if($form->num_errors > 0)
{
return 1; //Errors with form
}
/* No errors, add the new account to the */
else if($database->addLeagueInformation($subname, $subformat, $subgame, $subseason, $subwindow, $subadmin, $subchampion, $subtype))
{
$database->addLe...
in my search form, if the user types 'good', it displays all the results which contain the keyword 'good'. however if the user types in 'good sweetest', it displays no results because there is no record with the two words appearing together; BUT appearing in an entry at different places.
for example, the record says:
A good action...
hi
i want to create my own tool for back-links calculation using PHP. is there any api to fetech the data for back links
...
Just a simple problem for most of you i'm sure.
I have a function addTeamFixtures and it calls on a function flip.
That function is defined later in the script.
But I don't think it is happy with that.
The code where it calls the function:
$rounds[$round][0] = flip($rounds[$round][0]);
Any ideas?
More code.....
...
Hello,
how could I add an autocomplete for PHP build-in functions like htmlentities or var_dump?
The autocompleter work for my classes but there's not autocompletion for functions like mentioned above.
...
I understand the differences between fgets() and fgetss() but I don't get the difference between fgets() and fread(), can someone please clarify this subject? Which one is faster? Thanks!
...
I have a stored procedure:
CREATE PROCEDURE busi_reg
(IN instruc VARCHAR(10),
IN tble VARCHAR(20),
IN busName VARCHAR(50), IN busCateg VARCHAR(100),
IN busType VARCHAR(50),
IN phne VARCHAR(20), IN addrs VARCHAR(200), IN cty VARCHAR(50),
IN prvnce VARCHAR(50), IN pstCde VARCHAR(10), IN nm VARCHAR(20),
...