customize currency and date settings


hi,
i m a Reseller web host and i want to customize currency settings and date representation for my clients.

Advance thanks for any help

Regional Settings is an option that allows you to customize currency settings and date representation.

how can we change the default currency settings and date representation

To set custom regional settings:

  1. Select Regional Options in the Look and Feel menu.
  2. On the page that appears, enter preferred locale settings
  3. Click Submit and take a look at the values in the Appearance samples box to see how your changes will affect monetary amounts throughout the control panel.

Your regional settings will affect control panels of your direct end users. Resellers can set their own currency in their admin control panels.

discover the number of elements in an array


I can discover the number of elements in an array, so should I use a for statement to loop through an array?

You should be cautious of this technique. If you are not absolutely sure that the array you are reading is indexed by consecutively numbered keys, you might get unexpected results.

changing file of specific file’s web address


hi,
i want to change the file that appears when a user enters a specific file’s web address.how can i do it

Redirect URL is the option that allows you to change the file that appears when a user enters a specific file’s web address.

how can we create a redirect in our web hosting account

with Use of this feature u can redirect your visitors from one web page to another or even to a different website.

To create a redirect in a Unix-based account, do the following:

  1. On the control panel home page, click Web Options. Select the domain if you have more than one.
  2. On the Web Service page, scroll down to find the Redirect option and click the Add icon next to it.
  3. Agree with the charges.
  4. On the page that appears, create the redirect rule.

If you leave the Redirect from field empty, visitors will be redirected from any location in the site.

script that redirect pages


hello,

looking for php form script with redirect pages features.
also need to capture data into either txt file or mysql database.

when user input info, like name, email, address, etc..
and several options like link1, link2, link3..
and click submit.

script need to capture info like name, email, address into mysql database
and depends on options that user choose,
if link1, need to redirect to url1
if link2, need to redirect to url2
if link3, need to redirect to url3.

anybody know this kind a script?

try this script

Code:
<?php
$add=$_POST['add'];
$name=$_POST['name'];
$redirect=$_POST['redirect'];
//connect to db first - this is a sample query
mysql_query("insert into users (`id`,`name`) values ('','$name');");
if($redirect)
{
header('Location: '.$redirect.'');
}
?>
<form name="form3" action="2.php" method="post">
<table width="95%"  border="0">
<tr>
<td width="20%">Your Name </td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td><span>Redir</span> </td>
<td><select name=redirect>
<option value="http://www.msn.com" selected>Msn</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.yahoo.com">Yahoo</option>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="Submit" />
<input type="hidden" name="add" value="1">
</td>
</tr>
</table>
</form>

want to escape ‘ and “


I want to escape ‘ and “. I can’t figure out how to do this.
I guess the easiest way is to just add a to them, but how to do that?
BTW this is to stop some innocent SQL injection on my site.

You can use the function addslashes() to escape all of the ” and ‘ characters.

The proper way to prevent SQL injection is to use parameterised queries.

also try this

Code:
<?php
$value = stripslashes($value);
// to strip the slash.
$value = mysql_real_escape_string($value);
// to add slash.
?>

streaming of audio, video and rich media


hi,
i have a web hosting account with H-Sphere. can i do streaming of audio, video and rich media files on it.
Real Server is a software program from RealNetworks that allows the streaming of audio, video and rich media files. H-Sphere supports all versions of RealServer that have ISPHosting support.

PHP code help


I use:
$today = date(“F – j – Y”);

however I want to add a certain number of days to it.
Like: $nextweek = 7

How can I add those 7 days to the current date? and still keep it in the same format.

this function u can use with MySQL database

Code:
function dt_only_date_minus_x_days( $x ) {
  return date("Y-m-d", time( ) - ( $x * 24 * 60 * 60 ) );
}

function dt_minus_x_days( $x ) {
  return date("Y-m-d G:i:s", time( ) - ( $x * 24 * 60 * 60 ) );
}

function dt_now( ) {
  return dt_minus_x_days( 0 );
}

function dt_yesterday( ) {
  return dt_minus_x_days( 1 );
}

Try his one
Code:
$time = time() + (7 * 24 * 60 * 60);
print $today = date("F - j - Y");              # today
print $today = date("F - j - Y", $time);    # next week

I think this will be useful for u
Code:
date("F - j - Y", strtotime('+1 week'));

End users traffic graphs


Is there is any tool, which displays traffic graphs to end users?

MRTG (The Multi Router Traffic Grapher) is a logical server used for dedicated hosting. It receives servers’ traffic data from network switches and displays traffic graphs to end users. This software is installed from hsphere-mrtg-rrd system package in H-Sphere 2.5+.

how to add MRTG Logical Servers

u can add MRTG service when u have installed H-Sphere 2.5 and higher. If you haven’t done it with the installation or if you installed H-Sphere by updating from a version under H-Sphere 2.5 (which didn’t have MRTG service yet), you need to add this service later. This procedure will result in installing the hsphere-mrtg-rrd system package on a target H-Sphere box, and MRTG logical server will appear in the H-Sphere interface (in the E. Manager -> L. Servers menu). If you plan that your resellers lease their own dedicated servers, besides the ones that belong to you, and that servers’ traffic data is displayed properly to their end users, make sure to add a Service IP to this server.

set up and alter merchant gateways


hi,
i want to set up and alter merchant gateways, how can i do it?

Merchant Gateway Manager is a configurable H-Sphere add-on that allows you to set up and alter merchant gateways, the media for conducting transactions with online credit card processing centers.

how can we set up merchant gateways?

Merchant Gateway Manager allows you to setup different merchant gateway accounts for different types of credit cards (like VISA, MasterCard, Discover, American Express). In this way you can maximize your profits by processing every type of credit card with the gateway that offers the lowest rate for this type of card.

Before configuring a merchant gateway, register an account with a supported merchant gateway.

Setting Up Merchant Gateways

Once you have registered an account with a credit card processing center, you can set up a merchant gateway to your H-Sphere configuration

  1. Select Merchant Gateway in the Settings menu
  2. A page will appear If you need to test H-Sphere billing without making real charges, select Dummy Gateway in the Add new gateway box and use it in the subsequent configuration steps.

can we edit merchant gateway settings and how?

yes u can edit merchant gateway settings

for editing merchant gateway setting, do the following:

  1. In the Edit Gateway box choose necessary merchant gateway from the drop-down box.
  2. Click the Edit button. On the form that appears you can make necessary changes.
  3. Click the Submit Query button to save changes.

interface the program with the Scanner


Hi all,

I want to include a feature in a program in php whereby we can import images automatically from a document placed in a “Scanner”.

How can I interface the program with the Scanner.

Any idea

So just to be absolutely clear, this is a ‘web app’ you want to do, right? If so, it can’t be done by PHP alone. In this instance, the PHP is a server side application that has no access to the client, basically.

I would guess for this scenario, you’re going to have to look at something like a Java applet or something.