php

MaxClient Directive in apache

we have php web application on two db linux web server connected with RAC load balancy with two Oracle db server.. we have a high traffic .. about 500 client concurrency on the same time conenct the web application .. our linux web server is 2 giga RAM .. and 2 processors. we want to make apache more performance .. i have installed zend ...

how to register user clicked on link ads

I want to register user clicked on ads and save users info to database without change ads operation. <div> <a>ads link</a> // without modify ads <a>ads link</a> <a>ads link</a> <a>ads link</a> </div> how to update user info to database before load link ads. Please help. ...

Page encoding and Jquery-Ui (ajax tabs)

I am developing a web application and I'm forced to use: SQL_Latin1_General_CP1_CI_AS as a character encoding. I'm trying to use Jquery-ui to make some beautified tabs, but I cannot manage to get the correct encoding. I tried this: $("#tabs").tabs({ ajaxOptions: { contentType: "text/html; charset=SQL_Latin1_General_CP1_CI_AS" } }); ...

Multiple column articles in Joomla

I've got a client that requires that an article be displayed in two, sometimes three, columns in Joomla. I am fairly sure they won't be happy with having to edit 3 articles for 3 columns so the splitting would have to be done automatically. I've done something similar before where it'll split a chunk of HTML into n columns, but have ...

PHP mail cannot show links when sending html mails to thunderbird

Hello. I have this script that works ok. Trouble is that when I make Click here You cannot click the link in Thunderbird mailing program (Mozilla). If I see the source code it is okay. What gives? public function send_mail($email='',$subject='',$text='') { $mail = new PHPMailer(); $db = new Db(); $sql = $db->query("SELECT *...

apache php connections

Hi, I have one site running in apache and php, when I'm downloading something the site doesn't repond to any click on links until the download finish. What can be? Regards, Pedro ...

PHP: Show yes/no confirmation dialog

My php page has a link to delete one mysql table data.i want it to be in such a way that when i click the 'delete' link a confirm box should appear and it shoul ask for "are you sure, you want to delete?" with two buttons 'yes' & 'no'.when i click yes ,i want to delete the mysql table's data,and when i click no,nothing should happen. ple...

php 4 to 5 porting question on how to reset a class

Someone wrote the following php4 code which I now am trying to port to php5: the class is Foo (name changed to protect the guilty). In one of the methods, we'll call it save() the class apparently is reset like this: $this = new Foo($this->Foo_Id); That results in the following error: ( ! ) Fatal error: Cannot re-assign $this in ......

Facebook - cannot upload file using the <input type="file"> tag

Hi I am trying to let the user upload an image from my facebook app using the following php <?php echo render_header('Your'); define("MAX_SIZE", "1536"); function getExtension($str){ $i = strpos($str,"."); if(!$i) {return "";} $l = strlen($str) - $i; $ext = substr($str, $i+1, $l); return $ext; } $errors = 0; if(isset($_PO...

How to assign current date to row in Zend Framework?

I have the following private method in my form : function _verifywebsite ($id) { $row = $this->websites->fetchRow("id=$id"); $row->verified_date = $this->_get_date(); // this is the line in question $row->save(); } I assume that $row requires me to enter date as string value in correct date format. But what if I want to includ...

How to extract mail atachment with PHP?

I'm extracting emails from a database where they're stored as strings. I need to parse these emails to extract their attachments. I guess there must already be some library to do this easily but I can't find any. ...

HTTP vs FTP upload

I am building a large website where members will be allowed to upload content (images, videos) up to 20MB of size (maybe a little less like 15MB, we haven't settled on a final upload limit yet but it will be somewhere between 10-25MB). My question is, should I go with HTTP or FTP upload in this case. Bear in mind that 80-90% of uploads ...

PHP IMAP Formatting

I have wrote a simple php script which reads an IMAP email account and displays the body of the most recent mail. There is just one problem, it won't keep the new lines properly. It just puts it all on one line. I use imap_fetchbody($conn, $latest, "1"); to read the body of the email. How do I keep the original formatting with all t...

How can I get X amount of files per folder with math?

I actually have it done, I did this math equation about 2 years ago and I am having trouble understanding it now. Basicly I use this so that when users upload photos to my site, I can balance them out with only X amount of photo per folder. This gives me something like this 1/1 1/2 1/3 1/4 ----1/10 2/1 2/2 2/3 and so on but I need ...

Force user to download .txt (php, file.txt)

Hello! I have a small script, which reads the data from DB, array them and save them as .txt file. At the end, user is redirected to that file. Now, how to achieve that when user is redirected on .txt file download box appears? <?php // Preden zacnemo, dobi novico iz baze! $MOD_NEWS_SAVETXT_getnews = mysql_query("SELECT * FROM NEWS...

GhostScript PDF Merging (Losing Editable Fields)

I'm using GhostScript to merge to PDFs into one PDF. One of the PDFs has textbox fields (editable fields) that I created in Adobe Acrobat Pro 9. When I merge these two PDFs with GhostScript I lose the textbox fields. Is there any way to merge these files (using GS or some other free linux software) that keeps the textbox fields intact? ...

header readfile in remote server PHP

My site is Downloading one file using this code: $flv = **filename** $ch = curl_init($flv); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //not necessary unless the file redirects (like the PHP example we're...

Ping site and return result in PHP

I'd like to create a small IF procedure that will check if Twitter is available (unlike now, for example), and will return true or false. Help :) ...

[PHP] Inserting an array of lines into an SQL table

Hello everyone, I would really appreciate if you would take a look at this piece of code: <?php if(isset($_POST['add'])) { $self = $_SERVER['PHP_SELF']; //the $self variable equals this file $ipaddress = ("$_SERVER[REMOTE_ADDR]"); //the $ipaddress var equals users IP //connect $connect = mysql_connect($host,$username,$password) or di...

How to co host django app with php5 on apache2 with mod_python ?

Hi folks, I have django+python+apache2+mod_python installed hosted and working on ubuntu server/ linode VPS. php5 is installed and configured. We don't have a domain name as in example.com. Just IP address. So my apache .conf file looks like this ServerAdmin webmaster@localhost DocumentRoot /var/www <Location "/">...