473,394 Members | 1,734 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,394 software developers and data experts.

passing hidden values

i have an if else situation wherein if a user registers with a name that is already available in the database i redirect them to duplicateuser.php or else redirect to thankyou.php

presently i am able to pass value of a variable $username as part of the url and i am able to read using GET by doing so the value appears in the browser address bar and i would like to use hidden and also be able to read this value

following is the code i am presently using

if($usernamerows > 0)
{
header("Location: duplicateuser.php?duplicateuser=".$username);
}
else
{
header("Location: thankyou.php?fname=".$fname);
}

how can i use hidden so that the url does not get appended in the address bar and still the read the value of the variables i want to pass and how should i read the variables in the other pages, is it $_POST[]

i tried using this code just before the header() statement but it does not work and i get an error.

echo "<input type ='hidden' name='duplicateuser' value='$username'>";
echo "<input type ='hidden' name='fname' value='$fname'>";

please advice.

thanks.
Feb 23 '08 #1
1 1234
You said you had got an error but you did not mentioned what error it is?
if you want the post method you should submit the form using
javascript. then you would get the values in the processing page.

otherwise you could also do it simply like this. I am not a pro but i feel comfortable in doing this way.

Instead of redirecting to another page you could have submitted the form to the same page so that you wont' need to pass the values to another page. if the user is already available you could allow the option of doing the registration once more by using the same form. If successfully registered you can show the "registration successful message and avoid the rest of the form (don't show the form).
Feb 23 '08 #2

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

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
0
by: Mario T. Lanza | last post by:
Seasoned ASP Developers, I have developed an ASP page that displays multiple rows of data with which the user may work. As each row is updated, the graphical info displayed immediately beside...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
6
by: veganeater | last post by:
Hi Everyone, I was wondering if there was a way to pass a variable to a popup window. The purpose is make it so when a user clicks on a specific region/link of the glossary page, a popup opens...
8
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
1
by: williamroy | last post by:
Hello, I've got a form that runs over 5 pages. I need the last page submit button to post all of the answers at one time from the previous 5 pages (to another server). I'd like to see the last...
28
by: Skeets | last post by:
i'm passing session and hidden variables between pages. not to mention post values. i'm a little concerned that someone with sufficient knowledge could spoof these vlaues and manipulate the...
4
by: Auddog | last post by:
I'm needing to work with a bar code scanner and have come to realize that after scanning a barcode the unit actually does a hard return. What is the best way to variables from one page to another....
8
by: chimambo | last post by:
Hi All, I am trying to pass variables between two frames in PHP. I want to get a variable from F1 to F2 and the variable that is now in F2 should pass back the variable to F1 and call another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
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...

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.