Jump to content

"is Not Defined" Error


[dx]

Recommended Posts

Hi, I've tried to rewrite whole code again.I found word "Greska!"I've added it in registracija_src.php after I've posted code here in line$rez_email = mysql_query("SELECT email FROM korisnici WHERE email=$email") or die("Greska!");What's an error?I've added also one line in table korisnici to test it, and when searching viahttp://localhost/registracija_src.php?email=my@email.comI'm getting thisWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\registracija_src.php on line 16but dbase name, host, user, and pass are correct and there's line with my email in db.This is first time that I don't get it why mysql_query won't work

Link to comment
Share on other sites

  • Replies 62
  • Created
  • Last Reply

Hi,I've rewrited all script and now everything works fine. Also I made reference option which stores to db from who we are referented. But nevermind. I have problem with .htaccess and I think I could place it here.Also I have function in email's input which checks is entered email used by someones. There's <span> next to it which gets info from ajax via innerHTMLwhen I use http://localhost/registration.php works fine, also when I use http://localhost/registration.php?reference=some@mail.com , works fine, so problem is not with codes..And when I use http://localhost/registration it's still fine, but when I use http://localhost/registration/some@mail.comthere's problem.. just when I click to email <input> box and starts to type something, ajax returns me whole form.Regarding this, which is correct when not using redirections from htaccess, I know there's no problem with codes, so I didn't post them.This is my htaccessfile:

RewriteEngine onOptions -IndexesRewriteRule ^registration/(.*)$ "/registration.php?reference=$1" [NC]RewriteRule ^registration$ "/registration.php" [NC]

Where can be missmatch?Thanks

Link to comment
Share on other sites

If htaccess is supposed to redirect this:http://localhost/registration/some@mail.comto this:http://localhost/registration.php?reference=some@mail.comThen use the first URL and in registration.php print out $_GET['reference'] to see if it redirected correctly. If it did, then it doesn't look like there's a problem with htaccess.

Link to comment
Share on other sites

This is my ajax script which checks email with onkeyup

function check(what, for) {	ajax.open("GET", "check.php?what="+what+"&for="+for, true);	ajax.onreadystatechange = function () { main("reg-email"); }	ajax.send(null);}function main(id) { 		if (ajax.readyState == 4) { 				document.getElementById(id).innerHTML = ajax.responseText; 		} }

There's <span id="reg-email"></span> in registration form.and there's <input id="email" onkeyup="check(email, this.value)">And alsocheck.phpwhich checks if there mysql_num_rows > 0, and if format of mail is good

Link to comment
Share on other sites

:)This is me again with same problem...htaccess again.When goes to full link /registration.php?ref=some@email.com works fine and when use htaccess goes wrong. But if use echo $_GET['ref'] it shows me email fine when registration/some@email.comSo, is there any other way to check what's going on :SThanks

Link to comment
Share on other sites

Um.. sorry I forgot write my problem :)Well, when I type something in email input box function used by onkeyup checks is mail valid or not, and is it used by someone or not. And next to that is span tag which gets answer from ajax, like mail is used by someone, not valid email or available email. So when I use .htaccess redirection just when I type something in emails input box, I got whole page to span. Like page in page. And something is wierd couse when use standard link, works fine.Thanks

Link to comment
Share on other sites

HeyyyyyyyYES I FOUND IT!! :)There's was mismatch in checking functionchecking file is in root folder but I haven't used / so it looks like localhost/registration/check.php and it must be localhost/check.phpWell, it's OK now :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...