php

Database Design

I'm trying to build out a mysql database design for a project. The problem is coming up with the best solution. Basically in my application, I will have to insert approximately 10-30 rows per user. The primary key will be a random CHAR(16) string. There will also be an datetime index, and an additional row (with an index) called "data". ...

Jquery/php/taconite radio buttons

I am new to Jquery and taconite I want to have a page that does the following It has multiple panels the first contains search criteria to submit a request to a mysql database The second panel contains the results of the search I would like to use radio buttons on the second panel to get more specific details from the data base and disp...

Getting to the next key in an array

Let's assume I know that there is key "twoVal", but I do not know what is after it. How do I get to the next key for that matter? Shoud I know the position of key "twoVal"? Or there is another way around? $arr = array('Cool Viski' => array('oneVal' => '169304', 'twoVal' => '166678', ...

How relevant are OO design patterns to web development in PHP?

Singelton, Decoratot, Abstract, Factory, and the list goes on. How relevant are OO design patterns in developing PHP applications for the web? Does it do anything for performance? Or is it just to keep code lean for agile development practices? Who is the major benefactor for implementing these design patterns? Is it the customer or the ...

How do I include Zend Framework libraries in my domain?

Locally, on my xampp installation, the Zend folder is under PEAR\Zend, and Pear is in the include path. So when I do require_once "Zend\Date.php" there is no problem. However, on my domain (Hostmonster), that's not the case. I have no idea where the Zend folder is, although doing phpinfo(); seems to indicate that Zend Framework is defi...

PHP Launch script after background process completes?

I am converting a PDF with PDF2SWF and Indexing with XPDF.. with exec.. only this requires the execution time to be really high. Is it possible to run it as background process and then launch a script when it is done converting? ...

Javascript and PHP to generate "live" print preview

I want to be able to enter data and use Javascript onChange/onBlur/etc to render a "live" print preview; with page breaks. The ultimate goal is to have a PDF file that can be saved/emailed/etc that will be identical to the "preview". The data is to be stored in a MySQL database, I'm figuring AJAX to write it while entry. Has anyone hear...

if mysql_query() fails, what to do?

Sometimes so happens that mysql_query() fails to INSERT data and I am unaware of it. So, the question is how do I know when it happens? ...

how to assign an object to smarty templates?

i created a model object in PHP class User { public $title; public function changeTitle($newTitle){ $this->title = $newTitle; } } How do i expose the property of a User object in smarty just by assigning the object? I know i can do this $smarty->assign('title', $user->title); but my object has something like over 20 p...

Viewing Magento model data changes on before/after save event?

I’ve been trying to do something that seems like it should be simple: hook a MODEL_save_after event (or MODEL_save_before if that’s more appropriate) check getData() vs getOrigData() to see what changes the user has made Now, in the example of the ‘customer_address’ model, edited through the backend, I find that both the save events ...

Calling php from php through exec() gives no result

I have a PHP script that creates other PHP files based on user input. Basically, there are files containing language specific constants (define) that can be translated by the user. In order to avoid runtime errors, I want to test newly written files for parse errors (due to "unusual" character sequences). I have read several posts here o...

Allowing users to Refresh browser without the "Confirm Form Resubmission" pop-up

Hello, I have a login system, and while logged in, if I refresh the browser, Chrome shows a pop up window titled "Confirm Form Resubmission." I assume that the same thing would happen with other browsers. How can I allow the browser to be refreshed without this confirmation pop-up window? Of course, I would also like to stay logged i...

Emails sometimes get scrambled

Folks, I have a PHP-based site (using the QCubed framework); as a part of the site, I have a daemon that's sending out several thousand emails a day (no i'm not a spammer, everything is opt-in :)). Emails are sent through a custom framework component; that component serves as an SMTP client. I'm using a paid SMTP gateway from DNSExit.c...

How to omit "THE" in search using PHP and MYSQL

Hi all, I am doing a "ALPHABETICAL ORDER SEARCH" module for a project. that is it will look like A B C D E F . . . . . . . . . .. . . . . . . .. . . . Z When i click on "A" the results should be sort by "A". Which is same for all the alphabets. Now my prob is as follows: For example there is a film named "The Mummy". What i do i...

Wordpress: How do I get the current name of my page

If my current url is www.example.com/thank-you, how do I echo out the page name in a wordpress way. ...

Which PHP framework should I use when creating this type of website/application?

In the jungle of frameworks out there, I've come to the conclusion that I cannot simply determine a framework beforehand without considering the type of application/site I want to create. So I think I need a rittre herp with determining this one. This site is a heavy graphics site, where basically all of the content is presented in a sm...

Actionscript 2.0, Having a SendAndLoad() function Issue

I have this code: btn_jouer.onRelease = function () { verif = txt_email_user.text; if (txt_email_user.text == "") { txt_erreur.textColor = 16724736; txt_erreur.text = "Champ(s) manquant(s)"; } else if (verif.indexOf("@", 0) == -1 || verif.indexOf(".", 0) == -1) { txt_erreur.textColor = 167...

APC locking mechanisme alternative for win32

I want to use APC for php for storing and fetching values (function calls and return values) between a endless running php process and multiple client processes. The endless running process constantly checks for newly stored values. I am running php as a Apache module on WinXP. For each APC function call a apc.lock.* file is placed in th...

mobile phone's carrier information

We need to test the sms text notifications thru our project which is implemented in PHP. We have used the phone number combine with the carrier gateway. For example 7-11 Speakout (USA GSM) has a gateway @cingularme.com, so while send sms we are combining the number with the gateway as 9860112354@@cingularme.com and sending this thru PHP'...

jQuery, PHP, AJAX, "tu" variable beeing posted for no reason, shows in var_dump()

A jQuery AJAX request .post()s data to page.php, which creates $res and var_dump()s it. $res: $res = array(); foreach ($_REQUEST as $key => $value) { if($key){ $res[$key] = $value; } } var_dump($res): array(4) { ["text1"]=> string(6) "mattis" ["text2"]=> string(4) "test" ["tu"]=> string(32) "deb6adbbff4234b...