473,403 Members | 2,270 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,403 software developers and data experts.

How to send values from a form to PHP script and return answer

Hi, I am stumped at how to do this:

I have a simple webform that I want the user to enter one value (an address). I then want the form to send those values to a PHP script that processes the address and returns 2 numeric values back to the original webform populating two textboxes in a second form on the orginal page. I have the PHP script working to calculate the values, but I don't know how to send them properly and return the new calculated values and update the two textboxes with the new calcualted values.
I also don't want this main page with the form to have to do a refresh if that is possible.

So something like this in the main form page:

Expand|Select|Wrap|Line Numbers
  1. <form name="address_search" method="$_GET" action="http://............/Geocoder/googlegeoapi.php?">
  2. <input name="HOUSE_NUM" type="text" id="HOUSE_NUM"  size="20" >
  3. <input type="submit" name="Submit" value="Submit" >
  4. </form>
  5.  
  6. <input type="text" name="x_coord" id="x_coord"><br>
  7. <input type="text" name="y_coord" id="y_coord"><br>
  8. <a href="javascript:doSubmit();">Zoom to this location</a>
  9.  
So what is the best method to SEND the address value from the form to the PHP script? And how do I return the two calculated values and have them dynamically update the two textboxes with the results? Thanks for any help!
Apr 10 '07 #1
1 3017
code green
1,726 Expert 1GB
So what is the best method to SEND the address value from the form to the PHP script.And how do I return the two calculated values and have them dynamically update the two textboxes with the results
I might be mis-understanding you but you are adding unnescary layers of complication. Why not include a php script in the web page, let that do the calculation then show the results on the same page? [HTML]<form name="address_search" method="$_GET" action="http://............/Geocoder/googlegeoapi.php?">
<input name="HOUSE_NUM" type="text" id="HOUSE_NUM" size="20" >
<input type="submit" name="Submit" value="Submit" >
</form>

<? include 'calculate.php';?> #calculates $x and $y

<input type="text" name="x_coord" id="x_coord" value="<? echo $x;?>"> <br>
<input type="text" name="y_coord" id="y_coord" value="<? echo $y;?>" >
<a href="javascript:doSubmit();">Zoom to this location</a>[/HTML]
Apr 11 '07 #2

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

Similar topics

1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
0
by: Mike Copeland | last post by:
In the following code I am calculating 2 values when the "Compute Distance" button is pressed. I would like to find a way to "return" both value to the form so I can show both when the calculation...
1
by: mhawkins19 | last post by:
I have a form built and on the onclick event I validate all of the fields and then if the form is ok, on the submit event I run a javascript function to set a cookie and download a file from the...
15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
1
by: Miguel Dias Moura | last post by:
Hello, Can you help me out in making this work? What I want is as simple as sending form values to an email. The code I am using is the following:
1
by: Miguel Dias Moura | last post by:
Hello, Can you help me out in making this work? What I want is as simple as sending form values to an email. The code I am using is the following:
5
by: canajien | last post by:
I have a form that stores information in a table, but I also need it to send an email when a specific question, among the many, is answered with no the question is a simple drop box: <select...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.