473,796 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send parameters to another script without opening it

137 New Member
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 1594
Dormilich
8,658 Recognized Expert Moderator Expert
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
6651
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" section: http://www.biglist.com/lists/xsl-list/archives/200107/msg00002.html However, I'd like to be able to build that parameter list dynamically. So far, I can get the parameters into an array and pass the values to the loadXML function;...
13
26991
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. http://franz.org/java.htm Thanks for any help.
4
2464
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 Windows 2000 Server, but now under Server 2003 it seems that characters above 127 get converted somehow, and our code no longer produces the desired effect.
27
1596
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 quite get it right, the code I got here will start a new line on odd numbers like 9, 29, 16, etc.What am I doing wrong? (ignore any unbalanced braces or the referance to "i", since this is juat a small snippet.) if(!isNaN(mxfld) && mxfld != 0) {...
15
3319
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. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function isPPC() { if (navigator.appVersion.indexOf("PPC") != -1) return true; else return false;
5
4855
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, redirect a client to another page. In other way, a client will be able to send messages to another client, throw the server. These are the first funcionalities.
9
3158
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 other page, or is there something else like a stream which will be like a file. I am attempting to get a way from writing out a file and then having to give the page that I am posting to the file name. Instead I would like to just from asp.net...
19
3882
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 ReuseParameterValuesOnRefresh="True" in a viewer, but it still doesn't work. Did anyone run into this problem. What's the solution? Please help. Thank you
11
22384
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. Are there any examples of using smtpd ? I'm not an expert,so I need some examples to learn how to use it. Or maybe there is a better way to to this?
5
4961
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 (ooimpress, open office ppt), and translate the commands from client to a key event, and send it to child process. For example.
0
9530
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10236
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10182
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.