Jump to content


Photo

How to do pass value and calculate in PHP?, Help!!


  • Please log in to reply
4 replies to this topic

#1 CGLegacy

CGLegacy
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 March 2006 - 05:30 PM

hi... my very first post here...
im trying to do a simulation project based on PHP....
it will take my input.. lets say numbers which i will type in into a textbox...
and then press submit and the number will be passed on to the next php page to be used in calculations so that i can view the answer like i wanted in that very page....
the problem is... i do not know how to pass that value like numbers or string from one page to another page... i read about using echo... but cant seem to understand all the complicated codings...


#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 24 March 2006 - 06:51 PM

[!--quoteo(post=357981:date=Mar 24 2006, 05:30 PM:name=CGLegacy)--][div class=\'quotetop\']QUOTE(CGLegacy @ Mar 24 2006, 05:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
hi... my very first post here...
im trying to do a simulation project based on PHP....
it will take my input.. lets say numbers which i will type in into a textbox...
and then press submit and the number will be passed on to the next php page to be used in calculations so that i can view the answer like i wanted in that very page....
the problem is... i do not know how to pass that value like numbers or string from one page to another page... i read about using echo... but cant seem to understand all the complicated codings...
[/quote]

form.php:
<form action="processForm.php" method="POST">
Enter a value: <input type="text" name = "value">
<input type="submit">
</form>

processForm.php
<?php echo $_POST[value]; ?>

Read up a little on php.. and welcome ;)

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#3 CGLegacy

CGLegacy
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 March 2006 - 08:05 PM

[!--quoteo(post=358005:date=Mar 25 2006, 02:51 AM:name=keeB)--][div class=\'quotetop\']QUOTE(keeB @ Mar 25 2006, 02:51 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
form.php:
<form action="processForm.php" method="POST">
Enter a value: <input type="text" name = "value">
<input type="submit">
</form>

processForm.php
<?php echo $_POST[value]; ?>

Read up a little on php.. and welcome ;)
[/quote]

i am doing it right now... before this i used wizard to help me out... but it seems there is no wizard to help me pass value (go to detail page can be used if there is a recordset).....

i did that coding before... but how to display the passed value on the target page.... need to build a new page to display it ... or can i display it at the processForm.php???

[!--quoteo(post=358031:date=Mar 25 2006, 04:02 AM:name=CGLegacy)--][div class=\'quotetop\']QUOTE(CGLegacy @ Mar 25 2006, 04:02 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
i am doing it right now... before this i used wizard to help me out... but it seems there is no wizard to help me pass value (go to detail page can be used if there is a recordset).....

i did that coding before... but how to display the passed value on the target page.... need to build a new page to display it ... or can i display it at the processForm.php???
[/quote]

thanks2 so much... i left out the echo code.... silly me... anyway... other than displaying the passed value... how can i use passed value to do calculation.... any examples???

#4 CGLegacy

CGLegacy
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 March 2006 - 08:40 PM

[!--quoteo(post=358031:date=Mar 25 2006, 04:05 AM:name=CGLegacy)--][div class=\'quotetop\']QUOTE(CGLegacy @ Mar 25 2006, 04:05 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
i am doing it right now... before this i used wizard to help me out... but it seems there is no wizard to help me pass value (go to detail page can be used if there is a recordset).....

i did that coding before... but how to display the passed value on the target page.... need to build a new page to display it ... or can i display it at the processForm.php???
thanks2 so much... i left out the echo code.... silly me... anyway... other than displaying the passed value... how can i use passed value to do calculation.... any examples???
[/quote]

actually it's something like this that i want to build...

[a href=\"http://is.fsksm.utm.my/bukuphp/projek/\" target=\"_blank\"]Example For What I Want To Build[/a]

go there... just click any links... and just put numbers... lets say 4 digits and then click "Hantar"
that's how i want my output to be...
anyway... izzit normal to "can't" see the calculations behind the page... coz i cannot see a single calculation code... i downloaded all the php page... but to no avail... help...!!!

#5 CGLegacy

CGLegacy
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 March 2006 - 09:25 PM

[!--quoteo(post=358045:date=Mar 25 2006, 04:40 AM:name=CGLegacy)--][div class=\'quotetop\']QUOTE(CGLegacy @ Mar 25 2006, 04:40 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
actually it's something like this that i want to build...

[a href=\"http://is.fsksm.utm.my/bukuphp/projek/\" target=\"_blank\"]Example For What I Want To Build[/a]

go there... just click any links... and just put numbers... lets say 4 digits and then click "Hantar"
that's how i want my output to be...
anyway... izzit normal to "can't" see the calculations behind the page... coz i cannot see a single calculation code... i downloaded all the php page... but to no avail... help...!!!
[/quote]

hmmm.... i learned how to calculate using php now.... but how to limit the lines of the calculations.... for example i want to calculate for 5 loops... so the display will be only results for 5 lines.... any ways???
sorry for asking questions and then answering them myself.... coz... while waiting for the answers... im trying to get in on my own too... so which ever comes first... i'll take it..... sorry again....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users