KicsiHun Posted November 8, 2008 Share Posted November 8, 2008 Hello! I'm designing a website. The html contains multiple div-s. Once you click on a button, one of the div-s display is set to "block". What I want to do is: one of the div-s is about signup. I want to include the signup.php and signup.html in the main page, so that if a user signs up, the page won't be redirected, it stays on main page. Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 8, 2008 Share Posted November 8, 2008 So your asking how to display some text when a user clicks a button without reloading the page? That is Ajax. Quote Link to comment Share on other sites More sharing options...
KicsiHun Posted November 8, 2008 Author Share Posted November 8, 2008 No. I want he php to run, without refreshing the page. When the user clicks on the signup div's button, a javascript function displays the content of the div. Using ajax I load the signup.php: x.open("GET","signup.php",false); x.send(null); parent.document.getElementById("signup").innerHTML=x.responseText; After that when the user fills out the textfields of signup.html and clicks on the "create account" button the succes message should be displayed in the signup div. Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 8, 2008 Share Posted November 8, 2008 Unless I am misinformed you can't display dynamic content without reloading the page unless you do ajax. You can run php in ajax I think Quote Link to comment Share on other sites More sharing options...
haku Posted November 10, 2008 Share Posted November 10, 2008 No. I want he php to run, without refreshing the page. What you are saying and what you are describing IS Ajax. Quote Link to comment Share on other sites More sharing options...
KicsiHun Posted November 10, 2008 Author Share Posted November 10, 2008 I know it is ajax, but the php file, isn't running as it should. By pressing the create account it should create the account and display a succes message, but it doesn't work. Quote Link to comment Share on other sites More sharing options...
haku Posted November 10, 2008 Share Posted November 10, 2008 Ahh, that's because you forgot a quote at the end of line 16. Quote Link to comment Share on other sites More sharing options...
KicsiHun Posted November 10, 2008 Author Share Posted November 10, 2008 thank you, but i'v solved it with iframe. Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 10, 2008 Share Posted November 10, 2008 I personally like frames. I don't see why everyone hates them. I still prefer divs to frames but still.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.