I have a list of around 5,000 to 10,000 (individual user supplied) email addresses from people all over the world, each associated with their username and language codes. I also have a single message translated into the different languages of the users that I want to email. Now, I would like to send a single plain text email to each of t...
I've been tasked to migrate a web application to a more 'modern feeling' AJAX web 2.0 deal. The application as is currently uses PHP to pull data from the database, present the user with forms, and then update the database based on those form submissions. Frames are used to have a persistent main navigation menu, and a content area where...
I am having a problem doing a get on googles search url from php. Here's the code I have:
<?php
$handle = fopen("http://www.google.com/complete/search?hl=en&js=true&qu=" .
$_GET["qu"], "r");
while (!feof($handle)) {
$text = fgets($handle);
echo $text;
}
fclose($handle);
?>
Here's the error I get...
I am building a ZendFramework application which as a login form asking for an email address and password - it seemed to make sense to validate the email address before hitting the database with the login attempt, as an invalid email would never lead to a valid hit. Zend_Validate_EmailAddress seemed like the right way to go, but I am havi...
I would like to know how you can echo the ip-address of the user such that you can use it in your login cookie.
My code
<?php
echo "$_SERVER['REMOTE_ADDR']";
?>
I run it and I get in Firefox
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/file7.ph...
I have a script that currently has a step where I trigger a voice broadcast after a customer signs up. It's a nusoap call to callfire.
The latency there is rather high, and it's added about 2 seconds to my sub-second sign up process. As a result, I have people hitting the sign up button more than once.
Is there a way to tell the app ...
Possible Duplicate:
Stack Overflow / reddit voting system in php
How do voting systems, like the one here at SO, work? I would like to implement a voting system on my web page (coded in php), but dont want to have to force the user to post a form to vote and update the database. I would like it so when a user clicks a thumbs up,...
Give me the best standard way of coding in PHP. where to store my css, php, images etc. How to seperate my folders, How many folders and whats the name of that folder?
...
Possible Duplicate:
500 - An error has occurred! DB function reports no errors when adding new article in Joomla!
I have an article that I want to publish on my Joomla! site. Every time I click apply or save. I get error 500 - An error has occurred! DB function reports no errors. I have no idea why this error comes up, al I can ...
I am using file_put_contents to create a file. My php process is running in a group with permissions to write to the directory. When file_put_contents is called, however, the resulting file does not have group write permissions (it creates just fine the first time). This means that if I try to overwrite the file it fails because of a lac...
I'm working with Zend 1.8. I've set the default timezone to Europe/Helsinki, and I'm parsing a string that looks like this:
2009-08-06
with a statement like this:
new Zend_Date($dateStr, 'YYYY-MM-dd');
It produces a date like this:
object(Zend_Date)#53 (8) {
["_locale:private"]=>
string(5) "en_US"
["_fractional:private"]=>
...
Is there any sane way to make a HTTP request asynchronously in PHP without throwing out the response? I.e., something similar to AJAX - the PHP script initiates the request, does it's own thing and later, when the response is received, a callback function/method or another script handles the response.
One approach has crossed my mind - ...
I have no idea why this won't work.
function query($sql) {
$this->result = @mysql_query($sql, $this->conn);
return($this->result != false);
}
function convert() {
$this->db->open();
$sql_update = "";
$this->db->query("SELECT * FROM ACCOUNTS ");
$str = '';
while ($row = $this->db->fetchassoc()...
Given the following in PHP:
<?php
class foo {
public $bar;
function __construct() {
"Foo Exists!";
}
function magic_bullet($id) {
switch($id) {
case 1:
echo "There is no spoon! ";
case 2:
echo "Or is there... ";
break;
}
}
}
class bar {
function __construct() {
echo "Bar exists";
...
I often find that I have files in my projects that need to be accessed from the file system as well as the users browser. One example is uploading photos. I need access to the files on the file system so that I can use GD to alter the images or move them around. But my users also need to be able to access the files from a URL like "site....
I am trying to get the last line of a file.
The file, ff.log, is getting new data every second while ffmpeg is working.
The log file looks like this:
frame= 20 fps= 0 q=7.7 size= 40kB time=1.24 bitrate= 266.1kbits/s
frame= 30 fps= 28 q=6.6 size= 51kB time=1.90 bitrate= 218.4kbits/s
frame= 40 fps= 24 q=6.6 size= ...
I am trying to get a div that resides in a container div to scale the container divs height when the div inside the container gets taller. When the height of the div inside the container gets taller than the container itself it just moves past the bottom of the container. I want the container to scale with the contained div. How do I ...
Ahoy Stack Overflow! This be mai first post...
I'm attempting to identify users with a salted unique public key.
Algorithm - Should I use uniqid(), sha256, sha512, something else? All hashes will be salted. NIST recommended SHA256, but I like recommendations from geeks/scientists like me.
Generation - Does hash(SALT + AUTO_INCREME...
I'm using php and sql server 2008 and the SQL Server Driver for PHP 1.0 does not have a similar escape string like mysql_real_escape_string.
Do I just need to replace single quotations with something like
function sqlsvr_escape_string($string)
{
$pattern = "'";
$replace = "''";
return(stripslashes(eregi_replace($pattern,$replace,...
I have a project in which there is a site with multiple user types. And I am having trouble wrapping my head around the best practice for this.
I want to be able to get activity from (nodes) you follow regardless of node type. Pretend the node types are:
User:
Organization:
An organization will be an entity that can act as a user. ...