473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Output Messages from PHP page to another?

what is the best way to output error messages from one page to another?

i currently send the messages to display using header() with GET

[PHP]header("Location: /file.php?msg=Invalid Login)[/PHP]
Is there any good workarounds? or a standard way of doing it?
Nov 30 '07 #1
2 5055
stepterr
157 100+
what is the best way to output error messages from one page to another?

i currently send the messages to display using header() with GET



Is there any good workarounds? or a standard way of doing it?

I've done it two different ways.
on the first page that produces the error I will do something along the lines of
[PHP]

if(//whatever produces your error)
{
print "Invalid Input";
include 'file.php';
}[/PHP]

OR

the other way would be to do something like this on the first page.
[PHP]// assign it to a variable like
$errormsg ="Invalid Input";
// add it to a hidden variable
print "<input type='hidden' value=$errormsg name='message'>
[/PHP]

then on the second page
[PHP]$errormsg = $_POST['message']; //to get the value from the posted page
print $errormsg; //to print the message[/PHP]
Dec 15 '07 #2
to output the message to the other page try to look the $_REQUEST
Dec 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: dave | last post by:
Anyone seen why trace output on remote server goes on and off randomly? thx dave
1
by: Jay Patel | last post by:
Hello out there, If anyone can help me with this situation, I would be very grateful. I have to access an XML feed that is currently being accessed, parsed and turned into the target HTML via a...
3
by: nycjay | last post by:
hello, i am just getting started as a dba. ny current task is to set up notification for health alerts. so, we have the health monitor running, and it is currently putting health alerts (space...
4
by: KlassifiedBBS | last post by:
I want to create a game bot for a video chat program with a closed API. I can see the windows messages when I hook up Spy++ to the window in question. I have done numerous Googles for some kind...
1
by: Max Khitrov | last post by:
Hi there, I realize this is more of a Windows API question then C#, but thought I'd ask anyway just in case anyone had experience with this specifically in C#. What I'm trying to do is read...
3
by: Capsule | last post by:
Hi everyone! I'm trying to get the windows messages sent to and from another application. I'm able to get the handle to this object, and I pass it into the following function: public class...
5
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
0
by: harsha_forum | last post by:
Hi All, Iam having a proc which has dynamic sql inside that. ex- Use Northwind CREATE PROC TEST(
5
by: movieking81 | last post by:
I think I'm making a assumption about C#, that is works similar to VBscript. I'm new to C# and I believe I'm going about this bit of code the wrong way. If some one can take a look and maybe point...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.