473,422 Members | 2,096 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,422 software developers and data experts.

Question about form classes

Hi all,

I have a quick question about form classes. I am following this
tutorial: http://www.evolt.org/article/PHP_Log...384/index.html

Basically, it is a login system. There is a session.php and a
process.php that is called when validating a login. The problem I am
having, is on my login form I fill out the fields and then the <form>
calls process.php. In process.php, the $form->num_errors is being set
correctly. Then, it redirects back to my login form.

Well, for some reason I am losing $form->num_errors when returning to
the login form. I am new at this, so I am not sure what is causing
it.

Quick rundown of what I think is happening...

login.php has 'include ('session.php')' at the top...
The $form is created at the bottom of session.php...
login.php submits to process.php...
process.php also has 'include ('session.php')' at the top...
if login is incorrect, process.php calls 'header("Location: ".
$_SERVER['HTTP_REFERER']);'
login.php is loaded and $form is empty

Can anyone give me an idea of where to start looking?

Thanks

Aug 31 '07 #1
3 1327
On Aug 31, 1:15 pm, stacey <monkeym...@gmail.comwrote:
Hi all,

I have a quick question about form classes. I am following this
tutorial:http://www.evolt.org/article/PHP_Log...n_Features/17/...

Basically, it is a login system. There is a session.php and a
process.php that is called when validating a login. The problem I am
having, is on my login form I fill out the fields and then the <form>
calls process.php. In process.php, the $form->num_errors is being set
correctly. Then, it redirects back to my login form.

Well, for some reason I am losing $form->num_errors when returning to
the login form. I am new at this, so I am not sure what is causing
it.

Quick rundown of what I think is happening...

login.php has 'include ('session.php')' at the top...
The $form is created at the bottom of session.php...
login.php submits to process.php...
process.php also has 'include ('session.php')' at the top...
if login is incorrect, process.php calls 'header("Location: ".
$_SERVER['HTTP_REFERER']);'
login.php is loaded and $form is empty

Can anyone give me an idea of where to start looking?

Thanks
Looks like your losing state between your redirect. Make sure that
the the value for $form->num_errors are either being passed with a
request method (POST/GET/SESSION) and 'rebuilt' within
session.php...or that $form is being serialized and passed, then
unserialized.
Aug 31 '07 #2
Thanks for the reply. Sadly, 30 minutes later, I figured out the
problem. It's called Zone Alarm...lol! For whatever reason, it was
blocking my info on the development machine. As soon as I turned it
off, everything worked as it should. Just thought I'd post that in
case someone else runs into a similar problem.

Aug 31 '07 #3
On Aug 31, 7:08 pm, stacey <monkeym...@gmail.comwrote:
Thanks for the reply. Sadly, 30 minutes later, I figured out the
problem. It's called Zone Alarm...lol! For whatever reason, it was
blocking my info on the development machine. As soon as I turned it
off, everything worked as it should. Just thought I'd post that in
case someone else runs into a similar problem.
awesome, thanks

Sep 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
5
by: Mathias L. | last post by:
I have two questions for which I couldnt find answer: If I programaticaly close DialogForm (calling Close()), is it enough or do I have to dispose it as MS.NET help says? Also, in overriden...
14
by: 42 | last post by:
Hi, Stupid question: I keep bumping into the desire to create classes and properties with the same name and the current favored naming conventions aren't automatically differentiating them......
11
by: Peter M. | last post by:
Hi all, I'm currently designing an n-tier application and have some doubts about my design. I have created a Data Access layer which connects to the database (SQL Server) and performs Select,...
21
by: Roland | last post by:
The following issue is puzzling me: There are 2 ways of writing the code below: .... Dim fnt as Font = New Font(...) DrawString(myText, fnt,...) fnt.dispose(). or DrawString(myText, New...
10
by: mg | last post by:
I'm migrating from VB6 and have a question about using 'Using' and the best way to use it. Here is a example of a small bit of code: dbConx("open") Using CN Dim CMD As New OleDbCommand(sSQL,...
9
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I...
4
by: wageslave | last post by:
Hi folks, I have a question about using consequtive combo boxes on a form. I am designing a basic library database for a small community organisation which deals with inner city problems and...
29
by: Brad Pears | last post by:
Here is a simple OO design question... I have a Contract class. The user can either save an existing contract or they start off fresh with a blank contract, fill in the data and then save a...
2
by: pat.saunders | last post by:
Hi, I am using Visual Studio 2005 and am using Visual C#. I notice that the program.cs creates an instance of a form and runs it. I have a PictureBox in the form and a Class File x.cs and in the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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,...
0
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...

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.