Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
POST not working in apache2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
WhiskeyJack
n00b
n00b


Joined: 02 Jul 2004
Posts: 6

PostPosted: Fri Jul 02, 2004 7:27 pm    Post subject: POST not working in apache2 Reply with quote

I am running an apache2 server and I have some PHP/mysql pages that are using POST but the POST does not seem to be working.
My phpinfo() does not have any mention of POST or REQUEST.

Does anyone have any ideas what could be wrong?
Back to top
View user's profile Send private message
Lajasha
Veteran
Veteran


Joined: 17 Mar 2004
Posts: 1040
Location: Vibe Central

PostPosted: Fri Jul 02, 2004 7:35 pm    Post subject: Reply with quote

Can you give us a little detail as to why you do not think it is working? A snip of your php code would help too. Does the GET work?
_________________
Come and play in my land
Back to top
View user's profile Send private message
WhiskeyJack
n00b
n00b


Joined: 02 Jul 2004
Posts: 6

PostPosted: Fri Jul 02, 2004 7:43 pm    Post subject: Reply with quote

This is the code. Sorry bout the numbers.

Code:

  1 <html>
      2
      3 <?php
      4     require_once("functions.php");
      5
      6     if ($submit) {
      7         echo "Submitted";
      8         addAuthor();
      9     }
     10     else
     11     {
     12 ?>
     13     <form method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
     14     Name :         <input type="Text" name="name">
     15     Description :  <input type="Text" name="description">
     16     Homepage :     <input type="Text" name="homepage">
     17     <input type="Submit" name="submit" value="Add Author">
     18     </form>
     19 <?
     20 }
     21 ?>
     22
     23 </html>


When the code is executed the a form is shown but when the submit button is pressed it doesnt enter the first part of the if statement

And I the GET's dont work either
Back to top
View user's profile Send private message
Lajasha
Veteran
Veteran


Joined: 17 Mar 2004
Posts: 1040
Location: Vibe Central

PostPosted: Fri Jul 02, 2004 7:51 pm    Post subject: Reply with quote

give this a whirl:

Code:
<html>
<body>
<?PHP
  if(isset($_POST['id'])){
    echo $_POST['id'];
  }else{
?>
<form method="POST">
<input type="text" name="id">
<input type="submit">
</form>
<?
  }
?>
</body>
</html>

_________________
Come and play in my land
Back to top
View user's profile Send private message
WhiskeyJack
n00b
n00b


Joined: 02 Jul 2004
Posts: 6

PostPosted: Fri Jul 02, 2004 7:55 pm    Post subject: Reply with quote

Yep that worked . I think I may be beginning to understand
Isn't there some setting you can set in php.ini which turns off automatically changing POST's to variables. Is that right?
Back to top
View user's profile Send private message
int2str
Guru
Guru


Joined: 29 Sep 2003
Posts: 362

PostPosted: Fri Jul 02, 2004 8:01 pm    Post subject: Reply with quote

The setting is register_globals and here is why it should be OFF:
http://www.php.net/manual/en/security.globals.php

Cheers,
André
_________________
Adpot an unanswered post today!
Back to top
View user's profile Send private message
WhiskeyJack
n00b
n00b


Joined: 02 Jul 2004
Posts: 6

PostPosted: Fri Jul 02, 2004 8:04 pm    Post subject: Reply with quote

Thanks for the help.

Stupid really cos I just read why that should be off a while ago :oops:

1+1= 11
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum