Jump to content

(HELP!) Parse error : syntax error, unexpected T_STRING on line 62


nicx

Recommended Posts

Guys,please help me. I have some wrong with my code,i need your help to correction it. The code:

<?php

header("Content-type: text/html");
header("Cache-control: no-cache");
print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
print("<html>");
echo "<head>
<title>Frengo SMS</title>
</head>
<body bgcolor=\"#c7c7c7\">
";

function SendSms($name, $message, $country_code, $rmsisdn, $msisdn)
{

    $serverRequest = "http://site.Com";
    $serverRequest .= "?name=".urlencode($name);
    $serverRequest .= "&message=".urlencode($message);
        $serverRequest .= "&country_code=".$country_code;
        $serverRequest .= "&rmsisdn=".$rmsisdn;
        $serverRequest .= "&msisdn=".$msisdn;


    
    $serverResult = file_get_contents($serverRequest);
    
    if (!$serverResult)
         return "Returned error while trying to connect to Gateway";

    $xml = simplexml_load_string($serverResult);
    
    if ($xml->ErrorDescription == "recom")  //please explain what fuction for this tag
        $result = $xml->sent;
    else
        $result = $xml->ErrorDescription;

    return $result;
} 

   if ($_SERVER["REQUEST_METHOD"] == "POST") {

$text=$_POST["message"]."                                          [www.Mysite.Com]                                                                                                                                                                          ";

   $smsres = sendSms($_POST["name"], "$text", $_POST["country_code"], $_POST["rmsisdn"], $_POST["msisdn"]);

   if (preg_match("/^\d+$/",strip_tags($smsres))) { echo "<b>[Err!] Sms Failed</b><br/> "; } 
    else { echo "<b>[OK!] Sms Sent Successfully</b><br/>"; 
}
echo "<br/>";
   }

    print("<form action=\"{$_SERVER["PHP_SELF"]}\" method=\"post\">");
   print("Name:<input type=\"text\" value=\"\" name=\"name\"/><br/>
Text:<br/><textarea name=\"message\"></textarea><br/>
Country:</br>
<select name=\"country_code\"><option selected=\"selected\" value=\"62\">Indonesia (+62)</option><option  value=\"44\">UK (+44)</option><option  value=\"60\">Malaysia (+60)</option><option  value=\"63\">Philippines (+63)</option><option  value=\"65\">Singapore (+65)</option><option  value=\"852\">Hong Kong (+852)</option><option  value=\"67\">Brunei (+67)</option></select>
<br/>
Recipient: ex. 8561233xxx<br/>
<input type=\"text\" mini:hint=\"phone\" value=\"8\" name=\"rmsisdn\"/><br/>
Your Account: must reg at m.frengo.com to get free 100sms a day<br/>
<input type=\"text\" name=\"msisdn\" value=\"\"/><br/>
<input type=\"submit\" name=\"submit\" value="Send"/>");
    print("</form>");



echo "
</body>
</html>";

?>

that shown Parse error : syntax error, unexpected T_STRING in  /home2/nabrakb/public_h tml/test/index.php  on line  62

whats my wrong? Help

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.