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. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/ 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. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-685390 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. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-685427 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 Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-685486 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. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-686368 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. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-686520 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. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-686576 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. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-686615 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.. Link to comment https://forums.phpfreaks.com/topic/131922-solved-php-loading-in-html/#findComment-686644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.