samedi 11 avril 2015

Link to .php file inside action=" " in wordpress plugin


<?php
$result = $wpdb->get_results( "SELECT * FROM $pupils_table ORDER BY surname ASC");
foreach ( $result as $print ) {
?>

<tr style="cursor:pointer" onclick="location.href='/pupil/?pupil=<?php echo $print->id;?>'">
<td><?php echo $print->firstname;?></td>
<td><?php echo $print->surname;?></td>
<td><?php echo $print->gender;?></td>
<td><?php echo $print->dob;?></td>
<td><?php echo $print->startdate;?></td>
<td><?php echo $print->eal;?></td>
<td><?php echo $print->send;?></td>
<td><?php echo $print->pp;?></td>
<td>
<form action='<?php plugins_url(); ?>/foundtrack/includes/delete-pupil.php?id="<?php echo $print->id;?>"' method="post">
<input type="hidden" name="id" value="<?php echo $print->id;?>">
<input type="submit" name="submit" value="Delete">
</form>
</td>
<?php } ?>
</tr>


How would I link to my delete-pupil.php file inside of a form within a wordpress plugin. I've tried lots of different things and none have worked. It would be a lot easier if this was just php without wordpress.


Aucun commentaire:

Enregistrer un commentaire