I have a controller which has several methods which should all share common informations. Let's say my URI format is like this:
http://server/users/id/admin/index
http://server/users/id/admin/new
http://server/users/id/admin/list
http://server/users/id/admin/delete
I need to retrieve some informations from the database for id and have...
Hi,
Im populating a form with values from $_GET. I wish to have / in some fields and I thought url encoding the / to %2f would resolve the issue.
However page.php?val=mysite.com%2fdirectory still breaks the functionality. The browser Im using (Chrome) converts the %2f to / in the url bar. And in my form the value is cut off just before...
include_once 'facebook.php';
$fb = new Facebook('api_key', 'secret');
$user = $fb->require_login();
echo $fb->api_client->user;
echo $fb->api_client->session_key;
Whats wrong with the above code? when i first go to the page , it takes me to the facebook for login, after i login, its falling in infinite loop. how can make it pri...
Merry Christmas and Seasons Greetings all!
Quick question, looking for some recommendations. I have a site that will be requesting data from a database and displaying back to the user in a table. I am using jQuery (AJAX), php, and MySQL.
Where is the best place to generate the HTML for the table to display the data: should the php gen...
I've a script to send packages of 300-500 e-mails hour. That means that this script will be fired once a hour using cron or other feature.
The server has a max execution limit of 30secs and it's not configurable.
I've been thinking if the pseudo-code below should work:
$time=time();
$count=0;
while(condition){
$count++;
send(e...
I happened to write this:
<input type="hdnStatus" name="hidden" value="1" />
Instead of:
<input type="hidden" name="hdnStatus" value="1" />
I was surprised that the first line generated a text box with no correct type
specified.
If first line generates text box, then is the below line of any use:
<input type="text" name="tbox" va...
Is it possible to use facebook php api and crontab to create status updates? Crontab would run the php code that sends the status update to facebook.
The problem for me is the login part [$facebook->require_login();]. Crontab can't login, so can i send the login information (username and password) to facebook as well?
my example code:...
At present I am using a datagrid library, but I am experiencing some problems on browsers other than IE. This library can be found here.
This library works very well and is very easy to use except some compatibility issues. Is there any other easy to use grid library for PHP?
...
I'm trying to verify that certain fields in my form are numeric and not text.
Where would I start ?
If the fields are numeric, then serialize, if not then send an empty string.
The reason I want to do this is because PHP sees the data for each variable as a string and not numeric.
this is my ajax request
$.ajax({
type: "POST...
Hi,
I've received a request asking if it's possible to stream live video to a web site. The person requesting this has a notebook running MacOS, a professional camera that can be connected up using Firewire and a web site with PHP/MySQL.
What solutions exist to stream the video out on the Internet and, if practical, what would be neces...
hi
my problem is i want to show my registered site user on to google map but dont know how to locate the user, means i dont know the latitude and longitude of every user . I am a newbie in google map so plz help
Thanks a ton
...
In PHP 5, how do I figure out what class is an object instance of? I know I can compare with the "instanceof" operator, but I don't seem to find how to proceed when the Class name is unknown.
Thanks in advance! :)
...
I'm having difficulty configuring Zend_Form. I have a Zend_Form sub-class. The form has some required information and some additional information. I want the additional information to be accessible via an array. The submitted data will look something like this:
$formData['required1']
$formData['required2']
$formData['addiotnalData']['aD...
i am using jquery's thickbox plugin ( ver. 3) and inside it I want to place a form that will be submitted using $.post. But the form elements are not behaving as they should. For eg there is a select box
<select name="priority" id="priority">
<?php for($i = 5; $i > 0; $i--){ ?>
<!-- <input type="radio" cla...
I'm running the latest MAMP (i think so) on my Mac (10.5.8, PPC G4) and i added the following to my .profile - file in my home directory:
export PATH=/Applications/MAMP/htdocs/lib/vendor/symfony/data/bin:$PATH
But my Terminal is somehow unable to find the command, and all i get is the following errors:
: command not found
: command n...
<?LANG(no_download, 'you are not allowed to download')
instead of
$lang[no_download]
I have what I think is a better approach for embedding language strings in templates.
In almost all the PHP applications, the predominant language placeholder format is like <?=$lang['no_download']?> or {{no_download}}. Other designers/developers/t...
As a result,functions like session_start and setcookie can't run successfully,reporting:
Cannot modify header information -
headers already sent by
But the target file is like this:
1 <?php
2 session_start();
How to fix it?
FOUNDINGS
I've found the problem,the utf-8 formated files become utf-8+BOM after uploading to the serv...
I recently ran across some code which the person did the first one. Would like some thoughts on if the top one is better or why a person would write it that way? Any positive reasons over the bottom way.
$result = mysql_query($query)or die("Obtaining location data failed!");
for ($i = mysql_num_rows($result) - 1; $i >=0; $i--)
{
if (!...
In case of csv file we have fgetcsv in php to parse and get the output but in my case file is .dat and I need to parse it and store it into MySQL Database and so do we have any built in function in php like fgetcsv that can work in similar fashion on .dat file ?
Here is the sample value, it has headers DF_PARTY_ID;DF_PARTY_CODE;DF_CONNE...
How can I create a class with a given array of arguments to be sent to the constructor? Something along the lines of:
class a {
var $args = false;
function a() {$this->args = func_get_args();}
}
$a = call_user_func_array('new a',array(1,2,3));
print_r($a->args);
Ideally this needs to work, without modification to the class, i...