:wtf: he just mentioned running a php directly. Solution: 1) Even though WAMP is installed on ur system, it might not be configured properly, refer to the prev post 2) You are running files from the folder. instead, add "Listen 127.0.0.1:80" in ur httpd.conf (apache config file), then open any browser and type "localhost" in address and hit enter. also rename the html file to index.html so it is served to the browser without and explicit input. 3) "I ran php directly" is the fastest way to achieve defame on any php forum.. also, a starter tip: never use short php tag (", i learnt this the hard way :/ -- Modified Saturday, October 23, 2010 5:21 PM
Shantanu Gupta 1337
Posts
-
Error in developing my first AJAX example. . . . -
get input text value on text changethank you mate, that did just the trick i was looking for. Gosh W3C didnt mention that event for textbox, will remember this. Thanks again..
function check(obj) { var pin1 = parseStr(obj.value); if (pin1.length == 4) { // Will obfuscate PIN using hashes in later builds... if (pin1 == "3924") { <?php setcookie... ?> window.alert('Welcome master, Redirecting you'); setTimeout(function() { document.location ='main.php'; }, 2000); } else { <?php setcookie... ?> window.alert('Invalid Pin, Rerouting to Public Page.'); setTimeout(function() { document.location ='publ.php'; }, 2000); } } }
Just in case you were wondering why i used master, This is still in development and i like being treated like a Master... xP
modified on Sunday, August 8, 2010 1:09 PM
-
get input text value on text changeit is not for validating, it is for checking if the code entered is same as that defined by me on a file located in ../public_html/ so that it cannot be accessed and value is called when Jsp needs it using the part getting on my nerve is, the event does not fire onchange (when i type) but when i close the tab with data in it, it suddenly pops up with the correct answer if it is alert($('#pinin').val())); what i want is when the len of pinin reaches 4, it checks if its value is equal to my const. and if true display a alert or redirect.
-
get input text value on text changewell, this seems to be a silly question but is getting on my nerves -.- i am working with Javascript and Jquery, i have a password tag which is not nested in a form, i want to check wether the input matches a constant defined by me when typed by user and length = 4 here goes my current code :
PIN: Validate
I dont know PIN, go to Public Page >>i had to add " to div, else it would just show "pin"
-
Refresh Div contentwell thanks mate, cheers but i have edited your code a bit to just meet that edge:
function redir(ic) { ic++; switch(ic) { case 1: $('#text1').text(s0); break; case 2: $('#text1').text(s1); break; case 3: $('#text1').text(s2); break; case 4: $('#text1').text(s3); ic = 0; break; default: $('#text1').text(s0); } setInterval("redir("+ic+")", 500); return 0; } </script>
-
Refresh Div contentI am making a school project based on jsp, i have a page in the solution which shows an animated Redirecting using following code
var ic = 0; var s0 = "Redirecting"; var s1 = "Redirecting."; var s2 = "Redirecting.."; var s3 = "Redirecting..."; function redir() { ic++; switch(ic) { case 1: $('#text').html(s0); break; case 2: $('#text').html(s1); break; case 3: $('#text').html(s2); break; case 4: $('#text').html(s3); ic = 0; break; default: $('#text').html(s0); ic = 0; } setTimeout(redir(), 500); return 0; }
Problem is the div does not refresh (shows only "Redirecting." without any change) periodically with the text change calls. Thanks in advance