Jump to content

blacknight

Members
  • Posts

    271
  • Joined

  • Last visited

Everything posted by blacknight

  1. is what it shows you what is in the database?
  2. yea basicly i see that now ... try this.. echo "<option value='{$row['location_id']}'"; //Default value if(isset($_POST['location']) && $row['location_id'] == $_POST['location']) echo " selected "; echo ">{$row['location_name']}</option>\n";
  3. add if(isset($_POST['location']) && $row['location_id'] == $_POST['location']) echo " selected "; this working of the form is submitted to its self for further updates...
  4. isset is the built in function try defining the $_GET vars at the start of the function using shorter names...
  5. add echo $cid. ' - '.$catname.' - '.$catdesc. ' - ' .(bool)$ok; after your global statement and see if the values are even passing to the function... and if youa re getting a sql error post it please
  6. drop the $stmt = $db->stmt_init(); $stmt = $db->prepare("UPDATE category SET catname=?,catdesc=? WHERE cid=?"); $stmt->bind_param('ssi',$catname,$catdesc,$cid); $stmt->execute(); $stmt->close(); and just use a normal sql update string.... $result = $db->query("UPDATE `category` SET `catname`='$catname',`catdesc`='$catdesc' WHERE `cid`='$cid'"); only thing i can sujest because you dident post the $stmt function file ... but that seems like a lota work for an update ...
  7. $db = mysql_connect(__CFG_HOSTNAME, __CFG_USERNAME, __CFG_PASSWORD, TRUE, MYSQL_CLIENT_INTERACTIVE) or die(mysql_error()); mysql_query("SET SESSION interactive_timeout=120", $db); mysql_select_db(__CFG_DATABASE, $db); this would set the connection to time outa fter 120 seconds
  8. $_GET['id'] will still equal 10 in the rewrite so i cant see why not...
  9. using php's gd lib you can do this just have to set the peramiters for the script
  10. you dident md5 your password.... and if your webpage is not i strongly sugest you do ... as for limiting vote time .... add a time toamp to the user that is set for +24 hours and run a check if (time()=>$user['tstamp']) then let them vote
  11. both... php can only access the website folder not previous lower level directories if im not mistaken so you would need a server side batch file to move the file from the mydocuments to the webfolder or vise versa
  12. from whay i can tell you just need to pull the info from your database into an array and then encode it to json then pass it to the jquery script on page render then it should work..
  13. function Auth() { if (($_SESSION['uname']) && ($_SESSION['access'] == 2)) { #if already logged in, redirect based on dept id if ($_SESSION['dept'] == 1) { header("Location: admin/index.php"); } elseif ($_SESSION['dept'] != 1) { header("Location: cases/cases-list.php"); } else { // If access is not GRANTED then reset and hold user at login page unset($_SESSION['uname']); unset($_SESSION['access']); header("Location: index.php"); } } } then call Auth(); at the top of all your pages
  14. opps yea i see that now too some one shouldent be the sender and the reciver at the same time which is what the on statement is stating if you use ON (gold_logs.to_id = ibf_members.id OR gold_logs.from_id = ibf_members.id) it will list both sent and recived
  15. once you left join you have to declare each table each field is from im guessing form_id and to_id are in gold_logs SELECT gold_logs.*,name,star FROM gold_logs LEFT JOIN ibf_members ON (gold_logs.to_id = ibf_members.id AND gold_logs.from_id = ibf_members.id) WHERE gold_logs.to_id = 1 and see if that works..
  16. add #jump to your action setting in the form tag at the start this will go direct to the name tag
  17. use the # http var like #start in a link then <a name="start"></a> will move the page to this location
  18. setting your username and email as keys on your user table will stop multiple samenames signing up too
  19. no i would set this for page width it sets how many colums you have going across the page 3-5 is usualy good depending on the size of the page
  20. if (isset($_GET('what_page') { $what_page = int() $_GET('what_page'); if($what_page>3 OR $what_page<0) { what_page=0; } } should be all the code you need at the top after your array your else statement was allways setting your page to 0by not setting a else you let $what_page stay set if it passes the fail check
  21. ever think of using a table? $html = '<table><tr>'; $cols = 3;// can be any size you want $x = 0; while ($row = mysql_fetch_array($sql)) { $x++; $reference = $row['reference']; $image = $row['image']; $html .= '<td>'; $html .= '<p><img src="./images/cakes/'.$image.'" height="289px" width="177px" alt="IMAGE OF CAKE"></img><br />'; $html .= '<b>Reference:</b>'.$reference.'.</p>'; $html .= '</td>'; if ($x == $cols) { $html .= '</tr><tr>'; $x=0; } } if (!$reference) { $html .= '<td>There are no cakes in this category yet.</td>'; } echo $html;
  22. if you set size(w/h) and size (k Kb Mb) limits and check the mime type any file that passes your checks should be ok but i wouldent recomend any folder before your webroot folder use one called uploads in it then you can have php move it after its uploaded
  23. try taking out your <p> tages same idea makes paragraphs under each other
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.