0

Hallo every bodies,

i've problem that when i execute a form for update, that there is one of many fields as url input. Then response is forbidden, but when url's field is empty, all script are fine. I think it's so strange, I don't know how to do.
Or is this cause of my hosting? I develop other website, and I put it on other hosting, and all is fine.

I hope an advice to resolve it.. thanks.

2
Contributors
6
Replies
30
Views
3 Years
Discussion Span
Last Post by Idhar
0

thanks for your respon, this is mycode :

at first select based on id.. then show to a form.

echo "
<form method=POST enctype='multipart/form-data' name='myform' action=$_SERVER[PHP_SELF]> <input type=hidden name=id value='$r[id_product]'> <table> <tr><td class='left'>Link Slide Assembly</td><td> : <input type=text name='slide_assembly' size=60 value='$r[slide_assembly]'></td></tr> <tr><td class='left' colspan=2> <input type=submit value=Update name='Update'><input type=button value=Cancel onclick=self.history.back()> </td></tr> </table>
";

if(isset($_POST['Update'])){
 // do update
}

if slide_assembly field is empty, all is fine. But when slide_assembly field isn't empty, it give forbidden response like "You don't have permission to access .php file on this server."
I've change permission to 777, but still forbidden.

Edited by Idhar: grammer

0

Try this:

if( isset($_POST['update']) ){
    //Do update
}

$html  = '<form method="POST" enctype="multipart/form-data" name="myform" action="'. $_SERVER['PHP_SELF'] . '">';
$html .= '<input type="hidden" name="id" value="' .$r['id_product'].'" />';
$html .= '<table>';
$html .= '<tr>';
$html .= '<td class="left">Link Slide Assembly</td><td> : <input type="text" name="slide_assembly" size="60" value="'.$r['slide_assembly'].'"></td>";
$html .= '</tr>';
$html .= '<tr>';
$html .= '<tr>';
$html .= '<td class="left" colspan="2"> <input type="submit" value="Update" name="update" /><input type="button" value="Cancel" onclick="self.history.back()" /></td>';
$html .= '</tr>';
$html .= '</table>';

echo $html;

Edited by gabrielcastillo

0

owh.. still not work :(

@gabriel, can you explain about the problem?

0

Sorry I forgot to close the form

try this:

 if( isset($_POST['update']) ){
    //Do update
        echo $_POST['slide_assembly'];
    }
    $html  = 'form';
    $html .= '<form method="POST" enctype="multipart/form-data" name="myform" action="'. $_SERVER['PHP_SELF'] . '">';
    $html .= '<input type="hidden" name="id" value="' .$r['id_product'].'" />';
    $html .= '<table>';
    $html .= '<tr>';
    $html .= '<td class="left">Link Slide Assembly</td><td> : <input type="text" name="slide_assembly" size="60" value="'.$r['slide_assembly'].'"></td>';
    $html .= '</tr>';
    $html .= '<tr>';
    $html .= '<tr>';
    $html .= '<td class="left" colspan="2"> <input type="submit" value="Update" name="update" /><input type="button" value="Cancel" onclick="self.history.back()" /></td>';
    $html .= '</tr>';
    $html .= '</table>';
    $html .= '</form>';

    echo $html;
0

i'll try it.. thx for your response.. sorry my english not good :)

Edited by Idhar: grammer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.