Php通过超链接传递值并在下一页中使用 [英] Php passing values through hyper link and use in next page

查看:112
本文介绍了Php通过超链接传递值并在下一页中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天



我有一个问题

i希望通过超级链接将值传递到其他页面,例如

申请

和下一页即 somepage.php

i有一个表格,它将使用发送的价值。

$ somevar = $ _GET ['id'];

现在将输入此页面中的字段,即一个表格。

问题是当我提交页面时页面被刷新并且 $ somevar

在提交表单时变空。 br />


我也希望在表单下载后显示成功消息或错误消息

然后重定向到链接(id)所在的页面发送。

这是seniorio



1. 主页当我点击申请链接

申请

2. 申请页是输入用户数据的表单页面例如



表格名称=abcaction =result.php method =POST

名称:

年龄:

地址:

电子邮件:等



/表格



3. result.php

这里我执行验证然后,保存数据库中的数据

插入tablename(fied1,field2 ...)值(val1,val2,...);

现在我想用java显示成功消息脚本

echo申请成功提交;

header(Location:mainpage.php);



问题

问题是该记录已保存,但未显示警告消息,而是显示在没有显示任何消息的情况下转到mainpage.php;



我尝试了什么:



i试了很多东西但没有发生任何事情

解决方案

somevar =


_GET ['id'];

现在将输入此页面中的一个表格。

问题是当我提交页面时页面被刷新并且

somevar

在表单提交时变空。



我也想要在表单下载后显示成功消息或错误消息

然后重定向到发送链接(id)的页面。

这是seniorio



1. 主页当我点击申请链接时不包含任何工作

申请

2. 申请页面是输入用户数据的表格页面,例如



表格名称=abcaction =result.phpmethod =POST

名称:

年龄:

地址:

电子邮件:等等



/表格



3. result.php

这里我执行验证然后,将数据保存在数据库中

插入tablename(fied1,field2 ...)值(val1,val2,...);

现在我想用java脚本显示成功消息

echo应用已成功提交;

header(位置:mainpa ge.php);



问题

问题是该记录已保存但未显示警告消息相反,它去了mainpage.php而没有显示任何消息;



我尝试了什么:



i试了很多东西但没有发生任何事情


Good Day

I have a question
i want to pass a value through hyper link to other page like
apply
and in next page i.e. somepage.php
i have a form that will use value which is sent.
$somevar = $_GET['id'];
now will input fields in this page which is a form.
issue is that when i submit the page the page gets refreshed and $somevar
gets empty when the form is submitted.

also i want to display the success message or error message after form is submiited
and then redirect to page from where link (id) was sent.
this is seniorio

1. main page contains no of jobs when i click apply link
apply
2. apply page is form page that inputs user data e.g.

form name="abc" action="result.php" method="POST"
name:
age:
address:
email: etc

/Form

3. result.php
here i perform validation then, save data in database
insert into tablename(fied1,field2...) values (val1,val2,...);
now i want to show success message using java script
echo "Application Submitted Successfully";
header("Location:mainpage.php");

Issue
issue is that record is saved but alert message is not displayed instead it goes to mainpage.php without showing any message;

What I have tried:

i tried many things but nothing happend

解决方案

somevar =


_GET['id'];
now will input fields in this page which is a form.
issue is that when i submit the page the page gets refreshed and


somevar
gets empty when the form is submitted.

also i want to display the success message or error message after form is submiited
and then redirect to page from where link (id) was sent.
this is seniorio

1. main page contains no of jobs when i click apply link
apply
2. apply page is form page that inputs user data e.g.

form name="abc" action="result.php" method="POST"
name:
age:
address:
email: etc

/Form

3. result.php
here i perform validation then, save data in database
insert into tablename(fied1,field2...) values (val1,val2,...);
now i want to show success message using java script
echo "Application Submitted Successfully";
header("Location:mainpage.php");

Issue
issue is that record is saved but alert message is not displayed instead it goes to mainpage.php without showing any message;

What I have tried:

i tried many things but nothing happend


这篇关于Php通过超链接传递值并在下一页中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