GET , POST and REQUET not working

Thread Solved

Join Date: Jan 2009
Posts: 6
Reputation: arajapandi is an unknown quantity at this point 
Solved Threads: 1
arajapandi arajapandi is offline Offline
Newbie Poster

GET , POST and REQUET not working

 
0
  #1
Jul 16th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,402
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: GET , POST and REQUET not working

 
0
  #2
Jul 16th, 2009
You might want to show us some code, and use code tags when you do
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 6
Reputation: arajapandi is an unknown quantity at this point 
Solved Threads: 1
arajapandi arajapandi is offline Offline
Newbie Poster

Re: GET , POST and REQUET not working

 
0
  #3
Jul 16th, 2009
Hi,

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

  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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: GET , POST and REQUET not working

 
0
  #4
Jul 17th, 2009
You need to insert url for form action.

  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. ?>
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 6
Reputation: arajapandi is an unknown quantity at this point 
Solved Threads: 1
arajapandi arajapandi is offline Offline
Newbie Poster

Re: GET , POST and REQUET not working

 
0
  #5
Jul 17th, 2009
Yes. i tried it too, but no luck.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: GET , POST and REQUET not working

 
0
  #6
Jul 17th, 2009
Copy the following code into the file called "sample.php" It should work.

  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. ?>
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 53
Reputation: xuexue is an unknown quantity at this point 
Solved Threads: 1
xuexue xuexue is offline Offline
Junior Poster in Training

Re: GET , POST and REQUET not working

 
0
  #7
Jul 17th, 2009
here, try this sample...

********this is your index.php
  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
  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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 6
Reputation: arajapandi is an unknown quantity at this point 
Solved Threads: 1
arajapandi arajapandi is offline Offline
Newbie Poster

Re: GET , POST and REQUET not working

 
0
  #8
Jul 18th, 2009
Thanks xuexue,PoA and ShawnCplus.

I think the problem was php/apache. i re-installed php and apache. now everything is working.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC