php - Retrieve value from a table -
i want know content of first td
tag in each tr
tag. problem need store title of file , file name in database without repeating code each chosen file. trying value of <td>
tag. have written code shows user table of 2 columns first 1 file title, second button choose file user can upload multi files , send send button @ once. clarify idea:
this code:
<td>course report</td> <td>@foreach ($temp1 $fi) @if($fi->title =="course report") <form action="{{route('dele')}}" method="post" ><input type="hidden" name="_token" value="{{csrf_token()}} "> <button id="delete-id" name="filename" value="{{$fi->id}}">delete </button> @endif @endforeach @if($fi->title !="course report") <form action="{{route('filestest')}}" method="post" enctype="multipart/form-data"> {{csrf_field()}} <input id="file-id"type="file" name="file1"></input> @endif </td> </tr> <tr> <td>sample of midterm exam answer sheet – high</td> <td>@foreach ($temp1 $fi) @if($fi->title =="sample of midterm exam answer sheet – high") <form action="{{route('dele')}}" method="post" ><input type="hidden" name="_token" value="{{csrf_token()}} "> <button id="delete-id" name="filename" value="{{$fi->id}}">delete </button> @endif @endforeach @if($fi->title !="sample of midterm exam answer sheet – high") <form action="{{route('filestest')}}" method="post" enctype="multipart/form-data"> {{csrf_field()}} <input id="file-id"type="file" name="file2" ></input> @endif </td>
if want read data use input hidden tag. set data in hidden tag value too. may solves probelm.
<td>sample of midterm exam answer sheet – high</td> <td>@foreach ($temp1 $fi) @if($fi->title =="sample of midterm exam answer sheet – high") <form action="{{route('dele')}}" method="post" ><input type="hidden" name="_token" value="{{csrf_token()}} "> <button id="delete-id" name="filename" value="{{$fi->id}}">delete </button> @endif @endforeach @if($fi->title !="sample of midterm exam answer sheet – high") <form action="{{route('filestest')}}" method="post" enctype="multipart/form-data"> {{csrf_field()}} <input type="hidden" name="hiddendata" value="your data"> <input id="file-id"type="file" name="file2" ></input> @endif </td>
Comments
Post a Comment