« first day (124 days earlier)      last day (530 days later) » 

7:52 PM
all alone
 
Okay
Im here
 
foreveralone.jpg
 
whats up?
 
in JavaScript, 2 mins ago, by Connor
@DemCodeLines the plugin, so how is it possible to console.log() a response from php via that plugin?
What do you mean?
 
7:53 PM
@DemCodeLines ok paste all your javscript here!!!
 
you can't console.log() from PHP .. PHP is serverside.. console.log() is a function of the browser
 
jQuery("#signUpHome").validate({
	rules: {
		signUpemail: {
			expression: "return !!VAL.match(/^[^\\W][a-zA-Z0-9\\_\\-\\.]+([a-zA-Z0-9\\_\\-\\.]+)*\\@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*\\.[a-zA-Z]{2,4}$/);",
			required: true,
			email: true,
			remote: "/inc/1x7dsL3-email-Ez7iv91.php"
		}
	}
});
PHP file:
<?
$emailInput = $_POST['signUpemail'];
$result = $db->prepare('SELECT * FROM members WHERE email=?');
$result->execute(array($emailInput));

$count = count($result->fetchAll());

echo "hello";

if ($count > 0){
	echo "0";
}
else {
	echo "1";
}
return;
?>
@Connor I did
 
ok now wait
 
.validate is part of a bigger library?
 
7:55 PM
you said you couldn't see anything in the console?
 
Yes
I couldn't
Console is blank
 
even when you click the submit button or whatever button triggers the .validate
?
 
Yes
There is nothing
 
then my guess would be that you are not actually sending anything via Ajax.
 
Oh boy.
 
7:58 PM
for something simple like this you don't need large validation plugins.. you can just use regular JQuery and .ajax() .. then do all the checking in PHP
it's simpler IMO
 
well you wont get anything in the console unless you have errors or you use console.log('something);
 
Why don't you use $.ajax(); when recommended
what is the plugin supposed to do?
 
in JavaScript, 28 mins ago, by Connor
   $.ajax({
      url: 'somePHPfile.php',
      data:{email: 'someEmailAddress@notGmail.com'},
      type: 'POST',
      success: function (result) {
         result === 0 ? alert('well that email is already... Whatever') : alert('Ok, hes safe, let him in');
      },

      error: function () {
         alert('nothing suprises me');
      }
   });
that?
 
yes
 
8:03 PM
So you want me to replace that with the code I have?
 
@DemCodeLines well first explaing why you are using the plugin, ill be back in 5 mins :)
 
yes, I agree with connor.
 
I befriended Google and asked for help and it told me that I should use JQuery Validation
@Connor and @TheSnooker there is your answer.
 
Hi
 
8:09 PM
Hi
 
well Jquery validate is a large library not everything is useful..
 
Is there a reason why my sites code works fine in EVERY browser except for ie versions less than or equal to 9?
 
@Charlie yes because IE hates everything.
 
Well I know that
 
what are you doing that doesn't look right?.
 
8:10 PM
But as far as I know IE can still run javasdcript
 
it can yes but some methods are not available in eailer versions
 
but it just does not load anything in anyting less than version 10
animate?
 
oh you're talking abotu Jquery?
lol we are in the Jquery room.. makes sense.. then the answer tot hat question is that JQuery does not support anything lower then IE8
 
Yeah
 
anymore
 
8:12 PM
I say Javascript as I am an idiot
ok, so even version 8 and 9 I cant get it to work in
ah is it that I am using jquery 2
 
yes JQuery should work fine in IE8+
 
@Charlie hey charlie
@TheSnooker jQuery should work fine in IE6+
 
Hey @Connor
 
@Charlie whats up?
 
I thought they stopped supporting IE7 or lower?
 
8:16 PM
ok but jquery v 2.x is not supported below ie9 as I just read
 
oh
there ya go
 
this is probably my problem
quick downgrade and I should be rolling
 
