[PHP/APACHE] Method Post Denied?

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
Method Not Allowed
The requested method POST is not allowed for the URL /shout.php.

--------------------------------------------------------------------------------

Apache/1.3.27 Server at blaat Port 80


Dit krijg ik... als ik een POST METHOD probeer...
weet iemand waar je die goed moet instellen, in apache?

Acties:
  • 0 Henk 'm!

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 02-09 11:02

D2k

laat je formpje (relevante deel) eens zien?

Doet iets met Cloud (MS/IBM)


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
je bedoelt de code?

Acties:
  • 0 Henk 'm!

  • Shagura
  • Registratie: Augustus 2001
  • Laatst online: 14-09 08:25

Acties:
  • 0 Henk 'm!

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 02-09 11:02

D2k


gezien het feit dat we on hier in Programming en niet in "glazen bollen land" bevinden, is dat wel handig

Doet iets met Cloud (MS/IBM)


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
Hmmm.. toch zou ik niet aan nemen dat je een glazenbol nodig heb om een method POST te "ALLOW-en" in apache... maar ok

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<table cellspacing=0 cellpadding=0 border=0 width=300>
 <tr valign=top>
    <td rowspan=2 background="gfx/window_14.gif">[img]"gfx/window_01.gif"[/img]</td>
    <td>[img]"gfx/window_02.gif"[/img]</td>
    <td>[img]"gfx/window_shout.gif"[/img]</td>
 
    <td>[img]"gfx/window_05.gif"[/img]</td>
    <td background="gfx/window_06.gif" width=100%></td>
    <td>[img]"gfx/window_08.gif"[/img]</td>
 </tr>
 <tr valign=top height=14> <form name="shout" action="shout.php" method="post">
    <td bgcolor="#C6DEDB" rowspan=2 colspan=4>
        <table cellspacing=0 cellpadding=0 border=0 width=100%>
        
        
        </table>
    </td>
    <td background="gfx/window_12.gif" height=14></td>
 </tr></form>
 
 </TABLE>


Ook phpdeel nodig?

Acties:
  • 0 Henk 'm!

  • Hmmbob
  • Registratie: September 2001
  • Laatst online: 18-09 12:25
er staat zeg maar weinig informatie in die gepost wordt, of ligt dat aan mij?

enne, al die table's, daar hebben we hier weinig aan, alleen je <form></form> gedeelte is intressant

code:
1
2
<form name="shout" action="shout.php" method="post">
</form>


zal inderdaad weinig doen

[ Voor 29% gewijzigd door Hmmbob op 27-11-2002 14:07 ]

Sometimes you need to plan for coincidence


Acties:
  • 0 Henk 'm!

  • simon
  • Registratie: Maart 2002
  • Laatst online: 19:38
als je et zou moeten instellen -> php.ini

|>


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
Staat veel meer in, maar dan word het een hoop...
is een miniforum... hiero ik post wel alles :


code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<table cellspacing=0 cellpadding=0 border=0 width=300>
 <tr valign=top>
    <td rowspan=2 background="gfx/window_14.gif">[img]"gfx/window_01.gif"[/img]</td>
    <td>[img]"gfx/window_02.gif"[/img]</td>
    <td>[img]"gfx/window_shout.gif"[/img]</td>
 
    <td>[img]"gfx/window_05.gif"[/img]</td>
    <td background="gfx/window_06.gif" width=100%></td>
    <td>[img]"gfx/window_08.gif"[/img]</td>
 </tr>
 <tr valign=top height=14> <form name="shout" action="shout.php" method="post">
    <td bgcolor="#C6DEDB" rowspan=2 colspan=4>
        <table cellspacing=0 cellpadding=0 border=0 width=100%>
        
        <tr valign=top height=2><td colspan=2></td></tr>
        <tr valign=top height=1><td colspan=2 bgcolor="white"></td></tr>
        <tr valign=top>
            <td>[img]"gfx/icon_news.gif"[/img]&nbsp;</td><td class="header">November 27th :: 2002 | 10:20:31<br><b>w1m</b></td>
        </tr>
        <tr valign=top>
            <td bgcolor=white></td><td bgcolor=white>bl44t</td>
        </tr>
        <tr valign=top height=4><td colspan=2 bgcolor="white"></td></tr>
        
        <tr valign=top height=2><td colspan=2></td></tr>
        <tr valign=top height=1><td colspan=2 bgcolor="white"></td></tr>
        <tr valign=top>
            <td>[img]"gfx/icon_news.gif"[/img]&nbsp;</td><td class="header">November 14th :: 2002 | 11:58:37<br><b>Name pikkepuner</b></td>
        </tr>
        <tr valign=top>
            <td bgcolor=white></td><td bgcolor=white>Message saHFDksaFKHSAfIDOA</td>
        </tr>
        <tr valign=top height=4><td colspan=2 bgcolor="white"></td></tr>
        
        <tr valign=top height=2><td colspan=2></td></tr>
        <tr valign=top height=1><td colspan=2 bgcolor="white"></td></tr>
        <tr valign=top>
            <td>[img]"gfx/icon_news.gif"[/img]&nbsp;</td><td class="header">November 14th :: 2002 | 11:58:14<br><b>Namevvvv</b></td>
        </tr>
        <tr valign=top>
            <td bgcolor=white></td><td bgcolor=white>Message</td>
        </tr>
        <tr valign=top height=4><td colspan=2 bgcolor="white"></td></tr>
        
        <tr valign=top height=2><td colspan=2></td></tr>
        <tr valign=top height=1><td colspan=2 bgcolor="white"></td></tr>
        <tr valign=top>
            <td>[img]"gfx/icon_news.gif"[/img]&nbsp;</td><td class="header">October 18th :: 2002 | 16:09:46<br><b>NameMedjadji</b></td>
        </tr>
        <tr valign=top>
            <td bgcolor=white></td><td bgcolor=white>Message<br />
