Newbie89 Posted November 13, 2012 Share Posted November 13, 2012 May I know the step?I got the code example but I really dunno link them such as put at where or what...Help me plz... Link to comment Share on other sites More sharing options...
justsomeguy Posted November 13, 2012 Share Posted November 13, 2012 What code do you have so far? Most of the decisions are yours to make, there's not a strict set of rules that you must follow. Link to comment Share on other sites More sharing options...
Newbie89 Posted November 14, 2012 Author Share Posted November 14, 2012 order.html <html><body> <script language="javascript" type="text/javascript"><!-- //Browser Support Codefunction ajaxFunction(){var ajaxRequest; // The variable that makes Ajax possible! try{// Opera 8.0+, Firefox, SafariajaxRequest = new XMLHttpRequest();} catch (e){// Internet Explorer Browserstry{ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try{ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");} catch (e){// Something went wrongalert("Your browser broke!");return false;}}}// Create a function that will receive data sent from the serverajaxRequest.onreadystatechange = function(){if(ajaxRequest.readyState == 4){document.myForm.time.value = ajaxRequest.responseText;}}ajaxRequest.open("GET", "serverTime.php", true);ajaxRequest.send(null); } //--></script> <form name='myForm'>Name: <input type='text' onChange="ajaxFunction();" name='username' /> <br />Time: <input type='text' name='time' /></form></body></html> Link to comment Share on other sites More sharing options...
Newbie89 Posted November 14, 2012 Author Share Posted November 14, 2012 servertime.php <?phpecho date("H:i:s"); ?> Link to comment Share on other sites More sharing options...
Newbie89 Posted November 14, 2012 Author Share Posted November 14, 2012 How to make the date show in the order.html? Link to comment Share on other sites More sharing options...
Newbie89 Posted November 14, 2012 Author Share Posted November 14, 2012 I got the error when click the textbox of time in order.html.Error show like this... <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL /checksite/serverTime.php was not found on this server.</p><hr><address>Apache/2.2.22 (Ubuntu) Server at localhost Port 80</address></body></html> Link to comment Share on other sites More sharing options...
thescientist Posted November 14, 2012 Share Posted November 14, 2012 (edited) I got the error when click the textbox of time in order.html.Error show like this... <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL /checksite/serverTime.php was not found on this server.</p><hr><address>Apache/2.2.22 (Ubuntu) Server at localhost Port 80</address></body></html> the error seems clear enough. the page can't be found. casing is important. are you sure it is not servertime.php? servertime.php <?phpecho date("H:i:s");?> Edited November 14, 2012 by thescientist Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now