Click here to Skip to main content
14,270,034 members

Web Development

 
AnswerRe: Fatal error: Uncaught Error: Call to a member function prepare() Pin
Richard MacCutchan15-Apr-19 21:25
protectorRichard MacCutchan15-Apr-19 21:25 
QuestionCan I put SQLite database in a folder before root folder(public-html folder where index.php file could be placed in) of server and give the database folder full time read and write access permission? Pin
AndroidVH13-Apr-19 18:15
memberAndroidVH13-Apr-19 18:15 
QuestionMVC5 New Controller/View gives 404 Pin
#realJSOP12-Apr-19 1:56
mve#realJSOP12-Apr-19 1:56 
AnswerRe: MVC5 New Controller/View gives 404 Pin
Richard Deeming15-Apr-19 8:34
mveRichard Deeming15-Apr-19 8:34 
GeneralRe: MVC5 New Controller/View gives 404 Pin
#realJSOP15-Apr-19 8:44
mve#realJSOP15-Apr-19 8:44 
QuestionHow to download and save multiple files into the same folder with reactjs Pin
asb1469010-Apr-19 21:43
memberasb1469010-Apr-19 21:43 
QuestionWeb API Security Pin
Kevin Marois3-Apr-19 9:43
professionalKevin Marois3-Apr-19 9:43 
AnswerRe: Web API Security Pin
Vinod Jangle4-Apr-19 9:52
memberVinod Jangle4-Apr-19 9:52 
QuestionMVC5 validation decoration Pin
#realJSOP1-Apr-19 0:55
mve#realJSOP1-Apr-19 0:55 
AnswerRe: MVC5 validation decoration Pin
#realJSOP1-Apr-19 2:07
mve#realJSOP1-Apr-19 2:07 
GeneralRe: MVC5 validation decoration Pin
malkovich198823-Apr-19 5:08
membermalkovich198823-Apr-19 5:08 
QuestionIs there a basic HTML scripts bundle for VS code and none serve application? Pin
maze327-Mar-19 5:05
professionalmaze327-Mar-19 5:05 
AnswerRe: Is there a basic HTML scripts bundle for VS code and none serve application? Pin
Shmuel Zang28-Mar-19 4:08
memberShmuel Zang28-Mar-19 4:08 
AnswerRe: Is there a basic HTML scripts bundle for VS code and none serve application? Pin
Richard MacCutchan28-Mar-19 5:02
protectorRichard MacCutchan28-Mar-19 5:02 
QuestionExperimenting Pin
Member 1419652225-Mar-19 20:42
memberMember 1419652225-Mar-19 20:42 
AnswerRe: Experimenting Pin
maze327-Mar-19 5:14
professionalmaze327-Mar-19 5:14 
QuestionCopy and Paste to aspx GridView Pin
Wayne Hollier20-Mar-19 1:30
memberWayne Hollier20-Mar-19 1:30 
AnswerRe: Copy and Paste to aspx GridView Pin
Richard Deeming20-Mar-19 13:02
mveRichard Deeming20-Mar-19 13:02 
GeneralRe: Copy and Paste to aspx GridView Pin
Wayne Hollier22-Mar-19 1:12
memberWayne Hollier22-Mar-19 1:12 
QuestionNo action was found on the controller Pin
Kevin Marois18-Mar-19 15:16
professionalKevin Marois18-Mar-19 15:16 
AnswerRe: No action was found on the controller Pin
Richard Deeming19-Mar-19 2:16
mveRichard Deeming19-Mar-19 2:16 
QuestionTemplate engine (Ejs) Pin
Member 1418486016-Mar-19 20:43
memberMember 1418486016-Mar-19 20:43 
QuestionHosting WebAPI OnServer Pin
Kevin Marois12-Mar-19 14:09
professionalKevin Marois12-Mar-19 14:09 
AnswerRe: Hosting WebAPI OnServer Pin
Nathan Minier18-Mar-19 1:55
professionalNathan Minier18-Mar-19 1:55 
QuestionWhy my update & insert form return url+token instead of insert/update data (laravel) Pin
Galih indra waspada11-Mar-19 23:29
memberGalih indra waspada11-Mar-19 23:29 
I'm working on simple crud in laravel.I already built Controller,form, and model.But everytime i click the submit input.They always return this url and show 404 not found error,instead of insert the data.Can someone help me to find the problem?i have no clue about this part.

http://127.0.0.1:8000/POST?_token=bD5c3O0XpfTX7NWL7RA7wXSw3rWrQ12fbGLMw0kf&kode=galih&nama=galih&submit=Submit[^]

I set the route using Route::resource('urusan','MasterUrusanController)
Insert Form
<form action="POST" action="{{url('urusan')}}">
{{ csrf_field() }}
<table>
    <thead>
        <tr>
            <td>Kode Urusan</td>
            <td><input type="text" name="kode"></td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Nama Urusan</td>
            <td><input type="text" name="nama"></td>
        </tr>
        <tr>
            <td colspan="2" align="center"><input type="submit" name="submit" class="btn btn-primary" value="Submit"></td>
        </tr>
    </tbody>
</table>
</form>


Insert Form
<form action="POST" action="{{route('urusan.update',$urusan->kode_urusan)}}">
             {{ method_field("PUT") }}
       {{ csrf_field() }}
           <thead>
               <tr>
                   <td>Kode Urusan</td>
               <td><input type="text" name="kode" value="{{$urusan->kode_urusan}}"></td>
               </tr>
           </thead>
           <tbody>
               <tr>
                   <td>Nama Urusan</td>
                   <td><input type="text" name="nama" value="{{$urusan->nama_urusan}}"></td>
               </tr>
               <tr>
                   <td colspan="2" align="center"><input type="submit" name="submit" class="btn btn-primary" value="Update"></td>
               </tr>
           </tbody>

           </form>

       </table>



Controller

class MasterUrusanController extends Controller
{
    public function index()
    {
        $urusan=MasterUrusan::all();
        return view('master_urusan.select',['urusan'=>$urusan]);
        //return View::make('master_urusan.select')->with('urusan',$urusan);
    }

    public function create()
    {
        return view('master_urusan.insert') ;
    }

    public function store(Request $request)
    {
        $data=new MasterUrusan();
        $data->nama = $request->get('kode');
        $data->nama = $request->get('nama');
        $data->save();
        return redirect('/urusan');
    }

    public function edit($kode_urusan)
    {

        
        $data = MasterUrusan::where('kode_urusan','=',$kode_urusan)->firstOrFail();
        return view('master_urusan.update', ['urusan' => $data]);
    }
    public function update(Request $request,$kode_urusan)
    { 
        $data = MasterUrusan::where('kode_urusan','=',$kode_urusan)->firstOrFail();
        $data->nama = $request->get('nama');
        $data->save();
        return redirect('/urusan');
        
    }

    public function destroy($kode_urusan)
    {
        $data = MasterUrusan::where('kode_urusan','=',$kode_urusan)->firstOrFail();
        $data->delete();
        return redirect('/urusan');
    }
}


modified 12-Mar-19 5:47am.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.