He, de link daar beneden (contact us) doetutniet</td>
        </tr>
        <tr valign=top height=4><td colspan=2 bgcolor="white"></td></tr>
        
        <tr valign=top height=10><td colspan=2 bgcolor="white"></td></tr>
        <tr valign=top>
        <td bgcolor=white colspan=2><b><center><input size=34 name="Name" type=text value="Name" /></center></b></td>
        </tr>
        <tr valign=top>
        <td bgcolor=white colspan=2><b><center><textarea cols=33 name="Message">Message</textarea><br><a href="javascript: shout.submit();">Submit</a></b></b></center></b></td>
        </tr>
        </table>
    </td>
    <td background="gfx/window_12.gif" height=14></td>
 </tr></form>



Ok, nu het PHP gedeelte

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
    function show_shout() {
        $shouts = file("shouts.ftf");
        $shouts = array_reverse($shouts);   
        echo "<table width=200>";
        foreach ($shouts as $row) {
            $data = explode(";",$row);
            $date = date("j-m-y/G:i:s", $data[1]);
            echo "<tr><td><b>".$data[0]."</b><br><i>op: ".$date."</i><br>".$data[2]."<hr></td></tr>";
        }
        echo "</table>";
        
        //show form
        echo "<form name=addform action='".$PHP_SELF."'><table width=200><tr><td><input type='text' name='name' value='name' /><br><textarea name='message'>message</textarea><input type='hidden' name='action' value='add' /><br><a href='javascript: addform.submit()'>Shout!</a></td></tr></table></form>";
    }
    
    function add_shout() {
        $data = file("shouts.ftf");
        
        $fp = fopen("shouts.ftf", "w"); // open file in append-mode
    
        //create vars
        $date = strtotime("now");
        $name = $_GET['name'];
        $message = $_GET['message'];
    
        $row_to_insert = $name.";".$date.";".nl2br($message)."\n";
        array_push($data, $row_to_insert);
        
        $i = sizeof($data);
        $i = $i - 5; // max messages
        if ($i < 0) {
            $i = 0;
        }

        $data2 = array();
        while ($i < sizeof($data)) {
            array_push($data2,$data[$i]);
            $i++;
        }
            
        fwrite($fp, implode("", $data2));
    
        fclose($fp);
        
        header("Location: shout.php"); // return to view
    }
    
    if ($_GET['action'] == "add") {
        add_shout();
    } else {
        show_shout();
    }
?>



zo beter?

Acties:
  • 0 Henk 'm!

  • RedRose
  • Registratie: Juni 2001
  • Niet online

RedRose

Icebear

zo beter?
PHP tags zouden leuk zijn. Maar ik denk dat het om 2 dingen gaat (en dat is niet PHP):

1. je form post naar shout.php, dus naar http://www.bla.com/shout.php en daar heb je waarschijnlijk geen POST rechten. Zet dus je base-url goed.

2. Kijk naar httpd.conf (je apache config file) en bekijk eens wat je allemaal wel en niet mag. Dit:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory "C:/Program Files/Apache Group/Apache/users">
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <LimitExcept GET POST OPTIONS PROPFIND>
#        Order deny,allow
#        Deny from all
#    </LimitExcept>
#</Directory>


is wel een leuke. Voor de rest moet je de documentatie doorspitten op www.apache.org.

Sundown Circus


Acties:
  • 0 Henk 'm!

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06 13:31

drm

f0pc0dert

Simon:
als je et zou moeten instellen -> php.ini
hmzja, behulpzaam :z

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz

Pagina: 1