Jump to content

How to get variable in another page and submit/update in database


Tasos

Recommended Posts

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.