Parse error.... Помощ...

lekov90

Registered
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in D:\xampp\htdocs\25\modules\user\credits.php on line 49

ето тази грешка ми дава а това е файла....

Код:
<table width="270"  border="0" align="center" cellpadding="3" cellspacing="0">
<tr> 
<td height="10" align="center"> <TABLE align=center border=0 cellPadding=5 cellSpacing=1 width="250">
<TBODY>
<TR> 
<form name='form1' method='post' action=''>
<TD align=center class=txt_gray> <span class=normal_text_white><font face=tahoma>Account:
</font> </TD>
<TD width="100">
<input type='text' name='acc' >
</TD>
</TR>
<TR>
<TD align=center class=txt_gray> <span class=normal_text_white><font face=tahoma>Item:
</font> </TD>
<TD>
<select style='color: #000000;' id='clas' name='class'><optgroup label='Country'>
<option class=clchg value=bg>Bulgaria(1100 credits)</option>
<option class=clchg value=bg2>Bulgaria(2500 credits)</option>
<option class=clchg value=ro>Romania</option>
<option class=clchg value=pl>Poland</option>
<option class=clchg value=fl>Finland</option>
<option class=clchg value=cr>Czech Republic</option>
<option class=clchg value=uk>United Kingdom</option>
<option class=clchg value=es>Estonia</option>
<option class=clchg value=nt>Netherlands</option>
<option class=clchg value=lt>Lithuania</option>
</select><br />
</TD>
</TR>

</TBODY>
</TABLE></td>
</tr>
</form>
<? switch($_POST['class']){
			case 'bg': $_nm='1916'; $_credit='1100'; $_code='txt bgn'; $_cena='2.40 BGN.'; break; 
			case 'bg2': $_nm='1816'; $_credit='2500'; $_code='txt bgn2'; $_cena='4.80 BGN'; break;  
			case 'ro': $_nm='1314'; $_credit='2000'; $_code='txt get'; $_cena='2.00 EUR'; break;  
			case 'pl': $_nm='79550'; $_credit='1500'; $_code='txt get'; $_cena='10.98 PLN'; break;  
			case 'fl': $_nm='17211'; $_credit='1400'; $_code='txt13 get'; $_cena='1.30 EUR'; break;  
			case 'cr': $_nm='900 11 30'; $_credit='1700'; $_code='txt get'; $_cena='30,00 CZK'; break;  
			case 'uk': $_nm='88999'; $_credit='2300'; $_code='for sms'; $_cena='1,50 GBP'; break;  
			case 'es': $_nm='15330'; $_credit='2200'; $_code='txt get'; $_cena='15,00 EEK'; break;  
			case 'nt': $_nm='3555'; $_credit='1200'; $_code='dag get'; $_cena='1.10 EUR'; break;  
			case 'lt': $_nm='1337'; $_credit='1800'; $_code='pay get'; $_cena='5,00 LTL'; break; 
}
?>
<? echo "Send SMS on number: $_nm with text: pay $_code $_POST['name'] and you will get $_credit credits.The SMS price is $_cena" ?><br><br>
</td>
</TR>
</table>
 
Код:
	<table width="270"  border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td height="10" align="center"> <TABLE align=center border=0 cellPadding=5 cellSpacing=1 width="250">
<TBODY>
<TR>
<form name='form1' method='post' action=''>
<TD align=center class=txt_gray> <span class=normal_text_white><font face=tahoma>Account:
</font> </TD>
<TD width="100">
<input type='text' name='acc' >
</TD>
</TR>
<TR>
<TD align=center class=txt_gray> <span class=normal_text_white><font face=tahoma>Item:
</font> </TD>
<TD>
<select style='color: #000000;' id='clas' name='class'><optgroup label='Country'>
<option class=clchg value=bg>Bulgaria(1100 credits)</option>
<option class=clchg value=bg2>Bulgaria(2500 credits)</option>
<option class=clchg value=ro>Romania</option>
<option class=clchg value=pl>Poland</option>
<option class=clchg value=fl>Finland</option>
<option class=clchg value=cr>Czech Republic</option>
<option class=clchg value=uk>United Kingdom</option>
<option class=clchg value=es>Estonia</option>
<option class=clchg value=nt>Netherlands</option>
<option class=clchg value=lt>Lithuania</option>
</select><br />
</TD>
</TR>

