Server IP : 51.89.169.208 / Your IP : 216.73.216.57 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/staff/ |
Upload File : |
<? include '../connect.php'; session_start(); include 'accesscontrol.php'; if(isset($_POST['submit'])){ $catId=$_POST['id']; $plu=$_POST['plu']; $sing=$_POST['sing']; $title=$_POST['title']; $q3 = "UPDATE cats SET cat_name = '$plu' WHERE cat_id = '$catId'"; $r3 = mysql_query($q3) or die(mysql_error()); echo "done!<br><br><br><br>"; } $sql = mysql_query("SELECT *, COUNT(cat_id) AS remaining FROM cats WHERE cat_name LIKE '%s and %' AND cat_name NOT LIKE '%clothes and %' AND cat_name NOT LIKE '%ss and %' AND cat_name NOT LIKE '%gas and %' AND cat_name NOT LIKE '%Electrolysis and %' AND cat_name NOT LIKE '%EPOS and %' AND cat_name NOT LIKE '%Apparatus and %' ORDER BY cat_name ASC LIMIT 1"); $row = mysql_fetch_array($sql); $name = $row['cat_name']; $cat_singular = $row['cat_singular']; if(substr($name,-3)=='ies'){ $name = substr_replace ($name, 'y',-3);} if(substr($name,-4) == 'sses'){$name = substr_replace ($name, '',-2);} if(substr($name,-1) == 's' && substr($name,-2) != 'ss'){$name = substr_replace ($name, '',-1);} $name=ucwords($name); $id = $row['cat_id']; $remaining = $row['remaining']; ?> <!doctype html> <html> <head> <link href="../style.css" rel="stylesheet" type="text/css"> <link href="style_staff.css" rel="stylesheet" type="text/css"> <title>cats</title> <script> function formSubmit() { document.getElementById("frm1").submit(); } </script> <style> .tbl td, .tbl input{padding:5px;} </style> </head> <body onload="formSubmit()" style="background:#fafafa"> <? include 'staff_header.php'; ?> <form method="POST" name="myForm" id="frm1" action="cats.php"> <div align="center"> <table class="tbl" style="margin-top:150px"> <tr> <td valign="top">REMAINING</td> <td><input type="text" value="<?=$remaining?>" style="border:2px solid #00F" size="50"></td> </tr> <tr> <td valign="top">id</td> <td><input type="text" name="id" value="<?=$id?>" size="50"></td> </tr> <tr> <td valign="top">plural</td> <td><input type="text" name="plu" value="<?=$name?>" size="50"></td> </tr> <tr> <td valign="top">singular </td> <td><input style="border:1px solid red;" type="text" name="sing" value="<?=$cat_singular?>" size="50"> <br> <br> <a target="_blank" href="http://www.google.co.uk/search?q=<?=$name?>">Search <?=$name?></a> </td> </tr> <tr> <td> </td> <td> <input type="submit" value="Submit" name="submit"> <input type="submit" value="DELETE" name="delete"></td> </tr> </table> </div> </form> </body> </html>