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();

Features of H-sphere control panel


cpwebhosting.net provides H-sphere control panel with their all web hosting plans. can any one tell me the features of H-sphere control panel.

H-Sphere is designed for both Linux and Windows platforms. Moreover, resellers can set up plans for both Linux and Windows and administer sites on different servers from the same control panel. The control panel, actually a separate server, also provides administrative access to the integrated helpdesk.

In my opinion beginning webmasters may find H-Sphere too complicated for their needs. More advanced users, however, appreciate the features and control that H-Sphere offers the end user. A key feature is the ability to have control over separate domains with multi-domain hosting.
From the reseller’s point of view, H-Sphere has a higher learning curve than most other control panels because of its numerous features. For example, when setting up a new plan, the administrator has two pages of features to choose from, including setup and monthly pricing for optional services.
H-Sphere comes with the website builder SiteStudio, which guides users through a variety of style choices and stores content separately from the layout. No HTML or FTP knowledge is required.

H-Sphere is a scalable multiserver web hosting solution. It has many advanced features and a sophisticated billing system to automate and improve your web hosting tasks. H-Sphere was designed to work on many servers and can be scaled by adding more web, mail, database, and DNS servers without any downtime. It provides a simple, easy-to-use web interface that can be maintained from any computer with internet connection. H-Sphere was written in Java and works with any SQL-compliant database. It runs only industry standard software.


H-Sphere offers the highest level of web-hosting operations by providing:

* Complete automation for Linux, FreeBSD and Windows platforms
* Billing solution
* Over 20 Supported Merchant Gateways
* Flexibility at all levels
* Private label resellers
* User-friendly control panel
* Comprehensive set of hosting features

H-Sphere is a comprehensive hosting automation system that allows you to provide a heterogeneous operating system environment to your customers across multiple servers. It can manage hosting servers located in various data centers.

H-Sphere can have a multiple server layout, called a cluster. The main server in the cluster is the actual H-Sphere Control Panel, a web application with graphical interface, which centralizes all hosting management tasks, controls all hosting servers and services, manages users, domains, events, and processes. The Control panel consists of many subsystems, the major of them being the following:

* DNS Management
* Server Management
* User Signup
* Billing & Plan Management
* Merchant Gateway Management
* User/Account/Domain Management
* Resellers
* Automatic Domain Registration
* SSL
* Support Center
* Look And Feel Management

Through H-Sphere web interface, you can configure and manage these and other subsystems, other servers, user accounts and domains, etc. All system data, such as billing, domain, and other info, is stored in the Postgres system database.

DNS is managed by H-Sphere.

A typical H-Sphere setup requires one service domain name (example.com) which is used as:
– the control panel domain (cp.example.com:8080 or cp.example.com:8443),
– web server domain (web1.example.com, web2.example.com),
– name server domain (ns1.example.com, ns2.example.com), etc.
It can also be used for third level hosting and instant access domain aliases, as well as to host the corporate (promotional) website.

The most typical configuration is to have two DNS servers, each on a separate box. In case of one-server installations, you can put two DNS servers on one box. By default, H-Sphere randomly assigns primary and secondary DNS servers for each domain to balance server load. If you want, you can assign master and slave roles to DNS logical servers.
H-Sphere creates a zone file for each domain name on both name servers, and allows end users to create custom DNS records through a web interface.

H-Sphere offers fully automated user signup through the signup wizard. Depending on the billing type and signup settings, accounts may not be created until moderated by administrator. For instance, an account may not be immediately created because it was blacklisted by Signup Guard or because the user doesn’t pay with a credit card.
H-Sphere can work with credit card processors and web based payment systems to collect payments from customers.

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
 
 }

administer H-Sphere


What level of Unix or Win2000 knowledge do I need to administer H-Sphere?

For everyday tasks, no UNIX or Win2000 knowledge is required, H-Sphere offers a comprehensive web interface. To prepare servers for installations and resolve technical issues, you need some knowledge of these operating systems or help of a system administrator.

How many user accounts does H-Sphere support?


I have purchase a Reseller web hosting account from cpwebhosting.net. can u tell me How many user accounts does H-Sphere support?
H-Sphere should be able to handle hundreds of thousands and even millions of accounts. However, too many resellers may generate high control panel load.
How many accounts can a stand-alone H-Sphere web server handle?

cpwebhosting.net have customers with stand-alone web servers hosting thousands of accounts. However, the server will not be able to service as many users if they are actively using cgi or other scripts, if they have high hit rates, or if you host too many resellers.

What are the limitations to H-Sphere?
There are no hard limitations that we are aware of. The software scales well to the physical limits of the hardware.
 

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.