473,385 Members | 1,757 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,385 software developers and data experts.

Send parameters to another script without opening it

137 100+
Hello,
I am just a newbie to javascript, but the most stuff i do is in php or .net.
But, now i have 2 buttons on my script that are calling a javascript function as shown below (OnClick"").
Now after a person pushes 1 of the 2 buttons, i want to send some information to a php-file to update my database.
The only thing that the customer will see is a message from the alert( "Thanks");
for example.
This is what i did now:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  var Counter = 0;
  3.   function ConfirmPo( value, id ){
  4.  
  5.  
  6.       if( Counter == 0){
  7.  
  8.           if( value == true ){
  9.  
  10.               document.location.href = 'http://www.adres.nl/update.php?accept=true&amp;ip=11.11.11.11&amp;id=20';
  11.  
  12.               alert("Thanks! The repairing will be carried out." );  
  13.               Counter++;
  14.  
  15.           }else if( value == false ){
  16.  
  17. document.location.href = 'http://www.adres.nl/update.php?accept=false&amp;ip=11.11.11.11&amp;id=20';
  18.  
  19.               alert("Thanks! the repair will not be done.");
  20.               Counter++;
  21.  
  22.           }
  23.  
  24.       }else{
  25.  
  26.           alert("Sorry, you already have made a choice..");
  27.  
  28.       }
  29.   }
  30.  
  31.   </script>
  32.  
Maybe it looks odd,but the customer can only press once on button 1 or 2.
After that it is not possible to change the option he/she made.
But that is working fine.
Is it possible to send some vars to my php script without opening a new window?

Thanks!
Paul
Jan 21 '10 #1
1 1576
Dormilich
8,658 Expert Mod 8TB
Is it possible to send some vars to my php script without opening a new window?
this is called AJAX.
Jan 21 '10 #2

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

Similar topics

0
by: bearclaws | last post by:
I am trying to send URL parameters from an HTML page to an XSL page. I used this script to pass parameters manually to the XSL and it works great. I just modified the "input for XSL-processor"...
13
by: Al Franz | last post by:
Anyone understand how to pass parameters to a JavaScript. If anyone finds this easy to do maybe they could take a look at my short script on this page and show me how it needs to be changed. ...
4
by: Mark J. McGinty | last post by:
Greets, Part of the content of one of our web pages uses wingdings and Chr(239) through Chr(242) (which are little arrow outlines, though that's not really important.) It worked just fine in...
27
by: Terry Olson | last post by:
I'm trying to build a table on an output page based on text input by the user. And what I am trying to do is create 4 table data boxes on a row, then start a new row on the 5th one. But I can't...
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. ...
5
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
11
by: fdu.xiaojf | last post by:
Hi, I just want to send a very simple email from within python. I think the standard module of smtpd in python can do this, but I haven't found documents about how to use it after googleing....
5
by: Mirxon | last post by:
Hello, I'm working on a C program under Ubuntu. It's basd on socket. Browser calls a client cgi (C program), and send some parameters to server (C program). Server runs another program...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.