andy_b_1502 Posted May 28, 2012 Author Share Posted May 28, 2012 mrMarcus that worked, thank you. And yes there is still an issue with the header re-direct to view01.php. Is there any way around this, as the session at the top of the page is set so that if a unauthorized user tired to get to that page, it drops out to index.php with out a valid log in... Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349314 Share on other sites More sharing options...
mrMarcus Posted May 28, 2012 Share Posted May 28, 2012 You still need to change your redirection to: header("Location: view01.php?id=" . $id); and it will take you back properly. Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349317 Share on other sites More sharing options...
andy_b_1502 Posted May 28, 2012 Author Share Posted May 28, 2012 Fantastic!! happy chappy! thanks a lot! Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349319 Share on other sites More sharing options...
Kristoff1875 Posted May 28, 2012 Share Posted May 28, 2012 Told you an expert would be along to help!! Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349324 Share on other sites More sharing options...
andy_b_1502 Posted May 28, 2012 Author Share Posted May 28, 2012 On submitting the form (with SOME of the fields left blank) the details that were previously there are replaced by the blank fields (if left blank in the form) How can i eradicate this problem from happening? Thanks Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349333 Share on other sites More sharing options...
andy_b_1502 Posted May 28, 2012 Author Share Posted May 28, 2012 should i use isset() somehow? Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349337 Share on other sites More sharing options...
andy_b_1502 Posted May 28, 2012 Author Share Posted May 28, 2012 <?PHP session_start(); include ('php only scripts/db.php'); $id = $_GET['id']; $website = $_GET['website']; $phone = $_GET['phone']; $phone2 = $_GET['phone2']; $premiumuser_decription = $_GET['premiumuser_decription']; $website = isset($_POST['$website']); $phone = isset($_POST['$phone']); $phone2 = isset($_POST['$phone2']); $premiumuser_decription = isset($_POST['$premiumuser_decription']); $query = "UPDATE companies SET website = '". mysql_real_escape_string($website) ."', phone = '". mysql_real_escape_string($phone) ."', phone2 = '". mysql_real_escape_string($phone2) ."', premiumuser_description = '". mysql_real_escape_string($premiumuser_decription) ."' WHERE id = ". mysql_real_escape_string($id); $result = mysql_query($query ) or die("SELECT Error: ".mysql_error()); header("Location: view01.php?id=" . $id); exit(0); ?> i was thinking something like this? any ideas? Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349342 Share on other sites More sharing options...
andy_b_1502 Posted May 28, 2012 Author Share Posted May 28, 2012 As to not confuse, i have started a new post. Link to comment https://forums.phpfreaks.com/topic/263272-updateedit/page/3/#findComment-1349346 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.