Tasos Posted February 5, 2015 Share Posted February 5, 2015 Hello, i would like to know to how to make this script work. I get information using this link below in index.php, after i get the information i want to insert/update in database information which i don't show on the page self. index.php <?php echo '<a href="example.com?url='. $row['url'] . '&name='. $row['name'] .'&info='. $row['info'] .'&privat='. $row['privat'] .'" target="_blank">Edit</a> ';?> So like this here below i show the information. get_info.php <?php echo $_GET['name']; ?> Which works fine. So now updating the database. $ip_address = $_SERVER['REMOTE_ADDR']; // Ip address works fine $name = $_GET['name']; // not working $r_name = $_POST['$name']; // not working $r_name= 'test'; // this is working. mysql_query("insert into r_test (r_name,r_ip) values('$r_name','$ip_address')") or die(mysql_error()); So how can i get the value and insert in database, only row r_ip is updated with the ip address. I hope i explained it well Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/294411-how-to-get-variable-in-another-page-and-submitupdate-in-database/ Share on other sites More sharing options...
CroNiX Posted February 5, 2015 Share Posted February 5, 2015 You're not linking to your index.php script, which is where I presume you are trying to do your update code? example.com/index.php?url=... Quote Link to comment https://forums.phpfreaks.com/topic/294411-how-to-get-variable-in-another-page-and-submitupdate-in-database/#findComment-1504991 Share on other sites More sharing options...
Tasos Posted February 5, 2015 Author Share Posted February 5, 2015 (edited) Thanks for your reply CroNiX, i made an another test in example.php so i forgot to change it to index.php. And i cant solve the problem i am for 3 hours bussy with this. Thanks again. Edited February 5, 2015 by Tasos Quote Link to comment https://forums.phpfreaks.com/topic/294411-how-to-get-variable-in-another-page-and-submitupdate-in-database/#findComment-1504993 Share on other sites More sharing options...
CroNiX Posted February 5, 2015 Share Posted February 5, 2015 I don't see "example.php" in the url of your link. I see example.com Quote Link to comment https://forums.phpfreaks.com/topic/294411-how-to-get-variable-in-another-page-and-submitupdate-in-database/#findComment-1505000 Share on other sites More sharing options...
Tasos Posted February 6, 2015 Author Share Posted February 6, 2015 <?php echo '<a href="example.com/get_info.php?url='. $row['url'] . '&name='. $row['name'] .'&info='. $row['info'] .'&privat='. $row['privat'] .'" target="_blank">Edit</a> ';?> Quote Link to comment https://forums.phpfreaks.com/topic/294411-how-to-get-variable-in-another-page-and-submitupdate-in-database/#findComment-1505041 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.