php

Lightweight Free PHP forum software

I've used both Vbulletin and Simple Machines in the past but I'd like something much less bloated. It must have basic features like: user levels, list of users online, avatars, bans, mods, sticky threads, lock threads, etc. Private messaging would be a plus! It must also be easily customisable & clean coded. (And the more lightweight/...

Finding a PHP based product manager

I'm looking to find an user friendly PHP app to manage my client's collection of vintage tools. I can't find ANYTHING to just simply organize his collection. The closest thing I can find is a shopping cart, but that's not what he needs, as he doesn't want to sell his collection. I don't have the time to code this myself and he's getting ...

What's better, isset or not?

Is there any speed difference between if (isset($_POST['var'])) or if ($_POST['var']) And which is better or are they the same? ...

Preventing web site links and email addresses in a form when "Submit" is pressed

Folks, I have an html form which sends the form data as an email. Unfortunately spam bots have been filling the form in and send web site links and email addresses in the message part of the form. Is there a way I can delete the web site links and email addresses when the "Submit" button is pressed before it gets sent on as an email ad...

how to calculate the network diameter

I have data stored in relational database mysql and PHP. I have a table called "rel" which has two fields: from_node | to_node ===================== 1 2 1 3 2 3 and so on...... How can I calculate the network Diameter of a network. I know it is the longest or shortest path between any two p...

How can you pass a parameter from an action to the layout in Symfony

The global layout.php file contains the tags for each page: <body> <?php echo $sf_content ?> </body> But for all my inner HTML pages of the site, a class is applied to the body tag: <body class="inner-page"> <?php echo $sf_content ?> </body> How can I pass in a class to the layout from different templates? ...

Smarty templates uploaded during high trafficked site causes blank page

I work on a very high trafficked website that uses a Smarty templating system. When I upload a fresh copy of a template that is currently being used, the page turns blank (as if there is nothing in the template file itself). I have to shut down lighttpd, upload the template again, and start lighttpd back up. Are there any settings in S...

PHP: Can't find syntax error

Parse error: syntax error, unexpected $end in blah/blah/blah.php line 1 This is the error that I receive, with this code <?php include("db.php"); if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['email'])) { //Prevent SQL injections $username = mysql_real_escape_string($_POST['username']); ...

long time cron job via wget/curl ?

Hi All I am working on cron jobs for my php app and planning to use cron via wget/curl. Some of my php cron jobs can take 2-3 hours. How to let php work 2-3 hours from cron tab ? Is it good practice to run such long time jobs via cron wget/curl ? Anyone got experience on this ? I also have email queue and i needs to be run every 10 sec...

create jquery tabs according to data from database

Hello all i want to create tabs according to data from MySQL database using php for instance count the number of groups if they are 5 create 5 tabs.How could i do that. ...

How to do long time batch processes in PHP ?

Hi All I have batch process when i need to update my db table, around 100000-500000 rows, from uploaded CVS file. Normally it takes 20-30 minutes, sometimes longer. What is the best way to do ? any good practice on that ? Any suggest would be appreciated Thanks. ...

How to get useful error messages in PHP?

I find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a failed function call, or something else entirely. It is very difficult to figure out what w...

How to integrate PHPUnit to a custom framework

I'd like to integrate PHPUnit to my framework. By this, I mean that I have to do some initializing in the beginning, like setting up autoloads, before I'd run the tests. I'd like to use the cli test runner, and if I understand correctly, I have to make a class, that has a static function suite(), which returns an instance of PHPUnit_Fra...

Get the last modified date of a remote file

I would like to get the last modified date of a remote file by means of curl. Does anyone know how to do that? ...

Zipcode based search

I want to make a geographical search using US city and state or zip-code and corresponding results will be viewed. In the search we have to mention the radius distance. For example: i would like to search between 25 miles around California. To do this, what should i do? is there any database containing us city,state,zip, latitude, long...

CSS & Javascript rollup file(s)

The Yahoo User Interface library offers rollup support if you use their CDN. I'm using Zend Framework 1.8.0 and was wondering whats he best way to go about replicating this so as all our css or javascript files can be rolledup into one tag - thus one http request. I am using the standard MVC components with a .htaccess file that rewri...

PHP performance on shared hosting

Hi All I have php script which calls another script with php exec function. The called script does batch process job, that is updating transaction statuses, notifies customers(puts emails to mail queue which runs separately). So it will take 20-30 minutes due to a very large table(500000 rows), Now i am running it under my desktop windo...

PHP language (unit) tests

At the moment I am working (just for fun) on a kind of compiler that breaks PHP-code down to a source code for a low level VM. As the type system and a lot of of the PHP-features are not that logical I need a much testscripts to verify that my code behaves as it would in PHP. I started to test everything with the test from the PHP-sour...

Regex - Match ( only ) words with mixed chars

Hi all! :) i'm writing my anti spam/badwors filter and i need if is possible, to match (detect) only words formed by mixed characters like: fr1&nd$ and not friends is this possible with regex!? best regards! ...

How to access the form's 'name' variable from PHP

Hi, I'm trying to create a BMI calculator. This should allow people to use either metric or imperial measurements. I realise that I could use hidden tags to solve my problem, but this has bugged me before so I thought I'd ask: I can use $_POST['variableName'] to find the submitted variableName field-value; but...I don't know, or see, h...