create a list of the categories


In my database the table is set out like this:

id | title | category

There is about 1000 records in there and i want to be able to create a list of the categories but if i do a foreach statement i just get the same categories over and over.

try this

Code:

$select = "SELECT subcategory FROM recipes WHERE category = '" . $row['category'] . "' GROUP BY subcategory";

don't do this in php, use a mysql query.
Code:
SELECT DISTINCT ( category ) FROM mytable

OR

Code:
SELECT category FROM mytable GROUP BY category

vulnerability tester in PHP


I am building a small vulnerability tester in PHP that checks a URL for vulnerabilities. The check uses a function that either outputs Yes, or No. instead of having to wait for the whole page to load, is there a way to print them out one at a time as they are checked?

I think its depends on the browser, it will display line per line.

after you echo the line use these 2 lines:

ob_flush();
flush();

script time out error occur?


When we execute a php file under command line, that includes large functionality and it takes 2 or 3 minutes to complete the task, What is my doubt is while running that file under command line,will script time out error occur?

Increase the max_execution_time variable in php.ini to the required time and you should be ok.

use this code

Code:

set_time_limit(0);

Time out problem


I have a page that does many regexes with large files and iit’s giving me the 60 seconds time out. Is there a good way of avoiding this?

You can do it several ways..

If the hosting server does not have safe mode enabled, you should be able to use ini_set(max_execution_time, ###);

Otherwise, what you can do, is have the script open the file, and read 100 lines… pause, then reload and read the next 100 lines…

Use set_time_limit(99999999);

thanx for reply

I have a set of 10 textboxes with 10 url’s and my page should extract their titles and metas and lots of other details using regex and it timeouts. I really would like to know if it’s possible to run this job with reloads.

try using (.*?) between title…

and, only get the first half a kb per site

make website pages more dynamic.


I want to make my website pages more dynamic.
Can I do this using:

$file=”articledetails.php”;
include(‘$file’);

You can also use like this: include(“$file”);

variables won’t be parsed between single quotes.

Code:

include($file);

if not statement code.


i m looking for a if not statement code.

is this an if not statement:

if!()
{
}

try this code

Code:

if(!file_exists("foobar"))
{
        mkdir("foobar");
}
Just move the ! inside the parentheses, like this
Code:
if(!)
{
}

use it

Code:

if (!isset($var)) { }

or

if (empty($var)) {}

or

if (!something) {}

yes ! shuld be infront and in parentheses. like
 
 
 if(!$var)
 
 {
 
 do something
 
 }

can not match h2o


I have match against works fine with mysql. However I can not match h2o. Is there anything special with this phrase?

By default MySQL full text searches are limited to phrases of four or more characters. If you have access to the MySQL configuration options for the server it can be changed. However in most shared hosting environments you will not be able to change it.

Include forum into main site


I want to include my forum into my main site,How can I do it?

Try Iframes and the <?php include(“forum.php”); ?> tags

I have tried Iframes and the <?php include(“forum.php”); ?> tags. Both work but the problems with the iframe is it only works by width=”” and height=”” but not =”100%”. The Include tag wont open in my mainsite but only links to the forum when you click on a topic or thread. What is the best solution so that the forum is in my mainsite and stays there once you click on a topic or thread??

No, any extension should work.

An include won’t work as everything probably has relative paths. A frame would just be stupid.

I think you should either do a redirect or put the entire forum up one dir. i.e. in the root

u can not redirect with the use of frame.

yes, You can do an html redirect with the <meta> tag or a php redirect with the header() function.

Grab A Bargain – A New Deal A For You


Want some discount coupons for a posh dinner, weekend breaks or theatre shows? Checkout a good daily deal website soon! Quite a good number of daily deal websites have started coming up across the internet these days, displaying a variety of daily deals and special offers. Those who are interested in them can start searching some of the biggest and most popular group purchasing platforms or social purchasing websites such as Groupon, LivingSocial and Wahanda, and see what each one is offering. Go through every individual deal carefully and once you’ve decided proceed, join-in and partake by logging in.

Most of the deal websites give prominence to the local businesses, yet you will also have options to search outside of your location. This means you have options to look for quality deals to give as gifts to friends who are staying in other areas, far away from your city.

One of the best aspects of daily deal websites is that a lot of people join together and combine their buying power, to get a particular item in a far cheaper rate than they would normally be offered. This help very individual in the deal, as they can save a huge amount of money from the purchase. A deal website coupon thus makes many things affordable, that wouldn’t otherwise be. Hurry up! Find some good group buying platforms soon and start checking out all the cheap deals that they display!

wanted php coders


Seeking for experienced php coders, we have multiple projects to work with and looking for long term business.

Please send us your details and what work you have done previously, also your capability to make custom applications.

Application need to have the following

Name
Email id
Previous project details
Availability
Cost structure ( per hour / per project )