Jump to content

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


CGLegacy

Recommended Posts

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...
Link to comment
Share on other sites

[!--quoteo(post=357981:date=Mar 24 2006, 05:30 PM:name=CGLegacy)--][div class=\'quotetop\']QUOTE(CGLegacy @ Mar 24 2006, 05:30 PM) [snapback]357981[/snapback][/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: [code]<form action="processForm.php" method="POST">
Enter a value: <input type="text" name = "value">
<input type="submit">
</form>[/code]

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

Read up a little on php.. and welcome ;)
Link to comment
Share on other sites

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

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

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) [snapback]358031[/snapback][/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???
Link to comment
Share on other sites

[!--quoteo(post=358031:date=Mar 25 2006, 04:05 AM:name=CGLegacy)--][div class=\'quotetop\']QUOTE(CGLegacy @ Mar 25 2006, 04:05 AM) [snapback]358031[/snapback][/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...!!!
Link to comment
Share on other sites

[!--quoteo(post=358045:date=Mar 25 2006, 04:40 AM:name=CGLegacy)--][div class=\'quotetop\']QUOTE(CGLegacy @ Mar 25 2006, 04:40 AM) [snapback]358045[/snapback][/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....
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.