phpnewbie112 Posted August 8, 2008 Share Posted August 8, 2008 I had a problem with using the $_POST['text']; so I searched around and found file_get_contents('php://input',); this command is outputting all the form fields, how can I choose to output only the "text" field? thanks Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/ Share on other sites More sharing options...
MasterACE14 Posted August 8, 2008 Share Posted August 8, 2008 I believe it would probably be easier to fix your code where you are having the problem with the $_POST['text'] rather then getting the POST another way. Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611359 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 I have an output problem with the POST for example: "Alert" is returning \"Alert\" and the form enctype is "application/x-www-form-urlencoded" Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611364 Share on other sites More sharing options...
MasterACE14 Posted August 8, 2008 Share Posted August 8, 2008 what is the $_POST being used for? because if its returning... \"Alert\" you can use stripslashes(); Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611370 Share on other sites More sharing options...
True`Logic Posted August 8, 2008 Share Posted August 8, 2008 try stripslashes($_POST['text']); for more information search http://php.net for stripslashes Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611371 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 It's not only a matter of slashes also for example the new line is returning an _ Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611377 Share on other sites More sharing options...
MasterACE14 Posted August 8, 2008 Share Posted August 8, 2008 you can use str_replace(); for that Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611382 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 Even the str_replace(); is not doing the right job. Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611383 Share on other sites More sharing options...
MasterACE14 Posted August 8, 2008 Share Posted August 8, 2008 post some code lol Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611396 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 yes lol Form: <form action="post.php" name="form1" enctype="application/x-www-form-urlencoded" method="post" > <p>To: <input type="text" name="to" size="20"></p> <p>Text:<textarea rows="2" name="text" cols="20"></textarea></p> <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p> </form> and the post.php file <? $url = "www.clickatell.com/api....the clickatell api link here"; $to = $_POST['to']); $text = $_POST['text']); if ( (!empty($to)) && (!empty($text)) ) { $ret = file($url); $send = split(":",$ret[0]); if ($send[0] == "OK") { echo "Good"; } else { echo "Rejected"; } exit(); } ?> no correct text is received on mobiles Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611412 Share on other sites More sharing options...
MasterACE14 Posted August 8, 2008 Share Posted August 8, 2008 see what happens if you remove enctype="application/x-www-form-urlencoded" from the form. Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611415 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 the enctype="application/x-www-form-urlencoded" was not in the form, I added to see if it fix the problem but did not Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611417 Share on other sites More sharing options...
MasterACE14 Posted August 8, 2008 Share Posted August 8, 2008 ok, going back to your question, whats do you want to happen? and what is currently happening... ? Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611422 Share on other sites More sharing options...
Andy-H Posted August 8, 2008 Share Posted August 8, 2008 Can you show us the code where you display the data? It cant be raw postdata if its adding slashes to quotation marks and stuff. Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611428 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 very simple, this code is a contact form to send instant short messages to my mobile. this is for example a text inside a form and how it appears on mobile phone Form Text: It's a first test It's a 2nd [test] Mobile: It\'s a first test__It\'s a 2nd [test Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611432 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 Yes Andy-H it is not raw data, I wont to know how to post it as RAW data for the text field only Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611434 Share on other sites More sharing options...
Andy-H Posted August 8, 2008 Share Posted August 8, 2008 Is the data displayed on screen or inserted into a database? Or does it simply just send to the mobile? Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611459 Share on other sites More sharing options...
phpnewbie112 Posted August 8, 2008 Author Share Posted August 8, 2008 on screen and mobile. Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611469 Share on other sites More sharing options...
Andy-H Posted August 8, 2008 Share Posted August 8, 2008 $to = $_POST['to']); $text = $_POST['text']); I duno what the problem is but I just noticed that in your code... Quote Link to comment https://forums.phpfreaks.com/topic/118738-post-raw-data/#findComment-611518 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.