</TBODY>
</TABLE></td>
</tr>
</form>
<? switch($_POST['class']){
         case 'bg': $_nm='1916'; $_credit='1100'; $_code='txt bgn'; $_cena='2.40 BGN.'; break;
         case 'bg2': $_nm='1816'; $_credit='2500'; $_code='txt bgn2'; $_cena='4.80 BGN'; break; 
         case 'ro': $_nm='1314'; $_credit='2000'; $_code='txt get'; $_cena='2.00 EUR'; break; 
         case 'pl': $_nm='79550'; $_credit='1500'; $_code='txt get'; $_cena='10.98 PLN'; break; 
         case 'fl': $_nm='17211'; $_credit='1400'; $_code='txt13 get'; $_cena='1.30 EUR'; break; 
         case 'cr': $_nm='900 11 30'; $_credit='1700'; $_code='txt get'; $_cena='30,00 CZK'; break; 
         case 'uk': $_nm='88999'; $_credit='2300'; $_code='for sms'; $_cena='1,50 GBP'; break; 
         case 'es': $_nm='15330'; $_credit='2200'; $_code='txt get'; $_cena='15,00 EEK'; break; 
         case 'nt': $_nm='3555'; $_credit='1200'; $_code='dag get'; $_cena='1.10 EUR'; break; 
         case 'lt': $_nm='1337'; $_credit='1800'; $_code='pay get'; $_cena='5,00 LTL'; break;
}
?>
<? echo "Send SMS on number: $_nm with text: pay $_code $_POST[name] and you will get $_credit credits.The SMS price is $_cena"; ?><br><br>
</td>
</TR>
</table>
 
<table width="270" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td height="10" align="center"> <table align="center" border="0" cellpadding="5" cellspacing="1" width="250">
<tbody>
<tr>
<form name="form1" method="post" action="">
<td align="center" class="txt_gray"> <span class="normal_text_white"><font face="tahoma">Account:
</font> </td>
<td width="100">
<input type="text" name="acc">
</td>
</tr>
<tr>
<td align="center" class="txt_gray"> <span class="normal_text_white"><font face="tahoma">Item:
</font> </td>
<td>
<select style="color: #000000;" id="clas" name="class"><optgroup label="Country">
<option class="clchg" value="bg">Bulgaria(1100 credits)</option>
<option class="clchg" value="bg2">Bulgaria(2500 credits)</option>
<option class="clchg" value="ro">Romania</option>
<option class="clchg" value="pl">Poland</option>
<option class="clchg" value="fl">Finland</option>
<option class="clchg" value="cr">Czech Republic</option>
<option class="clchg" value="uk">United Kingdom</option>
<option class="clchg" value="es">Estonia</option>
<option class="clchg" value="nt">Netherlands</option>
<option class="clchg" value="lt">Lithuania</option>
</select><br />
<input type="submit" name="submit" value="Send">
</td>
</tr>
</tbody>
</table></td>
</tr>
</form>
<?php
if (isset($_POST['submit'])) {

switch($_POST['class']) {
case 'bg': $_nm='1916'; $_credit='1100'; $_code='txt bgn'; $_cena='2.40 BGN.'; break;
case 'bg2': $_nm='1816'; $_credit='2500'; $_code='txt bgn2'; $_cena='4.80 BGN'; break;
case 'ro': $_nm='1314'; $_credit='2000'; $_code='txt get'; $_cena='2.00 EUR'; break;
case 'pl': $_nm='79550'; $_credit='1500'; $_code='txt get'; $_cena='10.98 PLN'; break;
case 'fl': $_nm='17211'; $_credit='1400'; $_code='txt13 get'; $_cena='1.30 EUR'; break;
case 'cr': $_nm='900 11 30'; $_credit='1700'; $_code='txt get'; $_cena='30,00 CZK'; break;
case 'uk': $_nm='88999'; $_credit='2300'; $_code='for sms'; $_cena='1,50 GBP'; break;
case 'es': $_nm='15330'; $_credit='2200'; $_code='txt get'; $_cena='15,00 EEK'; break;
case 'nt': $_nm='3555'; $_credit='1200'; $_code='dag get'; $_cena='1.10 EUR'; break;
case 'lt': $_nm='1337'; $_credit='1800'; $_code='pay get'; $_cena='5,00 LTL'; break;
}
echo "Send SMS on number: $_nm with text: pay $_code {$_POST['name']} and you will get $_credit credits.The SMS price is $_cena";
}
?><br><br>
</td>
</tr>
</table>
Кода ти е правилен иначе беше изпуснал две скоби {} преди и след $_POST['name']
 
леле благодаря много а само да попитам има ли някакъв начин да се направи без бутон със самото избиране на опцията и да показва резултата
 
lekov90 каза:
леле благодаря много а само да попитам има ли някакъв начин да се направи без бутон със самото избиране на опцията и да показва резултата

Ajax
 

Back
Горе