yes thats right they are dropping support for ie 6 + 7
 
	$.ajax({
		url: '/inc/1x7dsL3-email-Ez7iv91.php',
		type: 'POST',
		success: function (result) {
			result === 0 ? alert('well that email is already... Whatever') : alert('Ok, hes safe, let him in');
		},
		error: function () {
			alert('nothing suprises me');
		}
	});
 
but millions of people will still use jQuery-1.9.1.min.js
and 8 maybe i dunno
 
8:18 PM
Added that, but I have no clue how the code knows that I am talking about the textbox with signUpemail name
 
@DemCodeLines yes...
@DemCodeLines so something like this maybe
$('#myForm').submit(function() {
   checkEmail();
});

function checkEmail() {
   $.ajax({
      url: 'somePHPfile.php',
      data:{email: $('#emailField').val()},
      type: 'POST',
      success: function (result) {
         result === 0 ? alert('well that email is already... Whatever') : alert('Ok, hes safe, let him in');
      },

      error: function () {
         alert('nothing suprises me');
      }
   });
}
 
$("submitbox").on('click', function(){

}
well Connor isn't apparently as lazy as I am^^
 
lol
and your form looking something like this
<form id="myForm">
   <input type="text" placeholder="Fist Name">
   <input type="text" placeholder="Last Name">
   <input type="email" id="emailField" placeholder="Email Address">
</form>ki
@Charlie i dont use jQuery v2 btw
you should make your own jQuery anyway
that way you can have what you need
 
I try to avoid web development at all costs
 
@Charlie what do you do then?
 
8:23 PM
But I had to take this project unfortunately as the customer is my wifes company
C++, C, Java
 
So you're code pops up nothing surprises me when I put in an email that is already in the DB, except after I click ok, it proceeds on and uses the email
@Connor ^
 
@DemCodeLines you can change the function to this
$('#myForm').submit(function() {
   checkEmail();
   return false;
});
so that it doesnt continue while you work on it, you must understand that you have to make functionality it doesnt make itself, that would not be fun otherwise
 
But wouldn't that apply to all situations, stop the form from submitting even if the email is unique?
 
@Charlie whats the project? :)
 
Just a companies site, wordpress theme
 
8:25 PM
@DemCodeLines ever hear of a if statement
add console.log(result) into the success function to see what is actually returned from php
 
simple stuff that got complicated because they keep changing their minds so now the code is a whole jumble of recycled crap
 
@Charlie Yeah, wordpress just hasn't tickled me yet!
@DemCodeLines scrap that
 
It is handy because it is an idiot proof cms
 
what does nothing supprises me mean in that javascript code?
 
but its annoying when the end user starts hammering plugins
 
8:27 PM
POST .../inc/1x7dsL3-email-Ez7iv91.php 403 (Forbidden)
 
@Charlie there is that, i have one problem at the moment and that is falling in love with blank slates
 
That is what is in the console
 
remove the /
check chmod
 
@DemCodeLines so you need to find out what is going on then, maybe you should use a php file that is in the web root ie www/....
 
alternatively look at the code and copy and paste the post url into the browser bar from the same DIR as the JS file
see if the file exists, see if you can view it
 
8:29 PM
have you give the file name that name for like a security reason or something?
 
you probably can't but its good to always go through that process to eliminate stuff
 
@Charlie it would be from the html file tho because the js file will inherit the html files location while executing code .... if that makes sense
 
Should I change the PHP file to chmod 755?
 
depending on where it is called from
 
8:32 PM
@DemCodeLines you working localhost?
!!brb
 
so I have an index file a folder called js and inside of this js DIR i have js.js and phpfile.php, if I give the url in the js.js file as phpfile.php then that will try and get the file on the same dir and not from the index dir
 
No, it hosted on a live server
 
link then?
@Charlie no if your js file is linked in your index file you would call /js/phpfile.php in your js file
 
thats what I am sayin g
the file you call needs to be in the same DIR as the file that calls it
not the html file that calls the js file
and if they are in the same DIR, you can remove the /js/
but if its a wordpress theme you have to write the whole damn URl
hold up
maybe I am wrong
I dont remember now
 
