By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

somebody help me!passing variable to same page after button submit

P: 28
Hello there,

Can anybody please help me with this.I used one php page from where i've sent a variable to other php page thru a hidden field (HTML).In that page i'm able to retrieve the value before i submit a button.From that page i forwarded the same value to the same page after submitting the button.There i'm just able to use the value as a static content.if fc is the value i retrieved

for ($i=0;$i<$fc;$i++)
{

$var = "a$i";
i have to retrieve a value from the database where a column value should be $$var.But there is no value for $$var.
Moreover,if i dont use any button submission and if there is no such thing like before and after submission but the variable is just used in the second page,there is being some value for $$var.

Please help me with this.Hope this is understandable.

Thanks,
Shara.
Feb 26 '07 #1
Share this Question
Share on Google+
2 Replies


P: 99
Hello there,

Can anybody please help me with this.I used one php page from where i've sent a variable to other php page thru a hidden field (HTML).In that page i'm able to retrieve the value before i submit a button.From that page i forwarded the same value to the same page after submitting the button.There i'm just able to use the value as a static content.if fc is the value i retrieved

for ($i=0;$i<$fc;$i++)
{

$var = "a$i";
i have to retrieve a value from the database where a column value should be $$var.But there is no value for $$var.
Moreover,if i dont use any button submission and if there is no such thing like before and after submission but the variable is just used in the second page,there is being some value for $$var.

Please help me with this.Hope this is understandable.

Thanks,
Shara.
I think if you want to pass a variable over multiple forms you put it in a session variable. This way it doesn't have to be in your form. Set the variable when you retrieve it and unset it when the last form is submitted correct.
Feb 26 '07 #2

P: 28
I think if you want to pass a variable over multiple forms you put it in a session variable. This way it doesn't have to be in your form. Set the variable when you retrieve it and unset it when the last form is submitted correct.
Thanks for responding.But its not that i want to pass a varible over forms.If i am retrieving the value of a variable directly from one page to other to perform some action,i am able to get some value for $$var.But its not the case if i want give a warning (button submit)before taking that action and then using $$var after button submission.In this case i'm not able to have any value for $$var.Can you please help me with this.
Feb 27 '07 #3

Post your reply

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