Jump to content


Photo

Redirecting a page using ajax


  • Please log in to reply
8 replies to this topic

#1 baiju

baiju
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 16 October 2006 - 11:55 AM

Hi

I done a login form. User name and password checking ajax script.
If password is wrong it showing correctly.
My prob is user name and password is correct, i want to redirect the page to members area

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 16 October 2006 - 11:57 AM

Use this javascript code:
location.href = 'new location here';

Wrong forum by the way.



#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 16 October 2006 - 12:23 PM

ajax is not a scripting lanuage it's an exstention of javascript.


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 16 October 2006 - 12:33 PM

Nor is it an extension, it is a combination of technologies. It uses JavaScript's XmlHttpRequest and it uses XML.

#5 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 18 October 2006 - 04:17 PM

Actually... I've been using AJAX techniques for quite some time and I have YET to use XML with it.

Info: PHP Manual


#6 fiddy

fiddy
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 19 October 2006 - 12:05 PM

Hi,

i guess you would have two JS functions one for request to the server and other for getting back the responce from the server. In the JS function which receives the responce you can user location.href='file.php'
:)

#7 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 October 2006 - 12:44 PM

Actually... I've been using AJAX techniques for quite some time and I have YET to use XML with it.


Then I guess it techinically wouldn't be AJAX but just the use of XmlHttpRequest as AJAX is short for "Asynchronous JavaScript and XML". If you remove one of the parts then it wouldn't be AJAX. I don't use XML myself either though...

#8 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 20 October 2006 - 02:25 PM

Someway of topic perhaps...

There are many ways of twisting this - if you use responcetext and get html in return you would perhaps call it AJAH (AJAXH for xhtml ??) or something, i still feel that i can call my usage of AJAX as AJAX even if i don't return XML - the principal of usage is the same exept for the way you treat the returned responce. If the responce is echoed out or adjusted further with a javascript is a matter of habbit if you ask me. I try to do things as little complicated as possible.

#9 yanny

yanny
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 22 October 2006 - 02:15 PM

You can work with header("location:url");




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users