I have a simple function1 that does a http request to a google api and returns the $result.
I then have another function2 that, if $result isset, should use $result to do some computing and then return $finalresult. .
My problem is that the call to the google api takes a couple of seconds and by the time $result is returned by function1...
I need to create an image dynamically then email it to the person. Here is the image creation script:
//Get the blank coupon
$rImg = ImageCreateFromJPEG('coupon.jpg');
$color = imagecolorallocate($rImg, 0, 0, 0);
imagestring($rImg,5,135,140,'$first_name', 'black');
imagestring($rImg,5,135,160,'$last_name', 'black');
imagestring($rImg,...
Most examples use time-based cache expiration. I'd like to read more about file caches (where the database is called only when there is no file in a given directory). This is for a basic information site with CMS functions made with php/mysql. My searches are returning too many sites on web applications. Adding CMS to the search returns ...
Hi All,
I have a PHP page that needs to read XML posted to this page.
The post will be done by content-type: application/xml(not application/x-www-form-urlencoded).
For example, my page is called test.php, another server will post the XML to this page (test.php).
My question is how can I create a code to this test.php page to read the...
I'd like to accept other type of files that contains PHP code. For example, it would be nice to read an .aspx file by PHP as if it were .php. Could it be possible?
Thank you very much in advance
...
I'm building a site like SO using PHP as a personal project. I started out with writing flat PHP files (the kind with SQL queries mixed in with HTML). After doing a few pages I noticed that it was getting hard to maintain. So I started using an ORM (Propel). Then I got introduced to Symfony.
I started refactoring my code to fit in with ...
I'm trying to build a tiny skeleton framework for a friend, where each time a button is pressed a certain animation is played. He wants a way to count the number of times the button is clicked, as well, but I can't seem to get that part working. What am I doing wrong?
<?php
if( isset($_POST['mushu']) )
{
echo "Working.";
pl...
$this->ADOStream = new COM('ADODB.Stream');
$this->ADOStream->Mode = adModeReadWrite;
$this->ADOStream->Type = adTypeBinary;
$this->ADOStream->Open();
$this->ADOStream->Write($this->Value);
$this->ADOStream->Position = 0;
$this->Size = $this->ADOStream->Size;
$this->Value is the result of
$myDataFile = "c:\\temp\\test.PNG";
$...
Hello,
I'm very new to PHP and OOP in general. I'm using codeigniter for a framework, and am currently attempting to build a class 'BuildLinks' that will redirect the user to the correct link based on what URL they landed on.
The controller passes the right variables to the class, while the function build_afflink() selects what class ...
Hello. Can anyone explain how to create friendly URLs? I mean URLs like http://store.steampowered.com/app/22600/ that doesn't have any pages like index.php visible. Any help is appreciated. Thanks.
...
Does Komodo support getter/setter auto generation a la NetBeans or Eclipse? If so how do I use it? I can't seem to find it.
...
My website was infected by a trojan script.
Somebody managed to create/upload a file called "x76x09.php" or "config.php" into my webspace's root directory. Its size is 44287 bytes and its MD5 checksum is 8dd76fc074b717fccfa30b86956992f8. I've analyzed this file using Virustotal. These results say it's "Backdoor/PHP.C99Shell" or "Trojan....
I'm trying to pass UTF-8 text as an argument to a command line program using php's exec function and have been having problems. I suspect it's due to character encoding issues.
When I call locale charmap from the command line, I get: UTF-8.
But when I do:
<?php echo exec('locale charmap'); ?>
I get
ANSI_X3.4-1968
How can I change...
Hello,
I'm using simplexml_load_file($path_xml_file), it works good!
If I do print_r($xml) it prints:
SimpleXMLElement Object
(
[@attributes] => Array
(
[Message] => Login Successful
[Token] => 11111111111
[DataFormat] => CSV
)
)
How Can I get "token" value?
Thank you!
...
I am attempting to store the date in a variable using getdate(). What am I doing wrong?
$today = getdate();
echo "the date today is ".$today;
Output: the date today is Array
...
I'm building an e-mail with PHP, following the RFC as closely as I can, and this appears to work in other clients (gmail, outlook), but not in Lotus Notes.
The client sees everything including the first boundary and below as raw text.
Any ideas what I'm doing wrong?
Delivered-To: to-address
Received: by 10.220.179.196 with SMTP id br4...
My site root is an english version of the site (/index.php).
I used an DirectoryIndex to point my users to a french version of the site by default (/fr/index.php).
I would like people to be able to click an link that would take them to the english version (/index.php).
Is there anyway to do this without changing the folder structure? ...
Hi all,
I Currently work within the IT industry in a hardware/software/desktop support role, but wish to move my career direction into software development/solution design/etc..
I have built a few application in the PHP framework language CodeIgniter(that I have noticed a lot of you like!)
My question is: (and I can answer it for myse...
I am using cakephp in one of my projects and my client wants the site URLs to end with .html and not the usual friendly urls. I was wondering if its possible in cakephp to do so through any of its routing techniques. Please help.
...
I'm trying to allow users to register with the site I am creating, however the code I am using is not working and I need you're help.
$registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."'");
Database:
I only want to store the Username, Password and Em...