I have read about dynamically loading your class files when needed in a function like this:
function __autoload($className)
{
include("classes/$className.class.php");
}
$obj = new DB();
Which will automatically load DB.class.php when you make a new instance of that class, but I also read in a few articles that it is bad to use thi...
Hi guys,
Sorry to bother again, but I really need help transforming this Python2 code into PHP.
net, cid, lac = 25002, 9164, 4000
import urllib
a = '000E00000000000000000000000000001B0000000000000000000000030000'
b = hex(cid)[2:].zfill(8) + hex(lac)[2:].zfill(8)
c = hex(divmod(net,100)[1])[2:].zfill(8) + hex(divmod(net,100)[0])[2:].zfi...
I cannot seem to figure out a way to read binary data from SQL server into PHP. I am working on a project where I need to be able to store the image directly in the SQL table, not on the file system.
Currently, I have been using a query like this one:
INSERT INTO myTable(Document)
SELECT * FROM
OPENROWSET(BULK N'C:\image.jpg',...
If got a table "Article" and a table "Tags". Articles can have multiple tags and tags can hang to multiple articles.
The class BaseArticle looks like this:
abstract class BaseArticle extends Doctrine_Record {
public function setTableDefinition() {
$this->setTableName('article');
$this->hasColumn('article_id', 'integer', 8, arra...
I'm familiarizing myself with Kohana. I've been reading up on the Input library, which automatically pre-filters GET and POST data for me, and the Validation libary, which helps with form filtering and validation.
Should I use both together? The examples given in the Validation library documentation use the unfiltered $_POST array ins...
Hi,
I have a few issues with the following php functions (part of a bigger class).
//encode
public function acc_pw_enc($text, $key) {
$text_num = str_split($text, 8);
$text_num = 8 - strlen($text_num[count($text_num)-1]);
for ($i=0; $i < $text_num; $i++) {
$text = $text . chr($text_num);
}
$cipher ...
Hey, so I have created a function to check the DB for unique entries, but when I call the function it doesn't seem to work and gives me a fatal error any ideas from the function or do you wish to see the sign up page calling it. Thanks :)
//Check for unique entries
function checkUnique($table, $field, $compared)
{
...
I'm really new to website development and for a project I need:
No public pages. All private.
Login+Password (Users, Admins)
Being able to upload XML-files from Android device
Parse this XML into something I can plot. Easy charting.
Admin users being able to read all sub-users uploads.
Doesn't have to look good.
No blog-post. Strictly...
I'm looking for a solution that will enable me to use WordPress for site/content management but will export static .html files rather than dynamic database driven files.
I've used wp-super cache and it is a step in this direction, however, the speed gains were not quite what I'd like.
Any ideas?
...
Hi all,
I have a problem with a jQuery ajax call.
I need to wait for the call to be finished in order to return a value.
However, the script seems to jump ahead and not wait for the call to be over.
my function then returns "undefined".
I have tried to use the .ajax() method and set the value of async to false, but this would not work ...
Hey, so I have created a function to check the DB for unique entries, but when I call the function it doesn't seem to work and gives me a fatal error any ideas ? Thanks :)
//Check for unique entries
function checkUnique($table, $field, $compared)
{
$query = $mysqli->query('SELECT '.$mysqli->real_escape_string($f...
With the recent announcement that PHP 6 development has been halted, I'm confused as to what the PHP 5.x and 6.x road map includes.
The current version of PHP is 5.3.2.
There were quite a few significant features to come in PHP 6.0, such as:
APC include for automatic bytecode caching
Unicode support
etc..
Question: What is the new ...
Setting a Magento store for a winery. They well bottles of wine, but you can only order bottles in cases of wine. There are 12 bottles of wine in a case, and you can make a custom case.
So user could pick 4 Chardonnay, 6 Merlot and 2 Shiraz to make a case of 12. But they could not just choose 4 Chardonnay and 6 Merlot. Orders have to b...
I have a simple PHP script that will either serve up a streaming ASF file or not, depending on whether you're logged in and have access to the file. It basically does this:
<?php
header('Content-Type: video/x-ms-asf');
header('Content-Disposition: inline; filename="file.asf"');
readfile('file.asf');
?>
This already works fine in Fir...
I'd like to add a date field to a drupal taxonomy term, alongside the default "title" and "description"
Is there some technique/php/module that lets me do this?
Is it possible to do with CCK??
I need to be able to display the new field in the same view presenting the content nodes referencing the term.
At the moment, I've added a date...
Pretty often I need to access config variables in views.
I know I can pass them from controller to load->view().
But it seems excessive to do it explicitly.
Is there some way or trick to access $config variable from CI views without
disturbing controllers with spare code?
...
Hi i want to compare all the values of 2 arrays and end up with a true or false . I am using the code below and would of thought that the result would be false . but that is not the case , when the last line runs I would expect a display something like
Array ( [0] => 0 )
but I get no display so assume that php is happy that there is no...
I'm getting bamboozled by "for each" loops and two dimensional arrays, and I'm a php newb so please bear with me (and ignore any variables with the word "image" - it's all about the mp3s, I just didn't change it from the xml tutorial)
I found a php function on the net that list files in a directory, the output of which is:
Array
(
[0...
There exists numerous solutions on generating a thumbnail or an image preview of a webpage. Some of these solutions are webs-based like websnapshots, windows libraries such as PHP's imagegrabscreen (only works on windows), and KDE's wkhtml. Many more do exist.
However, I'm looking for a GUI-less solution. Something I can create an API a...
Hi, I read this and I was inspired. I am asking for specific help to achieve a 12 for my current project. I am working in a team of 3-4 on a php project that is based on cakephp. I only have a dedicated server running on linux which i intend to have the website live on and i have a plan with assembla where i am using its svn repositor...