943,907 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 739
  • PHP RSS
Jul 16th, 2009
0

GET , POST and REQUET not working

Expand Post »
Hi ,

I installed apache,php, mysql ( https://help.ubuntu.com/community/ApacheMySQLPHP )

After installing when i submit the form i can't get the form values. all values r empty.

plz help me to resolve this problem?
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
arajapandi is offline Offline
7 posts
since Jan 2009
Jul 16th, 2009
0

Re: GET , POST and REQUET not working

You might want to show us some code, and use code tags when you do
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Jul 16th, 2009
0

Re: GET , POST and REQUET not working

Hi,

Thanks for your reply.
plz check the below simple code.. i can't get values from $_POST & $_REQUEST

PHP Syntax (Toggle Plain Text)
  1. <?php
  2.  
  3. print "<pre>";
  4. print_r($_POST);
  5. print_r($_REQUEST);
  6. print "</pre>";
  7.  
  8. print "<form action='' method='post'>
  9. <input type='text' name='inputname'>
  10. <input type='submit' name='test'>
  11. </form>";
Last edited by arajapandi; Jul 16th, 2009 at 11:53 pm.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
arajapandi is offline Offline
7 posts
since Jan 2009
Jul 17th, 2009
0

Re: GET , POST and REQUET not working

You need to insert url for form action.

php Syntax (Toggle Plain Text)
  1. <?php
  2.  
  3. print "<pre>";
  4. print_r($_POST);
  5. print_r($_REQUEST);
  6. print "</pre>";
  7.  
  8. print "<form action='<destination-url>.php' method='post'>
  9. <input type='text' name='inputname'>
  10. <input type='submit' name='test'>
  11. </form>";
  12. ?>
PoA
Reputation Points: 19
Solved Threads: 9
Posting Whiz in Training
PoA is offline Offline
234 posts
since Jul 2004
Jul 17th, 2009
0

Re: GET , POST and REQUET not working

Yes. i tried it too, but no luck.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
arajapandi is offline Offline
7 posts
since Jan 2009
Jul 17th, 2009
0

Re: GET , POST and REQUET not working

Copy the following code into the file called "sample.php" It should work.

php Syntax (Toggle Plain Text)
  1. <?php
  2.  
  3. print "<pre>";
  4. print_r($_POST);
  5. print_r($_REQUEST);
  6. print "</pre>";
  7.  
  8. print "<form action='sample.php' method='post'>
  9. <input type='text' name='inputname'>
  10. <input type='submit' name='test'>
  11. </form>";
  12. ?>
PoA
Reputation Points: 19
Solved Threads: 9
Posting Whiz in Training
PoA is offline Offline
234 posts
since Jul 2004
Jul 17th, 2009
0

Re: GET , POST and REQUET not working

here, try this sample...

********this is your index.php
html Syntax (Toggle Plain Text)
  1. <form action="welcome.php" method="post">
  2. Name: <input type="text" name="fname" />
  3. Age: <input type="text" name="age" />
  4. <input type="submit" />
  5. </form>


*******this one's your welcome.php
php Syntax (Toggle Plain Text)
  1. Welcome <?php echo $_POST["fname"]; ?>!<br />
  2. You are <?php echo $_POST["age"]; ?> years old.
  3.  
  4.  
  5. </form>
Last edited by peter_budo; Jul 17th, 2009 at 2:57 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 1
Junior Poster
xuexue is offline Offline
165 posts
since Jul 2009
Jul 18th, 2009
0

Re: GET , POST and REQUET not working

Thanks xuexue,PoA and ShawnCplus.

I think the problem was php/apache. i re-installed php and apache. now everything is working.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
arajapandi is offline Offline
7 posts
since Jan 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: adldap using php in linux machine
Next Thread in PHP Forum Timeline: Paging in array..!!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC