php

Possible apache/mysql/php wrapper?

I was tasked with writing a smallish program for data input and manipulation. My language of choice happens to be PHP. I have written out the program/site it all works fine is easily portable and everything but have one question. Is there anyway to wrap up apache/mysql/php into a bundle of one exe? I know of MoWes Portable and other opti...

php - Can I integrate functions with same content, different names?

I have a couple of functions inside a class that essentially do the same thing: public function fn_a(){ return __FUNCTION__; } public function fn_b(){ return __FUNCTION__; } public function fn_c(){ return __FUNCTION__; } I need those functions to remain in their current names so I intentionally did not do: pub...

Looking for a zone file parser written in php

I am looking for a class to parse root zone files. Have you seen one? My current script is in php so the class would need to be as well. G-Man ...

How to output formatted HTML from PHP?

I like to format all my HTML with tabs for neatness and readability. Recently I started using PHP and now I have a lot of HTML output that comes from in between PHP tags. Those output lines all line up one the left side of the screen. I have to use /n to make a line go to the next. Is there anything like that for forcing tabs, or any way...

PHP's form bracket trick is to Django's ___?

In PHP you can create form elements with names like: category[1] category[2] or even category[junk] category[test] When the form is posted, category is automatically turned into a nice dictionary like: category[1] => "the input value", category[2] => "the other input value" Is there a way to do that in Django? request.POST.getli...

What is wrong with my PHP/MySQL code?

I am building a navigation menu which lists all my categories and subcategories. The problem is it returns only one of these and not all. I have the categories echoed inside the while loop so I'm not sure why it's only showing one result and not all: <?php $query = mysql_query("SELECT * FROM categories_parent"); while ($row = mysql_fe...

How can I force email programs to show images send in html email using php?

I am sending an html email with php and it includes an image. Some email programs, such as gMail have a 'display images' button. The user has to click on that in order for the images in the email to show up. Is there any way I can force email programs to show images that are sent within html emails generated by php? ...

php resize image

I have a class to read and output the image content, if $width is set, it will resize the image, and then output it. If I call the function like this $image->readImage('123.jpg'); , it can output the image file correctly, but when I call $image->readImage('123.jpg', 300); to resize it, it just display a black image with resized width &...

Extracting Text from between parentheses in PHP using preg_replace

I am trying to take a string of text like so: $string = "This (1) is (2) my (3) example (4) text"; In every instance where there is a positive integer inside of parentheses, I'd like to replace that with simply the integer itself. The code I'm using now is: $result = preg_replace("\((\d+)\)", "$0", $string); But I keep getting a ...

Wordpress Post # of #

I'm looking for an easy way to assign a post number to each post in wordpress and display it out of the total number of posts. A little info: There will be about 100 "posts", each on its own page I want users to click through each post, so start at post 1 and click "next post" to get to post 2 I want it to say post 4/100 at the top for...

How to retrieve captcha and save session with PHP cURL?

UPDATE: SOLVED Hi all, i've got it, just save cookie to temp file, and resubmit form with curl and set cookies with previous temp file :) thanks all for respond :) Hi all, i'm create some script to submit content via php curl. first fetch session and captcha, and user must submit captcha to final submit. the problem is i c...

Forcing the www prefix with PHP/htaccess/mod_rewrite

Is there an easy way (preferably with htaccess and mod_rewrite) to force the browser to always access a site with the www. prefix (adding it automatically where necessary?) Thx. ...

Knowledge base web app -- need a demo mode

I was contracted to build an on-line knowledge base that searches and cross-references many thousands of replacement parts for a niche industry. My client furnishes this app to his customers on a subscription basis. It uses MySQL and PHP and it works great. I want to deploy it in "demo mode" to sell my skills. I want the user to se...

Call asp.net web service from php

Hi im calling an aps.net web service from a php service. The service searches both databases with a search parameter. Im not sure how to pass a search parameter to the asp.net service. Code is below. ( there is no search paramter currently but im just interested in how it would be passed to the asp.net service) $link = mysql_connect($...

Cannot login with PhpMyAdmin on Mac os x 10.6. Does anyone know a fix to this error message?

Hi, I just reinstalled Mac Os X 10.6.2 and had to reinstall/update my MySQL server. I run phpMyAdmin inside my localhost and I used to be able to login without a hitch. Since the updated (latest version MySQL 5.1.45 & PMA 3.3.1) versions I only get the following error when trying to login with phpMyAdmin: phpMyAdmin - Error Cannot st...

Load balancing a PHP program to support increasing users?

I have a PHP program that has been written keeping in mind a single server, so there are inherent limitation to how much it can handle. For example, the developer says that his current webhosting service provides him with "50 MySQL connections" which he interprets as that only 50 people can be simultaneously logged onto it. What do we n...

Whats The use of function strtok()in PHP, how is better than other string function doing the same thing?

Whats The use of function strtok()in PHP, how is better than other string function doing the same thing? ...

PHP Read xlsx Excel 2007 file

I am using oleread to read uploaded xls file. But I am not able to read xlsx files saved in excel-2007 format. can someone help me on how to read xlsx file in PHP. ...

How to start with AJAX/JSON in Zend?

I am working on some projects as a developer(PHP,MySQL) in which AJAX and jQuery is already implemented. But now I want to learn implementation of AJAX and jQuery stuff. Can anyone tell me the exact steps with explanation? I have created a project in Zend. There is only one controller(IndexController) and two actions(a and b) in my proj...

Creating a mySQL query using PHP form dropdowns - If user ignores dropdown, do not filter by that parameter

Hello, I am creating a simple MySQL query that will be built from the user selecting options from 2 dropdowns. The issue I am having is that I would like each drop down to default that if they do not actually choose an option, do not filter by that dropdown parameter. So, if they come in, and simply hit submit without choosing from a ...