dongzhong1891 2015-02-06 12:55
浏览 21

如何在另一页获取信息后插入数据库

i try to get information in another page which works fine, the only facing problem is that i can't insert in database the information i get, for example:

This is the link i use which works fine.

index.php

<a href="http://example.com/q.php?url= '. $row['url'] .'&title='. $row['title'] .'" target="_blank">Edit</a>

q.php

    $ip_address = $_SERVER['REMOTE_ADDR']; // This is working fine.
    $title = $_GET['title']; 

mysql_query("insert into test_insert (title,ip) values('$title','$ip_address')")
            or die(mysql_error());

$title = $_GET['title']; // Not working
// If i delete this row above and replace with below it works.
$title = 'test';         // This is working and puts (test) in row title

I can't understand why i can show the information in q.php with:

<?php echo $_GET['title']; ?>

And can't insert it in database, what is wrong with this ?

Any help is welcome.

Thanks in advance.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100