Looking for your reply
| From: | 200652800 at qu dot edu dot qa | Date: | Mon, 28 Mar 2011 16:50:26 +0000 |
| Subject: | Looking for your reply | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-10761@lists.php.net to get a copy of this message | ||
Hello
I'm a senior student in Qatar University, and I REALLY need your help. in our university we do
not have any php courses. So for me it's a new programming language. A part of my senior needs
to be programmed using php. I went through you tutorial and I really benefit from it.
But I'm no stuck in a part, and until now I can not figure out the solution.
Now what I need to do in php is to send an http request using the post method. in this request I
want to send a string variable. when I read your tutorial I found this code and I think that this
is the code that will send the variable from one php file to another one php file:
$r = new HttpRequest('http://localhost/form.php',
HttpRequest::METH_POST);
$r->addPostFields(array('TransferdWord' => $Message ));
try {
echo $r->send()->getBody();
} catch (HttpException $ex) {
echo $ex;
}
and this is the second php file that will receive the variable and print it.
<?php
$dbhost = 'localhost';
$dbuser = 'root';
print("welcome to this form");
$clientVariable=$_POST['box']; //to print out the data
print ($clientVariable);
?>
however, I'm not getting something in the second file.
Could you please tell me what is wrong with my codes ? please I really need your help.
Note: I'm using the wamp server to host my files.
Looking for your reply :(
Regards,
Nada