Hi,
I would like to ask if I have a table of events on my database, e.g.
description | startdt | enddt
event1 | 2010-04-01 10:00:00 | 2010-04-01 13:00:00
event2 | 2010-04-09 14:00:00 | 2010-04-09 18:00:00
event3 | 2010-04-30 11:00:00 | 2010-05-02 16:00:00
I have already created a php calendar, how can I dis...
Hi,
i have this code:
$password_introducido = sfContext::getInstance()->getUser()->getGuardUser()->setPassword($value['password_actual']);
$password_almacenado = sfContext::getInstance()->getUser()->getGuardUser()->getPassword();
var_dump("kfjsdlkjf");
var_dump($password_almacenado);
var_dump($password_almacenado...
I'm speaking mainly of simple classes that act as containers of data for the controllers and models. Say I have a basket model which takes care of adding fruit and vegetables for the controller. However, during the page load, i.e. between values are accessed from DB or session and are written back again, I am in need to create classes fo...
I'm using a form where the user can edit an entry. Everything is populating and all is well with the exception that I can't get the drop down to show the project that they've already assigned the image to.
$project_qry = "SELECT * from projects ORDER BY title ASC";
$project_res = mysql_query($project_qry);
$project_drop = "<select nam...
Hi,
I am wondering what would the best way to let visitors of a website ping various remote servers.
Example:
I am a visitor, I choose from a lsit of locations Paris, France and the script would ping from my location to Paris and return an average of x number of ping attempts.
Any ideas?
...
I need to retrieve a specific post to display on my websites front page.
To avoid hard coding the post ID, I've added a custom property where I add the post ID.
The following code displays the wanted post:
(The code is within the LOOP)
// Get content from specific post (in this case, Ã…pningstider post))
$openingHoursID = get_post_meta(...
Is there a way to get the size of a remote file http://my_url/my_file.txt without downloading the file?
...
I've read the other posts here about this topic, but I can't seems to get what I want.
This is the original HTML:
<div class="add-to-cart"><form class=" ajax-cart-form ajax-cart-form-kit" id="uc-product-add-to-cart-form-20" method="post" accept-charset="UTF-8" action="/product/rainbox-river-lodge-guides-salomon-selection">
<div><div cl...
I'm curious to know why the following code behaves differently?
The following does not work:
$_variable &= global $_global;
echo $_variable;
The following works:
global $global;
$_variable &= $_global;
echo $_variable;
?
...
In PHP, is it possible to have multiple inheritance (by the nature of the PHP, not writting modification code) ?
example :
class a
{
public function foo();
}
class b
{
public function bar();
}
class c extends a, b
{
public function baz();
}
...
I'm developing a web application that will send emails on behalf of a logged-in user.
I'm trying to use the new Gmail OAuth protocol announced described here to send these emails through the user's Gmail account (preferably using SMTP rather than IMAP, but I'm easy). However, the sample PHP code gives me a couple of problems.
All o...
Hi Community,
I've only written a few small php web apps and I'm throwing code together right now to allow for users to submit short stories. these stories will display and allow others to vote them up. The winner receives something rather valuable and I'm paranoid people are going to try to manipulate it.
Debian / Apache / PHP 5.2 ...
Dear all
I'm assigning session variables by filling the $_SESSION - Array throughout my script. My problem is, that for some reason not all variables are available in the session.
here is a shortened version of my code for explaining this issue:
session_start();
print_r($_SESSION);
$_SESSION['lang'] = 'de';
$_SESSION['locatio...
I'm familiar with php's function bin2hex() for converting binary data to its hexadecimal representation.
However, what is the complement function to convert the hexadecimal representation of the data back to binary data?
For example:
$foo = "hello";
$foo = bin2hex($foo);
echo $foo; // Displays 68656c6c6f
How do I turn it back to hel...
right now, i have this code where $obj_arr maybe contain array and object.
$obj_temp = array ($obj_identity, $arr_user, $obj_locale, $arr_query);
foreach ($obj_temp as $maybe_arr) {
if (is_array($maybe_arr)) :
$name = (string) key($maybe_arr);
if (is_object($maybe_arr)) :
...
I have a client who's wordpress sites have gotten hacked twice by iframe scammers. Each time they've injected iframe code into the content of the sites.
This last time, today, they simply changed the siteurl in wp_options to their iframe code. The result was obvious and appeared to simply botch the paths of the scripts that rely on
<?...
I have ZendServer CE (PHP 5.2) installed on a Fedora VM, and I have the system timezone set to 'America/Chicago'. I have date.timezone = 'UTC' in my php.ini file, and when I call date_default_timezone_get(), or display date('T') on a web page, it says 'CDT'.
The documentation on php.net for date_default_timezone_get() says it follows th...
Hello!
I have articles on my site, and I would like to add tags which would describe each article, but I'm having problems with design mysql table for tags. I have two ideas:
1) each article would have field "tags", and tags would be in format: "tag1,tag2,tag3"
2) create other table called tags with fields: tag_name, article_id, so when...
I'm trying to use empty() in array mapping in php. I'm getting errors that it's not a valid callback.
$ cat test.php
<?
$arrays = array(
'arrEmpty' => array(
'','',''
),
);
foreach ( $arrays as $key => $array ) {
echo $key . "\n";
echo array_reduce( $array, "empty" );
var_dump( array_map("empty...
I need to pass a JSON object from $.post() jQuery function to PHP page.
I tried this plugin jquery-json, but don't work:
//include jquery.js and jquery.json.js
$(document).ready(function(){
var data = new Object();
data.hello = "Hello";
data.world = "World";
var datajson = $.toJSON(data);
$.post('file.php', {data: d...