php

best way to update congfig.php

I have a config.php file for one of my site which holds information needed to run the site. It somewhat looks like this: <?php $site_name="The Site"; $base_url = "http://site.com"; $upload_path = "/images"; ?> Getting the values from that is easy, I just use require 'config.php'; but how can i give an option to add this from a html ...

Registry pattern and lazy instantiation of registered objects

Hello, Let's imagine that we have Registry pattern... <?php class Registry { private static $objects = array(); private static $instance = null; public static function getInstance() { if (self::$instance == null) { self::$instance = new Registry(); } return self::$instance; } protected function _get($key)...

Include and path problem

<?php // This is index.php ob_start(); include 'tem/u.html'; ob_end_flush(); ?> <html> <!-- This is u.html --> <link rel="stylesheet" href="style.css" media="screen" /> <body> <p> abc </p> </body> </html> Now my problem is when i run h.html -> Ok with style. But when i run index.php -> Ok without style (because now the index.php incl...

Using uploaded file without saving to server disk

Hello guys I have created a PHP script to upload a file, unfortunately I don't have permission to save files on the disk. I have to upload an excel file (using phpexcel), then I have to read all the rows in the file and save to disk, Is there any way for me to process this file without saving to disk, I tried to read $_FILES['file1']['t...

CubeCart 4 - "In Stock Now" category

Hey Guys, How can I create a category that shows JUST the items that are in stock now? http://www.lovejungle.com/store Surely it shouldn't be too hard if you can - "Enable out of stock purchases" set to no. h ttp://forums.cubecart.com/index.php?showt...nstock+category ...

How to pass values of form input fields to a script using AJAX/jQuery ?

My current code is like this. index.php <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript" src="ajax.js"></script> <select id="dropdown_id"> <option value="one.php">One</option> <option value="two.php">Two</option> </select> <div id="workspace">workspace</div> one.php $arr = array ( "wor...

calling single javascript function for each php variable fetched from database, multiple countdown program

Hi, I am trying to get a multiple countdown system, event day and minutes being fetched from database. There can be many such events. After getting the event date, i pass this values to a javascript function which on client side runs for every 1 sec using the setTimout function. This works fine for one event. However for many events how ...

How to know root of application dic

Possible Duplicate: GET DIR URL of current script This is a repost question (because i have no answers) localhost/buzz/install.php => This is a link to install the application,in install.php, i want to know BASE DIC (localhost/buzz). ex get_base() will return Basedic ...

Implementing "admin panel module" without using modules (MVC related)

Hello, Let's suppose that we have poor MVC framework without modules support. Our aim is to implement admin panel with some functionality. Url for all admin panel features will start with /admin (/admin/add_user, /admin/remove_user) etc. As we don't have modules, so we have to create Admin controller (yes, this controller probably will...

My PHP file/browser just frozed...

Okay i'm just starting out on PHP & i'm doing the tutorials on the PHP manuals. After doing the first part.. which is echo hello world!, my browser just frozed? I refresh and all it says is Hello World! Even if I echo another word. Why doesn't it change? and i'm also using Wamp for my PHP. ...

Transform project from windows-1256 to utf-8 charset, what's the right steps?

I got a PHP & MySQL script that use windows-1256 charset, I now want to modify the whole script make it completely built on utf-8 charset. starting from mysql DataBase to PHP files. what is the right steps to achive that's??!! Note: I use non-Latin language in script (Arabic language). ...

Compiling PHP 5.3.3 From Source Into Apache.

Just compiled 5.3.3 from source (win32). Trying to test some header() stuff but it looks like it won't work with CLI sapi. Any good docs on putting your compiled source into apache as a module, just like i'd normally do with the pre-compiled module. Basically my test would be from CLI php -r "header('Content-Type: text/plain', true, 4...

How to embed sfDoctrineGuardPlugin signin form into an existing template (homepage) and have it take on the template it occurs in

I'm working with the Symfony Framework, I have installed the sfDoctrineGuardPlugin. I already have my own homepage design and I'm trying to embed my sfGuardAuth signin/login fields into my homepage. I want them to use my homepage design too. I paste this into one of my table rows: <?php echo $form['username']->render() ?> which is bas...

i18n and Error messages in Kohana 3

Hello. I am developping an administration application with Kohana 3 and I'm obviously working with a lot of forms. The application needs to be multilangual and I'm very confused about how to manage my messages files and especially how to access them. Does i18n support different folders and files inside le language folder? E.g: i18n...

Php Buffer Problem fgets (Bandwidth)

Hello i'm saxtor, i'm creating this download quota program, so what i am doing is fetching the file from a remote server and buffering it out back to the client however i would like to record the buffer output to the client and record how much bytes the client has downlaoad, what the code supposed to do is to limit the client if he or s...

ACL implementation

Hello, First question Please, could you explain me how simpliest ACL could be implemented in MVC. Here is the first approach of using Acl in Controller... <?php class MyController extends Controller { public function myMethod() { //It is just abstract code $acl = new Acl(); $acl->setController('MyController'); ...

Performance of FOR vs FOREACH in PHP

First of all, I understand in 90% of applications the performance difference is completely irrelevant, but I just need to know which is the faster construct. That and... The information currently available on them on the net is confusing. A lot of people say foreach is bad, but technically it should be faster since it's suppose to simpl...

Delete everything between "quote" tags ([quote])

Hey, I have nested quotes enabled in my private message system, but now I want to show the user a part of the message when they hover the title of the message. To get the relevant text out of the message I want to delete the quote parts. The quote structure is as follows: [quote] [quote] dasdasa adsadsa ds a [/quote] ddasd...

Form inside a form, is that alright?

Whether we can have a form inside another form?. Is there any problem with that. ...

Automatically unban users after a period of time

I would like to set up temporary ban system on my site to ban users for example only for one day or one week. I can choose the duration of the ban and appropriate record is made into the database so I would like to know if the is a way to automatically update that record when the ban period is over... or what else would you suggest? ...