@Charlie yes wordpress is a different kettle of fish my friend dont you do something like <?php echo get_stylesheet_directory_uri(); ?> ?
@DemCodeLines ^^
 
8:46 PM
?
 
link...
@DemCodeLines
 
Why what happened?
 
@DemCodeLines if you send the link maybe we could help more??????
 
Its not up
What I meant is that I have a live server to put it on, but to do that, I will have to rearrange the variables and stuff.
 
how you getting on?
 
8:52 PM
its offline
local
 
how you getting on solving your problem
 
My problem is should I make the php file accessible and executable by all?
Wouldn't that be insecure?
 
@DemCodeLines not really
 
Running a query in that PHP file. If that file is open to all, it could create potential hacking opportunities.
 
@DemCodeLines how do you think people manage when you see example.com/index.php?
@DemCodeLines then you have to prevent that with php code
 
9:00 PM
Yes, but this php file is just being used to query the database
it doesn't produce anything that needs to be shown to the user.
 
@DemCodeLines if there was another way then people would be doing it
 
So I have to 777 it?
 
no
you have a index.html file right or index.php?
 
still shows 403 forbidden
for that remote php file
 
1 min ago, by Connor
you have a index.html file right or index.php?
 
9:06 PM
index.php
 
and where is the email.php relative to index.php
 
in another folder
/index.php vs /inc/email.php
 
open email.php in your browser and just copy the link and paste it here
 
here?
 
yeah
 
9:11 PM
why?!
@Connor going back to the ajax stuff, it still doesn't validate right. Everything is stopped. The form doesn't move forward.
 
@DemCodeLines all you have told it to do is check if it is in the database, not what to do after its checked
 
@Connor I am not sure how to do that. I removed return false; from the form submit event and put it inside the error method, but that didn't stop it.
@Connor Oh, by the way, the script that you gave me doesn't work.
Everything is shown as an error, even when the email entered doesn't exist in the DB.
 
good, maybe you could help yourself and make it work
im not your Code Bank
im sure if you put this
  error: function (error) {
     alert(error);
  }
you will find its your code thats not working
 
9:28 PM
Shows [object Object] very helpful
@Connor Perhaps, next time, you could tell me that you are giving me incomplete code that is not functional before giving it, instead of making it seem like it works and then telling me later it isn't supposed to work.
 
it does work
try
console.log(error)
@DemCodeLines it will say 403 file error
 
so how does that mean my code is wrong?
that means it isn't able to find the file
 
Does conditional stylesheet <!--[if IE]> not apply to IE 10?
 
@Charlie no, they recon that you wouldn't need to use it on IE10 because it is apparently a good browser
 
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
 
9:40 PM
@Charlie but you could detect IE10 with javascript then append a stylesheet
 
\so thats why it has a positioning mind of its own!
I thin if IE10 exists
 
@DemCodeLines well if its not my code thats wrong then its something your doing wrong
 
if ($.browser.msie && $.browser.version == 10) {
$("html").addClass("ie10");
}
 
The only code I have left is the PHP file.
 
@Charlie that looks (about) right, although i don't use jQuery to detect browsers
@Charlie HINT when posting code press CTRL + K or COMMAND + K
 
9:44 PM
damn I forgot about that
 
you can press up in the text box to edit prev messages
@DemCodeLines like i said before i think you have bit off more than you can chew
 
Ok, well to tackle this problem and this problem only, how should I go about it?
 
var isIE = false;
if (window.navigator.msPointerEnabled) {
    isIE = true;
}
 
@Charlie or
var isIE = window.navigator.msPointerEnabled ? true : false;
@Charlie ^^^
 
ok thanks
 
9:49 PM
@DemCodeLines you should find out why the file is 403 and maybe move it to the same folder as index.php
@Charlie are you trying to detect any IE?
 

« first day (124 days earlier)      last day (530 days later) »