php

Port of Statpress to CodeIgniter

I was wondering if anyone has ported the wordpress plugin Statpress into a CI library. If they hadn't, would this be worthwhile doing? ...

[PHP] Unset Class

Hello Guys, i have a complete Form creation System. There are many different Question Types and I have to check if the answer which the person had made is correct. All types of Questions has its own class will is always called ItemClass and this Class is in its own File. Everytime a Question is asked I include the File and the there is...

Modrewrite regex

I have the following URL: http://www.domain.com/keyword/b21?f=&ca1=50&p=1 And the RewriteRule I am trying to use is as follows: RewriteRule ^([^.]+)/b([0-9]+)?f=([^.]+)&p=([0-9]+)$ script.php?id=$2&p=$2&filters=$3 Unfortunately this rule is not matching the URL. I think it has something to do with the ? as i know this is a c...

Secure password list in PHP

Hello, I'm thinking about storing list of passwords for users (eventually more info about them) of small-scale (max. 20 users) app in PHP file in directory like public_html_root/system/config/ <?php if($calledByApp !== true) die(); $pwds['username1'] = 'hispassword'; $pwds['username2'] = 'herpassword'; $pwds['username3'] = 'anothe...

PHP Calculator Problem

Hi, I'm trying to create a calculator where the user can put in 4 values, these then each multiply by 0.75 and then get added together to give a price in pounds. -----------My HTML:---------- <h2>Monthly Fee &amp; transactions Calculator </h2> <form action="orderprocessing.php" method=post> <table> <tr><td>Total of invoices you send ...

figure out how many times a word comes up

dogdogdogdogsdogdogdogs how would I count how many times "dog" and "dogs" appeared without regex? ...

php mysql compare two columns return mismatches

I have two columns in different product tables. tblproduct1.partno is an old product list tblproduct2.partno2 is a new one Both partno columns should have identical model numbers but they don't. When executing the below query, I get about 300 model numbers that don't match when comparing counts from both tables. tblproduct2 has 1955...

zend framework paginaator results too slow

I have a query that running way too slow. the page takes a few minutes to load. I'm doing a table join on tables with over 100,000 records. In my query, is it grabbing all the records or is it getting only the amount I need for the page? Do I need to put a limit in the query? If I do, won't that give the paginator the wrong record count?...

How to make search engine query in Mysql&PHP?

Hello, I want to make a search engine in an intranet. Now i use this clause in PHP. $k = explode(" ",$_GET[key]); $sql = "select entreprise.*, employee.* where entreprise.* or employee.* like '%$k[0]%' or '%$k[1]%'"; But it seems doesn't work. Do you know where is wrong? Thanks in advance. Edit: $sql = "select * from entreprise...

file_get_contents() Breaks Up UTF-8 Characters

I am loading a HTML from an external server. The HTML markup has UTF-8 encoding and contains characters such as ľ,š,č,ť,ž etc. When I load the HTML with file_get_contents() like this: $html = file_get_contents('http://example.com/foreign.html'); It messes up the UTF-8 characters and loads Å, ¾, ¤ and similar nonsense instead of proper...

PHP: How do I search in an unindexed array?

I have an array that is formatted like so (this example has 5 keys): [0]: HTTP/1.1 200 OK [1]: Date: Wed, 10 Feb 2010 12:16:24 GMT [2]: Server: Apache/2.2.3 (Red Hat) [3]: X-Powered-By: PHP/5.1.6 [4]: etc.. The array keys sometimes alternate, as one may be omitted. How can I search for the array with "Server: ..." in it, and if it exi...

How to print name of variable in PHP?

I'm writing a simple script for my webby that would send me an e-mail in case error 500 happens. I want to dump all possible variables, sessions, POSTs or whatever, present at time when error happened, so I can analyze the problem as precise as I can. Here's the code I have for now: function variable_name( &$var ) { $var_name = arr...

Need to obtain the name of Global variable $_REQUEST

I need to obtain the identifier, name of Global variables. Eg. If I have $_REQUEST['email'] I need to obtain the word email within the $_REQUEST variable. ...

PHP / cURL problem opening remote file

We have a script which pulls some XML from a remote server. If this script is running on any server other than production, it works. Upload it to production however, and it fails. It is using cURL for the request but it doesn't matter how we do it - fopen, file_get_contents, sockets - it just times out. This also happens if I use a Pyth...

Getting the full URL of the current page (PHP)

I'm working on this page: http://localhost/projectname/custom.php Both <?php echo $_SERVER['REQUEST_URI']; ?> and <?php echo $PHP_SELF; ?> don't give full location. What should I use to grab the full url location? Thanks ...

Why Does DOM Change Encoding?

$string = file_get_contents('http://example.com'); if ('UTF-8' === mb_detect_encoding($string)) { $dom = new DOMDocument(); // hack to preserve UTF-8 characters $dom->loadHTML('<?xml encoding="UTF-8">' . $string); $dom->preserveWhiteSpace = false; $dom->encoding = 'UTF-8'; $body = $dom->getElementsByTagName('body...

how to get Jquery to send POST data to populate $HTTP_RAW_POST_DATA var in PHP?

I am trying to tidy up some legacy code. The following is a cut down of the main parts of the code that does the ajax request: var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XML...

PHP DOM XML - Create Multiple NameSpace Addtributes?

Guys, I'm working on some PHP to create XML from a database using the DOM extension. Basically, I need to create a NameSpace and add 3 attributes to it: <NameSpaceName xmlns="http://xxx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xxx"&gt; The full code i've written is below: include_onc...

PHP - same server, different domains require different sessions.

Hello, I'm implementing login and registration for multiple domains that talk to a single database - we'll call them i.domain-a.com and i.domain-b.com. Both these subdomains have A records in the DNS that point to a single server - thus making i.domain-a.com/hello.php and i.domain-b.com/hello.php run the same thing. So, if I create a s...

php image creating in loop

i have to create number of images with php GD library. but after calling imagejpeg(''name,'',100); The First image is generated and execution is halted with browser window showing the image generator file name. does any body tell me how can i loop to create images in loop my code looks like <?php // Including all required classes req...