tags:

views:

61

answers:

2

I had a textarea, when i post that content in textarea, I only get only first word before a space is given. For example if my value in textarea is 'He is mad man', i get only 'He'.

plz Help me to sort out this problem;

Code:

<form name="SendSMS" method="post" action="admin_main.php">
                <div class="reg_item">Category </div>
                <div class="reg_item">
                    <select name="cat" class="reg_combo" class="tboxstyle">
                        <option value="car" class="tboxstyle">Carrer</option>
                        <option value="tho" class="tboxstyle">Thoughts</option>
                        <option value="jok" class="tboxstyle">Jokes</option>
                        <option value="hea" class="tboxstyle">Health</option>
                     </select>
                </div><br />


                <div class="reg_item">Message </div>
                <div class="reg_item"><input type="text" name="message" class="tboxstyle"></input></div><br />



                 <?
                            if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
                            {

                            $msms=new sms();
          $msms->sendsms();


                            }

                         ?>


                <div class="reg_item"><input type="submit" name="register" value="Send >>" /></div>
                </form>

function:

function sendsms()
     { 
     try
      {

                                $cat              =$_POST[cat];
       $message   =$_POST[message];
                                $link="http://www.aswinanand.com/sendsms.php?uid=9488446874&amp;pwd=sivad&amp;phone=9952880550&amp;msg=dg";
       $table="";

       if($cat=="car")
       {
         $table=="carrer_memb";
       }
       elseif($cat=="tho")
       {
        $table=="thoughts_memb";
       }
       elseif($cat=="jok")
       {
        $table=="jokes_memb";
       }
       elseif($cat=="hea")
       {
        $table=="health_memb";
       }



       $result = mysql_query("SELECT mobile FROM carrer_memb");

                                while($row = mysql_fetch_array($result))
                                {
                                     echo $message;
                                   $link="http://www.aswinanand.com/sendsms.php?uid=9488486874&amp;pwd=sivakasi&amp;phone=".$row['mobile']."&amp;msg=".$message;
                                   $contents = file_get_contents($link);
                                   echo $contents;
                                   //header("Location: http://www.aswinanand.com/sendsms.php?uid=9488486874&amp;pwd=sivakasi&amp;phone=".$row['mobile']."&amp;msg=".$message);


                                }



      }
     catch(Exception $e)
      {
       echo 'Caught exception: ',  $e->getMessage(), "\n";
      }
     }








}
A: 

Your browser is 99.99% likely to be correctly POSTing the entire contents (use a firefox extension like Firebug or LiveHTTPHeaders to be certain). The problem is almost certainly in your server-side code that is parsing the HTTP request. Any chance you could post that and explain a little bit more about your environment?

Nick Bastin
+5  A: 

You have to apply urlencode function to all values in link string:

$params = array(
    'uid'  =>urlencode($uid),
    'pwd'  =>urlencode($pwd),
    'phone'=>urlencode($row['mobile']),
    'msg'  =>urlencode($message)
);
$link= 'http://www.aswinanand.com/sendsms.php?' . http_build_query($params)

P.S. change your password, and never post your username and password online

Nazariy
You typed my answer faster than I did. :)
Muxecoid
Thanks its working fine
Rajasekar
Thats wrong username, password mate. LOL
Rajasekar