FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
VERY IMPORTANT question about reading variables
Message  

Reply with quote
Post VERY IMPORTANT question about reading variables 
i have 3 pages = register.html confirmregistration.php registration.php


in the register.html page the user enters their details and in confirmregistration.php i have displayed all the information that a user has entered in register.html to check what they have entered with a back button(onclick='javascript: history.go(-1)') and a confirm submit button

the registration.php file is the actual file that should take the information from confirmregistration.php and insert into database.

presently confirmregistration.php file displays all the information a user has entered and if they click on back button and make changes the new changes appear however when they click on register button the browser shows registration.php however
    a) the output is what i have written in confirmregistration.php  and
    b) the values that the user entered is blank

i have used an include("confirmregistration.php") in the registration.php in order to read all the information that a user has entered.

in confirmregistration.php i have read the values into variables ex =
$username = $_POST["username"];     $fname = $_POST["fname"]; etc

so in registration.php i have an echo statement like =
echo "value of username is = ".$username; etc for the rest

all these variables are blank they have no value that the user entered in register.html

any help will be greatly appreciated. please suggest what needs to be done and the code as well.

waiting for a reply.

thanks.

View user's profile Send private message

Reply with quote
Post  
hii...
do this
in confirmregistration.php make an another form like in register.html, with all field hidden,
as,

Code:
//getting variable from register.html
$username = $_POST['username'];
$email = $_POST[email'];
...
...
so on

//showing entries for confirmation as well as form for further posting to registration.php

echo "<form action=\"registration.php\" method=\"POST\">";
echo "USERNAME = $username<input type=\"hidden\" name=\"username\" value=$username><br>";
echo "USERNAME = $email<input type=\"hidden\" name=\"email\" value=$email><br>";....so on

echo "<input type=\"submit\" value=\"Submit\" name=\"submit\"><input type="button" onclick='javascript: history.go(-1)'></form>";

// now all ur variable will also available in registration.php collect all them by using $_POST method and insert into database




_________________
Anil Sharda
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Reply with quote
Post  
hii...
do this
in confirmregistration.php make an another form like in register.html, with all field hidden,
as,

Code:
//getting variable from register.html
$username = $_POST['username'];
$email = $_POST[email'];
...
...
so on

//showing entries for confirmation as well as form for further posting to registration.php

echo "<form action=\"registration.php\" method=\"POST\">";
echo "USERNAME = $username<input type=\"hidden\" name=\"username\" value=$username><br>";
echo "USERNAME = $email<input type=\"hidden\" name=\"email\" value=$email><br>";....so on

echo "<input type=\"submit\" value=\"Submit\" name=\"submit\"><input type="button" onclick='javascript: history.go(-1)'></form>";

// now all ur variable will also available in registration.php collect all them by using $_POST method and insert into database




_________________
Anil Sharda
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Reply with quote
Post  
now there is an another method...
make all ur variable session variable so they will available on all the pages untill session expired....
as:

Code:

session_start();
//collecting variable
$var1 = $_POST['value1];
$var2 = $_POST['value2];
:::::::::
::::::::
so on

//making them session variable
session_register($var1, $var2, .....so on)

//echo variables for conformation


now all ur variable will also available on your next page.
after inserting values in database unregistered the variables & expire the session.
so they will not create problem on other pages...
i think that will solve ur problem...

good luck

have a nice day


_________________
Anil Sharda
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com