j'ai eu déjà un problème résolu sur ce forum donc je continu pour voir si vous pouvez encore m'aider les pros du code PHP.
J'aimerais bien s'il vous plait que vous jetiez un coup d'oeil sur ce code.
il s'agit d'une page d'expédition de sms avec différente conditions.

Il y a un préformatage des numéros de téléphone que je voudrais changer. Les numéros de téléphones dans mon pays sont comme ceci :
07342819 ou encore 01524433 (indicatif +225).
Il y a nécessairement un 0 au début du numéro, ce que n'accepte pas ce code.
Le préformatage téléphonique de cette page PHP est celui de l'indonésie. j'aimerais le changer. Ou dois-je le faire ?
je vois un peu mais comme je suis nouveau en PHP, je ne veux pas faire de bêtises donc j'ai besoin de vos conseil éclairés.

Vous trouverez ci dessous le code en question.
Excusez moi pour la mauvaise traduction Indonésien/Anglais. je l'ai faites moi même sur toute l'application. Galère ....

Merci d'avance


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
if ($_COOKIE['SMS_Danta']==''){
echo ('<BODY ONLOAD="javascript:window.location=\'login.php?err=4\'">');
}else{
include_once "meta.header.php";
include_once "css.php";
$phone_num=$cfg['SMS']['country_header'].$_POST['number'];
$sms_text=$cfg['SMS']['sms_header'].$_POST['text'];
$allowed_text = 160 - strlen($cfg['SMS']['sms_header']);
//Cek nomor telepon
if (!is_numeric($_POST['number'])){
echo ('<TABLE WIDTH=90% class="title" ALIGN = "CENTER"><TR><TD class="title"><CENTER><B> MISTAKE PENGISTAN </B></CENTER></TD></TR></TABLE>');
echo ('<BR><BR>');
echo ('<CENTER><FONT COLOR="#FF0000">The phone number is wrong,<BR>The phone number must take the form of the figure.<BR>Clic link below to return <BR><BR></FONT><CENTER>');
echo ('<A HREF=./send.sms.php?number='.$_POST['number'].'&text='.$_POST['text'].'><< Return</A>');
 
}elseif (substr($_POST['number'], 0, 1)==0){
//Cek ada kosong
echo ('<TABLE WIDTH=90% class="title" ALIGN = "CENTER"><TR><TD class="title"><CENTER><B> MISTAKE PENGISIAN </B></CENTER></TD></TR></TABLE>');
echo ('<BR><BR>');
echo ('<CENTER><FONT COLOR="#FF0000">The phone number was preceeded with the figure 0,<BR>The figure 0 might not be written in the phone number.<BR>Clic link below to return <BR><BR></FONT><CENTER>');
echo ('<A HREF=./send.sms.php?number='.$_POST['number'].'&text='.$_POST['text'].'><< Return</A>');
 
 
}elseif (strlen($sms_text)>160){
//Cek panjang pesan
echo ('<TABLE WIDTH=90% class="title" ALIGN = "CENTER"><TR><TD class="title"><CENTER><B> MISTAKE PENGISIAN </B></CENTER></TD></TR></TABLE>');
echo ('<BR><BR>');
echo ('<CENTER><FONT COLOR="#FF0000">Ordered that will be sent too long,<BR>Message that will be sent might not more than '.$allowed_text.' character.<BR>Clic link below to return <BR><BR></FONT><CENTER>');
echo ('<A HREF=./send.sms.php?number='.$_POST['number'].'&text='.$_POST['text'].'><< Return</A>');
} else {
 
echo ('<CENTER><FONT COLOR=#FF0000>');
$OutSMS_serv_conn=mysql_connect($cfg['Servers']['host'],$cfg['Servers']['user'],$cfg['Servers']['password'])
or die("Fail to carry out the connection ..... <BR> Contact <a href=mailto:".$cfg['Servers']['admin_email']."> SMS Administrator (".$cfg['Servers']['admin_name'].")</a>.");
$OutSMS_db_conn=mysql_select_db($cfg['Servers']['database'])
or die("Database was not found");	
$OutSMS_str_query = "INSERT INTO outbox (number,text,insertdate) VALUES ('".$phone_num."','".$sms_text."',NOW())";
$OutSMS_query=mysql_query($OutSMS_str_query)
or die("The request could not be carried out");
echo ('</CENTER></FONT>');
 
echo ('<TABLE WIDTH=90% class="title" ALIGN = "CENTER"><TR><TD class="title"><CENTER><B> DALAM THE QUEUE </B></CENTER></TD></TR></TABLE>');
echo ('<BR><BR>');
echo ('<CENTER><FONT COLOR="#0000FF">Your message was put in the queue,<BR>Please see the status of sending SMS in SMS Manager<BR>You could head SMS Manager or went out with followed link below<BR><BR></FONT><CENTER>');
echo ('<A HREF=./main.php>SMS Manager</A> | <A HREF="./post.sms.php" onclick="javascript:window.close()">Close</A>');
}
echo ('<BR><BR>');
include_once "footer.php";
}	
?>