dongnue4923 2011-12-19 14:41
浏览 381
已采纳

使用php中的“header(location:)”发布数据

i've just made a sign script for my website. The form posts the data to itself and then checks to see if all the data is correct. if so it then loads a payment page. To load this payment page i use:

  header(location: payment.php);

So i want to send data over to the page that im loading, i though i could use:

  $userid = mysql_insert_id();

to get the last id added to the database but its not working, maybe im using it wrong though. Anyway, i know what in my database the email address on every record with be unique as well as the id, so i thought maybe i'd change the header to:

 header(location: payment.php?email=$email);

This way it would put the email address into the URL and i'd be able to find the user again on the next page by using:

 $email = $_GET['email'];

Now this works fine and from that i can get the users details from the database. However i thought that putting someones email address into the URL wasn't best practice but i can't for the life of me think of another way around it.

Any suggestions or good ways of doing this?

Thanks for the time.

  • 写回答

4条回答 默认 最新

  • down101102 2011-12-19 14:45
    关注

    I think you should go back and check why mysql_insert_id() isn't working. That'll be the best way to get the data across.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用