Jump to content

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


Tasos
 Share

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.

 

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

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