php

PHP Class Database interaction (using PDO)

Hey guys, so I'm completely new to Object Oriented PHP -- I've read some tutorials, but I can't find anything that really goes into working with a database with PHP classes. I'm trying to make something simple -- a quick news post class. You get the post from the database, etc. However, I'm getting an error whenever I try to interact wi...

php fopen , str_replace

I need to open a file , replace some content( 12345 with 77348) and save it. As far I have $cookie_file_path=$path."/cookies/shipping-cookie".$unique; $handle = fopen($cookie_file_path, "r+"); $cookie_file_path = str_replace("12345", "77348", $cookie_file_path); fclose($handle); However it doesn't seem to work .... I would app...

Display possible combinations of string

I am trying to take a string and display the possible combinations of it (in PHP), but while saying in order of each word. For example: "how are you" would return (an array) How are you How are are you how you are The code I have now displays all combinations but I am wanting it to keep them in order and not flip words. Any one have a...

jquery get not passing values

My html form: <input id="captcha_response" name="captcha_response" type="text" value="" size="5" maxlength="5"> <div class="new_comment"><input id="comment" name="comment" type="text" value="your comment here..."></div> <div class="author"><input name="name" type="text" value="your name"></div> <div class="email"><input nam...

Error defining variable in PHP object

I am getting the following error in the following code: Class primeField implements field { private $intmodulus = ''; public function generator(){ return ; } public function modulus(){ return $this->$intmodulus; } public function __construct($modulus , $base=0) { if (is_resource($modulus)...

Is there anything like MasterPages on CodeIgniter Framework?

I am new to Code Igniter and I wish to know if there is anything that works like MasterPages do on .NET. Also i was wondering where should i keep my public files, like scripts, styles and images. Greetings, and Thank you in Advance ...

Which databases support encryption

I use MySQL extensively, but it doesn't support database-level encryption without some external library. What databases come with db-level support built-in, and if you know MySQL enough to compare, how close is its syntax to MySQL. I'd obviously prefer not to re-learn everything. I also use PDO extensively to handle sql injections, s...

PHP output buffering not working

Hello, I have a php file that I am trying to send the output in a email using the php mail function (PHPMailer is not an option as the server I am working restricts their SMTP server). The code for the mail function is $to = "[email protected]"; $subject = "Outdoor Grill Service Request"; ob_start(); require 'grill-form.php'; $body = ob_get_...

PHP custom error handling: an error in one page affects users browsing other pages.

I have a custom PHP error handler in my application, which displays a friendly error message to the user and logs the error for me to fix. However, I've noticed since implementing it that when an error occurs in one page, the error is reported from users on unrelated parts of the site. Say it's a error in /some_site_section/view_one.ph...

HTML Bullet points to Word XML

I need to take user input from a web page and write it to a word document. Im using a wysywyg editor that allows bullet points with the output being a html list. I need to then convert that to Word XML. Any suggestions? I have the syntax/structure for the XML bullet lists but I need to convert the html list to the xml bullet point li...

Object could not be converted to string?

Why am I getting this error: Catchable fatal error: Object of class Card could not be converted to string in /f5/debate/public/Card.php on line 79 Here is the code: public function insert() { $mysql = new DB(debate); $this->initializeInsert(); $query = "INSERT INTO cards VALUES('$this->$type','$t...

where can we specify the width of the column that is generated in pdf?

Hi I have generated a pdf using fpdf library. The datas are exported to pdf document i want to set the width of the indivijual column cells how to do that i know some thing has to be done here in this function to increase the width function CalcWidths($width,$align) { //Compute the widths of the columns $TableWidth=0; foreach($t...

PHP Extensions Crash Apache HTTP Server on Windows 7 64-bit

Apache 2.2.15 (32-bit) PHP 5.3.2 VC6 Thread-Safe (32-bit) Windows 7 Ultimate (64-bit) Intel Core 2 Duo T7200 2 GHz Apache Service Monitor recognizes PHP, but crashes if ANY extension is enabled in PHP.ini. If I disable them all, as below, then it works. ;[PHP_BZ2] ;extension=php_bz2.dll ;[PHP_CURL] ;extension=php_curl.dll ;[PHP_GD2] ...

How can i fixed this problem ?

Hi Fatal error: Cannot redeclare config() (previously declared in D:\xampp\htdocs\cakephp-trial\cake\basics.php:59) in D:\xampp\htdocs\cakephp-trial\cake\basics.php on line 76 I am getting this error Please help Thanks. ...

Why this strange behavior in google chrome and IE?

I am using fpdf library and generating pdfs... What happens when i click ExportToPdf button in firefox it opens the Save as dialogbox but google chrome and IE just opens the pdf file in browser, the save as doesn't seem to open it... Why this strange behavior? ...

php ziparchive class source code

How can i get source code for ziparchive class itself. ...

PHP - Notification upon email reciept using CPanel scripts.

I am helping re-code a website that allows teachers to text message/email their students about upcoming new/assignments. Students can subscribe to their teacher's notifications by texting/emailing a flag to the inbox. How would I go about watching these inbox's for incoming messages, to then flag php procedures (using cpanel scripts to...

How to connect Pervasive ODBC using PHP on Windows??

I want to Connect Pervasive ODBC using PHP on Windows. Wether we have to download Pervasive client version for same???? whats else we need to download for this??? ...

Why don't reg expressions from regexlib.com work in PHP?

I found a regex on http://regexlib.com/REDetails.aspx?regexp_id=73 It's for matching a telephone number with international code like so: ^(\(?\+?[0-9]*\)?)?[0-9_\- \(\)]*$ When using with PHP's preg_match, the expression fails? Why is that? ...

Open Source chat

Possible Duplicate: Secure, customizeable, open-source chat engine on PHP/JavaScript for all popular browsers Could you suggest the best open source chat for PHP/MySQL? ...