473,788 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Output Messages from PHP page to another?

26 New Member
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("Locatio n: /file.php?msg=In valid Login)[/PHP]
Is there any good workarounds? or a standard way of doing it?
Nov 30 '07 #1
2 5076
stepterr
157 New Member
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
underscore
30 New Member
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
1250
by: dave | last post by:
Anyone seen why trace output on remote server goes on and off randomly? thx dave
1
1526
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 .php page,which then uses a simple "echo" command to send the ASCII HTML back. I would like to be able take that HTML, read it, and embed it into an .htm or ..shtm page. I am thinking that javascript might be a way to go with this. Is there a way,...
3
1740
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 usage, runstat warnings, etc) into the normal db2diag logs. as i understand it, we can set up the admin server (das?) to send an email or page to a dba when one of these health alters is triggered. what we are trying to do is slightly different...
4
8315
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 of example in C# code to no avail. Can someone point me to someplace with a little information how to do this?
1
1672
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 window messages for windows that aren't owned by current thread. That's the key part because if I just wanted to read messages for my own windows I'd just use the GetMessage function from user32.dll. I have no problems finding the window I'm...
3
3034
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 MyHookClass : NativeWindow { public MyHookClass(IntPtr hWnd) {
5
4855
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, redirect a client to another page. In other way, a client will be able to send messages to another client, throw the server. These are the first funcionalities.
0
1795
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
5137
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 in the right direction that would be great. I'm trying to read data from a MSSQL database/table and display one of the columns on the page. Of course, I have removed the names for security. <%@ Page Language="C#" AutoEventWireup="true"...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10118
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.