View previous topic :: View next topic |
Author |
Message |
WhiskeyJack n00b

Joined: 02 Jul 2004 Posts: 6
|
Posted: Fri Jul 02, 2004 7:27 pm Post subject: POST not working in apache2 |
|
|
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 |
|
 |
Lajasha Veteran


Joined: 17 Mar 2004 Posts: 1040 Location: Vibe Central
|
Posted: Fri Jul 02, 2004 7:35 pm Post subject: |
|
|
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 |
|
 |
WhiskeyJack n00b

Joined: 02 Jul 2004 Posts: 6
|
Posted: Fri Jul 02, 2004 7:43 pm Post subject: |
|
|
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 |
|
 |
Lajasha Veteran


Joined: 17 Mar 2004 Posts: 1040 Location: Vibe Central
|
Posted: Fri Jul 02, 2004 7:51 pm Post subject: |
|
|
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 |
|
 |
WhiskeyJack n00b

Joined: 02 Jul 2004 Posts: 6
|
Posted: Fri Jul 02, 2004 7:55 pm Post subject: |
|
|
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 |
|
 |
int2str Guru


Joined: 29 Sep 2003 Posts: 362
|
|
Back to top |
|
 |
WhiskeyJack n00b

Joined: 02 Jul 2004 Posts: 6
|
Posted: Fri Jul 02, 2004 8:04 pm Post subject: |
|
|
Thanks for the help.
Stupid really cos I just read why that should be off a while ago
1+1= 11 |
|
Back to top |
|
 |
|