Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
zubby is on a distinguished road
 
Posts: 29
Join Date: Oct 2008
Default Help With one myprofile.php - 11-04-2008, 05:13 PM

Hi. I am having much trouble with a code.
I have a form where you update your profile. But is asking me to enter the phone, but at registration I did not ask the phone numbers.

Please big help. Thank you.

2 files:

1 - myprofile.php wich has this... refering to my problem

Code:
$country=$row[country];
$code=$row[pin_code];
//$primary2=$row[home_phone];
$primary=explode("-",$row[home_phone]);
$primary1=$primary[0];
$primary2=$primary[1];
$primary=$primary[2];
/*$pri_count=strlen($primary2);
$primary1=substr($primary2, 0, 3); 
$primary=substr($primary2, 3, $pri_count); */
//$secondary2=$row[work_phone];
$secondary_phone=explode("-",$row[work_phone]);
$secondary1=$secondary_phone[0];
$secondary=$secondary_phone[1];
$zipcode=$row[pin_code];
$country=$row[country];
/*$sec_count=strlen($secondary2);
$secondary1=substr($secondary2, 0, 3); 
$secondary=substr($secondary2, 3,$sec_count); */
$email=$row[email];

...

$primary=$_POST[txtprimary];
$primary1=$_POST[txtprimary1];
$primary2=$_POST[txtprimary2];
$secondary=$_POST[txtsecondary];
$secondary1=$_POST[txtsecondary1];

...

 if(empty($primary))
   {
     $err_primary="please enter info";
	 $err_flag=1;
   }
   if((strlen($primary)<6) || !is_numeric($primary))
   {
    $err_primary="Phoneno incorect";
    $err_flag=1;
	}
	 if(empty($primary1))
   {
     $err_primary="please enter info";
	   $err_flag=1;
   }
   if((strlen($primary1)<2) || !is_numeric($primary1))
   {
    $err_primary="Phoneno  primar incorect";
    $err_flag=1;
	}
	 if(empty($primary2))
   {
     $err_primary="please enter info";
	   $err_flag=1;
   }
   if((strlen($primary2)<2) || !is_numeric($primary2))
   {
    $err_primary="Phoneno primar incorect";
    $err_flag=1;
	}
    if(empty($secondary))
   {
    $err_secondary="please enter info";
    $err_flag=1;
	}
    if(strlen($secondary)<7 || !is_numeric($secondary))
	{
      $err_secondary="Secundar Phoneno not valid";
	  $err_flag=1;
	}
	if(empty($secondary1))
   {
    $err_secondary="please enter info";
    $err_flag=1;
	}
    if(strlen($secondary1)<3 || !is_numeric($secondary1))
	{
      $err_secondary="Secundar Phoneno  not valid";
	  $err_flag=1;

...
   $sql.="city='$city',state='$state',country='$country',pin_code='$zipcode',home_phone='$primary',";
   $sql.=" work_phone='$secondary',email='$reemail',html_profile ='$html_profile' where user_id=".$_SESSION['userid'];

..
and

myprofile.tpl

Quote:

<? if(!empty($err_primary))

{

?>

<tr><td>&nbsp;</td><td class="detail9txtnormal"><a href="myprofile.php#txtprimary" class="header_text2">

Telefon fix</a> - <?= $err_primary; ?></td></tr>

<?

}

?>

<? if(!empty($err_secondary))

{

?>

<tr><td>&nbsp;</td><td class="detail9txtnormal"><a href="myprofile.php#txtsecondary" class="header_text2">

mobil phone</a> - <?= $err_secondary; ?></td></tr>

<?

}

?>

.... <tr><td class="detail9txt">

<!-- <? if(!empty($err_primary))

{

?>

<img src="http://www.000webhost.com/forum/images/warning_9x10.gif">&nbsp;<font color=red><?= $err_primary ?></font>

<br>

<b><font color="red" size="2">home phone</font></b>

<?

}

else

{

?> -->

<b><font size="2">home phone</font></b>

<!-- <?

}

?> -->

</td>

<td class="detail9txt">

<!-- <? if(!empty($err_secondary))

{?>

<img src="http://www.000webhost.com/forum/images/warning_9x10.gif">&nbsp;<font color=red><?= $err_secondary ; ?></font>

<br>

<b><font size=2 color=red>mobile phone</font></b>

<?

}

else

{

?> -->

<b><font size=2>mobile phone</font></b>

<!-- <?

}

?> -->

</td>

</tr>

<tr align="left"><td>

<input type="text" name="txtprimary" class="txtsmall" value="<?=$primary?>" maxlength="10" size="15" onBlur="numchk(this);" onKeyPress="numchk(this);" onKeyDown="numchk(this);" onKeyUp="numchk(this);" /></td>

<td>

<input type="text" name="txtsecondary" class="txtsmall" value="<?= $secondary; ?>" maxlength="10" size="15">

</td></tr>

Last edited by zubby : 11-04-2008 at 05:22 PM.
Reply With Quote
(#2 (permalink))
Old
Junior Member
zubby is on a distinguished road
 
Posts: 29
Join Date: Oct 2008
Default 11-04-2008, 05:18 PM

i made at phone primary instead of 3 boxes only one. and secondary only one box, ten numbers only.

how to make so it not asking for phone number ?

I did in tpl and is still error...

help apreciated.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
vBulletin Skin developed by: vBStyles.com