XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 8th, 2004, 07:55 AM
Larry770 Larry770 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 114 Larry770 User rank is Private First Class (20 - 50 Reputation Level)Larry770 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 18 h 13 m 9 sec
Reputation Power: 5
Using XML HTTP

Hi,
I currently have a form which is submitted via a Javascript using a PHP page. The problem is that the page refreshes after each post/submit. Someone mentioned that this should be done with XML HTTP, but I have no clue on where to begin with this (I have searched online and have not found a good tutorial on how to use it)

Here is the basic idea:

PHP Code:
<HTML
<
HEAD

<
TITLE>webcam controls</TITLE

<
script type="text/javascript"
     
function 
register(e) { 
    if (!
e) var e=window.event
    var 
keyHit=false
    if (
e['keyCode']==38) {document.keyForm.direction.value="up";keyHit=true;} 
    if (
keyHit==true) {document.keyForm.submit();keyHit=false;} 
    } 

function 
init() { 
    
document.onkeydown register
     



</script> 

</HEAD> 
<BODY onload="init();"> 

<form name="keyForm" action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST"> 
    <input type="hidden" name="direction" value="null"> 
</form 
<br> 

<?php 

if (isset($_POST['direction']) && $_POST['direction'] == "upright") { 
     
system("lptout.exe 128"); 
           


?> 

</body>
</html> 


In this script the page reloads after every post. As a way out I am toying with using html frames, but if there is a better way, it would make more sense.

Thanks,
Larry

Reply With Quote
  #2  
Old August 10th, 2004, 12:12 AM
Larry770 Larry770 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 114 Larry770 User rank is Private First Class (20 - 50 Reputation Level)Larry770 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 18 h 13 m 9 sec
Reputation Power: 5
Pretty please?

Reply With Quote
  #3  
Old August 18th, 2004, 01:51 AM
Larry770 Larry770 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 114 Larry770 User rank is Private First Class (20 - 50 Reputation Level)Larry770 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 18 h 13 m 9 sec
Reputation Power: 5
Ok, then can somebody at least tell me why no one is answering?

Reply With Quote
  #4  
Old August 19th, 2004, 01:28 AM
Larry770 Larry770 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 114 Larry770 User rank is Private First Class (20 - 50 Reputation Level)Larry770 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 18 h 13 m 9 sec
Reputation Power: 5
Quote:
Originally Posted by Larry770
Hi,
I currently have a form which is submitted via a Javascript using a PHP page. The problem is that the page refreshes after each post/submit. Someone mentioned that this should be done with XML HTTP, but I have no clue on where to begin with this (I have searched online and have not found a good tutorial on how to use it)

Here is the basic idea:

PHP Code:
<HTML
<
HEAD

<
TITLE>webcam controls</TITLE

<
script type="text/javascript"
     
function 
register(e) { 
    if (!
e) var e=window.event
    var 
keyHit=false
    if (
e['keyCode']==38) {document.keyForm.direction.value="up";keyHit=true;} 
    if (
keyHit==true) {document.keyForm.submit();keyHit=false;} 
    } 

function 
init() { 
    
document.onkeydown register
     



</script> 

</HEAD> 
<BODY onload="init();"> 

<form name="keyForm" action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST"> 
    <input type="hidden" name="direction" value="null"> 
</form 
<br> 

<?php 

if (isset($_POST['direction']) && $_POST['direction'] == "upright") { 
     
system("lptout.exe 128"); 
           


?> 

</body>
</html> 


In this script the page reloads after every post. As a way out I am toying with using html frames, but if there is a better way, it would make more sense.

Thanks,
Larry



Aint nothing like talking to yourself...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Using XML HTTP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT